AGENT SKILL

sec-review-fixes

Companion to `sec-review-team`. Takes the `REPORT.md` or `findings.jsonl` from a security review run and produces fix PRs (one per finding or one consolidated) with interactive approval. Each candidate finding becomes a proposed diff + a regression test that would have caught it + a commit/PR citing the finding ID. Filters by default to `severity IN (critical, high) AND confidence IN (certain, likely)`. Modes: interactive (default), `--dry-run` (produces a fix-plan document with no code changes), `--re-verify` (re-runs sec-review-team against a specific set of finding IDs and reports fixed / still-present / inconclusive). Safeguards: branch-only commits (never main), no force-push, clean-working-tree required, regression-test must pass before commit lands. Use when the user says "fix the security findings", "apply sec-review fixes", "open PRs for the security report", "re-verify the security fixes", or similar.

License 许可
MIT
最近更新
2026-11-14
Stars
★ 8
Forks
4

01 前言 Front Matter

name
sec-review-fixes
description
Companion to `sec-review-team`. Takes the `REPORT.md` or `findings.jsonl` from a security review run and produces fix PRs (one per finding or one consolidated) with interactive approval. Each candidate finding becomes a proposed diff + a regression test that would have caught it + a commit/PR citing the finding ID. Filters by default to `severity IN (critical, high) AND confidence IN (certain, likely)`. Modes: interactive (default), `--dry-run` (produces a fix-plan document with no code changes), `--re-verify` (re-runs sec-review-team against a specific set of finding IDs and reports fixed / still-present / inconclusive). Safeguards: branch-only commits (never main), no force-push, clean-working-tree required, regression-test must pass before commit lands. Use when the user says "fix the security findings", "apply sec-review fixes", "open PRs for the security report", "re-verify the security fixes", or similar.
argument-hint
`[path to REPORT.md or findings.jsonl] [--dry-run | --re-verify <id>...] [--one-pr | --pr-per-finding]`

03 SKILL.md 正文

sec-review-fixes — Fix-Workflow Orchestration

Companion to sec-review-team. Never applies a code change without explicit user approval.

Step 0: Locate findings source

Parse $ARGUMENTS:

  • Source path — either a REPORT.md or a <agent>.findings.jsonl file (or a directory containing them, e.g. <target>/.planning/security-review/).
    • If source is a directory, aggregate every *.findings.jsonl in it.
    • If source is REPORT.md, prefer the sibling *.findings.jsonl files if they exist (structured parse). Fall back to parsing the markdown if only the prose report is available.
  • Mode:
    • default = interactive
    • --dry-run = write a fix-plan markdown, no code changes
    • --re-verify <id>... = re-run sec-review-team on the specified finding IDs and report status (skip Steps 2–5)
  • PR granularity: --one-pr (all fixes in one PR) or --pr-per-finding (default for ≤ 3 fixes; for ≥ 4, default switches to one-PR to avoid PR storm).

Do not operate on the source target repo yet. Just read metadata.

Step 1: Filter candidate findings

Apply default filter:

  • severity IN (critical, high) — medium/low need manual review first, they are not eligible for auto-fix.
  • confidence IN (certain, likely) — possible/unverified require human triage first; they are not eligible for auto-fix.
  • User may relax the filter explicitly (prompt: "N findings matched default filter. X additional findings available at lower severity/confidence — include them?").

For --re-verify, skip filtering; use the specified IDs literally.

Step 2: Safety preflight

Before touching any file, verify:

  1. Target git state: Working tree clean (git status --porcelain empty). If dirty, abort with explanation. The user must stash/commit first.
  2. Current branch is NOT main / master / trunk / default-branch. If it is, offer to create sec-review-fix/<timestamp> and switch. Never operate directly on default.
  3. No in-progress rebase / merge / cherry-pick (git status shows no in-progress operation).
  4. Remote reachable (if PR mode, not dry-run): git ls-remote --exit-code origin succeeds.
  5. gh CLI available and authenticated (if PR mode).

