Token导航 LogoToken导航TokenDH.com
开发敏感数据github未标认证来源可访问许可证需确认审计异常

project-hook-setup项目挂钩设置

Agent Skill

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

总安装

250

周安装

10

GitHub Stars

7

下载量

81
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/ingpoc/skills --skill project-hook-setup

简介

project-hook-setup 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态、代码变更或协作事项进行整理。

  • 适用于项目钩子配置、自动化流程和协作规则设置等开发类任务。
  • 可结合来源仓库和安装命令进一步核验具体用法和功能边界。
  • 安装前建议确认权限范围和维护状态,避免触发不必要的联网或命令执行。
  • 需注意是否会读写文件或访问私有仓库,确保 token 权限和用户授权合规。

SKILL.md

Project Hook Setup

Per-project setup for Claude Code hooks. These hooks read from .claude/config/project.json for project-specific settings.

Purpose

Installs 5 project-specific hooks that enforce:

  • Test verification before marking tested
  • File existence before marking complete
  • Health checks for API projects
  • Dependency validation
  • Session entry protocol

When to Use

SituationAction
New projectRun during INIT
.claude/hooks/ missingRun setup
Project config changedRe-run setup
Adding dependenciesUpdate config, re-run

Quick Check

# Check if project hooks exist
ls .claude/hooks/

# Check if config exists
cat .claude/config/project.json

Interactive Config

Setup prompts for project configuration:

SettingDescriptionExample
Project typeFramework usedfastapi, django, node
Dev server portLocal development port8000
Health checkCommand to verify servercurl -sf http://localhost:8000/health
Test commandHow to run testspytest
Required envEnvironment variables neededDATABASE_URL, API_KEY
Required servicesServices to be runningredis://localhost:6379

Setup Steps

1. Install Hooks

# Interactive mode (prompts for config)
.skills/project-hook-setup/scripts/setup-project-hooks.sh

# Non-interactive mode (for agents/automation)
.skills/project-hook-setup/scripts/setup-project-hooks.sh --non-interactive

# Auto-confirm prompts
.skills/project-hook-setup/scripts/setup-project-hooks.sh --yes

# Use existing config
.skills/project-hook-setup/scripts/setup-project-hooks.sh --config /path/to/config.json

# Environment variable (agent mode)
CLAUDE_NON_INTERACTIVE=1 .skills/project-hook-setup/scripts/setup-project-hooks.sh

Non-interactive flags:

FlagPurpose
--non-interactive / -nSkip all prompts (keeps existing config)
--yes / -yAuto-confirm all prompts
--config / -c <path>Use existing config file

This:

  • Creates .claude/config/project.json (or uses provided config)
  • Copies 5 hook templates to .claude/hooks/
  • Sets executable permissions

2. Verify Installation

.skills/project-hook-setup/scripts/verify-project-hooks.sh

Hooks Installed

HookEventPurposeReads From
verify-tests.pyPreToolUseRun tests before testedproject.json → test_command
verify-files-exist.pyPreToolUseCheck files before completefeature-list.json
verify-health.pyPreToolUseCheck server healthproject.json → health_check
require-dependencies.pyPreToolUseValidate env, servicesproject.json
session-entry.shCLI utilitySession entry protocolproject.json

Note: session-entry.sh is a CLI utility. Use: .claude/hooks/session-entry.sh

Settings.json Configuration

Setup script configures .claude/settings.json:

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Write|Edit",
        "hooks": [
          {"type": "command", "command": "python3 \"$CLAUDE_PROJECT_DIR\"/.claude/hooks/verify-tests.py"},
          {"type": "command", "command": "python3 \"$CLAUDE_PROJECT_DIR\"/.claude/hooks/verify-files-exist.py"},
          {"type": "command", "command": "python3 \"$CLAUDE_PROJECT_DIR\"/.claude/hooks/verify-health.py"},
          {"type": "command", "command": "python3 \"$CLAUDE_PROJECT_DIR\"/.claude/hooks/require-dependencies.py"}
        ]
      }
    ]
  }
}

Note: Uses $CLAUDE_PROJECT_DIR for project-relative paths.

Exit Criteria (Code Verified)

# Config exists with required fields
[ -f ".claude/config/project.json" ]
jq -e '.project_type' .claude/config/project.json >/dev/null
jq -e '.health_check' .claude/config/project.json >/dev/null
jq -e '.test_command' .claude/config/project.json >/dev/null

# Hooks exist and executable
[ -d ".claude/hooks" ]
[ -x ".claude/hooks/verify-tests.py" ]
[ -x ".claude/hooks/verify-files-exist.py" ]
[ -x ".claude/hooks/verify-health.py" ]
[ -x ".claude/hooks/require-dependencies.py" ]
[ -x ".claude/hooks/session-entry.sh" ]

# Verify script passes
.skills/project-hook-setup/scripts/verify-project-hooks.sh

Scripts

ScriptPurpose
setup-project-hooks.shMain setup (config + hooks + settings + validate)
configure-project-settings.pyConfigure.claude/settings.json
validate-settings.pyValidate hooks configured in settings.json
prompt-project-config.shInteractive config creation
verify-project-hooks.shVerify hook files exist
install-hooks.shCopy templates to.claude/hooks/

Project Config Schema

.claude/config/project.json:

{
  "project_type": "fastapi|django|node|python|other",
  "dev_server_port": 8000,
  "health_check": "curl -sf http://localhost:8000/health",
  "test_command": "pytest",
  "required_env": ["DATABASE_URL", "API_KEY"],
  "required_services": ["redis://localhost:6379"]
}

Troubleshooting

ProblemSolution
Config missingRun setup-project-hooks.sh to create
Hook can't read configCheck JSON syntax, verify required fields
Tests not foundUpdate test_command in project.json
Health check failsServer not running or wrong port
Permission deniedRun: chmod +x.claude/hooks/*

Integration

This skill is called by the initializer skill during INIT state:

5. Setup hooks:
   - Check: ~/.claude/hooks/verify-state-transition.py exists (global)
   - Check: .claude/hooks/verify-tests.py exists (project)
   - If missing, load respective setup skill

Next Steps

After project hooks: Continue with feature breakdown and implementation.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

34.16%
按下载量换算28

Claude

31.26%
按下载量换算25

Cursor

20.37%
按下载量换算16

Gemini CLI

9.9%
按下载量换算8

安全审计

Gen Agent Trust Hub

未通过

Socket

可疑

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

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

来源信息

继续浏览同类 Skills