hook-guard/skills/setup/SKILL.md
This skill should be used when the user asks to "set up hooks", "configure pre-commit", "add linting hooks", "set up code quality checks", "initialize hook-guard", "add pre-commit hooks", "set up git hooks", "configure Claude Code hooks", "add security checks to commits", "set up conventional commits", "hook-guard setup", "hook guard setup", "add commit checks", "protect my commits", "configure git hooks for this repo", "I need a pre-commit hook", "help me set up code quality automation", or mentions setting up commit hooks, pre-commit scripts, or code quality gates. Detects project language/toolchain and generates Claude Code hooks, git pre-commit scripts, and CLAUDECODE skip logic.
npx skillsauth add musingfox/cc-plugins hook-guard-setupInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
One-stop hook setup: detect project environment, recommend configuration, generate all hook files after user confirmation.
Do NOT use when:
Run detection commands to identify the project context. Read references/detection.md for the full detection matrix.
Detect all of the following:
.githooks/, .git/hooks/, core.hooksPath, .pre-commit-config.yaml, .claude/settings.local.json hooksIf existing hooks are found, warn the user and ask how to proceed (merge, replace, or abort).
Present a summary table to the user with all checks grouped by category:
A. Claude Code Hooks (written to .claude/settings.local.json):
| Hook | Trigger | Tools | Mode |
|------|---------|-------|------|
| Lint | PostToolUse (Edit/Write) | [detected tools] | Soft feedback |
| Format | PostToolUse (Edit/Write) | [detected tools] | Soft feedback |
| Test gate | PreToolUse (Bash: git commit) | [detected tools] | Hard gate |
B. Pre-commit Hooks — Always Run (security, integrity, structure): List each check with enabled/disabled status.
C. Pre-commit Hooks — Skip when CLAUDECODE=1 (redundant with CC hooks):
D. Commit Message Hook:
Read references/cc-hooks.md for Claude Code hooks patterns.
Read references/pre-commit-checks.md for all check implementations.
Read references/commit-msg.md for conventional commits validation.
Ask user to confirm or adjust the configuration before generating.
After user confirmation, generate the following files:
.githooks/pre-commitGenerate a self-contained bash script. Structure:
#!/usr/bin/env bash
set -euo pipefail
# CLAUDECODE skip logic
# Configuration variables
# Check functions (one per check)
# Run checks, collect results
# Summary and exit code
Use the check implementations from references/pre-commit-checks.md. Only include enabled checks.
Make executable: chmod +x .githooks/pre-commit
.githooks/commit-msg (if conventional commits enabled)Generate from references/commit-msg.md.
Make executable: chmod +x .githooks/commit-msg
.claude/settings.local.json — Claude Code hooksRead existing file if present and MERGE new hooks (do not overwrite existing settings).
Add hooks following patterns from references/cc-hooks.md.
Also add the environment variable for CLAUDECODE skip logic:
{
"env": {
"CLAUDECODE": "1"
}
}
Run: git config core.hooksPath .githooks
If the project has a setup script or Makefile, suggest adding this command there for team onboarding.
.gitignore updates (if needed)Ensure .claude/*.local.md is gitignored if using hook-guard settings.
After generation, display:
git config core.hooksPath .githooksIf .claude/hook-guard.local.md exists, read it for user overrides before Phase 2.
Read references/settings.md for the full schema, defaults, and how to apply overrides.
data-ai
Unified entry point for Obsidian daily-note captures and long-form notes. Triggers on "記一下 / log / 紀錄 / capture this / 寫到 journal" (→ cap mode) and "建立筆記 / new note / 寫一份筆記 / create a note on" (→ note mode). Also via `/obw:cap` and `/obw:note`. Requires `.obsidian.yaml`.
tools
Use the `gog` CLI to operate Google Workspace — Gmail (read/search/send/labels/drafts), Calendar (events/RSVP/freebusy/focus-time/out-of-office), and Drive (list/search/upload/ download/share/move). Triggers on any Gmail, inbox, email, calendar, agenda, meeting, schedule, RSVP, Drive, Google Doc/Sheet/Slides, file share, or upload/download request.
documentation
Interactively create .obsidian.yaml for a project and install starter templates (task / doc / adr) into the vault's Templates folder. Skips templates that already exist; never overwrites.
tools
Manage project hook-guard installation — set up, diagnose, or update Claude Code hooks, git pre-commit, and commit-msg scripts with security checks, code-quality gates, and CLAUDECODE skip logic. Triggers on "set up hooks", "configure pre-commit", "add linting hooks", "initialize hook-guard", "check hooks", "hook doctor", "verify hook setup", "troubleshoot hooks", "update hooks", "regenerate hooks", "sync hooks with current tools", or similar requests.