code-review-session
Skill0 starsChanged 5 months agoMITView on GitHub
Use after writing or modifying code, before committing or merging — to catch bugs, security issues, and quality problems. Trigger on: "review this code", "check my code", "look at what I wrote", "code review", finishing a feature or bug fix, after a tdd-workflow green phase, or before any git commit on non-trivial changes. NOT for design reviews, architecture discussions, or general issue checking — only for reviewing code changes (git diff).
- Reads credentials
In this repository10 other files it gives its agents.
- debug-sessionSkill
- decision-logSkill
- devil-advocateSkill
- judge-panelSkill
- performance-tuningSkill
- pre-mortemSkill
- refactor-sessionSkill
- security-auditSkill
- spec-driven-devSkill
- tdd-workflowSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
23 rules. About 0 are common, 19 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈19
Distinctive · estimate
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
- Distinctive: line 19
Diff >1000 lines: STOP and ask the user to break it into logical chunks before reviewing.
- Distinctive: line 20
Do not request architecture changes in a code review — that belongs to a design/architecture pass.
- Distinctive: line 21
Do not request refactoring for code NOT in the diff — stay in scope.
- Distinctive: line 22
Do not flag style issues if there is a linter/formatter configured — trust the tooling.
- Distinctive: line 29
If the diff is >1000 lines, STOP and ask the user to break the review into logical chunks.
- Distinctive: line 78
Go through checklist top-down: Don't spend time on LOW if CRITICAL exists.
- Distinctive: line 86
After the checklist, flip your mindset.
- Distinctive: line 92
If this pass finds something the checklist missed, promote it to the appropriate severity level
- Distinctive: line 130
Entire file quality: when only reviewing a diff → stay scoped to what changed
- Distinctive: line 131
Do not request architecture changes in a code review — that belongs to a design/architecture pass
- Distinctive: line 132
Do not request refactoring for code NOT in the diff — stay in scope
- Distinctive: line 133
Do not flag style issues if there's a linter/formatter configured — trust the tooling
- Distinctive: line 158
After reviewing individual code quality, zoom out:
- Distinctive: line 160
If this pattern were extended to 10 similar cases, would the codebase be better or worse?
- Very specific: line 168
After completing the review, consider running an independent reviewer for a different model's perspective — many CLIs expose a one-shot …
- Distinctive: line 188
Use this skill when:
- Distinctive: line 193
Do NOT use it for design reviews, architecture discussions, or whole-codebase audits — this skill reviews a diff, not a system.
- Very specific: line 197
NOT for full codebase security audits — use security-audit instead
- Very specific: line 198
NOT for diagnosing root cause of a bug — use debug-session instead
- Very specific: line 199
NOT for architectural planning or design decisions — use spec-driven-dev or decision-log instead
- Distinctive: line 200
NEVER use this for reviewing an entire repo — scope to the diff only
- Distinctive: line 204
Reviewing code you haven't read: Always read the file before commenting — reviewing a diff without understanding the surrounding code leads …
- Distinctive: line 205
Suggesting changes that conflict with project rules: Check the project's own conventions and rules files first — the project may have hard …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Hard Rules
- Scope is the diff only — review only what changed (
git difforgit diff --staged). Never audit the entire codebase; that is a full security audit, not a code review. - Diff >1000 lines: STOP and ask the user to break it into logical chunks before reviewing.
- Do not request architecture changes in a code review — that belongs to a design/architecture pass.
- Do not request refactoring for code NOT in the diff — stay in scope.
- Do not flag style issues if there is a linter/formatter configured — trust the tooling.
Code Review Session
Review changed code systematically. Produce a severity-ranked finding list. Ship confidently.
Diff Size Check: If the diff is >1000 lines, STOP and ask the user to break the review into logical chunks. Large diffs cause reviewers to miss critical issues — smaller reviews are higher quality.
Scope: Review only what changed — git diff or git diff --staged. Never audit the entire codebase; that is a full security audit.
Review Checklist (in priority order)
Work top to bottom. Stop and fix before moving down.
CRITICAL — Block commit
- Secrets exposed: API keys, passwords, tokens hardcoded in source code
- Data loss: destructive operations (DELETE, DROP, overwrite) without guard
- Provably wrong logic: off-by-one, inverted condition, wrong operator
- Security hole: unvalidated user input at a boundary, SQL injection, XSS
- New code has zero test coverage (unless it's configuration/markup only)
HIGH — Fix before merging
- Exceptions swallowed:
except: pass,.catch(() => {}), silent error discard - Null/undefined unguarded: accessing
.propertyon something that could be None/null - Breaking change: function signature changed, callers not updated
- Performance trap: O(n²) in hot path, N+1 queries, blocking the event loop
- Zero test coverage on new code: If diff introduces new functions/classes with no corresponding tests, flag as HIGH
- Test tests the mock, not the code: If new tests mock so thoroughly that removing the implementation would still pass, flag as HIGH
- Coverage regression: If coverage report shows new code is <50% covered, flag as HIGH
MEDIUM — Fix if quick, log if not
- Misleading names: function or variable name doesn't describe what it does
- Duplicated logic: same code copy-pasted in 2+ places (extract it)
- Magic values: hardcoded numbers or strings that should be named constants
- Function too long: over 50 lines — candidate for splitting
LOW — Note and move on
- Missing comment on non-obvious logic
- Formatting inconsistency (prefer linter over manual fix)
- TODO left in code that should be a tracked ticket
How to Run
- Get the diff:
git diff # unstaged changes
git diff --staged # staged changes
git diff HEAD~1 # last commit- Go through checklist top-down. Don't spend time on LOW if CRITICAL exists.
- File each finding with this format:
[SEVERITY] path/to/file.py:42 — what's wrong → specific fix- Adversarial Pass (Devil's Advocate): After the checklist, flip your mindset. You are now an attacker trying to BREAK this code.
- "What input would crash this?" — pick 3 edge cases and mentally trace them
- "What assumption is wrong?" — list every implicit assumption, challenge each one
- "What happens under load/concurrency?" — race conditions, shared state, non-atomic ops
- "If I deleted the implementation but kept the tests, would tests still pass?" — mock integrity
- 60%+ of effort here should be DISCONFIRMATION, not confirmation. Ask "why X fails" not "why X works"
- If this pass finds something the checklist missed, promote it to the appropriate severity level
- Output a verdict:
- ✅ Ship — no CRITICAL or HIGH findings
- ⚠️ Fix first — HIGH findings present
- 🚫 Block — CRITICAL found
Output Format
Code Review — <feature or file name>
Reviewed: <git diff range>
CRITICAL (N)
- [CRITICAL] src/auth.py:15 — API key hardcoded → move to os.environ.get("API_KEY")
HIGH (N)
- [HIGH] src/api.js:88 — fetch() not awaited → add await
MEDIUM (N)
- [MEDIUM] src/utils.py:30 — magic number 86400 → extract as SECONDS_PER_DAY
LOW (N)
- [LOW] src/models.py:55 — missing docstring on public method
Verdict: ✅ Ship / ⚠️ Fix HIGH before merge / 🚫 BlockWhat NOT to Flag
- Style/formatting a linter handles → run the linter instead
- "I would have done it differently" preferences → only flag if correctness is affected
- Architectural concerns already decided → raise separately, don't block this review
- Test edge cases beyond the spec → nice to have, not a blocker
- Entire file quality when only reviewing a diff → stay scoped to what changed
- Do not request architecture changes in a code review — that belongs to a design/architecture pass
- Do not request refactoring for code NOT in the diff — stay in scope
- Do not flag style issues if there's a linter/formatter configured — trust the tooling
Quick Reference
| Situation | Action |
| Found a CRITICAL | Stop. Fix before anything else. |
| Found only MEDIUM/LOW | Ship with notes — document as TODOs |
| Unsure if it's a bug | Check with a failing test — if you can write one, it's a bug |
| Hard to review your own code | Use the checklist sequentially — don't free-form |
| Reviewing a large diff | Break it into logical chunks, review each separately |
Review the Review
Before presenting findings:
- Re-read your critique. Is each point actionable and specific, or vague?
- Did you miss anything by focusing too much on one area?
- Are you being performatively thorough (flagging non-issues to seem careful) or genuinely helpful?
- Would a senior engineer agree with your top 3 findings? Strip any finding that doesn't pass these checks.
Architecture Step-Back
After reviewing individual code quality, zoom out:
- Does this change fit well with the existing architecture, or is it fighting it?
- If this pattern were extended to 10 similar cases, would the codebase be better or worse?
- Is there a simpler design that achieves the same goal? These are LOW severity observations — note them and move on. But they compound into real architectural improvements over time.
Second Opinion
After completing the review, consider running an independent reviewer for a different model's perspective — many CLIs expose a one-shot review command (e.g. a review --uncommitted or review <diff> subcommand). A second model often catches what the first missed.
Skill Chain
| Stage | Skill |
| Before (writing the code) | tdd-workflow — tests first, then implementation |
| This skill | code-review-session — review before committing |
| Next (committing) | a git-workflow pass — conventional commit, right branch |
| If CRITICAL security found | security-audit — full audit if secrets or injection risk |
| If CRITICAL bug found | debug-session — diagnose root cause before fixing |
| After fix | tdd-workflow — add regression test for the bug found |
| For deep adversarial scrutiny | devil-advocate — stress-test the change against its own assumptions |
Trigger Conditions
Use this skill when:
- You just wrote or modified code and want a pre-commit / pre-merge check ("review this code", "check my code", "look at what I wrote", "code review").
- You finished a feature or bug fix, or completed a tdd-workflow green phase.
- You are about to
git commita non-trivial change.
Do NOT use it for design reviews, architecture discussions, or whole-codebase audits — this skill reviews a diff, not a system.
Out of Scope
- NOT for full codebase security audits — use
security-auditinstead - NOT for diagnosing root cause of a bug — use
debug-sessioninstead - NOT for architectural planning or design decisions — use
spec-driven-devordecision-loginstead - NEVER use this for reviewing an entire repo — scope to the diff only
Common Traps
- Reviewing code you haven't read: Always read the file before commenting — reviewing a diff without understanding the surrounding code leads to incorrect or irrelevant suggestions.
- Suggesting changes that conflict with project rules: Check the project's own conventions and rules files first — the project may have hard rules that override general best practices.
- Over-reviewing trivial changes (formatting, style) instead of logic/architecture: Focus on substance — if a linter handles it, don't flag it. Spend review time on correctness, security, and design.
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.

