|
2 | 2 |
|
3 | 3 | Thank you for your interest in contributing to the Awesome GitHub Copilot repository! We welcome contributions from the community to help expand our collection of custom instructions and prompts. |
4 | 4 |
|
| 5 | +## Table of Contents |
| 6 | + |
| 7 | +- [How to Contribute](#how-to-contribute) |
| 8 | + - [Adding Instructions](#adding-instructions) |
| 9 | + - [Adding Prompts](#adding-prompts) |
| 10 | + - [Adding Agents](#adding-agents) |
| 11 | + - [Adding Skills](#adding-skills) |
| 12 | + - [Adding Plugins](#adding-plugins) |
| 13 | + - [Adding Hooks](#adding-hooks) |
| 14 | + - [Adding Agentic Workflows](#adding-agentic-workflows) |
| 15 | +- [Submitting Your Contribution](#submitting-your-contribution) |
| 16 | +- [What We Accept](#what-we-accept) |
| 17 | +- [What We Don't Accept](#what-we-dont-accept) |
| 18 | +- [Quality Guidelines](#quality-guidelines) |
| 19 | +- [Contributor Recognition](#contributor-recognition) |
| 20 | + - [Contribution Types](#contribution-types) |
| 21 | +- [Code of Conduct](#code-of-conduct) |
| 22 | +- [License](#license) |
| 23 | + |
5 | 24 | ## How to Contribute |
6 | 25 |
|
7 | 26 | ### Adding Instructions |
@@ -61,7 +80,7 @@ Your goal is to... |
61 | 80 | - Include examples where helpful |
62 | 81 | ``` |
63 | 82 |
|
64 | | -### Adding an Agent |
| 83 | +### Adding Agents |
65 | 84 |
|
66 | 85 | Agents are specialized configurations that transform GitHub Copilot Chat into domain-specific assistants or personas for particular development scenarios. |
67 | 86 |
|
@@ -161,25 +180,64 @@ plugins/my-plugin-id/ |
161 | 180 | - **Clear purpose**: The plugin should solve a specific problem or workflow |
162 | 181 | - **Validate before submitting**: Run `npm run plugin:validate` to ensure your plugin is valid |
163 | 182 |
|
| 183 | +### Adding Hooks |
| 184 | + |
| 185 | +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. |
| 186 | + |
| 187 | +1. **Create a new hook folder**: Add a new folder in the `hooks/` directory with a descriptive, lowercase name using hyphens (e.g., `session-logger`) |
| 188 | +2. **Create `README.md`**: Add a `README.md` file with frontmatter including `name`, `description`, and optionally `tags` |
| 189 | +3. **Create `hooks.json`**: Add a `hooks.json` file with hook configuration following the [GitHub Copilot hooks specification](https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/use-hooks) |
| 190 | +4. **Add bundled scripts**: Include any scripts or assets the hook needs, and make them executable (`chmod +x script.sh`) |
| 191 | +5. **Update the README**: Run `npm run build` to update the generated README tables |
| 192 | + |
| 193 | +#### Example hook structure |
| 194 | + |
| 195 | +``` |
| 196 | +hooks/my-hook/ |
| 197 | +├── README.md # Hook documentation with frontmatter |
| 198 | +├── hooks.json # Hook event configuration |
| 199 | +└── my-script.sh # Bundled script(s) |
| 200 | +``` |
| 201 | + |
| 202 | +#### Example README.md frontmatter |
| 203 | + |
| 204 | +```markdown |
| 205 | +--- |
| 206 | +name: 'My Hook Name' |
| 207 | +description: 'Brief description of what this hook does' |
| 208 | +tags: ['logging', 'automation'] |
| 209 | +--- |
| 210 | + |
| 211 | +# My Hook Name |
| 212 | + |
| 213 | +Detailed documentation about the hook... |
| 214 | +``` |
| 215 | + |
| 216 | +#### Hook Guidelines |
| 217 | + |
| 218 | +- **Event configuration**: Define hook events in `hooks.json` — supported events include session start, session end, user prompts, and tool usage |
| 219 | +- **Executable scripts**: Ensure all bundled scripts are executable and referenced in both `README.md` and `hooks.json` |
| 220 | +- **Privacy aware**: Be mindful of what data your hook collects or logs |
| 221 | +- **Clear documentation**: Explain installation steps, configuration options, and what the hook does |
| 222 | +- Follow the [GitHub Copilot hooks specification](https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/use-hooks) |
| 223 | + |
164 | 224 | ### Adding Agentic Workflows |
165 | 225 |
|
166 | 226 | [Agentic Workflows](https://github.github.com/gh-aw) are AI-powered repository automations that run coding agents in GitHub Actions. Defined in markdown with natural language instructions, they enable scheduled and event-triggered automation with built-in guardrails. |
167 | 227 |
|
168 | | -1. **Create your workflow file**: Add a new `.md` file in the `workflows/` directory (e.g., `daily-issues-report.md`) |
169 | | -2. **Include frontmatter**: Add `name`, `description`, `triggers`, and optionally `tags` at the top, followed by agentic workflow frontmatter (`on`, `permissions`, `safe-outputs`) and natural language instructions |
170 | | -3. **Test locally**: Compile with `gh aw compile --validate` to verify it's valid |
171 | | -4. **Update the README**: Run `npm run build` to update the generated README tables |
| 228 | +1. **Create your workflow file** with a new `.md` file in the `workflows/` directory (e.g., [`daily-issues-report.md`](./workflows/daily-issues-report.md)) |
| 229 | +2. **Include frontmatter** with `name` and `description`, followed by agentic workflow frontmatter (`on`, `permissions`, `safe-outputs`) and natural language instructions |
| 230 | +3. **Test locally** with `gh aw compile --validate --no-emit daily-issues-report.md` to verify it's valid |
| 231 | +4. **Update the README** with `npm run build` to update the generated README tables |
172 | 232 |
|
173 | 233 | > **Note:** Only `.md` files are accepted — do not include compiled `.lock.yml` or `.yml` files. CI will block them. |
174 | 234 |
|
175 | 235 | #### Workflow file example |
176 | 236 |
|
177 | 237 | ```markdown |
178 | 238 | --- |
179 | | -name: 'Daily Issues Report' |
180 | | -description: 'Generates a daily summary of open issues and recent activity as a GitHub issue' |
181 | | -triggers: ['schedule'] |
182 | | -tags: ['reporting', 'issues', 'automation'] |
| 239 | +name: "Daily Issues Report" |
| 240 | +description: "Generates a daily summary of open issues and recent activity as a GitHub issue" |
183 | 241 | on: |
184 | 242 | schedule: daily on weekdays |
185 | 243 | permissions: |
@@ -294,7 +352,8 @@ In addition, all standard contribution types supported by [All Contributors](htt |
294 | 352 |
|
295 | 353 | ## Code of Conduct |
296 | 354 |
|
297 | | -Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms. |
| 355 | +Please note that this project is maintained with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). |
| 356 | +By participating in this project you agree to abide by its terms. |
298 | 357 |
|
299 | 358 | ## License |
300 | 359 |
|
|
0 commit comments