agentleFS
REPOZYREPOZY/superpowers-optimized/skills/requesting-code-review/SKILL.md

requesting-code-review

Skill146 starsChanged 7 months agoMITView on GitHub

Structured code review against requirements, quality, and security standards. Invoke after meaningful code changes or before merge. Triggers on: "review my code", "code review", "check this before merge", "security review", "is this secure", "look over my changes", "second pair of eyes", "check the diff". Routed by using-superpowers or executing-plans after implementation.

187 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use chinese-code-review, chinese-commit-conventions and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • Leodorareluctant259Skill

    chinese-code-review

    中文代码审查规范——在保持专业严谨的同时,用符合国内团队文化的方式给出有效反馈

    Also in 8 projects that use this

  • Leodorareluctant259Skill

    chinese-commit-conventions

    中文 Git 提交规范 — 适配国内团队的 commit message 规范和 changelog 自动化

    Also in 8 projects that use this

  • obraSkill

    diagnosing-superpowers

    Use when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.

    Also in 20 projects that use this

  • math-incSkill

    heartmula

    Set up and run HeartMuLa, the open-source music generation model family (Suno-like). Generates full songs from lyrics + tags with multilingual support.

    Also in 9 projects that use this

  • Tommy-ywSkill

    webhook-subscriptions

    Create and manage webhook subscriptions for event-driven agent activation, or for direct push notifications (zero LLM cost). Use when the user wants external services to trigger agent runs OR push notifications to chats.

    Also in 5 projects that use this

  • john-data-chenSkill

    touchdesigner-mcp

    Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.

    Also in 7 projects that use this

  • +3 more from Leodorareluctant259

The file

We split this skill into the rules it gives an agent

11 rules. 0 are common, 8 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 173 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    After completing a plan task or batch

    line 18
  2. Distinctive:

    After major refactor/feature work

    line 19
  3. Distinctive:

    Before merge or PR finalization

    line 20
  4. Very specific:

    No remote, or origin/main not fetched: fall back to git merge-base main HEAD.

    line 27
  5. Very specific:

    If a plan is in play, write the diff to a file first: bash ../subagent-driven-development/scripts/review-package PLAN_FILE BASE HEAD.

    line 35
  6. Distinctive:

    When changes touch security-relevant areas, the code review must include a security pass.

    line 46
  7. Distinctive:

    Identify the entry point: Start with the finding marked ASI in the red team summary.

    line 92
  8. Distinctive:

    Re-assess the remaining findings: Update your list — remove resolved findings, re-prioritize if the fix changed the risk landscape.

    line 96
  9. Very specific:

    Run one final regression check covering everything the fixes touched, scoped per verification-before-completion.

    line 100
  10. Distinctive:

    If the red team report has zero Critical/High findings, skip the pipeline entirely.

    line 106
  11. Distinctive:

    If the user explicitly says to skip auto-fix, respect that.

    line 108

“Common” is measured: kept by at least 6 in 10 of the 173 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Requesting Code Review

Request review early to catch issues before they spread.

When

  • After completing a plan task or batch
  • After major refactor/feature work
  • Before merge or PR finalization

How

  1. Determine review range (BASE_SHA -> HEAD_SHA). Getting this wrong silently reviews the wrong thing:
    • Whole branch: BASE_SHA=$(git merge-base origin/main HEAD) (substitute your default branch). Not a bare origin/main — once main moves past your branch point, main's newer files appear in the diff as phantom deletions your branch never made, and the reviewer spends its pass on them.
    • A single task or batch: the commit recorded before the work started. Not HEAD~1, which silently drops all but the last commit of a multi-commit task.
    • No remote, or origin/main not fetched: fall back to git merge-base main HEAD.
    • Confirm the range is non-empty before dispatching — git diff --stat BASE..HEAD. An empty range produces a confident "no issues found" review of nothing.
  2. The review scope is always git diff --name-only BASE_SHA..HEAD_SHA. Never take it from context-snapshot.json: its changed_files are the commits since the last session start (or the last commit), not your review range.

    • The snapshot may add callers. If it exists and its git_hash equals git rev-parse HEAD, then for each file in the review range that has a blast_radius entry, add those callers to the reviewer prompt: "Changed files: [range list]. Also referenced by: [blast_radius callers]." If the hashes differ, ignore blast_radius.

    What blast_radius means. Each entry lists files containing a reference that resolves to the changed file's path — a relative import, or the repo path written out. It is deliberately incomplete: references that cannot be resolved (package-style imports, dynamic paths, aliases from tsconfig) are dropped rather than guessed, so an empty list means "nothing was proven," not "nothing depends on this." Never widen review scope on a name match alone; if you need dependents the snapshot does not list, grep for them and say you did.

    blast_radius_method records how the edges were derived. If it is missing, the snapshot came from a version that matched basenames as words — ignore blast_radius entirely and scope from the diff.

  3. If a plan is in play, write the diff to a file first: bash ../subagent-driven-development/scripts/review-package PLAN_FILE BASE HEAD. It refuses empty and non-descendant ranges outright, so the reviewer never receives a range that cannot mean what it claims. Pass the printed path to the reviewer.
  4. Dispatch superpowers-optimized:code-reviewer using requesting-code-review/code-reviewer.md.
  5. Provide:
    • What changed (from context snapshot or git diff)
    • Scoped file list (changed files + blast radius callers if fresh snapshot available, or broad if not)
    • Requirement or plan reference
    • SHA range
    • Short summary