If any check fails, abort with a specific message. Never proceed past a failed safety check.

Step 3: Per-finding fix authoring (spawn subagents in parallel)

For each candidate finding, spawn a fix-author Agent with:

  • Subagent type: general-purpose (or a typed code-writer if available).
  • Brief: "Here is one security finding from sec-review-team: <finding>. The current state of the code at <file>:<line_range> is <snippet>. Produce (1) a diff that implements the fix field, (2) a regression test that would fail before the fix and pass after. Write to <TARGET>/.planning/sec-review-fixes/<id>.diff and <id>.test.<ext> respectively. Also write a one-paragraph commit message at <id>.commit-msg.txt."
  • Allowed tools: Read, Grep, Glob, read-only Bash allowlist. Write scoped to the three output paths only. No Edit on target files — the orchestrator applies diffs later, not the subagent.

Subagents don't mutate target code. They produce candidate artifacts.

Step 4: Interactive approval (one finding at a time)

For each candidate:

━━ Finding <id>: <title> ━━
  Severity:    <sev>
  Confidence:  <conf>
  File:        <file>:<line_range>
  Root issue:  <root_issue>

Exploit:
  <exploit>

Proposed fix:
  <fix>

Proposed diff:
  <diff contents>

Proposed regression test:
  <test contents>

Approve / edit-fix / skip / abort? [a/e/s/x]
  • a (approve) — move to Step 5 for this finding.
  • e (edit-fix) — let the user type revised instructions; respawn the fix-author with the revised brief.
  • s (skip) — finding stays un-fixed; continue to next.
  • x (abort) — stop all further processing; do not apply any pending approved fixes that haven't been committed yet.

Default if no response: treat as skip (never auto-approve).

Exception: --dry-run skips this step entirely. The fix-plan is just the collected proposals.

Step 5: Apply + test + commit + push + PR (per approved finding)

Still safeguarded. Even after approval:

  1. Create or checkout the fix branch: sec-review-fix/<finding-id> (for per-PR mode) or sec-review-fix/<timestamp> (for one-PR mode). Never operate on main.
  2. Apply the diff via git apply <id>.diff. On failure: mark finding as apply-failed, do not commit, continue to next.
  3. Run the regression test. How: detect target's test runner (package.json scripts.test, cargo test, pytest, go test, etc.) and invoke. The test must pass before proceeding. If it fails, revert (git checkout -- <affected>), mark as regression-test-failed, continue to next.
  4. Commit with message: the contents of <id>.commit-msg.txt, plus a trailer Fixes-finding: <id> + Ref: <source path of findings>. Default commit message ends with Co-Authored-By: Claude (sec-review-fixes) <noreply@anthropic.com>.
  5. Push to origin (for PR mode only). git push -u origin <branch>.
  6. Open PR via gh pr create:
    • Title: fix(security): <finding title>
    • Body: full finding (exploit + fix + evidence), the regression test description, a checklist for the reviewer (manual verification + security implications + adjacent review).
    • Label: security, sec-review-team.

Safeguards that stay on throughout:

  • Never force-push.
  • Never push to main.
  • Never amend an existing commit.
  • Never modify .git/ directly.
  • If any safeguard tripping is requested, abort and surface it to the user.

Step 6: Report

Emit a summary table:

Finding Status PR Branch
auth-001 fixed + PR opened #1234 sec-review-fix/auth-001
iv-003 skipped — —
sc-001 regression-test-failed — —
de-002 apply-failed — —

Print absolute paths to .planning/sec-review-fixes/ artifacts for every candidate (even skipped ones, so the user can come back later).

--re-verify mode

Alternate flow triggered by --re-verify <id>...:

  1. Parse the finding IDs from args.
  2. For each ID, look up the original finding metadata (severity, file, root_issue, evidence) from the source findings.jsonl.
  3. Invoke sec-review-team against the same target and same scope. Wait for new findings.jsonl.
  4. For each requested ID:
    • If no finding with the same root_issue + file appears in the new run → fixed.
    • If a finding with the same root_issue appears → still-present. Show the diff between old and new evidence.
    • If the specialist that would cover this category is not in the new roster (stack changed), or the category was not-checked → inconclusive (explain why).
  5. Emit a re-verify report at .planning/sec-review-fixes/re-verify-<timestamp>.md.

