Skip to main content
skill CX Codex

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.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add undeadlist/claude-code-agents --skill pre-commit -a claude-code
Open on GitHub

What 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 any types and empty catch blocks
  • Find console.log calls 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-code

2Manually: put the files in place

~/.claude/skills/pre-commit/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/pre-commit/

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

Similar skills

All skills for Testing and QA →

From the same set6

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor