plugins/plugin-creator/skills/hooks-guide/SKILL.md
Cross-platform hooks reference for AI coding assistants — Claude Code, GitHub Copilot, Cursor, Windsurf, Amp. Covers hook authoring in Node.js CJS and Python, per-platform event schemas, inline-agent hooks and MCP in agent frontmatter, common JSON I/O, exit codes, best practices, and a fetch script to refresh docs from official sources. Use when writing, reviewing, or debugging hooks for any AI assistant.
npx skillsauth add jamie-bitflight/claude_skills hooks-guideInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
flowchart TD
Start([What do you need?]) --> Q1{Which platform?}
Q1 -->|Claude Code| Q2{Inline agent hooks<br>hooks/mcpServers/skills/memory?}
Q1 -->|GitHub Copilot| Copilot["Read references/github-copilot.md"]
Q1 -->|Cursor, Windsurf, Amp<br>or coverage gaps| Coverage["Read references/platform-coverage.md"]
Q2 -->|Yes — agent frontmatter| Agent["Read references/inline-agent-hooks.md"]
Q2 -->|No — project or global hooks| Q3{Interacts with session data?<br>costs, workloads, duration, tracking}
Q3 -->|Yes — reading or writing<br>session logs or token data| SessionSchema["Load references/claude-session-log-schema-reference.md<br>before writing any code"]
Q3 -->|No| Q4{Which language?}
SessionSchema --> Q4
Q4 -->|Node.js CJS| CJS["Read references/hooks-cjs.md"]
Q4 -->|Python| Py["Read references/hooks-python.md"]
Q4 -->|Not sure / both| Both["Read references/hooks-cjs.md<br>then references/hooks-python.md"]
Agent --> CC["Also read references/claude-code.md<br>for full event schema"]
Q4 --> Schema["Cross-platform concepts:<br>references/common-schema.md"]
Copilot --> Schema
Coverage --> Schema
For deeper Claude Code coverage, these focused skills are available:
Skill(skill: "plugin-creator:hooks-core-reference") for configuration and troubleshooting.Skill(skill: "plugin-creator:hooks-io-api") for writing hook scripts that process input or produce JSON output.Skill(skill: "plugin-creator:hooks-patterns") for implementation patterns and examples.references/common-schema.md — shared concepts, cross-platform comparison, JSON I/O, exit codesreferences/claude-code.md — Claude Code hooks full reference (events, matchers, configuration)references/inline-agent-hooks.md — hooks, mcpServers, skills, and memory in agent frontmatterreferences/github-copilot.md — GitHub Copilot coding agent hooksreferences/hooks-cjs.md — Node.js CJS authoring guide and templatesreferences/hooks-python.md — Python authoring guide and templatesreferences/best-practices.md — cross-platform conventions and anti-patternsreferences/platform-coverage.md — known platforms, fetch URLs, coverage statusreferences/hooks-lifecycle.png — visual diagram of the full hook event sequencereferences/claude-session-log-schema-reference.md — verified schema for Claude Code session JSONL logs: file locations, record structure, tool_use/tool_result pairing, usage fields, observed response sizes. Load when creating or modifying hooks that interact with session data for costs, workloads, duration, or tracking.Re-fetch all platform docs and re-run the rwr:doc-to-skill transform on each:
bash plugins/plugin-creator/skills/hooks-guide/scripts/fetch-and-transform-hooks-docs.sh
This updates reference files from official sources. Run when upstream docs change.
https://docs.anthropic.com/en/docs/claude-code/hooks.md (accessed 2026-02-27)https://docs.anthropic.com/en/docs/claude-code/sub-agents.md (accessed 2026-02-27)https://docs.github.com/en/copilot/using-github-copilot/using-claude-as-your-copilot-llm (accessed 2026-02-27)development
When an application needs to store config, data, cache, or state files. When designing where user-specific files should live. When code writes to ~/.appname or hardcoded home paths. When implementing cross-platform file storage with platformdirs.
testing
Enforce mandatory pre-action verification checkpoints to prevent pattern-matching from overriding explicit reasoning. Use this skill when about to execute implementation actions (Bash, Write, Edit) to verify hypothesis-action alignment. Blocks execution when hypothesis unverified or action targets different system than hypothesis identified. Critical for preventing cognitive dissonance where correct diagnosis leads to wrong implementation.
tools
Reference guide for the Twelve-Factor App methodology — 15 principles (12 original + 3 modern extensions) for building portable, resilient, cloud-native applications. Use when evaluating application architecture, designing cloud-native services, reviewing codebases for methodology compliance, advising on configuration, scaling, observability, security, and deployment patterns. Incorporates the 2025 open-source community evolution and cloud-native reinterpretations of each factor.
tools
Converts user-facing documentation (how-to guides, tutorials, API references, examples) in any format — Markdown, PDF, DOCX, PPTX, XLSX, AsciiDoc, RST, HTML, Jupyter notebooks, man pages, TOML/YAML/JSON configs, and plain text — into Claude Code skill directories with SKILL.md plus thematically grouped references/*.md files. Use when given a docs directory or mixed-format documentation to transform into an AI skill. Uses MCP file-reader server for binary formats.