agentleFS
mindfortaimindfortai/security-skills/skills/branch-review/SKILL.md

branch-review

Skill16 starsChanged 5 months agoMITView on GitHub

Orchestrates parallel security and code-quality audits for a branch or PR, deduplicates findings, and produces one prioritized merge-readiness list. Use when reviewing BASE...HEAD before merge.

9 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. 0 are common, 12 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 8 edited versions we read keep these.

  • 12

    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:

    Use this skill to run two independent branch audits and synthesize the results:

    line 9
  2. Distinctive:

    Do not chase unrelated pre-existing issues.

    line 23
  3. Distinctive:

    Do not modify code unless the user explicitly asks for fixes.

    line 27
  4. Distinctive:

    If reviewing a PR and GitHub CLI is available:

    line 41
  5. Distinctive:

    Use the same base/head and diff for both audit passes.

    line 48
  6. Distinctive:

    When the environment supports background agents or subagents:

    line 52
  7. Very specific:

    Start one reviewer with pr-review.

    line 54
  8. Distinctive:

    When the environment does not support background agents, run two isolated passes in sequence:

    line 59
  9. Distinctive:

    Only synthesize after both passes are complete.

    line 63
  10. Distinctive:

    Do not average away severe findings.

    line 87
  11. Distinctive:

    After independent passes, run focused local tests, builds, lint checks, migrations, or smoke tests for merge-blocking findings when …

    line 91
  12. Distinctive:

    Use temporary stubs only to isolate unavailable external services, credentials, or nondeterministic dependencies.

    line 92
  13. Distinctive:

    When subagents are available, use a separate validation subagent or ask the original reviewers to challenge each other's confirmed …

    line 94
  14. Very specific:

    Use status values such as merge_blocking, ready_after_fix, non_blocking, needs_verification, pre_existing, or no_confirmed_findings.

    line 104
  15. Very specific:

    If no findings are found, still emit the header and one no_confirmed_findings informational row.

    line 112

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

Branch Review

Use this skill to run two independent branch audits and synthesize the results:

  1. pr-review: security, correctness, breakage, feature flags, devex regressions.
  2. code-quality: maintainability, boundaries, complexity, testability, architecture quality.

The output is one prioritized list for merge readiness.

Core Idea

Gather BASE...HEAD evidence once. Give both audit passes identical diff evidence. Keep the passes independent. Deduplicate and prioritize the final findings. When both passes flag the same issue, rank it higher because overlap is signal.

Ground Rules

  • Diff-first only. Do not perform a full repo audit.
  • Do not chase unrelated pre-existing issues.
  • The security/correctness pass must complete its independent audit before reading PR comments, bugbot output, or prior review threads.
  • The code-quality pass should focus on maintainability and boundaries, not security impact.
  • The synthesis should preserve dissent: if one reviewer sees risk and the other does not, keep the evidence and confidence clear.
  • Do not modify code unless the user explicitly asks for fixes.

Evidence Setup

Identify base and head:

git status --short --branch
git branch --show-current
git merge-base HEAD origin/main
git diff --stat BASE...HEAD
git diff BASE...HEAD

If reviewing a PR and GitHub CLI is available:

gh pr view --json number,title,body,baseRefName,headRefName,author,files,commits,statusCheckRollup
gh pr diff

Use the same base/head and diff for both audit passes.

Parallel Review Model

When the environment supports background agents or subagents:

  • Start one reviewer with pr-review.
  • Start one reviewer with code-quality.
  • Provide both reviewers the same base/head, diff stat, full diff, and review scope.
  • Instruct both reviewers not to read each other's work until they finish.

When the environment does not support background agents, run two isolated passes in sequence:

  • Complete the full security/correctness pass first and write its findings.
  • Then complete the full code-quality pass without revising the first pass.
  • Only synthesize after both passes are complete.

Synthesis Rules

Merge findings by changed behavior, not by file name.

For each finding, record:

  • Source: security/correctness, code quality, or both.
  • Severity from the originating pass.
  • Confidence.
  • Whether the same changed behavior was flagged by both passes.
  • Whether tests or checks already cover the risk.
  • Whether the finding is merge-blocking.

Priority ranking:

  1. Critical or high security/correctness findings.
  2. Findings flagged by both passes.
  3. Medium security/correctness findings with high confidence.
  4. High code-quality findings that affect core boundaries, future correctness, or testability.
  5. Lower-confidence findings that need verification.
  6. Non-blocking notes.

Do not average away severe findings. A critical security issue stays critical even if code quality is otherwise fine.

Validation

  • After independent passes, run focused local tests, builds, lint checks, migrations, or smoke tests for merge-blocking findings when commands are clear and safe.
  • Use temporary stubs only to isolate unavailable external services, credentials, or nondeterministic dependencies. Do not stub the changed contract, security control, or boundary being reviewed.
  • Clean up scratch files, temporary fixtures, mock servers, local config changes, and ad hoc scripts before final output unless the user asked for implemented tests.
  • When subagents are available, use a separate validation subagent or ask the original reviewers to challenge each other's confirmed high-impact findings before synthesis.

Output Format

Output the synthesized prioritized findings as CSV with this exact header:

id,severity,confidence,status,category,title,location,asset_or_flow,actor,issue,impact,evidence,fix,test,scope_notes

Use status values such as merge_blocking, ready_after_fix, non_blocking, needs_verification, pre_existing, or no_confirmed_findings. Use category values such as security, correctness, code-quality, operability, devex, or both.

Example row:

F-001,high,high,merge_blocking,both,New worker bypasses tenant-scoped service,workers/export_worker.py:44,export worker,tenant member,The branch queues exports through a worker that reads records by project_id without tenant binding,Tenant data can be exported across organizations and policy ownership is split across layers,Security pass found missing tenant check and quality pass found duplicated export logic,Route should enqueue actor and tenant context and worker should call the existing export service policy,Add cross-tenant export denial test covering route and worker,Source both; base origin/main head feature/export-worker

If no findings are found, still emit the header and one no_confirmed_findings informational row. Put reviewer summaries, deduplication notes, coverage, and merge readiness after the CSV unless the user asks for CSV only.

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.