Agent skill
hooks-guide
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.
Install this agent skill to your Project
npx add-skill https://github.com/Jamie-BitFlight/claude_skills/tree/main/plugins/plugin-creator/skills/hooks-guide
SKILL.md
Route to Reference
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
Specialist Skills
For deeper Claude Code coverage, these focused skills are available:
- hooks-core-reference — Hook system fundamentals: events, configuration, matchers, environment variables, execution, security, debugging. Use
Skill(skill: "plugin-creator:hooks-core-reference")for configuration and troubleshooting. - hooks-io-api — JSON input/output API: what data hooks receive via stdin and what JSON they return to control Claude. Use
Skill(skill: "plugin-creator:hooks-io-api")for writing hook scripts that process input or produce JSON output. - hooks-patterns — Recipes and working examples: plugin hooks, frontmatter hooks, prompt-based hooks, complete code examples in Python/Node.js. Use
Skill(skill: "plugin-creator:hooks-patterns")for implementation patterns and examples.
Reference Files
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.
Refresh Docs
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.
Sources
- Claude Code hooks:
https://docs.anthropic.com/en/docs/claude-code/hooks.md(accessed 2026-02-27) - Claude Code agent frontmatter:
https://docs.anthropic.com/en/docs/claude-code/sub-agents.md(accessed 2026-02-27) - GitHub Copilot coding agent:
https://docs.github.com/en/copilot/using-github-copilot/using-claude-as-your-copilot-llm(accessed 2026-02-27)
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
ccc
This skill should be used when code search is needed (whether explicitly requested or as part of completing a task), when indexing the codebase after changes, or when the user asks about ccc, cocoindex-code, or the codebase index. Trigger phrases include 'search the codebase', 'find code related to', 'update the index', 'ccc', 'cocoindex-code'.
agent-browser
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.
delegate
Quick delegation template for sub-agent prompts. Use when assigning work to a sub-agent, before invoking the Agent tool, or when preparing prompts for specialized agents. Provides the WHERE-WHAT-WHY framework. For comprehensive delegation guidance, activate the agent-orchestration how-to-delegate skill.
swarm-spawning
Spawn agents and teammates in Claude Code swarms. Use when choosing between subagents vs teammates, selecting agent types (Explore, Plan, general-purpose, plugin agents), configuring spawn backends (in-process, tmux, iterm2), or setting environment variables for spawned agents.
knowledge-explorer
Manage the research/ knowledge base (KB) of tool and library research entries. Use when browsing KB topics, adding new research entries, updating existing entries with dated revisions, fetching GitHub repo metadata into a draft KB entry, or migrating old-format entries to skill-spec frontmatter. Triggers on tasks like "what do we have on X", "add this to the KB", "update the KB entry for Y", "fetch github info for owner/repo", or "migrate old entries".
design-anti-patterns
Enforce anti-AI UI design rules based on the Uncodixfy methodology. Use when generating HTML, CSS, React, Vue, Svelte, or any frontend UI code. Prevents "Codex UI" — the generic AI aesthetic of soft gradients, floating panels, oversized rounded corners, glassmorphism, hero sections in dashboards, and decorative copy. Applies constraints from Linear/Raycast/Stripe/GitHub design philosophy: functional, honest, human-designed interfaces. Triggers on: UI generation, dashboard building, frontend component creation, CSS styling, landing page design, or any task producing visual interface code.
Didn't find tool you were looking for?