跳到正文
cccskills
免费在 GitHub 公开

hooks-guide

Cross-platform hooks reference for AI coding assistants — Claude Code, OpenAI Codex, GitHub Copilot, Cursor, Windsurf, and Amp. Covers hook authoring in Node.js (ESM and 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.

中文简介正在准备中。当前显示原文说明。

集成工具GitHubOpenAI
查看安装方法

包含的文件(14)

  • SKILL.md4.7 KB
  • references/best-practices.md20.2 KB
  • references/claude-code.md40.9 KB
  • references/claude-session-log-schema-reference.md23.0 KB
  • references/common-schema.md12.5 KB
  • references/github-copilot.md5.5 KB
  • references/hooks-lifecycle.png63.6 KB
  • references/hooks-lifecycle.svg7.9 KB
  • references/hooks-nodejs-extension.md18.5 KB
  • references/hooks-python.md10.0 KB
  • references/inline-agent-hooks.md14.1 KB
  • references/openai-codex.md2.4 KB
  • references/platform-coverage.md1.9 KB
  • scripts/fetch-and-transform-hooks-docs.sh4.3 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

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 -->|OpenAI Codex plugin| OpenAI["Read references/openai-codex.md"]
    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["Read references/hooks-nodejs-extension.md"]
    Q4 -->|Python| Py["Read references/hooks-python.md"]
    Q4 -->|Not sure / both| Both["Read references/hooks-nodejs-extension.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. Activate /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. Activate /plugin-creator:hooks-io-api when 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. Activate /plugin-creator:hooks-patterns for implementation patterns and examples.

Reference Files

  • references/common-schema.md — shared concepts, cross-platform comparison, JSON I/O, exit codes
  • references/claude-code.md — Claude Code hooks full reference (events, matchers, configuration)
  • references/openai-codex.md — OpenAI plugin hook discovery, trust, execution, and platform boundaries
  • references/inline-agent-hooks.md — hooks, mcpServers, skills, and memory in agent frontmatter
  • references/github-copilot.md — GitHub Copilot coding agent hooks
  • references/hooks-nodejs-extension.md — Node.js authoring guide: extension rules (.mjs/.cjs), templates, anti-patterns
  • references/hooks-python.md — Python authoring guide and templates
  • references/best-practices.md — cross-platform conventions and anti-patterns
  • references/platform-coverage.md — known platforms, fetch URLs, coverage status
  • references/hooks-lifecycle.png — visual diagram of the full hook event sequence
  • references/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 run the script's focused single-reference 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://code.claude.com/docs/en/hooks.md (accessed 2026-09-24)
  • Claude Code hooks guide: https://code.claude.com/docs/en/hooks-guide.md (accessed 2026-09-24)
  • Claude Code agent frontmatter: https://code.claude.com/docs/en/sub-agents.md (accessed 2026-09-24)
  • OpenAI plugin hooks: https://developers.openai.com/plugins/build/plugins.md and https://learn.chatgpt.com/docs/hooks (accessed 2026-09-24)
  • GitHub Copilot coding agent: https://docs.github.com/en/copilot/using-github-copilot/using-claude-as-your-copilot-llm (accessed 2026-02-27)

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Add automated documentation updater to any Claude skill. Creates a Python sync script that downloads upstream docs, processes markdown for AI consumption, and maintains local cache with configurable refresh. Collects template variables, then delegates implementation through 5-phase workflow. Use when adding auto-updating reference documentation to plugins or skills.

中文简介正在准备中。当前显示原文说明。

Jamie-BitFlight/claude_skills672026年10月20日 更新

SAM-style feature initiation workflow — discovery through codebase analysis, architecture spec, task decomposition, validation, and context manifest. Use when a user asks to add a feature, plan a feature, or convert an idea into an executable SAM plan.

中文简介正在准备中。当前显示原文说明。

Jamie-BitFlight/claude_skills672026年10月20日 更新

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.

中文简介正在准备中。当前显示原文说明。

Jamie-BitFlight/claude_skills672026年10月20日 更新

Browser automation for AI agents using the agent-browser CLI and Playwright. Use when navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, logging into sites, or automating any browser task. Triggers on "open a website", "fill out a form", "click a button", "scrape data", "test this web app", "automate browser actions", or any programmatic web interaction request.

中文简介正在准备中。当前显示原文说明。

Jamie-BitFlight/claude_skills672026年10月20日 更新

Runs the description-drift experiment — spawns all Claude Code agents simultaneously to collect self-reported capabilities, then compares them against static frontmatter descriptions to reveal how reliable orchestrator routing based on descriptions actually is. Use when measuring description drift across the agent fleet, re-running the capability collection experiment, analyzing a specific agent's self-reported capabilities, or auditing whether frontmatter descriptions accurately reflect agent behavior.

中文简介正在准备中。当前显示原文说明。

Jamie-BitFlight/claude_skills672026年10月20日 更新

Create or adapt Claude Code agent definitions. Use when creating an agent, changing subagent configuration, selecting agent scope, or designing a specialized delegation role.

中文简介正在准备中。当前显示原文说明。

Jamie-BitFlight/claude_skills672026年10月20日 更新

查看 Jamie-BitFlight 的全部技能

报告此技能的问题