Agent skill
install-precommit
Install the pre-commit review hook that forces you to understand changes before committing. Use when you want to enable commit reviews or when setting up a new project.
Install this agent skill to your Project
npx add-skill https://github.com/zbruhnke/claude-code-starter/tree/main/.claude/skills/install-precommit
SKILL.md
You are helping the user install the pre-commit review hook.
What This Hook Does
The pre-commit review hook runs before every git commit and:
- Shows files being committed with their status (added/modified/deleted)
- Shows lines added and removed
- Detects potentially sensitive files (.env, secrets, keys)
- Detects debug statements (console.log, print, debugger, etc.)
- Shows new dependencies being added
- Shows TODOs being introduced
- Requires user confirmation (y/n/d for diff) before proceeding
This prevents "vibe coding" - blindly committing AI-generated code without understanding it.
Installation Steps
-
Check prerequisites:
- Verify this is a git repository (
.gitdirectory exists) - Check if a pre-commit hook already exists
- Verify this is a git repository (
-
Create the hook script: If
.claude/hooks/pre-commit-review.shdoesn't exist, create it with the standard implementation. -
Install as git hook:
- Create
.git/hooks/directory if needed - Copy or symlink the script to
.git/hooks/pre-commit - Make it executable
- Create
-
Verify installation:
- Confirm the hook is in place
- Show the user how to test it
- Explain how to bypass if needed
Hook Script Source
The pre-commit hook script is located at .claude/hooks/pre-commit-review.sh.
Do NOT embed a copy here - always use the canonical version from the hooks directory. This ensures updates to the hook are applied everywhere.
If .claude/hooks/pre-commit-review.sh doesn't exist in the user's project, they may need to copy it from a template or create it based on their needs.
After Installation
Tell the user:
- The hook is now active for all future commits
- To skip the review (not recommended):
SKIP_PRE_COMMIT_REVIEW=1 git commit -m "message" - To uninstall:
rm .git/hooks/pre-commit
Output Format
[OK] Pre-commit review hook installed
Location: .git/hooks/pre-commit
Source: .claude/hooks/pre-commit-review.sh
The hook will run before every commit, showing:
- Files being committed
- Lines added/removed
- Potential issues (sensitive files, debug statements)
- Requires your confirmation before proceeding
To test: stage some files and run `git commit`
To skip: SKIP_PRE_COMMIT_REVIEW=1 git commit -m "message"
To remove: rm .git/hooks/pre-commit
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
risk-register
Document risks for changes touching auth, data, or migrations. Lists top risks, how to test/monitor them, and rollback strategy.
review-mr
Review a merge request or branch. Compares a branch against main/master, summarizes changes, highlights concerns, and provides actionable feedback. Use for PR reviews or before merging.
changelog-writer
Maintain CHANGELOG.md with properly categorized entries. Use after implementing features, fixing bugs, or making any notable changes. Follows Keep a Changelog format.
wiggum
Start an autonomous implementation loop from a spec or PRD. Enters plan mode for user approval, enforces command gates (test/lint/typecheck/build), validates dependencies, commits incrementally, and maintains documentation and changelog. Production-ready quality gates.
generate-tests
Generate comprehensive tests for code. Use when adding test coverage, implementing TDD, or ensuring code reliability.
release-checklist
Run a final release checklist before shipping. Verifies no TODOs, no debug code, docs updated, tests passing, dependencies justified, and security reviewed.
Didn't find tool you were looking for?