kjellkod/metrics-and-insights/pre-commit-review
Claude Code and agent skill by kjellkod/metrics-and-insights
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Review local staged and unstaged tracked-file changes before committing or before a pull request exists. Use when the user invokes /pre-commit-review, asks for a pre-commit review, asks to review local changes before commit, or wants a local working-tree review before a PR exists.
Install
npx vskill@latest install kjellkod/metrics-and-insights/pre-commit-reviewSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as kjellkod/quest/pre-commit-review.
Pre-Commit Review
Review the local working-tree diff before a commit exists for review. At activation, announce the skill name and scope in one line:
[pre-commit-review] reviewing local working-tree diff before commit
What this skill does
- Reviews staged plus unstaged tracked-file changes against repo conventions (
AGENTS.md), the code-reviewer severity model, and shared review anti-patterns. - Includes a local UX gate on UI files. When the diff contains
*.tsx,*.jsx,*.vue,*.svelte,*.css,*.scss, or*.swiftchanges, invokes.skills/ux-review/SKILL.mdagainst the same diff and folds any P0/P1 UX findings into the report as blocking findings. P2/P3 UX findings are noted but do not block. A one-line CSS or component tweak triggers the rubric. - Does not push, comment on PRs, write Quest decision artifacts, or commit on its own. The terminal choice (
fix,skip,commit) rests with the user.
Run these checks before reviewing:
- Verify this is a git repository:
- Run
git rev-parse --is-inside-work-tree. - If it fails, stop with:
pre-commit-review requires a git repository; no review was run.
- Refuse during an in-progress merge, rebase, or cherry-pick:
- Resolve git metadata paths with
git rev-parse --git-path MERGE_HEAD,git rev-parse --git-path CHERRY_PICK_HEAD,git rev-parse --git-path rebase-merge, andgit rev-parse --git-path rebase-apply. - Check the resolved paths, not direct
.git/...paths. - If any resolved path exists, stop with:
pre-commit-review will not review during an in-progress merge/rebase/cherry-pick; finish or abort the operation first.
- Verify the repository has a
HEADcommit:
- Run
git rev-parse --verify HEAD. - If it fails, stop with:
pre-commit-review requires at least one commit; no review was run.
- Check for tracked-file changes:
- Run
git diff --cached --quiet --andgit diff --quiet --. - If both are quiet, stop with:
No staged or unstaged tracked-file diff found; pre-commit review has nothing to review.
- Warn about untracked files:
- Run
git status --porcelain. - If any line begins with
??, say that untracked files are not part of this review until staged and offer to stop so the user can rungit addfirst.
Default review diff:
This reviews staged plus unstaged tracked-file changes. Untracked files are not included until they are staged.
Review Process
- Read
AGENTS.mdif present and apply repo rules. - Read
.skills/code-reviewer/SKILL.mdfor the severity model only:
BlockerMust fixShould fixNit
- Read
.skills/review-anti-patterns.mdand apply the shared review anti-pattern guidance. - Focus on correctness, security hygiene, tests for touched behavior, maintainability, and commit-readiness.
- Keep feedback high signal. Omit
Nitfindings by default unless they are bundled with a higher-value issue or the user explicitly requested nits.
UI/UX Changes
If the review diff (staged plus unstaged tracked changes — same scope this skill already reviews) includes UI files (any of *.tsx, *.jsx, *.vue, *.svelte, *.css, *.scss, or *.swift), also invoke .skills/ux-review/SKILL.md against the same review diff and include any P0/P1 findings in the pre-commit report. P2/P3 UX findings are noted but do not block. The rubric source is .skills/ux-context/resources/ux-stress-test.md.
Do NOT inherit PR-only behavior from code-reviewer:
- No PR comment placement rules.
- No GitHub inline-first review handling.
- No manifest validation Step 0.
- No acceptance-criteria test coverage mapping unless the user provided specific acceptance criteria for the local change.
- No
PR Commentoutput section. - No GitHub CI, PR creation, PR update, or push workflow.
Output Format
Findings come first. Emit numbered findings in current-review order:
[N] Blocker|Must fix|Should fix|Nit - path:line - finding and concrete fix
Examples:
[1] Must fix - src/app.py:42 - The error branch swallows failed writes, so callers can commit data loss. Fix: return a non-zero result or raise the existing domain exception.
[2] Should fix - tests/test_app.py:18 - The changed validation path has no regression coverage. Fix: add a focused test for the invalid input case.
If there are no findings, say there are no findings and include a short commit-ready note. Do not show fix-oriented choices when there is nothing to fix.
Terminal Decision Flow
After findings, present only the choices that match the review result:
- If there are no findings, show only:
commitskip
- If findings contain
BlockerorMust fix, show:
fix all Mustfix selected [N...]skipcommit
- If findings contain only
Should fixorNit, show:
fix selected [N...]skipcommit
If any Blocker or Must fix findings exist, recommend fixing them before commit.
Choice behavior:
fix all Must: fix allBlockerandMust fixfindings that are actionable in the working tree.fix selected [N...]: fix only the requested numbered findings.skip: leave the working tree unchanged.commit: create a local commit only if the user explicitly asks. Usegit-commit-assistantwhere applicable.
These labels are only terminal decision labels. This skill runs outside the Quest pipeline and must not write review_backlog.json or any other Quest decision artifact.
Never push from this skill.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.skills/pre-commit-review/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/kjellkod/metrics-and-insights/pre-commit-review)