skills/code-review/SKILL.md
Review or improve code — one skill, four modes: bug/security review (default), performance, clean-code audit, slop cleanup. Pass mode:review|perf|clean|cleanup or infer. Don't use for writing features or generating tests (use test-coverage).
npx skillsauth add luongnv89/skills code-reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
One skill for reviewing and improving code quality. Pick a mode by intent (or pass an explicit
mode: parameter); each mode is a full, self-contained workflow in references/. Load only the
mode you need — this protects the agent's context budget.
| Mode | Use when the user wants to... | Reads / writes | Output | Workflow |
|---|---|---|---|---|
| review (default) | find bugs, security holes, quality issues in a diff/PR | read-only | prioritized findings report | references/review-mode.md |
| perf | make code faster — bottlenecks, leaks, algorithmic waste | read-only | performance findings report | references/perf-mode.md |
| clean | audit readability/standards vs the bbv Clean Code cheat sheet | read-only | CLEAN_CODE_AUDIT.md | references/clean-mode.md |
| cleanup | actually refactor out AI slop, dead code, duplication, cruft | WRITES CODE | modified source files | references/cleanup-mode.md |
mode:review|perf|clean|cleanup (or --mode <name>), use it.review, perf, and clean are strictly read-only: they analyze and report, never touching
source. cleanup modifies files. Therefore:
cleanup by weak inference. Run it only when the user explicitly asks to
refactor / clean up the codebase (or passes mode:cleanup). A plain "review my code" must never
rewrite files — stay in a read-only mode.cleanup, and follow that mode's own gating.The router itself is read-only. The two modes that touch a git repo carry the mandatory
sync-before-edits step in their own workflow: cleanup (writes source) in references/cleanup-mode.md
and clean (writes CLEAN_CODE_AUDIT.md) in references/clean-mode.md. Before either mode edits,
follow that reference's Repo Sync step — sync with remote (stash-first if the tree is dirty) so writes
land on top of the latest base.
Read the selected mode's reference file and execute its steps exactly. Supporting files each mode uses (already colocated under this skill):
references/review-mode.md — agents agents/reviewer.md, agents/file-reviewer.md, agents/report-assembler.md; refs references/subagent-architecture.md, references/code-smells.mdreferences/perf-mode.md — ref references/language-checks.mdreferences/clean-mode.md — refs references/clean-code-checklist.md, references/tdd-checklist.md, references/html-report-guide.md, references/report-template.htmlreferences/cleanup-mode.md — the 8 cleaner agents in agents/ (deduplicator.md, type-consolidator.md, unused-code-killer.md, circular-dep-untangler.md, weak-type-strengthener.md, defensive-programming-remover.md, legacy-code-remover.md, slop-comment-cleaner.md)If the Agent tool is available, modes that use subagents (review, cleanup) spawn them per their workflow — fresh-context validation and parallel work. If it is unavailable (e.g., Claude.ai), execute each mode's phases inline (less rigorous, but functional).
Modes compose: a common flow is clean (audit → CLEAN_CODE_AUDIT.md) then cleanup (apply the
refactors), or review/perf to find issues before fixing. Run one mode at a time; confirm with
the user before switching into the code-writing cleanup mode.
clean or cleanup, validate repository state and follow that mode's sync, backup, dry-run,
confirmation, and rollback instructions. Stop on sync errors or failed safety checks.Verify every run against the selected mode's own acceptance criteria, then assert all of these router criteria:
git diff when applicable.Example response after a read-only review:
Mode: review
Result: PASS
Findings: 1 critical, 2 major, 0 minor
Output: CODE_REVIEW.md
Validation: reviewer pass complete; no source files changed
After routing and after the selected workflow, emit a compact report:
◆ Code Review ([mode])
Mode selection: √ pass
Workflow criteria: √ pass
Output verified: √ pass
Safety boundary: √ pass
Result: PASS | FAIL | PARTIAL
Use × fail — reason for any unmet check. Never report PASS while a selected-mode acceptance
criterion, expected output, required test, or safety guardrail is unresolved.
mode: value → reject it and list the four valid modes.cleanup run.tools
Run Herdr loops for one open GitHub issue (resolve→review→fix) or an existing PR (review→lazy fixer) until CLEAN. Don't use for plain resolution without review, review-only/no-fix requests, backlog automation, or merging.
tools
Manage AI agent fleets in Herdr: split root + sub-agents into one tab as a tiled grid, message/wait/read via herdr CLI, steer any pane. Use for Herdr multi-agent fleets. Don't use for tmux, screen, or non-Herdr terminals.
development
Generate or update docs to match the code, citing each claim to path:line and asking on ambiguity; runbook docs also get a check-only validation script. Don't use for API-reference autogen (JSDoc/Sphinx), landing pages, or CLAUDE.md/AGENTS.md.
testing
Generate a diagram and route to the right engine — draw.io XML (precise, editable, C4, swimlanes) or Excalidraw JSON (hand-drawn, sketch, wireframes). One entry for flowcharts, architecture, ER, sequence, mind maps. Don't use for Mermaid or slides.