Token导航 LogoToken导航TokenDH.com
前端设计执行命令github未标认证来源可访问许可证需确认审计提醒

scaffold-cc-hooks脚手架 cc 挂钩

Agent Skill

scaffold-cc-hooks 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

489

周安装

21

GitHub Stars

13

下载量

171
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:scaffold-cc-hooks(脚手架 cc 挂钩)
来源仓库:https://github.com/jpcaparas/skills
仓库路径:skills/scaffold-cc-hooks
安装命令:
npx skills add https://github.com/jpcaparas/skills --skill scaffold-cc-hooks
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/jpcaparas/skills --skill scaffold-cc-hooks

简介

scaffold-cc-hooks 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适合围绕仓库状态、代码变更或协作事项进行整理和分析。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装使用。
  • 安装前建议确认权限范围、维护状态及是否触发联网或命令执行。
  • 可结合原始 README 进一步核验具体功能和使用方法。

SKILL.md

scaffold-cc-hooks

Audit the target project first, then scaffold Claude Code hooks with a deterministic bash-first layout.

Decision Tree

What is the user asking for?

  • New Claude Code hooks in a project with no hook setup yet: Run live docs verification, audit the project, choose a hook plan, then scaffold.
  • Existing .claude/settings*.json or .claude/hooks/ files: Audit what already exists, choose additive or overhaul, then regenerate only the managed hook layer.
  • Existing hooks that show up in /hooks but never actually fire: Treat workspace trust as the first diagnostic. Check ~/.claude.json for the exact project path before debugging settings or script logic, then offer to enable trust if it is still off.
  • Existing hooks plus possible Claude Code feature drift: Verify the live official hook event list before writing files. If the docs changed, update the scaffold inputs first.
  • Explanation only, not implementation: Read references/hook-events.md and references/scaffold-layout.md, then answer without scaffolding.

Quick Reference

