code-review-workflow
Skill1 starsChanged 4 months agoMITView on GitHub
Use when the user asks to review code, a diff, pull request, patch, branch, implementation, or change set for bugs, regressions, security risks, data loss, concurrency issues, performance problems, maintainability risks, API contract drift, or missing tests. Do NOT use for reviewing SKILL.md quality; use skill-review-workflow for skill files.
- Pipes a download into a shell
6 other projects use a version of this.
Adopted by
Most recently taken up by
- Resgrid/Coretheir own version, first seen Oct 8, 2026
- Abdox-menara/guard-skillstheir own version, first seen Aug 24, 2026
- agent-packs/registrytheir own version, first seen Jun 15, 2026
- codecharmhq/claude-code-skillstheir own version, first seen May 17, 2026
- thoitiettxl-cyber/Claw-IItheir own version, first seen Apr 3, 2026
- u9401066/template-is-all-you-needtheir own version, first seen Mar 6, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- Resgrid/Core★ 238same name
- u9401066/template-is-all-you-need★ 3same name
- thoitiettxl-cyber/Claw-II★ 2same name
- codecharmhq/claude-code-skills★ 1same name
- Abdox-menara/guard-skills★ 0same name
- agent-packs/registry★ 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 repository15 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agent-config-referenceSkill
- agent-security-guardSkill
- cross-model-verificationSkill
- git-workflow-for-agentsSkill
- incident-retro-workflowSkill
- observability-workflowSkill
- planning-workflowSkill
- requirements-clarifierSkill
- skill-authoring-workflowSkill
- skill-pipeline-orchestratorSkill
- skill-review-workflowSkill
- systematic-debuggingSkill
- test-design-workflowSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
21 rules. 0 are common, 16 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
16
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 43
Run the narrowest commands that match the artifact:
- Distinctive: line 51
If reviewing a branch against a base branch:
- Very specific: line 60
If the base branch is not main, replace it with the PR base.
- Distinctive: line 71
Read the complete diff before forming findings:
- Distinctive: line 103
Search before claiming a change is complete:
- Distinctive: line 118
Read each consumer that branches, filters, serializes, validates, displays, or persists the value.
- Distinctive: line 124
Use this order. Stop style commentary until these passes are complete.
- Distinctive: line 128
Check for exploitable or sensitive failures:
- Very specific: line 143
If a Security finding appears, load agent-security-guard.
- Distinctive: line 150
Read-check-write race without unique constraint, lock, compare-and-swap, or transaction.
- Very specific: line 166
Use test-design-workflow when review becomes test planning.
- Distinctive: line 174
No regression test for fixed bug.
- Distinctive: line 175
Only happy path for auth, parsing, migration, or payment logic.
- Distinctive: line 176
Test asserts implementation detail but not user-visible behavior.
- Very specific: line 209
Use Critical: for user-visible bugs, data loss, migration failures, release breakage, or incorrect results.
- Distinctive: line 226
Before final output, check your own claims:
- Distinctive: line 228
If you say "handled elsewhere", cite the file that handles it.
- Distinctive: line 229
If you say "tests cover it", cite the test file and assertion.
- Distinctive: line 230
If you say "safe because input is constrained", cite the constraint.
- Very specific: line 231
If you cannot verify, say unverified, not probably.
- Distinctive: line 242
If tests are unavailable or too expensive, do not pretend.
“Common” is measured: kept by at least 6 in 10 of the 3 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
Code Review Workflow
Overview
Review code to find behavior risk before merge. Read the whole diff, trace changed behavior outside edited lines, and report issues that can fail users, data, security, tests, or maintenance. Output findings first, ordered by severity, with evidence, failure mode, and the smallest actionable fix
When to Use
| Use When | Don't Use When |
| The user says "review this PR", "code review", "check my diff", "look for bugs", "pre-landing review", or "is this safe to merge" | The artifact is a SKILL.md quality review; use skill-review-workflow |
| A branch, patch, pull request, commit range, or uncommitted diff needs review before merge | The user asks to implement fixes immediately instead of review; clarify whether to review first or fix |
| Code touches auth, money, billing, data deletion, migrations, shell commands, LLM output, concurrency, caching, release, or CI/CD | The user only wants formatting, naming, copyediting, or style polish |
| Tests changed and need review for false confidence, missing negative paths, or regression gaps | The user wants a test plan from scratch; use test-design-workflow |
| A previous implementation needs an independent safety pass before deployment | No code, diff, commit, or design artifact is available |
Phase 0 Benchmark Decision
Type: Technique. Adopt the GStack/Hermes review pattern: review against merge-base, run critical categories first, read consumers outside the diff, and back every claim with evidence. Omit platform preambles, telemetry, Greptile handling, and default auto-fix behavior.
The Process
scope -> diff -> changed behavior -> risk passes -> tests -> findings -> decision
| | | | | |
v v v v v v
artifact base call/data flow severity coverage merge signalStep 1: Establish Review Scope
Expected Output: scope=<branch|diff|files>, base=<branch|commit|none>, files=<N>, mode=<read-only|fix-after-review>
Run the narrowest commands that match the artifact:
git status --short
git branch --show-current
git rev-parse --show-toplevelIf reviewing a branch against a base branch:
git fetch origin main --quiet
DIFF_BASE=$(git merge-base origin/main HEAD)
git diff --stat "$DIFF_BASE"
git diff --name-status "$DIFF_BASE"If the base branch is not main, replace it with the PR base. With GitHub CLI: gh pr view --json baseRefName,headRefName and gh pr diff.
If fails:
fatal: not a git repository-> no repository context -> ask for the diff or repo path.origin/mainmissing -> base unknown -> rungit branch -aand ask which base to use.- Patch only -> review patch text as static artifact and label execution confidence limited.
Step 2: Read the Whole Diff Before Commenting
Expected Output: diff read: <files>, <insertions>/<deletions>, high-risk files=<list>
Read the complete diff before forming findings:
git diff "$DIFF_BASE"
git diff "$DIFF_BASE" -- path/to/file
git show --stat --oneline HEADFor large diffs, chunk by file:
git diff --name-only "$DIFF_BASE"
git diff "$DIFF_BASE" -- path/to/high-risk-fileClassify files before deep review:
| File signal | Review stance |
migrations/, schema, sql, models | Data safety |
auth, session, token, permission | Security |
queue, worker, lock, cache, retry, async | Race and idempotency |
prompt, llm, agent, tool, parser | Trust boundary |
.github/workflows, release, install, package | Supply-chain and CI/CD |
| tests only | False confidence and missing assertions |
If fails: diff too large -> review by risk-ranked file groups; generated files dominate -> review generator or source input.
Step 3: Trace Behavior Outside Edited Lines
Expected Output: touched behavior=<entrypoints>, consumers=<files>, unchecked assumptions=<list>
Search before claiming a change is complete:
rg -n "newStatus|NewEnumValue|changedFunction|featureFlag" .
rg -n "dangerouslySetInnerHTML|html_safe|eval\\(|exec\\(|shell=True" .For a changed function or exported symbol:
rg -n "functionName\\(" .
rg -n "existingValue1|existingValue2|newValue" .
rg -n "\\bcase\\b|switch|if .*status|allowed|valid|include|exclude" path/to/relevant/dirRead each consumer that branches, filters, serializes, validates, displays, or persists the value. If search is noisy, search sibling values, route names, JSON keys, database columns, and fixtures.
Step 4: Run Risk Passes in Severity Order
Expected Output: findings grouped by Security, Critical, Nit, or explicit no-finding result
Use this order. Stop style commentary until these passes are complete.
Pass 1: Security
Check for exploitable or sensitive failures:
git diff "$DIFF_BASE" | rg -n "password|secret|api[_-]?key|token|Bearer|private_key|sk-|AKIA|xox"
git diff "$DIFF_BASE" | rg -n "eval\\(|exec\\(|os\\.system|subprocess\\..*shell=True|curl .*\\| bash"
git diff "$DIFF_BASE" | rg -n "dangerouslySetInnerHTML|html_safe|raw\\(|v-html|mark_safe"Flag:
- Auth bypass, missing authorization check, tenant isolation failure.
- Secret exposure in code, tests, logs, CI, release manifests, screenshots, or prompts.
- Shell injection, unsafe deserialization, remote script execution.
- LLM output used as a command, URL fetch target, SQL fragment, email address, file path, or tool argument without validation.
- SSRF, XSS, path traversal, open redirect, CSRF, unsafe CORS.
If a Security finding appears, load agent-security-guard.
Pass 2: Critical Correctness
Flag likely user-visible failure:
- Data loss, double write, migration without rollback, non-idempotent retry.
- Read-check-write race without unique constraint, lock, compare-and-swap, or transaction.
- Status transition not guarded by old status.
- New enum/status not handled by all consumers.
- Changed API contract without caller/client update.
- Error swallowed, partial failure reported as success, or background job silently drops work.
- Timezone, pagination, off-by-one, empty input, duplicate input, or stale cache bug.
Commands:
rg -n "transaction|lock|unique|retry|idempot|upsert" .
rg -n "try:|except|catch \\(|rescue|finally|return null|return None|console\\.error" .Pass 3: Tests and Verification
Use test-design-workflow when review becomes test planning. Here, answer whether tests prove changed behavior.
git diff "$DIFF_BASE" -- '*test*' '*spec*' '__tests__/*'
rg -n "changedFunction|newStatus|newEndpoint|newFlag" test tests spec specs __tests__ 2>/dev/nullFlag:
- No regression test for fixed bug.
- Only happy path for auth, parsing, migration, or payment logic.
- Test asserts implementation detail but not user-visible behavior.
- Snapshot updated without behavior assertion.
- Mock hides the integration boundary that broke.
Pass 4: Maintainability, Performance, and Release
Flag only real future risk:
git diff "$DIFF_BASE" | rg -n "for .*await|Promise\\.all|sleep|setTimeout|SELECT \\*|N\\+1|TODO|FIXME"
git diff "$DIFF_BASE" -- .github/workflows package.json pyproject.toml Cargo.toml go.modLook for:
- O(n*m) lookup on hot path, missing eager load, unbounded query, unbounded retry.
- New dependency without lockfile or supply-chain consideration.
- CI path, artifact name, tag format, or publish target mismatch.
- Documentation that describes changed behavior but was not updated.
Step 5: Write Findings, Not Vibes
Expected Output: findings-first review with severity, evidence, failure mode, fix, tests
Finding format:
- Security: <short title>
Evidence: `<file>:<line>` or `<diff hunk>`
Failure mode: <what breaks, who is affected, how it can happen>
Fix: <smallest actionable change>
Test: <test or verification that would catch it>Use Critical: for user-visible bugs, data loss, migration failures, release breakage, or incorrect results. Use Nit: for non-blocking readability or maintainability. Do not include praise before findings.
If no issues:
No findings.
Residual risk: <unrun tests, unavailable environment, large generated files, or "none identified">
Decision: approveDecision labels: request changes for Security/Critical, approve with nits for Nit only, approve for no findings, blocked for missing artifact/base/context.
Step 6: Verify Before Final Claim
Expected Output: review confidence=<high|medium|low>, tests=<run|not run>, unresolved=<N>
Before final output, check your own claims:
- If you say "handled elsewhere", cite the file that handles it.
- If you say "tests cover it", cite the test file and assertion.
- If you say "safe because input is constrained", cite the constraint.
- If you cannot verify, say
unverified, notprobably.
Optional commands:
npm test
pytest -q
go test ./...
cargo testIf tests are unavailable or too expensive, do not pretend. State what was reviewed statically.
Bad/Good Review Patterns
Pattern 1: Style Before Safety
Bad:
Looks good overall. Maybe rename `x` to `request`.Good:
- Critical: duplicate webhook delivery can charge twice
Evidence: `billing/webhook.ts:88` checks `event.id` then inserts outside a transaction.
Failure mode: concurrent retries both pass the check and create two invoices.
Fix: add a unique index on `event_id` and treat duplicate-key as success.
Test: concurrent delivery test for the same event id.Pattern 2: Trusting LLM Output
Bad:
The model usually returns JSON, so parsing is fine.Good:
- Security: LLM URL can trigger SSRF
Evidence: `fetcher.ts:51` passes `model.url` directly to `fetch`.
Failure mode: prompt injection can make the model request `http://169.254.169.254`.
Fix: parse URL, require https, and allowlist hostnames before fetch.Rationalization Table
| Rationalization | Why it fails |
| "The diff is small, so risk is low" | A one-line auth, SQL, cache, or status transition change can be the highest-risk part of a release. |
| "Tests passed, so review can be shallow" | Tests prove only what they assert. Review still checks missing paths, unsafe assumptions, and boundary drift. |
| "I know this codebase, no need to read call sites" | Familiarity creates blind spots. New enum values, new callers, and changed contracts require fresh search. |
| "It is probably handled elsewhere" | Probably is not evidence. Cite the handler or report residual risk. |
| "The reviewer should be balanced" | Code review is not a compliment sandwich. Findings first; praise is usually noise. |
Red Flags
- You are about to comment after reading only the changed lines.
- You are writing "looks good overall" before deciding whether there are findings.
- You found a new enum/status/type but have not searched sibling values.
- You see auth, tenant, secret, shell, SQL, LLM, or migration changes and treat them as ordinary refactors.
- You cannot name the user-visible failure mode for a finding.
- You are relying on "probably", "usually", "should be fine", or "tests likely cover this".
- You are reviewing a SKILL.md file with this skill instead of
skill-review-workflow. - You are about to edit code during review even though the user asked only for review.
Common Pitfalls
| Symptom | Root cause | Fix |
| Review reports only style nits | Safety passes were skipped or run after readability | Run Security and Critical passes first; style can wait |
| Finding says "could be wrong" but gives no path | The reviewer did not trace call sites or data flow | Add exact evidence, failure mode, and smallest fix |
| New enum works in one screen but breaks another | Only edited file was read | Search sibling enum values and read all consumers |
| Security issue is downgraded because "internal only" | Trust boundary was assumed | Treat internal inputs as hostile unless code enforces the boundary |
| Tests were mentioned but not inspected | Coverage inferred from file names | Open the test and cite the assertion, or call it unverified |
| Fix recommendation is bigger than the bug | Reviewer optimized for elegance | Recommend the smallest safe change; move refactor to Nit |
| No-finding review hides uncertainty | Missing context was not stated | Add residual risk: tests not run, base unknown, or environment unavailable |
Verification Checklist
- Review surface declared: branch, base, files, and read-only or fix mode.
- Complete diff or risk-ranked file chunks were read before findings.
- Changed behavior was traced outside edited lines.
- Security pass completed for auth, secrets, shell, XSS, SSRF, LLM output, and unsafe external dispatch.
- Critical pass completed for data loss, races, migrations, enum completeness, contracts, and error handling.
- Tests were inspected for changed behavior; missing tests are explicit.
- Every finding has severity, evidence, failure mode, fix, and verification.
- Output is findings first, ordered Security, Critical, then Nit.
- No speculative language remains without an
unverifiedlabel. - Final decision is
request changes,approve with nits,approve, orblocked.
Interaction with Other Skills
| Related Skill | Trigger During Review | Handoff |
| agent-security-guard | Security finding, secret exposure, dangerous shell, risky git or deploy operation | Load for deeper safety scan |
| test-design-workflow | Review finds missing or weak tests | Convert gaps into success, failure, boundary, and regression tests |
| systematic-debugging | A finding requires reproducing a failure | Switch from review to reproduce, isolate, fix, verify |
| cross-model-verification | High-risk diff or reviewer uncertainty remains | Ask for independent adversarial pass |
| git-workflow-for-agents | Review result needs commit, branch, PR, or push handling | Use git workflow after review, never as a substitute for review |
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.

