ワンクリックで
setup-snip-hooks
Use when setting up snip CLI token reduction hooks in a project, before first terminal commands are run
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Use when setting up snip CLI token reduction hooks in a project, before first terminal commands are run
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Use when implementing any feature or fix using TDD, before writing any implementation code
Use when domain logic leaks into API/Infrastructure, project references violate layer boundaries, or you need to decide between CQS (always), CQRS bus (complex domains), and DDD patterns (invariants and events).
Use when configuring Git hooks in .NET projects before team commits occur, to enforce commit message standards and code formatting automatically
Use before writing any test or implementation task, when observable behavior needs to be captured in business language scenarios and approved by the user before code begins
Use when running mutation testing, killing mutants, verifying test quality, checking mutation score, or analyzing survivors after the test baseline is green
Use when writing tests from the outside-in, defining behavior before code, or any feature where tests should start from observable business behavior and let internal design emerge
| name | setup-snip-hooks |
| description | Use when setting up snip CLI token reduction hooks in a project, before first terminal commands are run |
| argument-hint | Run this skill to scaffold snip preToolUse hooks for CLI token reduction in a project. Follow the instructions in the generated SKILL.md file to complete setup. |
| compatibility | copilot |
| user-invocable | true |
| disable-model-invocation | false |
Scaffolds snip preToolUse hook into a project's .github/hooks/ directory. The hook automatically rewrites supported CLI commands through snip to reduce output tokens.
Copilot/VS Code hooks require a hardcoded cwd in hooks.json — there is no environment variable (like ${CLAUDE_PLUGIN_ROOT}) to resolve the hook script path dynamically. The hook must live inside the project so the relative path works.
.github/hooks/snip-rewrite.sh yetsnip and jq are available on the machinecommand -v snip # must exist
command -v jq # must exist
If either is missing, STOP — install before proceeding.
.github/hooks/ in project root if it doesn't existtemplates/ directory:mkdir -p .github/hooks
cp templates/snip-rewrite.sh .github/hooks/snip-rewrite.sh
cp templates/hooks.json .github/hooks/hooks.json
chmod +x .github/hooks/snip-rewrite.sh
.github/hooks/hooks.json already exists, merge the preToolUse entry instead of overwriting.| File | Purpose |
|---|---|
snip-rewrite.sh | preToolUse hook — rewrites commands through snip (Claude Code + Copilot formats) |
hooks.json | Hook registration for Claude Code plugin system |
git, go, cargo, dotnet, npm, npx, yarn, pnpm, docker, kubectl, make, pip, pytest, jest, tsc, eslint, rustc
Custom snip filters for dotnet build and dotnet test are available in filters/:
mkdir -p ~/.config/snip/filters
cp <skill-dir>/filters/dotnet-build.yaml ~/.config/snip/filters/dotnet-build.yaml
cp <skill-dir>/filters/dotnet-test.yaml ~/.config/snip/filters/dotnet-test.yaml
Replace
<skill-dir>with the path to this skill folder (e.g.plugins/minimal-context-tools/skills/setup-snip-hooks).
dotnet-build keeps: compiler errors/warnings + Build succeeded. / Build FAILED. summary.
dotnet-test keeps: test failure details (name, error message, stack trace) + Passed! / Failed! summary.
echo '{"tool_input":{"command":"git status"}}' | .github/hooks/snip-rewrite.sh
# Should output JSON with "snip git status" in updatedInput
git add .github/hooks/
git commit -m "chore: add snip preToolUse hooks for token reduction"