docs: complete factual audit pass 2 — 90+ corrections

Second 10-agent parallel audit covering all remaining sections:
ultimate-guide.md (ch1-ch11), workflows/ (17 files), quiz/ (12 files),
examples/agents+skills+commands. Source of truth: official Anthropic docs.

Key corrections:

Hook system (+8 missing events):
- Complete 17-event list: PermissionRequest, PostToolUseFailure, SubagentStart,
  TeammateIdle, TaskCompleted, WorktreeCreate, WorktreeRemove, SessionEnd
- SessionStart confirmed valid (previous audit wrongly doubted it)
- Hook output format: hookSpecificOutput.permissionDecision (not {"decision":"block"})
- Missing common input fields added: transcript_path, cwd, permission_mode

Agent YAML frontmatter (13 valid fields restored/added):
- Restored: disallowedTools, memory, background, isolation, skills, permissionMode, hooks
- Added new: maxTurns, mcpServers
- Fixed: tools format is comma-separated (not space-separated)

Plan Mode (12 occurrences fixed):
- Ctrl+G = "open plan in text editor" (NOT "enter plan mode")
- Plan Mode = Shift+Tab × 2 (Normal → acceptEdits → plan)

Commands table (10.1) + built-in commands (6.1):
- Added 18+ missing commands: /copy, /doctor, /hooks, /memory, /model,
  /config, /permissions, /remote-control, /rename, /resume, /sandbox, etc.

Workflow files:
- agent-teams.md: removed fake --experimental-agent-teams flag
- hooks.yaml + post_edit event → settings.json + PostToolUse (2 files)
- TodoWrite → TaskCreate/TaskUpdate (3 files)
- task-management.md: removed fake "failed" task status

Quiz / examples:
- 01-010: Esc stops mid-action (not Ctrl+C)
- refactoring-specialist.md: removed MultiEdit (not a valid tool)
- ast-grep-patterns.md: name field (not title)
- validate-changes.md, diagnose.md: field name fixes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Florian BRUNIAUX 2026-02-26 18:21:28 +01:00
parent 8cb9f9efa6
commit 4a0a0bf30e
22 changed files with 365 additions and 322 deletions

View file

@ -48,13 +48,23 @@ Hooks are scripts that execute automatically on Claude Code events. They enable
| Event | When | Typical Use Cases |
|-------|------|-------------------|
| `SessionStart` | Session begins or resumes | Initialization, environment setup, config scanning |
| `UserPromptSubmit` | User sends a message | Context enrichment, preprocessing |
| `PreToolUse` | Before a tool executes | Validation, blocking dangerous operations |
| `PostToolUse` | After a tool executes | Formatting, logging, cleanup |
| `UserPromptSubmit` | When user sends a message | Context enrichment, preprocessing |
| `Notification` | When Claude sends a notification | Sound alerts, external notifications |
| `SessionStart` | At session start | Initialization, environment setup |
| `SessionEnd` | At session end | Cleanup, session summary |
| `PermissionRequest` | Permission dialog appears | Custom approval logic |
| `PostToolUse` | After a tool succeeds | Formatting, logging, cleanup |
| `PostToolUseFailure` | After a tool fails | Error logging, recovery actions |
| `Notification` | Claude sends a notification | Sound alerts, external notifications |
| `SubagentStart` | Sub-agent spawns | Subagent initialization |
| `SubagentStop` | Sub-agent finishes | Subagent cleanup |
| `Stop` | Claude finishes responding | Post-response actions, state saving |
| `TeammateIdle` | Agent teammate goes idle | Team coordination |
| `TaskCompleted` | Task marked completed | Workflow triggers |
| `ConfigChange` | Config file changes during session | Enterprise audit, block unauthorized changes |
| `WorktreeCreate` | Agent worktree created | Set up DB branch, install deps |
| `WorktreeRemove` | Agent worktree torn down | Clean up DB branch, temp credentials |
| `PreCompact` | Before context compaction | Save state before compaction |
| `SessionEnd` | Session terminates | Cleanup, session summary |
## Advanced Guardrails (NEW in v3.3.0)