review-and-fix
Skill2 starsChanged 3 months agoMITView on GitHub
Reviews git diff changes with senior-engineer judgment: investigates context, adapts rigor to change type, weighs downstream impact, and guides user-approved fixes. Use when reviewing code changes and deciding whether to fix issues.
6 other projects use a version of this.
Adopted by
Most recently taken up by
- CIrcui-try/Circuittheir own version, first seen Nov 8, 2026
- kimgea/agent-kittheir own version, first seen Oct 15, 2026
- dannys-code-corner/incantheir own version, first seen Oct 9, 2026
- hmislk/hmistheir own version, first seen Oct 8, 2026
- robustmq/robustmqtheir own version, first seen Oct 8, 2026
- The01Geek/prflowtheir own version, first seen Aug 29, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- robustmq/robustmq★ 1.9ksame name
- hmislk/hmis★ 244same name
- The01Geek/prflow★ 99same name
- dannys-code-corner/incan★ 73same name
- CIrcui-try/Circuit★ 5same name
- kimgea/agent-kit★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-reportSkill
- create-skillSkill
- figcraft-liveSkill
- git-branch-cleanupSkill
- github-repo-baselineSkill
- herdr-parallel-devSkill
- improve-skillSkill
- natural-writingSkill
- test-designSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
35 rules. 0 are common, 31 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
31
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 38
Scope resolution: If $ARGUMENTS provides paths, review only those files.
- Distinctive: line 45
Preserve intent: Keep what the code does; only fix how it does it.
- Very specific: line 47
No suppression shortcuts: Never suggest as any, @ts-ignore, @ts-expect-error, unwrap() to silence errors, or equivalent suppression …
- Distinctive: line 51
Before reviewing a line of code, determine the nature of the change.
- Distinctive: line 80
If external context sources exist, use them to sharpen your understanding.
- Distinctive: line 82
Check for linked tickets (issue keys or numbers) in commit messages or branch names
- Very specific: line 83
Look for design documents: docs/, designs/, *.md files mentioning the feature
- Distinctive: line 84
Read linked wiki or tracker pages when the environment provides access to them
- Very specific: line 85
Read AGENTS.md, CONTRIBUTING.md, or project-level documentation for conventions
- Distinctive: line 93
Language-server diagnostics: Use the environment's language-server diagnostics on each changed file when available.
- Distinctive: line 98
Verify each project-declared command is installed before running it.
- Distinctive: line 99
Build / type-check: If discovered from observation, run it.
- Distinctive: line 101
Key principle: Every tool is optional. Missing tools are report notes, not errors.
- Distinctive: line 110
Library/SDK files: check downstream consumers for panics, breaking changes, or behavioral shifts.
- Distinctive: line 111
New files: check whether similar files exist and match established patterns.
- Distinctive: line 112
External research: when a change uses an unfamiliar library, framework pattern, or domain concept, look up documentation and real-world …
- Distinctive: line 161
Search exit: Stop a context search when you have evidence sufficient to explain the behavior and its consequence for this change.
- Distinctive: line 175
Consider the library stability dimension: If the change is in library/SDK code, any fix must preserve backward compatibility and not …
- Distinctive: line 218
If diagnostics are clean, continue to the next approved fix.
- Distinctive: line 219
If diagnostics report a new failure:
- Distinctive: line 220
Stop and identify whether it is caused by the fix.
- Distinctive: line 221
If a follow-up fix is needed and is not covered by the user's approval, present it to the user and obtain approval before applying it.
- Distinctive: line 224
If a fix causes cascading errors: stop, revert, re-assess, and adjust the approach.
- Distinctive: line 225
Never leave a file in a broken state between fixes.
- Distinctive: line 227
If formatting tools are available, run them on modified files.
- Distinctive: line 233
If any diagnostic fails:
- Distinctive: line 234
Stop before generating the report and identify whether the failure is caused by an approved fix.
- Distinctive: line 236
After approval, return to the Step 9 validation loop, then restart this gate.
- Distinctive: line 238
Run the build if available and run tests if available (unless told not to).
- Distinctive: line 239
If a build or test failure needs a fix, present it to the user for approval, return to Step 9, and restart this gate after the approved fix …
- Distinctive: line 241
Verify every approved fix was applied correctly.
- Distinctive: line 242
Check for unintended side effects.
- Distinctive: line 249
Hotfix review: When reviewing a hotfix, resist the urge to refactor.
- Distinctive: line 251
Unfamiliar patterns: If something looks wrong but you are unsure, research it before flagging.
- Distinctive: line 255
Keep the human-readable report primary.
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Review and Fix
Review code changes as a senior engineer would: investigate context first, weigh trade-offs against the change type, then organize findings for user action.
When to Use
- The user asks to review their changes, the git diff, or a commit range ("review my changes", "check the diff", "code review")
- The user wants issues found and fixed before committing ("review and fix", "fix the issues")
- The user invokes
/review-and-fix
When NOT to Use
- Full codebase auditing (use a broader code review tool)
- Security auditing specifically (use a dedicated security skill)
- Performance profiling (different domain)
- Generating tests (separate workflow)
Inputs
| Input | Required | Format | Example |
$ARGUMENTS | No | File paths or refs | src/auth.rs, HEAD~3, main..HEAD |
| Git diff scope | No | Ref or path | Defaults to all uncommitted changes, including untracked files |
Scope resolution: If $ARGUMENTS provides paths, review only those files. If it provides git refs, diff those refs. Otherwise, review all uncommitted changes: staged, unstaged, and untracked files.
Hard Rules
- Investigate before judging: Understand why the code looks the way it does before flagging an issue. History, constraints, and intent matter.
- Adapt rigor to context: A production hotfix needs a different review than a new library API. Adjust your standards accordingly.
- No silent fixes: Present every fix to the user for approval before applying it.
- Preserve intent: Keep what the code does; only fix how it does it.
- Evidence-based: Cite a specific line, rule, or diagnostic for every issue rather than a vague impression.
- No suppression shortcuts: Never suggest
as any,@ts-ignore,@ts-expect-error,unwrap()to silence errors, or equivalent suppression mechanisms.
Core Principle: Context Determines Rigor
Before reviewing a line of code, determine the nature of the change. That context dictates which issues matter and which are noise.
| Change Type | Review Focus | What to Deprioritize |
| Hotfix / minimal patch | Correctness, no regressions, blast radius | Style, naming, refactoring |
| Library / SDK code | API stability, breaking changes, downstream panic risk, backward compat | Internal style, non-critical perf |
| New feature | Architecture, correctness, error handling, API design | Minor naming, premature optimization |
| Refactor | Behavioral equivalence, no regressions | New features, scope creep |
| Config / infra | Correct values, security, environment parity | Code style |
If you cannot determine the change type, default to "new feature" rigor. When in doubt, review more rather than less.
Workflow
Phase 1: Investigate Before Judging
Build a mental model of the change before evaluating the code.
Step 1: Read the Git Diff
- Get the full diff for the resolved scope. For uncommitted work, run
git diff HEAD(staged + unstaged in one view) andgit status --porcelain;git diffalone omits staged changes, and no diff form shows untracked files, so read every??file in full. - Parse each changed file: added lines, removed lines, modified regions
- Classify the change type using the table above (hotfix, library, new feature, refactor, config)
- Build a mental model: what is the author trying to accomplish?
Output: Change summary per file (type, intent, scope).
Step 2: Gather External Context
If external context sources exist, use them to sharpen your understanding.
- Check for linked tickets (issue keys or numbers) in commit messages or branch names
- Look for design documents:
docs/,designs/,*.mdfiles mentioning the feature - Read linked wiki or tracker pages when the environment provides access to them
- Read
AGENTS.md,CONTRIBUTING.md, or project-level documentation for conventions
Exit when each listed source has been checked once, or no external context exists; record missing context and move on. Do not broaden the search beyond the change's documented scope.
Step 3: Run Automated Diagnostics
Observe the environment, then run what's available. Assume no tool exists until you have seen it, because a missing tool reported as a failure misleads the user.
- Language-server diagnostics: Use the environment's language-server diagnostics on each changed file when available. If no server covers that file type, skip silently.
- Linter discovery: Observe project files and dependencies to find what it uses. Scan the declarations relevant to the changed language:
- JavaScript/TypeScript:
package.json, ESLint/Prettier config,tsconfig - Python:
pyproject.toml,setup.cfg,tox.ini,noxfile.py - Rust/Go:
Cargo.toml,go.mod, andMakefileor task-runner configs Verify each project-declared command is installed before running it. If nothing is found, skip.
- JavaScript/TypeScript:
- Build / type-check: If discovered from observation, run it. If none found, skip.
Key principle: Every tool is optional. Missing tools are report notes, not errors. Record each attempted or skipped diagnostic and its reason.
Step 4: Historical and Codebase Context
For each changed file, understand its role in the larger system.
git log --oneline -20 <file>: check how mature the file is.git blameon changed regions: check who wrote what, when, and why they might have done it that way.- High-churn files (50+ commits): review carefully; changes here carry history and constraints.
- Library/SDK files: check downstream consumers for panics, breaking changes, or behavioral shifts.
- New files: check whether similar files exist and match established patterns.
- External research: when a change uses an unfamiliar library, framework pattern, or domain concept, look up documentation and real-world usage before forming opinions.
Research exit criterion: For each unfamiliar library, framework pattern, or domain concept, stop when you have authoritative documentation or a real-world example that explains the relevant behavior and how it applies here. After two targeted searches without authoritative evidence, record the uncertainty and proceed conservatively; do not keep searching indefinitely.
Investigation exit criteria: End Phase 1 after every changed file has a change summary, relevant external and historical context has been checked, available diagnostics are recorded, and each unfamiliar concept is resolved with evidence or documented as uncertain. Do not continue investigating once these conditions are met.
Phase 2: Apply Judgment
Now that you have full context, think like a senior engineer. For detailed review dimensions, read references/review-criteria.md.
Step 5: Deep Review
Review each changed region with the rigor appropriate to its change type (see table above).
Universal checks (apply to all change types):
- Correctness: Logic errors, off-by-one, wrong conditions, missing edge cases
- Error handling: Swallowed errors, missing propagation, empty catches
- Security: Injection, hardcoded secrets, missing validation (only when the change touches trust boundaries)
Context-dependent checks (apply based on change type):
| Dimension | Hotfix | Library | New Feature | Refactor |
| Type safety | ○ | ●●● | ●● | ●● |
| API design | — | ●●● | ●● | ● |
| Naming | — | ● | ●● | ○ |
| Complexity | ○ | ● | ●● | ●● |
| Performance | — | ○ | ● | ○ |
| Concurrency safety | ● | ●●● | ●● | ●● |
| Downstream impact | ●● | ●●● | ● | ●● |
Legend: ●●● = critical, ●● = important, ● = nice-to-have, ○ = only if obvious, — = skip
For each issue found, record:
- File, line(s)
- Category
- Severity:
critical/warning/suggestion - Why it matters in this context (cite the concrete failure mode, not generic "best practice")
- The specific risk or consequence if left unfixed
When to search for more context during review:
- You see an unfamiliar library function → search its docs before flagging usage as wrong
- The pattern looks odd but might be intentional → check git history for why it exists
- The change affects a public API → search for downstream consumers before suggesting breaking changes
- You're unsure about a language idiom → look it up, don't guess
Search exit: Stop a context search when you have evidence sufficient to explain the behavior and its consequence for this change. If two targeted searches yield no reliable answer, record the uncertainty and do not flag the behavior as wrong solely on assumption.
Step 6: Synthesize Findings
Evaluate findings together rather than as isolated items:
- Merge issues from automated diagnostics (Step 3) and manual review (Step 5).
- Deduplicate overlapping findings.
- Weigh fix cost against benefit for each issue:
- High benefit + low cost → recommend
- High benefit + high cost → recommend, but flag scope
- Low benefit + any cost → mention as optional, do not push
- Issue exists but the change is a hotfix → note it, don't block the fix
- Think about cascading impact: Will fixing issue A break B? Are there related issues that should be fixed together?
- Consider the library stability dimension: If the change is in library/SDK code, any fix must preserve backward compatibility and not introduce panics for downstream consumers
Phase 3: Present to User
Step 7: Present Findings and Interactive Fix Selection
Present a structured report covering context, findings, and rationale:
- Context summary: What you reviewed, what change type you identified, what tools you ran
- Findings table with severity, description, and why it matters in this context:
┌────┬──────────┬───────────────────────────────────────────┬──────────────────┐
│ # │ Severity │ Issue │ Why It Matters │
├────┼──────────┼───────────────────────────────────────────┼──────────────────┤
│ 1 │ critical │ unwrap() on user input can panic │ Library API — │
│ │ │ │ downstream crash │
│ 2 │ warning │ Missing error context in fetch │ Debugging cost │
│ 3 │ suggest │ Magic number 404 in handler │ Low priority │
└────┴──────────┴───────────────────────────────────────────┴──────────────────┘- Ask the user which fixes to apply. Default: apply all. User can opt out of specific fixes.
Step 8: Fix Planning
For each approved fix:
- Draft a concrete plan: what to change, why, before/after, risk, and dependencies.
- Order fixes by dependency.
- Flag risky fixes that need extra verification.
- Present the plan for final confirmation.
See references/fix-patterns.md for common fix patterns and before/after examples, and adapt them to the project's conventions.
Phase 4: Execute and Verify
Step 9: Execute Fixes
For each approved fix, run this validation loop before proceeding to the next fix:
- Apply one fix in dependency order.
- Re-run all available diagnostics on the modified file.
- If diagnostics are clean, continue to the next approved fix.
- If diagnostics report a new failure:
- Stop and identify whether it is caused by the fix.
- If a follow-up fix is needed and is not covered by the user's approval, present it to the user and obtain approval before applying it.
- Apply the approved follow-up, then return to step 2.
- Repeat steps 2–4 until diagnostics for the current fix are clean. Only then proceed.
- If a fix causes cascading errors: stop, revert, re-assess, and adjust the approach. If the cascade exceeds 5 files, re-plan with the user.
- Never leave a file in a broken state between fixes.
- Match the project's existing conventions by reading similar files first if needed.
- If formatting tools are available, run them on modified files.
Step 10: Post-Fix Review
- Enter this gate only after every approved fix has passed the Step 9 validation loop.
- Re-run all available diagnostics on every changed file.
- If any diagnostic fails:
- Stop before generating the report and identify whether the failure is caused by an approved fix.
- Present any unapproved follow-up fix to the user and obtain approval before applying it.
- After approval, return to the Step 9 validation loop, then restart this gate.
- Repeat steps 2–3 until all available diagnostics are clean. This is the gate's diagnostic exit criterion.
- Run the build if available and run tests if available (unless told not to).
- If a build or test failure needs a fix, present it to the user for approval, return to Step 9, and restart this gate after the approved fix passes validation.
- Re-read
git diffto review final state. - Verify every approved fix was applied correctly.
- Check for unintended side effects.
- Generate the final report only after all available diagnostics are clean and available build/tests pass or are explicitly unavailable or exempted.
Gotchas
- Fix cascading: A "simple" type fix can cascade into 20 files. If cascade exceeds 5 files, stop and re-plan with the user.
- Generated files: Skip review of autogenerated files (look for
// Code generated by,@generatedheaders). - Hotfix review: When reviewing a hotfix, resist the urge to refactor. The goal is correct + minimal, not beautiful.
- Library changes: A cosmetic fix in a library can break downstream consumers. Always consider: "could this change cause a panic or behavioral change for someone using this API?"
- Unfamiliar patterns: If something looks wrong but you are unsure, research it before flagging. It may be an established idiom in that stack.
Output Contract
Keep the human-readable report primary. On completion, return these sections in order:
- Context summary: Change type, tools used, and scope reviewed
- Findings: Each finding includes severity (
critical/warning/suggestion), evidence (file/line, rule, or diagnostic), the issue, and why it matters here - Diagnostics before/after: Comparison of diagnostic results, including the final pass/fail table for each verification check
- Fixes applied: Approved fixes that were applied and their validation results
- Fixes skipped with reason: What the user chose not to fix and why
- Issues discovered but out of scope: New issues found during post-fix review that were not part of the approved work
For downstream consumers, preserve this stable field order (a field contract, not a requirement to emit JSON):
context_summary
findings[]: severity, evidence, issue, rationale
diagnostics_before_after
fixes_applied
fixes_skipped_with_reason
issues_discovered_out_of_scopeReferences
- Review Criteria: review dimensions with context-dependent weighting (Phase 2)
- Fix Patterns: fix principles and examples (Phases 3–4)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

