Security Review
Review a TARGET against this repository's security rubric and write an actionable findings
report to REPORT_OUTPUT_PATH. Each finding names the exact rule it violates and why, is graded
by severity, and comes with a concrete fix and a way to confirm the fix. Work through the
Instructions and Workflow below, produce the report in the Report Format, then print the
Report summary.
This skill is advisory — it finds and documents problems. It does not modify the reviewed
code unless the request explicitly asks for fixes in the same turn.
Variables
TARGET — what to review. Derived from the user's request. Default (no explicit target):
changed code = git diff main...HEAD plus uncommitted working-tree changes
(git status, git diff, and git diff --staged). If the repo's default branch is not
main (e.g. master/trunk), diff against the actual default branch instead. The request
overrides this with a path (review plugins/foo/), a set of files, or whole repo (review
the full tree).
REPORT_OUTPUT_PATH — where the report is written. Default: specs/security-review.md.
If the request names a different path (e.g. "write it to specs/auth-security.md"), use that.
RULES_SOURCE — where the rubric is read from, resolved in this order (first that exists
wins), per references/rubric-map.md:
- The target repo's
.cursor/rules/security-global/ + .cursor/rules/security-lang/ — the
repo's own live standard takes precedence when present.
- The bundled copy at
${CLAUDE_SKILL_DIR}/references/security-rules/ — verbatim rule
files shipped with this skill, so it works in any repo.
- The built-in OWASP/CWE fallback checklist at the bottom of
references/rubric-map.md.
Note in the report's Notes which source was used.
Instructions
- Resolve the target first. Determine concretely which files/lines are in scope before
reviewing anything. If the request is ambiguous about scope, state the chosen interpretation
in the report's Scope section rather than stalling.
- Load only the relevant rubric. Do not read all 18 rule files every time. Use
references/rubric-map.md to resolve the rubric source (target repo's .cursor/rules/ if
present, else the bundled copies) and to map the languages and concerns present in the target
to the specific security-*.mdc files worth reading. security-global-base.mdc always applies.
- Cite the triggered rule for every finding. State which rule fired and why it applies to
this code. This is not optional decoration — the base rule mandates it: "All violations must
include a clear explanation of which rule was triggered and why." A finding without a cited
rule (or a clearly-stated OWASP/CWE basis when using the fallback checklist) is incomplete.
- Do not invent findings. A clean review is a valid, expected result. If the target has no
security issues, say so plainly and emit a zero-finding report. Never manufacture speculative
problems to fill the report — false positives waste the reader's time and erode trust.
- Grade honestly. Classify each finding by severity (Critical/High/Medium/Low/Info) and a
category (injection, authz, secrets, crypto, SSRF, path-traversal, deps, config, logging,
MCP/agent, …). See
references/severity-model.md. Reserve Critical/High for real,
reachable impact — don't inflate severity, and don't bury a genuine Critical under caveats.
- Scale the effort to the target. For a small target, review directly in this context. For a
large diff or a whole-repo audit, fan out parallel review subagents and merge their findings —
see
references/fanout.md.
- Graceful fallback. If neither the target repo's
.cursor/rules/security-global/ +
.cursor/rules/security-lang/ (a repo can have a .cursor/rules/ directory with no
security-specific rules in it — check the security-global/ subdirectory specifically, not just
whether .cursor/rules/ exists) nor the bundled references/security-rules/ copies are
available, fall back to the built-in OWASP-style checklist at the bottom of
references/rubric-map.md, and note in the report's Notes section that the structured rubric
was unavailable.
Workflow
- Resolve Target — Determine the exact files/lines in scope (default: changed code). Use
git diff main...HEAD, git status, and git diff for the changed-code default; use the
named path or full tree when the request overrides.
- Load Rubric — From the target's languages and apparent concerns, pick the rule files to
read via
references/rubric-map.md. Always include security-global-base.mdc.
- Recon & Classify — Skim the in-scope code to identify languages, entry points, trust
boundaries, and the security-relevant surfaces present (user input → dangerous sinks,
auth/session, secrets/config, external calls, deserialization, SQL, XML, subprocess, etc.).
- Analyze — Review the code against the loaded rules. Decide single-context vs. fan-out per
references/fanout.md; when fanning out, give each subagent its file subset and the rule
files it must apply, and collect their findings.
- Triage & Dedupe — Merge findings, remove duplicates (same
file:line + same rule), and
assign final severity + category to each.
- Document — Write the report to
REPORT_OUTPUT_PATH using the Report Format exactly.
Create parent directories if needed.
- Save & Report — Confirm the file was written and print the
Report summary block.
Report Format
Write the report in this structure. Omit the per-finding block entirely when there are no
findings (keep the Summary table with zero counts and state "No findings" under Findings).
# Security Review: <target>
## Scope
- Target: <what was reviewed — diff range, path(s), or "whole repo">
- Ref: <branch / commit reviewed>
- Rubric source: <live .cursor/rules/ | bundled security-rules | OWASP fallback> (<rule files actually applied>)
- Date: <YYYY-MM-DD>
## Summary
| Severity | Count |
| -------- | ----- |
| Critical | <n> |
| High | <n> |
| Medium | <n> |
| Low | <n> |
| Info | <n> |
Top risks:
- <one-line summary of the highest-impact issue, or "None — no findings">
<!-- Include this section only if there is at least one Critical or High finding: -->
## Immediate Remediation
1. <do this first — highest severity, most reachable>
2. <next>
## Findings
<!-- One block per finding, ordered by severity (Critical first). If none: "No findings." -->
### [SEVERITY] <short title> (<category>)
- Rule triggered: <which .cursor rule fired — e.g. security-lang-python.mdc rule 7 — and why it applies here>
- Location: <file:line (range)>
- Description: <what is wrong, concretely>
- Impact: <what an attacker gains / what breaks>
- Remediation: <the concrete fix; include a short safe-pattern snippet where it clarifies>
- References: <rule id / OWASP / CWE>
## Re-check
<how to confirm each finding is resolved — commands to run, or what to look for after the fix>
## Acceptance Criteria
<measurable definition of "all resolved" for this review>
## Notes
<assumptions made, areas explicitly out of scope, and — if applicable — that the structured
rubric was unavailable and the OWASP fallback checklist was used>
Report
After writing the file, print this summary to the user (not into the report file):
✅ Security Review Complete
File: <REPORT_OUTPUT_PATH>
Target: <what was reviewed>
Findings: <c> critical, <h> high, <m> medium, <l> low, <i> info
Top risks:
- <risk 1>
- <risk 2>
Reference Files
references/rubric-map.md — Consult in Workflow step 2 to resolve the rubric source (live vs.
bundled) and choose which security-*.mdc files to read for the target's languages and
concerns. Also holds the OWASP-style fallback checklist for when no structured rubric is found.
references/security-rules/ — The bundled verbatim rubric (18 .mdc files). Read the specific
files rubric-map.md points to; used when the target repo has no .cursor/rules/.
references/severity-model.md — Consult in Workflow step 5 to assign severity consistently and
to order the Immediate Remediation list.
references/fanout.md — Consult in Workflow step 4 to decide single-context vs. parallel
subagents and how to scope each subagent and merge its findings.
When to invoke
- The user asks to review, audit, or check code for security issues, vulnerabilities, or a
specific vuln class (injection, SSRF, path traversal, XXE, hardcoded secrets, unsafe
deserialization,
shell=True, etc.).
- The user wants a security pass on a branch, PR, file, or directory — especially "before I
merge" — and wants the result written down rather than delivered as ephemeral chat.
- The user asks "is this secure?" about specific code in this repo.
Example commands
run a security review on src/auth/
audit my changes for vulnerabilities before I merge
check this file for injection issues and write the report to specs/auth-review.md
do a whole-repo security audit
1---2name: boss-security-review3description: Performs a security review / security audit / vulnerability review of code and writes a structured, severity-graded findings report (default path specs/security-review.md, overridable from the request). Reviews changed code by default; the request can override the target to a named path (e.g. "review src/auth/") or the whole repo. Reviews against a bundled security rubric (and the target repo's .cursor/rules/security-* rules when present) and cites the specific rule each finding triggered. Use whenever the user asks to "run a security review", "do a security audit", "audit this for vulnerabilities", "check for security issues", "review my changes for security", "is this code secure", "find security bugs", or "look for injection / SSRF / path traversal / hardcoded secrets" — including a pre-merge pass on a branch, PR, file, or directory. Prefer this over an ad-hoc review so findings are graded, cite the triggered rule, and land in a re-checkable report.4---56# Security Review78Review a `TARGET` against this repository's security rubric and write an actionable findings9report to `REPORT_OUTPUT_PATH`. Each finding names the exact rule it violates and why, is graded10by severity, and comes with a concrete fix and a way to confirm the fix. Work through the11`Instructions` and `Workflow` below, produce the report in the `Report Format`, then print the12`Report` summary.1314This skill is **advisory** — it finds and documents problems. It does not modify the reviewed15code unless the request explicitly asks for fixes in the same turn.1617## Variables1819- **TARGET** — what to review. Derived from the user's request. Default (no explicit target):20 **changed code** = `git diff main...HEAD` plus uncommitted working-tree changes21 (`git status`, `git diff`, and `git diff --staged`). If the repo's default branch is not22 `main` (e.g. `master`/`trunk`), diff against the actual default branch instead. The request23 overrides this with a path (`review plugins/foo/`), a set of files, or `whole repo` (review24 the full tree).25- **REPORT_OUTPUT_PATH** — where the report is written. Default: `specs/security-review.md`.26 If the request names a different path (e.g. "write it to specs/auth-security.md"), use that.27- **RULES_SOURCE** — where the rubric is read from, resolved in this order (first that exists28 wins), per `references/rubric-map.md`:29 1. The **target repo's** `.cursor/rules/security-global/` + `.cursor/rules/security-lang/` — the30 repo's own live standard takes precedence when present.31 2. The **bundled** copy at `${CLAUDE_SKILL_DIR}/references/security-rules/` — verbatim rule32 files shipped with this skill, so it works in any repo.33 3. The built-in **OWASP/CWE fallback** checklist at the bottom of `references/rubric-map.md`.3435 Note in the report's Notes which source was used.3637## Instructions3839- **Resolve the target first.** Determine concretely which files/lines are in scope before40 reviewing anything. If the request is ambiguous about scope, state the chosen interpretation41 in the report's Scope section rather than stalling.42- **Load only the relevant rubric.** Do not read all 18 rule files every time. Use43 `references/rubric-map.md` to resolve the rubric source (target repo's `.cursor/rules/` if44 present, else the bundled copies) and to map the languages and concerns present in the target45 to the specific `security-*.mdc` files worth reading. `security-global-base.mdc` always applies.46- **Cite the triggered rule for every finding.** State which rule fired and *why* it applies to47 this code. This is not optional decoration — the base rule mandates it: "All violations must48 include a clear explanation of which rule was triggered and why." A finding without a cited49 rule (or a clearly-stated OWASP/CWE basis when using the fallback checklist) is incomplete.50- **Do not invent findings.** A clean review is a valid, expected result. If the target has no51 security issues, say so plainly and emit a zero-finding report. Never manufacture speculative52 problems to fill the report — false positives waste the reader's time and erode trust.53- **Grade honestly.** Classify each finding by severity (Critical/High/Medium/Low/Info) and a54 category (injection, authz, secrets, crypto, SSRF, path-traversal, deps, config, logging,55 MCP/agent, …). See `references/severity-model.md`. Reserve Critical/High for real,56 reachable impact — don't inflate severity, and don't bury a genuine Critical under caveats.57- **Scale the effort to the target.** For a small target, review directly in this context. For a58 large diff or a whole-repo audit, fan out parallel review subagents and merge their findings —59 see `references/fanout.md`.60- **Graceful fallback.** If neither the target repo's `.cursor/rules/security-global/` +61 `.cursor/rules/security-lang/` (a repo can have a `.cursor/rules/` directory with no62 security-specific rules in it — check the `security-global/` subdirectory specifically, not just63 whether `.cursor/rules/` exists) nor the bundled `references/security-rules/` copies are64 available, fall back to the built-in OWASP-style checklist at the bottom of65 `references/rubric-map.md`, and note in the report's Notes section that the structured rubric66 was unavailable.6768## Workflow69701. **Resolve Target** — Determine the exact files/lines in scope (default: changed code). Use71 `git diff main...HEAD`, `git status`, and `git diff` for the changed-code default; use the72 named path or full tree when the request overrides.732. **Load Rubric** — From the target's languages and apparent concerns, pick the rule files to74 read via `references/rubric-map.md`. Always include `security-global-base.mdc`.753. **Recon & Classify** — Skim the in-scope code to identify languages, entry points, trust76 boundaries, and the security-relevant surfaces present (user input → dangerous sinks,77 auth/session, secrets/config, external calls, deserialization, SQL, XML, subprocess, etc.).784. **Analyze** — Review the code against the loaded rules. Decide single-context vs. fan-out per79 `references/fanout.md`; when fanning out, give each subagent its file subset and the rule80 files it must apply, and collect their findings.815. **Triage & Dedupe** — Merge findings, remove duplicates (same `file:line` + same rule), and82 assign final severity + category to each.836. **Document** — Write the report to `REPORT_OUTPUT_PATH` using the `Report Format` exactly.84 Create parent directories if needed.857. **Save & Report** — Confirm the file was written and print the `Report` summary block.8687## Report Format8889Write the report in this structure. Omit the per-finding block entirely when there are no90findings (keep the Summary table with zero counts and state "No findings" under Findings).9192```md93# Security Review: <target>9495## Scope96- Target: <what was reviewed — diff range, path(s), or "whole repo">97- Ref: <branch / commit reviewed>98- Rubric source: <live .cursor/rules/ | bundled security-rules | OWASP fallback> (<rule files actually applied>)99- Date: <YYYY-MM-DD>100101## Summary102| Severity | Count |103| -------- | ----- |104| Critical | <n> |105| High | <n> |106| Medium | <n> |107| Low | <n> |108| Info | <n> |109110Top risks:111- <one-line summary of the highest-impact issue, or "None — no findings">112113<!-- Include this section only if there is at least one Critical or High finding: -->114## Immediate Remediation1151. <do this first — highest severity, most reachable>1162. <next>117118## Findings119120<!-- One block per finding, ordered by severity (Critical first). If none: "No findings." -->121### [SEVERITY] <short title> (<category>)122- Rule triggered: <which .cursor rule fired — e.g. security-lang-python.mdc rule 7 — and why it applies here>123- Location: <file:line (range)>124- Description: <what is wrong, concretely>125- Impact: <what an attacker gains / what breaks>126- Remediation: <the concrete fix; include a short safe-pattern snippet where it clarifies>127- References: <rule id / OWASP / CWE>128129## Re-check130<how to confirm each finding is resolved — commands to run, or what to look for after the fix>131132## Acceptance Criteria133<measurable definition of "all resolved" for this review>134135## Notes136<assumptions made, areas explicitly out of scope, and — if applicable — that the structured137rubric was unavailable and the OWASP fallback checklist was used>138```139140## Report141142After writing the file, print this summary to the user (not into the report file):143144```145✅ Security Review Complete146File: <REPORT_OUTPUT_PATH>147Target: <what was reviewed>148Findings: <c> critical, <h> high, <m> medium, <l> low, <i> info149Top risks:150- <risk 1>151- <risk 2>152```153154## Reference Files155156- `references/rubric-map.md` — Consult in Workflow step 2 to resolve the rubric source (live vs.157 bundled) and choose which `security-*.mdc` files to read for the target's languages and158 concerns. Also holds the OWASP-style fallback checklist for when no structured rubric is found.159- `references/security-rules/` — The bundled verbatim rubric (18 `.mdc` files). Read the specific160 files `rubric-map.md` points to; used when the target repo has no `.cursor/rules/`.161- `references/severity-model.md` — Consult in Workflow step 5 to assign severity consistently and162 to order the Immediate Remediation list.163- `references/fanout.md` — Consult in Workflow step 4 to decide single-context vs. parallel164 subagents and how to scope each subagent and merge its findings.165166## When to invoke167168- The user asks to review, audit, or check code for security issues, vulnerabilities, or a169 specific vuln class (injection, SSRF, path traversal, XXE, hardcoded secrets, unsafe170 deserialization, `shell=True`, etc.).171- The user wants a security pass on a branch, PR, file, or directory — especially "before I172 merge" — and wants the result written down rather than delivered as ephemeral chat.173- The user asks "is this secure?" about specific code in this repo.174175## Example commands176177```178run a security review on src/auth/179audit my changes for vulnerabilities before I merge180check this file for injection issues and write the report to specs/auth-review.md181do a whole-repo security audit182```