TaskAction
Verify the current official hook modelRead the live official docs at https://code.claude.com/docs/en/hooks and https://code.claude.com/docs/en/hooks-guide, then compare them to assets/hook-events.json
Audit a target repoRun scripts/audit_project.sh /path/to/project
Check whether Claude Code trusts the target workspaceRun scripts/check_workspace_trust.sh /path/to/project --json
Enable workspace trust for the target workspaceRun scripts/check_workspace_trust.sh /path/to/project --enable
Understand the event catalogRead references/hook-events.md
Decide additive vs overhaulRead references/merge-strategy.md
Generate or refresh the managed hook scaffoldRun `scripts/scaffold_hooks.sh --project /path/to/project --plan /path/to/plan.json --mode additive
Merge generated hooks into settingsLet scripts/scaffold_hooks.sh call scripts/merge_settings.sh, or run the merge script directly
Regenerate the hooks README in a target projectRun scripts/render_hooks_readme.sh --project /path/to/project --plan /path/to/plan.json

Non-Negotiable Workflow

  1. Verify the live official Claude Code hook docs before planning any scaffold.
  2. Compare the live event list, hook type support, and async rules with assets/hook-events.json.
  3. Audit the target project in detail before deciding which events to enable.
  4. Inspect any existing .claude/settings.json, .claude/settings.local.json, .claude/hooks/, CLAUDE.md, .claude/rules/, and related automation files before choosing a merge mode.
  5. Produce or update a concrete hook plan JSON. Keep the scaffold deterministic by putting project-specific judgment into the plan, not into the scaffold script.
  6. Scaffold every current hook event as a commented bash stub under the managed hook root, even if the event stays disabled in settings.
  7. Wire only the enabled events into the chosen settings file so the project does not pay runtime cost for inactive stubs.
  8. Regenerate .claude/hooks/README.md so the project always has a readable event map.
  9. If the user reports that hooks are registered but not firing, or you just completed a real scaffold and need to verify the setup, check or explicitly offer to check workspace trust for the exact project path before debugging hook logic.
  10. If trust is disabled, explain that hasTrustDialogAccepted is false for that project. Offer the user two recovery paths: accept the dialog in a fresh Claude Code session, or flip the flag directly. Only mutate ~/.claude.json when the user asks you to do so or explicitly asks you to ensure trust is enabled.

Trust First Heuristic

Default to a trust check early when any of these signals appear:

  • the user says hooks are not activating, not firing, or being ignored
  • /hooks shows registered handlers with the expected counts, but nothing executes
  • the hook scripts work when run by hand, but Claude Code never invokes them
  • you just scaffolded hooks and the user wants you to confirm they actually work

Use this flow:

  1. Canonicalize the target path first. Trust is keyed by the exact absolute project path.
  2. Run scripts/check_workspace_trust.sh /path/to/project --json.
  3. If status is untrusted, tell the user the flag is false and offer to enable it.
  4. If the user wants it fixed, run scripts/check_workspace_trust.sh /path/to/project --enable.
  5. Only after trust is confirmed should you spend time debugging settings merges, hook matchers, script permissions, or hook logic.

Live Docs First

The official Claude Code docs are the source of truth:

  • https://code.claude.com/docs/en/hooks
  • https://code.claude.com/docs/en/hooks-guide

Use the two reading.sh articles only as secondary material for practical patterns and trade-off language:

  • https://reading.sh/claude-code-hooks-a-bookmarkable-guide-to-git-automation-11b4516adc5d
  • https://reading.sh/claude-code-async-hooks-what-they-are-and-when-to-use-them-61b21cd71aad

If the official docs and the secondary articles disagree, follow the official docs and update the local references.

Project Analysis Rules

Before choosing any hook structure, inspect:

  • repo root and workspace shape
  • the exact absolute project path Claude Code will trust, because trust is keyed by path in ~/.claude.json
  • languages and package managers
  • build, test, lint, and format entry points
  • monorepo tools like Turborepo, Nx, pnpm workspaces, Bun workspaces, or custom task runners
  • existing Claude Code settings, rules, hooks, plugins, and skills
  • existing Git hooks, Husky, Lefthook, or CI gates
  • sensitive paths like .env, secrets, migrations, lockfiles, generated code, and infra directories
  • environment reload needs such as direnv, .envrc, or per-directory tooling

Run scripts/audit_project.sh first, then read references/project-analysis.md when you need the full checklist.

Deterministic vs Project-Specific Work

Keep these parts deterministic:

  • managed hook root path
  • event stub filenames
  • generated settings fragment shape
  • merge behavior for previously managed hooks
  • hooks README generation
  • event manifest coverage for every current official hook event

Allow these parts to stay project-specific:

  • which events are enabled
  • event matchers
  • sync vs async choice
  • if filters on tool events
  • timeouts
  • the actual logic inside enabled event scripts
  • whether the refresh is additive or overhaul

Repeat-Run Rules

When the skill is invoked again against a project:

  • Re-run live docs verification before assuming the event set is unchanged.
  • Re-audit the project before assuming the current hook plan still fits.
  • If the user says hooks never fire, or the scaffold needs verification, re-check workspace trust for the exact project path before assuming the generated settings are wrong.
  • Preserve non-managed hooks by default.
  • Treat previously generated hooks under the managed root as replaceable in overhaul mode.
  • Treat previously generated hooks as append-only in additive mode unless a missing event or stale README requires a refresh.
  • If new official hook events exist, add new stubs and README entries even if the project keeps them disabled.

Scaffold Rules

  • Generate bash scripts, not Python, for the project hook runtime.
  • Comment the generated bash stubs in plain language.
  • Use $CLAUDE_PROJECT_DIR in generated command paths.
  • Default to a managed root of .claude/hooks/generated unless the project already has a stronger convention.
  • Default to .claude/settings.json when the hook setup should be shared. Use .claude/settings.local.json only when the project needs machine-local behavior or already uses that pattern.
  • Keep one managed script per event so the event map stays obvious.
  • Keep the merged settings deterministic: remove only previously managed handlers, never unrelated custom hooks.

Reading Guide

NeedRead
Full audit checklist and what to inspect firstreferences/project-analysis.md
Current official event list and support matrixreferences/hook-events.md
Managed folder layout and plan file shapereferences/scaffold-layout.md
Additive versus overhaul behaviorreferences/merge-strategy.md
Async, if, shell, and settings pitfallsreferences/gotchas.md

Operational Scripts

  • scripts/audit_project.sh builds a project profile from real repo signals.
  • scripts/check_workspace_trust.sh checks or enables Claude Code workspace trust for an exact project path.
  • scripts/scaffold_hooks.sh renders the managed hook tree, manifest, README, and settings fragment.
  • scripts/merge_settings.sh preserves non-managed hooks while replacing previously managed handlers.
  • scripts/render_hooks_readme.sh rebuilds .claude/hooks/README.md from the manifest and the current plan.

Gotchas

  1. async only applies to command hooks, and async hooks cannot block or steer Claude after the triggering action is already done.
  2. The if field only works on tool events and requires Claude Code v2.1.85 or later.
  3. Stop hooks can loop forever unless you honor stop_hook_active.
  4. Hook shells are non-interactive. Shell profile noise can break JSON output.
  5. PermissionRequest does not fire in non-interactive -p mode.
  6. Hooks do not fire in untrusted workspaces. Claude Code gates execution on hasTrustDialogAccepted in ~/.claude.json under .projects["/absolute/path/to/project"]. When hooks look installed but never run, or after a real scaffold, check trust first with scripts/check_workspace_trust.sh before blaming the hook config. See references/gotchas.md gotcha 9 for the exact recovery flow.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.28%
按下载量换算57

Claude

28.06%
按下载量换算48

Cursor

18.98%
按下载量换算32

Gemini CLI

10.66%
按下载量换算18

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/jpcaparas/skills --skill scaffold-cc-hooks 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills