security-review
Portable security review for a feature, endpoint, or change before it ships. Orchestrates the existing OWASP review (@security-boss) and secrets scan (security_secrets validator), then adds the pass they miss — an explicit business-logic-flaw walkthrough (IDOR, race/TOCTOU, state-machine bypass, privilege escalation, price/quantity tampering). Advisory and non-mutating — produces a findings report; real findings are filed as tasks. Use when a change touching money, access control, or multi-step state is about to ship, or when the auth looks fine but the flow could be abused. NOT FOR SAST or dependency-CVE scanning (consumer CI owns those).
- License 许可
- MIT
- 最近更新
- 2026-10-23
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- security-review
- description
- Portable security review for a feature, endpoint, or change before it ships. Orchestrates the existing OWASP review (@security-boss) and secrets scan (security_secrets validator), then adds the pass they miss — an explicit business-logic-flaw walkthrough (IDOR, race/TOCTOU, state-machine bypass, privilege escalation, price/quantity tampering). Advisory and non-mutating — produces a findings report; real findings are filed as tasks. Use when a change touching money, access control, or multi-step state is about to ship, or when the auth looks fine but the flow could be abused. NOT FOR SAST or dependency-CVE scanning (consumer CI owns those).
- allowed-tools
- Read, Glob, Grep, Bash, Write, TodoWrite, Task
03 SKILL.md 正文
security-review Workflow
Reviews a feature or change for security flaws before it ships — including the business-logic flaws generic OWASP red-flags miss. Input is the change (a diff, a feature's files, or a task ID); output is a findings report, with real findings filed as tasks. Mutates nothing — findings become tasks, never a hard gate.
Index
| File or section | Read when… |
|---|---|
| What it orchestrates | Knowing which existing pieces (@security-boss, secrets validator) own which pass |
| When to use (incl. when not to) | Deciding whether the change has a surface worth reviewing |
| Invocation | Choosing scope (diff, task, --files, --output) |
| Steps 1–3 | Scoping the surface, running OWASP + secrets, the business-logic walkthrough |
| Step 4: Report and file findings | Writing the report and filing findings as tasks or intents |
_shared/task-triage.md |
Step 4 — security findings are a hard floor: blocker-or-next, never deferred by default |
| Anti-criteria for this skill | Checking the run stayed advisory and self-contained |
What it orchestrates
This skill orchestrates Forge's existing security pieces and adds the one missing pass. It does not re-implement OWASP or secret detection — those already exist:
- OWASP Top 10 review →
@security-boss(injection, broken auth, broken access control, XSS, SSRF, etc.). It already carries the authn-vs-authz distinction and access-control red-flags. - Secrets scan → the
security_secrets.pyvalidator (hardcoded keys/tokens,.envwrites), with patterns fromhooks/config/secret-patterns.yaml.
What neither covers — and what this skill adds — is business-logic flaws: vulnerabilities where every individual call is "authenticated and well-formed," but the sequence or values break an invariant. A generic OWASP red-flag list provably doesn't force this; it takes a deliberate walkthrough. The skill self-contains that walkthrough so it runs on a bare clone with no PAI/external plugins.
When to use
- Before shipping a feature that touches money, access, or state — checkout, balance, role changes, multi-step workflows.
- At
/new-featuresecurity review and in the/create-prStep 3.7 pre-flight for any security-relevant change. - When a reviewer says "the auth looks fine" but the flow could be abused.
Do NOT use it as a SAST engine or dependency-CVE scanner — those are the consumer project's CI/runtime job (Semgrep, CodeQL, npm audit), not this portable framework's. This skill is review judgment, not tooling. Skip it too for pure secrets scanning with no logic surface (the security_secrets.py validator already fires on writes), and for a change with no money/access/state surface — a normal @security-boss review suffices.
Invocation
/security-review # review the current diff (git diff)
/security-review T### # review the change for a task
/security-review --files <glob> # review specific files
/security-review --output PATH # custom report path (default: memories/security-review-{date}.md)
Step 1: Scope the surface
Identify what's under review (diff, feature files, or a task's scope). Read docs/code-map.md if present to locate the relevant surfaces (auth handlers, input parsers, money/state mutations, external-call sites). Note which surfaces touch money, access control, or multi-step state — those are where business-logic flaws live.
Step 2: OWASP + secrets (orchestrate existing)
- Invoke
@security-boss(via the Task tool) for the OWASP Top 10 review of the scoped surface. Do not restate the OWASP list here —@security-bossowns it. - Confirm the secrets scan is clean (the
security_secrets.pyvalidator fires on writes; for a review pass, grep the diff for the same pattern classes — hardcoded keys, tokens,.envcontent).
Step 3: Business-logic-flaw walkthrough (the missing pass)
For each money/access/state surface, walk these explicitly — each is a flaw where the individual request is valid but the logic is exploitable:
- IDOR / object-level: can a user act on another user's object by changing an ID? (
/orders/{id}returning any order.) - Race / TOCTOU: can two concurrent requests both pass a check that should only pass once? (double-spend, coupon reuse, balance going negative.)
- State-machine / workflow bypass: can a step be skipped or replayed out of order? (reaching "shipped" without "paid"; re-submitting a one-time action.)
- Privilege escalation: horizontal (peer's data) or vertical (higher role's capability) — by manipulating a role/tenant/flag the server trusts without re-checking.
- Price / quantity tampering: is an amount, price, discount, or quantity taken from the client and trusted? (negative quantity, client-set price, stacked discounts.)
- Invariant breaks: what business rule must always hold (balance ≥ 0, one vote per user, total = sum of line items) — and can a sequence of valid calls violate it?
For each surface, record: the invariant, the abuse it could allow, and whether the code enforces it server-side on every relevant operation (not just the happy path, not client-trusted).
Step 4: Report and file findings
Write the findings to memories/security-review-{date}.md (or --output). For each real finding: severity, the surface, the abuse, and the fix direction. File genuine findings as tasks via the @security-boss convention (forge task add with severity in --category) — so they enter the work queue rather than evaporate. Security findings are a hard floor under skills/_shared/task-triage.md — blocker-or-next, never deferred to the backlog epic by default. A finding wider than a bounded patch — an architectural gap or the same flaw repeated across a surface — is written as /intent "<problem>" with this report as evidence, then promoted once accepted; the task queue holds fixes, not redesigns. Print a one-paragraph summary and stop. Advisory only — never blocks a ship; the findings are the deliverable.
Anti-criteria for this skill
- Anti: Does NOT re-implement the OWASP Top 10 inline — it invokes
@security-boss, which owns that list. - Anti: Does NOT block a ship — advisory only; findings become tasks, not gates (informational-hooks doctrine).
- Anti: Does NOT ship SAST/CVE tooling — review judgment only; scanning tools are the consumer's CI job.
- Anti: Does NOT depend on a PAI/external plugin — the business-logic walkthrough is self-contained, bare-clone runnable.
See also
agents/security-boss.md— the OWASP + authn/authz reviewer this skill orchestrateshooks/validators/agents/security_secrets.py+hooks/config/secret-patterns.yaml— the secrets scan + its (now live) pattern configrules/security.md— the authn-vs-authz distinction + when to invoke@security-boss/audit-rules//vet-idea— sibling advisory, non-mutating, report-only skills this mirrors
Project-specific overrides: if SKILL.local.md exists in this directory, read it — it is consumer-owned, survives framework refresh, and wins on conflict. A sidecar that relaxes a gate defined above must state how to prove the gate is wrong in that case. Doctrine: rules/framework-vs-project-root.md.
04 同仓库更多 Skills
wizard
Generates an interactive bash wizard that walks a human through steps only they can perform — opens each URL, says what to click and copy, captures values (hidden entry for secrets), writes .env and GitHub secrets, confirms before irreversible actions. Use when provisioning infrastructure, setting up credentials or CI secrets, walking an unfamiliar third-party dashboard, or running a one-off migration or cutover. Don't invoke this for steps the agent can perform itself.
vet-idea
Vets an idea, decision, or plan BEFORE it is built. Runs a single model through five fixed adversarial advisor roles, a peer-review pass, and a chairman synthesis that emits a halt-capable GO / NO-GO / RECONSIDER verdict. Advisory and non-mutating — outputs a report, never writes task state. Use when an idea, feature, or costly hard-to-reverse decision is of uncertain worth and the question is whether to build it at all. NOT FOR settled work (bug fixes, approved features) or for shaping how to build it (the ISA Interview workflow).
triage-incident
Production incident triage — from "something is broken for users" to fixed, verified, and learned-from. Pulls the error signal (Sentry/logs/user report), reproduces before touching code, routes the fix through /fix-bug's prod fast path, and closes with a postmortem entry. Use when something is broken for users in production — an outage, data corruption, a Sentry spike, or a crash-rate alert. NOT FOR bugs found in development (use /fix-bug directly) or CI failures (use /diagnose-ci).
setup-review-bot
Configures a repo's AI code reviewers — the post-PR mention bot and the pre-push local reviewer — and writes the AGENTS.md the reviewers read. Interviews the user for what the reviewer should weight, then sets git config forge.reviewBot / forge.localReview and populates AGENTS.md at the project root. Use when a repo has no reviewer configured, when review findings are consistently off-target, or when onboarding a new project.
run-epic
Autonomously drains every open task in a single epic. Pulls ready tasks via the forge CLI, executes the work in-context using the matching discipline (fix-bug / new-feature / refactor), files newly-discovered work as follow-up tasks without stopping to ask, opens a PR per completed task via /create-pr, and repeats until the epic has zero ready/in-progress/pending tasks. Use when the user says `/run-epic E##`, "run epic autonomously", "finish all remaining tasks for epic X", or "drive epic X to completion".
remember
Saves and retrieves project knowledge that persists across sessions — bug patterns, technical decisions, key facts, and code patterns. Use whenever the user wants to record a lesson learned, save a debugging insight, document a technical choice, note a convention, or search past memories.