Security Review (Built-In)

When changes touch security-relevant areas, the code review must include a security pass. This is not a separate step — it's part of every review where applicable.

Triggers automatically when changes touch:

  • Authentication or authorization flows
  • Input validation or output encoding
  • API endpoints handling user data
  • Secrets management or credential handling
  • Cryptography, key management, or token generation
  • Infrastructure, deployment, or CI/CD configs

Security checklist:

  • OWASP Top 10 and CWE vulnerability scan
  • OWASP API Security Top 10: broken object/function-level authorization, unrestricted resource consumption, SSRF, mass assignment, improper inventory management
  • Input validation and injection risk (SQL, XSS, CSRF, command injection)
  • Auth flow correctness (session handling, token expiry, privilege escalation, rate limiting on auth endpoints)
  • Secrets handling (no hardcoded credentials, proper env var usage)
  • Dependency vulnerabilities (known CVEs in imported packages)
  • API hardening (security headers, CORS configuration, error message sanitization, rate limiting)
  • Logging hygiene (no secrets in logs, adequate audit trail)

Severity enforcement:

  • Critical/High security findings block merge until addressed or the user explicitly accepts the risk with documented rationale.
  • Medium security findings should be fixed before merge unless explicitly deferred.

Adversarial Red Team (Optional)

For changes involving complex logic, concurrency, state management, or critical data paths, dispatch superpowers-optimized:red-team in parallel with the code reviewer.

Triggers when changes touch:

  • State machines or multi-step workflows
  • Concurrent access to shared resources
  • Complex business logic with branching conditions
  • Data transformation pipelines
  • Retry/recovery/rollback logic
  • Performance-critical paths handling large inputs

The red team agent finds concrete failure scenarios (specific inputs, race conditions, state corruption, resource exhaustion) that checklist-based review misses. It does NOT duplicate the security review — its focus is adversarial logic analysis, not OWASP/CWE compliance.

Red team critical findings block merge alongside security critical findings.

Auto-Fix Pipeline

When the red team report contains Critical or High findings, run the auto-fix pipeline. The pipeline is ASI-guided and iterative — fix one finding at a time, starting from the red team's designated ASI, then re-assess before proceeding. This prevents fixes from conflicting with each other when findings touch shared code.

Iteration loop:

  1. Identify the entry point. Start with the finding marked ASI in the red team summary. If no ASI is marked, start with the highest-severity finding.
  2. Write the failing test. Flesh out the test skeleton from the red team report into a real test and run it. It MUST fail — this proves the scenario is real. If the test passes, the finding was a false positive; skip it and note it in the triage, then re-identify the next ASI.
  3. Fix the code. Make the minimum change to pass the test. Do not refactor or improve surrounding code.
  4. Run a targeted re-check. Re-read only the files touched by the fix and check whether: (a) the fix introduced any new issues, and (b) any previously reported findings are now resolved as a side effect.
  5. Re-assess the remaining findings. Update your list — remove resolved findings, re-prioritize if the fix changed the risk landscape. Identify the new ASI.
  6. Repeat from step 2 until no Critical or High findings remain.

After the loop completes:

  • Run one final regression check covering everything the fixes touched, scoped per verification-before-completion. Fixes confined to one module: that module's suite plus its dependents. Fixes spanning modules or touching a shared contract: the full suite.
  • Report: findings fixed, false positives skipped, any regressions introduced and resolved.

Skip conditions:

  • If the red team report has zero Critical/High findings, skip the pipeline entirely.
  • Medium findings are tracked for later, not auto-fixed.
  • If the user explicitly says to skip auto-fix, respect that.

Triage Rules

  • Fix all Critical issues before proceeding.
  • Fix Important issues unless user explicitly defers.
  • Track Minor issues for later.
  • Push back with evidence when feedback is incorrect.

Output Requirement

Review must include severity, file references, security findings (if applicable), and merge readiness verdict.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.