mirror of
https://github.com/github/awesome-copilot.git
synced 2026-02-20 02:15:12 +00:00
feat: add hooks functionality with automated workflows
- Introduced hooks to enable automated workflows triggered by specific events during GitHub Copilot sessions. - Added documentation for hooks in AGENTS.md and README.md. - Created a new directory structure for hooks, including README.md and hooks.json files. - Implemented two example hooks: Session Auto-Commit and Session Logger. - Developed scripts for logging session events and auto-committing changes. - Enhanced validation and parsing for hook metadata. - Updated build and validation scripts to accommodate new hooks functionality.
This commit is contained in:
39
AGENTS.md
39
AGENTS.md
@@ -8,6 +8,7 @@ The Awesome GitHub Copilot repository is a community-driven collection of custom
|
||||
- **Prompts** - Task-specific prompts for code generation and problem-solving
|
||||
- **Instructions** - Coding standards and best practices applied to specific file patterns
|
||||
- **Skills** - Self-contained folders with instructions and bundled resources for specialized tasks
|
||||
- **Hooks** - Automated workflows triggered by specific events during development
|
||||
- **Collections** - Curated collections organized around specific themes and workflows
|
||||
|
||||
## Repository Structure
|
||||
@@ -18,6 +19,7 @@ The Awesome GitHub Copilot repository is a community-driven collection of custom
|
||||
├── prompts/ # Task-specific prompts (.prompt.md files)
|
||||
├── instructions/ # Coding standards and guidelines (.instructions.md files)
|
||||
├── skills/ # Agent Skills folders (each with SKILL.md and optional bundled assets)
|
||||
├── hooks/ # Automated workflow hooks (.hook.md files)
|
||||
├── collections/ # Curated collections of resources (.md files)
|
||||
├── docs/ # Documentation for different resource types
|
||||
├── eng/ # Build and automation scripts
|
||||
@@ -48,9 +50,9 @@ npm run skill:create -- --name <skill-name>
|
||||
|
||||
## Development Workflow
|
||||
|
||||
### Working with Agents, Prompts, Instructions, and Skills
|
||||
### Working with Agents, Prompts, Instructions, Skills, and Hooks
|
||||
|
||||
All agent files (`*.agent.md`), prompt files (`*.prompt.md`), and instruction files (`*.instructions.md`) must include proper markdown front matter. Agent Skills are folders containing a `SKILL.md` file with frontmatter and optional bundled assets:
|
||||
All agent files (`*.agent.md`), prompt files (`*.prompt.md`), instruction files (`*.instructions.md`), and hook files (`*.hook.md`) must include proper markdown front matter. Agent Skills are folders containing a `SKILL.md` file with frontmatter and optional bundled assets:
|
||||
|
||||
#### Agent Files (*.agent.md)
|
||||
- Must have `description` field (wrapped in single quotes)
|
||||
@@ -80,9 +82,20 @@ All agent files (`*.agent.md`), prompt files (`*.prompt.md`), and instruction fi
|
||||
- Asset files should be reasonably sized (under 5MB per file)
|
||||
- Skills follow the [Agent Skills specification](https://agentskills.io/specification)
|
||||
|
||||
#### Hook Folders (hooks/*/README.md)
|
||||
- Each hook is a folder containing a `README.md` file with frontmatter
|
||||
- README.md must have `name` field (human-readable name)
|
||||
- README.md must have `description` field (wrapped in single quotes, not empty)
|
||||
- Must include a `hooks.json` file with hook configuration (hook events extracted from this file)
|
||||
- Folder names should be lower case with words separated by hyphens
|
||||
- Can include bundled assets (scripts, utilities, configuration files)
|
||||
- Bundled scripts should be referenced in the README.md and hooks.json
|
||||
- Follow the [GitHub Copilot hooks specification](https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/use-hooks)
|
||||
- Optionally includes `tags` field for categorization
|
||||
|
||||
### Adding New Resources
|
||||
|
||||
When adding a new agent, prompt, instruction, or skill:
|
||||
When adding a new agent, prompt, instruction, skill, or hook:
|
||||
|
||||
**For Agents, Prompts, and Instructions:**
|
||||
1. Create the file with proper front matter
|
||||
@@ -90,6 +103,16 @@ When adding a new agent, prompt, instruction, or skill:
|
||||
3. Update the README.md by running: `npm run build`
|
||||
4. Verify the resource appears in the generated README
|
||||
|
||||
**For Hooks:**
|
||||
1. Create a new folder in `hooks/` with a descriptive name
|
||||
2. Create `README.md` with proper frontmatter (name, description, hooks, tags)
|
||||
3. Create `hooks.json` with hook configuration following GitHub Copilot hooks spec
|
||||
4. Add any bundled scripts or assets to the folder
|
||||
5. Make scripts executable: `chmod +x script.sh`
|
||||
6. Update the README.md by running: `npm run build`
|
||||
7. Verify the hook appears in the generated README
|
||||
|
||||
|
||||
**For Skills:**
|
||||
1. Run `npm run skill:create` to scaffold a new skill folder
|
||||
2. Edit the generated SKILL.md file with your instructions
|
||||
@@ -186,6 +209,16 @@ For skills (skills/*/):
|
||||
- [ ] Any bundled assets are referenced in SKILL.md
|
||||
- [ ] Bundled assets are under 5MB per file
|
||||
|
||||
For hook folders (hooks/*/):
|
||||
- [ ] Folder contains a README.md file with markdown front matter
|
||||
- [ ] Has `name` field with human-readable name
|
||||
- [ ] Has non-empty `description` field wrapped in single quotes
|
||||
- [ ] Has `hooks.json` file with valid hook configuration (hook events extracted from this file)
|
||||
- [ ] Folder name is lower case with hyphens
|
||||
- [ ] Any bundled scripts are executable and referenced in README.md
|
||||
- [ ] Follows [GitHub Copilot hooks specification](https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/use-hooks)
|
||||
- [ ] Optionally includes `tags` array field for categorization
|
||||
|
||||
## Contributing
|
||||
|
||||
This is a community-driven project. Contributions are welcome! Please see:
|
||||
|
||||
Reference in New Issue
Block a user