fix: align hooks docs with official GitHub Copilot hooks spec

- Remove non-existent copilotAgentCommit event from all articles
- Add 5 missing hook events: preToolUse, postToolUse, agentStop,
  subagentStop, errorOccurred
- Fix hooks location from .copilot/hooks.json to .github/hooks/*.json
- Add powershell field to config format
- Add preToolUse security gating example (approve/deny tool executions)
- Update glossary and coding agent article cross-references

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Aaron Powell
2026-02-26 14:01:17 +11:00
parent a88c9f89d5
commit 31c41a6a1c
3 changed files with 83 additions and 46 deletions

View File

@@ -208,7 +208,9 @@ The agent will read your feedback, make changes, and push new commits to the sam
Hooks are especially valuable with the coding agent because they provide deterministic guardrails for autonomous work:
- **`copilotAgentCommit`**: Format code, run linters, and validate changes before every commit the agent makes
- **`preToolUse`**: Approve or deny tool executions — block dangerous commands and enforce security policies
- **`postToolUse`**: Format code, run linters, and validate changes after edits
- **`agentStop`**: Run final checks (e.g., full lint pass) when the agent finishes responding
- **`sessionStart`**: Log the start of autonomous sessions for governance
- **`sessionEnd`**: Send notifications when the agent finishes