Pre commit review

From KjellKod/quest · View interactive version

Pre commit review is an AI agent skill from the GitHub repository KjellKod/quest. 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.

How to use this skill

Skill file

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

Run these checks before reviewing:

  1. Verify this is a git repository:
  1. Refuse during an in-progress merge, rebase, or cherry-pick:
  1. Verify the repository has a HEAD commit:
  1. Check for tracked-file changes:
  1. Warn about untracked files:

Default review diff:

git diff --no-ext-diff HEAD --

This reviews staged plus unstaged tracked-file changes. Untracked files are not included until they are staged.

Review Process

  1. Read AGENTS.md if present and apply repo rules.
  2. Read .skills/code-reviewer/SKILL.md for the severity model only:
  1. Read .skills/review-anti-patterns.md and apply the shared review anti-pattern guidance.
  2. Focus on correctness, security hygiene, tests for touched behavior, maintainability, and commit-readiness.
  3. Keep feedback high signal. Omit Nit findings 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:

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:

1. commit

2. skip

1. fix all Must

2. fix selected [N...]

3. skip

4. commit

1. fix selected [N...]

2. skip

3. commit

If any Blocker or Must fix findings exist, recommend fixing them before commit.

Choice behavior:

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.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.