Never apply fixes in re-verify mode. Pure audit.

--dry-run mode

Triggered by --dry-run. Steps 2, 4 (modified), 5 are skipped:

  • Step 2 safety preflight still runs (we still inspect repo state) but doesn't require branch-switching.
  • Step 3 still spawns fix-authors (artifact-only).
  • Step 4 shows proposals but doesn't prompt for apply — just collects them.
  • Step 5 is skipped entirely.
  • Instead: write .planning/sec-review-fixes/fix-plan.md — a human-readable document with every proposed fix + test + commit message, organized by severity. User can hand off to a team for manual implementation.

Related

04 同仓库更多 Skills

tbeack
tbeack/fsad_playbook

sync

Pre-flight sync check for registered projects. Fetches from remote, reports uncommitted changes, and handles four states — up-to-date, ahead, behind (warns + pulls), or diverged (warns, no pull). Supports single-project (cwd detection), named-project (fsad-harness:sync key1 key2), and full-sync (fsad-harness:sync ALL) modes.

★ 8
tbeack
tbeack/fsad_playbook

spec-review

Run a detailed, adversarial multi-agent review of a written proposal or specification (spec.md, PRD, RFC, design doc, architecture proposal, business case) — reviews the document, not code. Runs a steelman/inventory pass, then up to 10 specialist lenses (logic, assumptions, evidence, completeness, feasibility, alternatives, consistency, stakeholders, testability, risk), then adversarial validation that defaults to refuting each finding unless it survives, then a loop-until-dry completeness pass. Writes a single severity-ranked SPEC-REVIEW.md next to the document. Use when the user says "review this spec", "adversarial review", "poke holes in this proposal", "red team this PRD", "critique this design doc", "what's wrong with this RFC", "stress test this plan", or similar. Review-only — never edits the document.

Skill与智能体开发
★ 8
tbeack
tbeack/fsad_playbook

ship

Short alias for /fsad-harness:ship-it. Wrap up finished work, cut a version, commit, push, and open a PR.

★ 8
tbeack
tbeack/fsad_playbook

ship-it

Wrap up a finished round of work — verify README and CHANGELOG are current, cut a version if warranted, move completed task files into the completed/ folder, then create a feature branch if needed, commit, push, and open a PR. Run after `/fsad-harness:do-task` has marked one or more tasks done. Takes no arguments.

★ 8
tbeack
tbeack/fsad_playbook

set-context

Gather codebase and initiative context before planning starts — runs a graphify build or query when graphify is available locally, falls back to a manual repo sweep otherwise, then asks targeted questions and writes a single context.md. Invocable standalone or as fsad-harness:plan's mandatory Phase 0. Use when the user says "set context", "gather context", or as the first step of fsad-harness:plan.

★ 8
tbeack
tbeack/fsad_playbook

sec-review-team

Run a multi-agent security review TEAM over a codebase or recent diff. Picks a specialist roster based on detected stack signals (webapp / desktop / iac / llm-agent / container / backend / mobile / etc.) from a library of 13 specialists. Each specialist writes structured JSONL + prose findings in parallel; input-validation-auditor and auth-authz-auditor run a loop-until-dry consensus fan-out (2-8 passes); every deduped finding is adversarially verified by a dedicated validator agent before it can appear in the report. Orchestrator consolidates into a single severity-ranked REPORT.md with deduped root issues, archived per-run under a known-findings.jsonl ledger that drives auto re-review. Distinct from the built-in `/security-review` (which is a single-pass branch review). Use when the user says "multi-agent security review", "security review team", "sec-review team", "audit this branch with a team", "pre-release hardening team pass", or similar. Review-only — no fixes.

后端与接口Skill与智能体开发
★ 8