pre-commit — Claude Code skill: checks before committing
Review changed code and run the full test suite before a commit. Get a clear pass-or-fail verdict with the issues that need attention.
npx skills add undeadlist/claude-code-agents --skill pre-commit -a claude-codeWhat pre-commit does
The skill sets up a pre-commit review in sequential stages. First, code-auditor examines staged and changed files for suspicious any types, empty catch blocks, console.log calls, and obvious defects. Its review stays focused on the files affected by the pending commit.
Next, test-runner runs the full test suite and reports failures. The final report includes a PASS or FAIL status, code-quality findings, test results, and a recommendation to commit or fix the reported issues first. This gives you a checkpoint for catching regressions before the changes enter Git history.
The workflow relies on the code-auditor and test-runner agents being available. A failed check means the skill recommends fixing the problems before committing, rather than treating the review as a successful sign-off.
What it helps with
- Inspect changed files for obvious defects before committing
- Catch new
anytypes and emptycatchblocks - Find
console.logcalls left in production code - Run the complete test suite and identify regressions
- Produce a clear verdict on whether changes are ready to commit
Example prompts for the agent
- Review my staged changes and list code issues before I commit.
- Run the code-quality checks and full test suite before committing.
- Inspect the changed files and tell me whether the code is ready to commit.
How to install pre-commit
1Skills CLI (Vercel)
npx skills add undeadlist/claude-code-agents --skill pre-commit -a claude-code2Manually: put the files in place
~/.claude/skills/pre-commit/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/pre-commit/
1Skills CLI (Vercel)
npx skills add undeadlist/claude-code-agents --skill pre-commit -a codex2Manually: put the files in place
.agents/skills/pre-commit/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add undeadlist/claude-code-agents --skill pre-commit -a cursor2Manually: put the files in place
.cursor/skills/pre-commit/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install undeadlist/claude-code-agents pre-commit2Manually: put the files in place
.github/skills/pre-commit/SKILL.md1Skills CLI (Vercel)
npx skills add undeadlist/claude-code-agents --skill pre-commit -a gemini-cli2Platform CLI
gemini skills install https://github.com/undeadlist/claude-code-agents --path skills/pre-commitManually: put the files in place
.devin/skills/pre-commit/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add undeadlist/claude-code-agents --skill pre-commit -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about pre-commit
How do I install pre-commit in Claude Code?
Run npx skills add undeadlist/claude-code-agents --skill pre-commit -a claude-code. The skill file is located at ~/.claude/skills/pre-commit/SKILL.md.
What does the pre-commit skill do?
It coordinates a code audit through code-auditor, followed by a full test run through test-runner. The final report gives a PASS or FAIL result and lists issues that should be fixed before committing.
Which issues does pre-commit check for?
The audit looks for any types, empty catch blocks, console.log calls, and obvious bugs in changed files. The workflow then runs the full test suite to surface failures and regressions.
Source text
SKILL.md · MIT
--- name: pre-commit description: Run code quality checks and tests before committing --- # Pre-Commit Workflow Run before every commit to catch issues early. ## Execution (Sequential) ### Step 1: Code Audit Spawn `code-auditor` on staged/changed files: - Check for `any` types, empty catch blocks, console.logs, obvious bugs - Focus only on files being committed ### Step 2: Test Run Spawn `test-runner`: - Run the full test suite - Report any failures ### Step 3: Decision - **All pass** -> "Ready to commit" - **Any fail** -> "Fix before committing" with specific issues listed ## Expected Output ```markdown # Pre-Commit Check ## Status: PASS / FAIL ### Code Quality - [x] No new `any` types - [x] No empty catch blocks - [x] No console.logs in production code ### Tests - [x] All tests pass - [x] No regressions ## Verdict Ready to commit / Fix issues first ```
© undeadlist · MIT · undeadlist/claude-code-agents