Files
awesome-copilot/docs
Gordon Lam 5c0a993189 feat: add hooks authoring instruction 🤖🤖🤖 (#1507)
* feat: add hooks authoring instruction

Add hooks.instructions.md with portable guidance for writing GitHub Copilot hooks:
- Folder structure, config schema, and all field documentation
- Script contract: stdin JSON, exit codes, stdout/stderr channels
- Payload schemas for all common events (sessionStart, sessionEnd, userPromptSubmitted, preToolUse, postToolUse, errorOccurred, agentStop)
- Per-event deny mechanisms (structured JSON for preToolUse, non-zero exit for others)
- Matcher support for host-level tool filtering
- Three impactful examples: commit gate, auto-format, dangerous command blocker
- Bash and PowerShell templates
- Cross-platform guidance (Python through both entries)
- Anti-patterns, design rules, and portability notes (GitHub Copilot vs Claude Code)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: address PR review comments

- Document both toolArgs (JSON string) and tool_input/toolInput (object) variants with defensive parsing
- Update sessionStart stdout to reflect additionalContext injection support
- Document preToolUse stdout output fields: modifiedArgs/updatedInput, additionalContext
- Add matcher field note about local verification
- Remove undocumented notification event from event table

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: address round 2 review comments

- Defensive toolArgs parsing in all 3 example scripts (handle toolArgs string, tool_input, toolInput)
- PowerShell type check: test -is [string] before ConvertFrom-Json, init to null
- commit-gate.sh: add package.json existence guard before jq
- block-dangerous.sh: truncate command in deny reason and stderr to avoid leaking secrets
- Consistent defensive parsing helper across all Bash examples

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: handle toolArgs as string or object in jq, fix short_cmd scoping

- All 3 Bash example jq blocks now check toolArgs type before fromjson
- short_cmd defined before the deny/log branch to avoid set -u error
- Consistent defensive pattern across commit-gate, format-on-save, block-dangerous

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: remove accidentally committed agency.toml

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: expand Portability Note into CLI vs VS Code vs Cloud Agent section

Address Aaron's review: replace the thin portability bullet points with
a concrete comparison table covering what is the same (config schema,
event name casing, fields) and what differs (hook loading, shell
environment, tool argument field names). Add a 'How to write portable
hooks' checklist. Separate Claude Code into its own subsection.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: simplify to toolArgs-only parsing, clean portability section

- toolArgs is the documented contract — remove tool_input/toolInput defensive
  fallbacks from all examples and the Script Contract template
- Simplify portability section: same config everywhere, one-line note about
  cloud agent requiring default branch
- All 3 example scripts now use simple toolArgs pipe parsing

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-30 10:03:51 +10:00
..
2025-10-29 06:07:13 +11:00
2026-03-19 16:06:48 +11:00

Agentic Workflows

Agentic Workflows are AI-powered repository automations that run coding agents in GitHub Actions. Defined in markdown with natural language instructions, they enable event-triggered and scheduled automation with built-in guardrails and security-first design.

How to Contribute

See CONTRIBUTING.md for guidelines on how to contribute new workflows, improve existing ones, and share your use cases.

How to Use Agentic Workflows

What's Included:

  • Each workflow is a single .md file with YAML frontmatter and natural language instructions
  • Workflows are compiled to .lock.yml GitHub Actions files via gh aw compile
  • Workflows follow the GitHub Agentic Workflows specification

To Install:

  • Install the gh aw CLI extension: gh extension install github/gh-aw
  • Copy the workflow .md file to your repository's .github/workflows/ directory
  • Compile with gh aw compile to generate the .lock.yml file
  • Commit both the .md and .lock.yml files

To Activate/Use:

  • Workflows run automatically based on their configured triggers (schedules, events, slash commands)
  • Use gh aw run <workflow> to trigger a manual run
  • Monitor runs with gh aw status and gh aw logs

When to Use:

  • Automate issue triage and labeling
  • Generate daily status reports
  • Maintain documentation automatically
  • Run scheduled code quality checks
  • Respond to slash commands in issues and PRs
  • Orchestrate multi-step repository automation
Name Description Triggers
Daily Issues Report Generates a daily summary of open issues and recent activity as a GitHub issue schedule
OSPO Contributors Report Monthly contributor activity metrics across an organization's repositories. schedule, workflow_dispatch
OSPO Organization Health Report Comprehensive weekly health report for a GitHub organization. Surfaces stale issues/PRs, merge time analysis, contributor leaderboards, and actionable items needing human attention. schedule, workflow_dispatch
OSPO Stale Repository Report Identifies inactive repositories in your organization and generates an archival recommendation report. schedule, workflow_dispatch
OSS Release Compliance Checker Analyzes a target repository against open source release requirements and posts a detailed compliance report as an issue comment. issues, workflow_dispatch
Relevance Check Slash command to evaluate whether an issue or pull request is still relevant to the project slash_command, roles
Relevance Summary Manually triggered workflow that summarizes all open issues and PRs with a /relevance-check response into a single issue workflow_dispatch
Weekly Comment Sync Weekly workflow that finds stale code comments or README snippets, makes text-only synchronization updates, and opens a draft pull request when changes are needed. schedule, workflow_dispatch