You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
├── collections/ # Curated collections of resources (.md files)
22
24
├── docs/ # Documentation for different resource types
23
25
├── eng/ # Build and automation scripts
@@ -48,9 +50,9 @@ npm run skill:create -- --name <skill-name>
48
50
49
51
## Development Workflow
50
52
51
-
### Working with Agents, Prompts, Instructions, and Skills
53
+
### Working with Agents, Prompts, Instructions, Skills, and Hooks
52
54
53
-
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:
55
+
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. Hooks are folders containing a `README.md` with frontmatter and a `hooks.json` configuration file:
54
56
55
57
#### Agent Files (*.agent.md)
56
58
- Must have `description` field (wrapped in single quotes)
@@ -80,16 +82,37 @@ All agent files (`*.agent.md`), prompt files (`*.prompt.md`), and instruction fi
80
82
- Asset files should be reasonably sized (under 5MB per file)
81
83
- Skills follow the [Agent Skills specification](https://agentskills.io/specification)
82
84
85
+
#### Hook Folders (hooks/*/README.md)
86
+
- Each hook is a folder containing a `README.md` file with frontmatter
87
+
- README.md must have `name` field (human-readable name)
88
+
- README.md must have `description` field (wrapped in single quotes, not empty)
89
+
- Must include a `hooks.json` file with hook configuration (hook events extracted from this file)
90
+
- Folder names should be lower case with words separated by hyphens
91
+
- Can include bundled assets (scripts, utilities, configuration files)
92
+
- Bundled scripts should be referenced in the README.md and hooks.json
93
+
- Follow the [GitHub Copilot hooks specification](https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/use-hooks)
94
+
- Optionally includes `tags` field for categorization
95
+
83
96
### Adding New Resources
84
97
85
-
When adding a new agent, prompt, instruction, or skill:
98
+
When adding a new agent, prompt, instruction, skill, or hook:
86
99
87
100
**For Agents, Prompts, and Instructions:**
88
101
1. Create the file with proper front matter
89
102
2. Add the file to the appropriate directory
90
103
3. Update the README.md by running: `npm run build`
91
104
4. Verify the resource appears in the generated README
92
105
106
+
**For Hooks:**
107
+
1. Create a new folder in `hooks/` with a descriptive name
108
+
2. Create `README.md` with proper frontmatter (name, description, hooks, tags)
109
+
3. Create `hooks.json` with hook configuration following GitHub Copilot hooks spec
110
+
4. Add any bundled scripts or assets to the folder
111
+
5. Make scripts executable: `chmod +x script.sh`
112
+
6. Update the README.md by running: `npm run build`
113
+
7. Verify the hook appears in the generated README
114
+
115
+
93
116
**For Skills:**
94
117
1. Run `npm run skill:create` to scaffold a new skill folder
95
118
2. Edit the generated SKILL.md file with your instructions
@@ -186,6 +209,16 @@ For skills (skills/*/):
186
209
-[ ] Any bundled assets are referenced in SKILL.md
187
210
-[ ] Bundled assets are under 5MB per file
188
211
212
+
For hook folders (hooks/*/):
213
+
-[ ] Folder contains a README.md file with markdown front matter
214
+
-[ ] Has `name` field with human-readable name
215
+
-[ ] Has non-empty `description` field wrapped in single quotes
216
+
-[ ] Has `hooks.json` file with valid hook configuration (hook events extracted from this file)
217
+
-[ ] Folder name is lower case with hyphens
218
+
-[ ] Any bundled scripts are executable and referenced in README.md
Copy file name to clipboardExpand all lines: README.md
+7-2Lines changed: 7 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@ This repository provides a comprehensive toolkit for enhancing GitHub Copilot wi
11
11
-**👉 [Awesome Agents](docs/README.agents.md)** - Specialized GitHub Copilot agents that integrate with MCP servers to provide enhanced capabilities for specific workflows and tools
12
12
-**👉 [Awesome Prompts](docs/README.prompts.md)** - Focused, task-specific prompts for generating code, documentation, and solving specific problems
13
13
-**👉 [Awesome Instructions](docs/README.instructions.md)** - Comprehensive coding standards and best practices that apply to specific file patterns or entire projects
14
+
-**👉 [Awesome Hooks](docs/README.hooks.md)** - Automated workflows triggered by specific events during development, testing, and deployment
14
15
-**👉 [Awesome Skills](docs/README.skills.md)** - Self-contained folders with instructions and bundled resources that enhance AI capabilities for specialized tasks
15
16
-**👉 [Awesome Collections](docs/README.collections.md)** - Curated collections of related prompts, instructions, agents, and skills organized around specific themes and workflows
16
17
-**👉 [Awesome Cookbook Recipes](cookbook/README.md)** - Practical, copy-paste-ready code snippets and real-world examples for working with GitHub Copilot tools and features
@@ -96,6 +97,10 @@ Use the `/` command in GitHub Copilot Chat to access prompts:
96
97
97
98
Instructions automatically apply to files based on their patterns and provide contextual guidance for coding standards, frameworks, and best practices.
98
99
100
+
### 🪝 Hooks
101
+
102
+
Hooks enable automated workflows triggered by specific events during GitHub Copilot coding agent sessions (like sessionStart, sessionEnd, userPromptSubmitted). They can automate tasks like logging, auto-committing changes, or integrating with external services.
103
+
99
104
## 🎯 Why Use Awesome GitHub Copilot?
100
105
101
106
-**Productivity**: Pre-built agents, prompts and instructions save time and provide consistent results.
@@ -107,7 +112,7 @@ Instructions automatically apply to files based on their patterns and provide co
107
112
108
113
We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details on how to:
109
114
110
-
- Add new prompts, instructions, agents, or skills
115
+
- Add new prompts, instructions, hooks, agents, or skills
111
116
- Improve existing content
112
117
- Report issues or suggest enhancements
113
118
@@ -148,7 +153,7 @@ The customizations in this repository are sourced from and created by third-part
148
153
149
154
---
150
155
151
-
**Ready to supercharge your coding experience?** Start exploring our [prompts](docs/README.prompts.md), [instructions](docs/README.instructions.md), and [custom agents](docs/README.agents.md)!
156
+
**Ready to supercharge your coding experience?** Start exploring our [prompts](docs/README.prompts.md), [instructions](docs/README.instructions.md), [hooks](docs/README.hooks.md), and [custom agents](docs/README.agents.md)!
Hooks enable automated workflows triggered by specific events during GitHub Copilot coding agent sessions, such as session start, session end, user prompts, and tool usage.
4
+
### How to Use Hooks
5
+
6
+
**What's Included:**
7
+
- Each hook is a folder containing a `README.md` file and a `hooks.json` configuration
8
+
- Hooks may include helper scripts, utilities, or other bundled assets
9
+
- Hooks follow the [GitHub Copilot hooks specification](https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/use-hooks)
10
+
11
+
**To Install:**
12
+
- Copy the hook folder to your repository's `.github/hooks/` directory
13
+
- Ensure any bundled scripts are executable (`chmod +x script.sh`)
14
+
- Commit the hook to your repository's default branch
15
+
16
+
**To Activate/Use:**
17
+
- Hooks automatically execute during Copilot coding agent sessions
18
+
- Configure hook events in the `hooks.json` file
19
+
- Available events: `sessionStart`, `sessionEnd`, `userPromptSubmitted`, `preToolUse`, `postToolUse`, `errorOccurred`
20
+
21
+
**When to Use:**
22
+
- Automate session logging and audit trails
23
+
- Auto-commit changes at session end
24
+
- Track usage analytics
25
+
- Integrate with external tools and services
26
+
- Custom session workflows
27
+
28
+
| Name | Description | Events | Bundled Assets |
29
+
| ---- | ----------- | ------ | -------------- |
30
+
|[Session Auto-Commit](../hooks/session-auto-commit/README.md)| Automatically commits and pushes changes when a Copilot coding agent session ends | sessionEnd |`auto-commit.sh`<br />`hooks.json`|
31
+
|[Session Logger](../hooks/session-logger/README.md)| Logs all Copilot coding agent session activity for audit and analysis | sessionStart, sessionEnd, userPromptSubmitted |`hooks.json`<br />`log-prompt.sh`<br />`log-session-end.sh`<br />`log-session-start.sh`|
Copy file name to clipboardExpand all lines: eng/constants.mjs
+45-15Lines changed: 45 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,5 @@
1
-
importpathfrom"path";
1
+
importpath,{dirname}from"path";
2
2
import{fileURLToPath}from"url";
3
-
import{dirname}from"path";
4
3
5
4
const__filename=fileURLToPath(import.meta.url);
6
5
const__dirname=dirname(__filename);
@@ -100,6 +99,34 @@ Skills differ from other primitives by supporting bundled assets (scripts, code
100
99
- Browse the skills table below to find relevant capabilities
101
100
- Copy the skill folder to your local skills directory
102
101
- Reference skills in your prompts or let the agent discover them automatically`,
102
+
103
+
hooksSection: `## 🪝 Hooks
104
+
105
+
Hooks enable automated workflows triggered by specific events during GitHub Copilot coding agent sessions, such as session start, session end, user prompts, and tool usage.`,
106
+
107
+
hooksUsage: `### How to Use Hooks
108
+
109
+
**What's Included:**
110
+
- Each hook is a folder containing a \`README.md\` file and a \`hooks.json\` configuration
111
+
- Hooks may include helper scripts, utilities, or other bundled assets
112
+
- Hooks follow the [GitHub Copilot hooks specification](https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/use-hooks)
113
+
114
+
**To Install:**
115
+
- Copy the hook folder to your repository's \`.github/hooks/\` directory
116
+
- Ensure any bundled scripts are executable (\`chmod +x script.sh\`)
117
+
- Commit the hook to your repository's default branch
118
+
119
+
**To Activate/Use:**
120
+
- Hooks automatically execute during Copilot coding agent sessions
121
+
- Configure hook events in the \`hooks.json\` file
122
+
- Available events: \`sessionStart\`, \`sessionEnd\`, \`userPromptSubmitted\`, \`preToolUse\`, \`postToolUse\`, \`errorOccurred\`
0 commit comments