gadievron/raptor/.claude/skills/audit/SKILL.md
audit
Hypothesis-driven, tool-grounded security review of coverage gaps
- Source repository stars
- 3,413
- Declared platforms
- 0
- Static risk flags
- 0
- Last source update
- 2026-07-28
- Source checked
- 2026-07-28
Decision brief
What it does—and where it fits
Hypothesis-driven, tool-grounded security review of coverage gaps
Not for
- Tasks that require unconfirmed production actions or broad system permissions.
- Environments where the pinned source and install steps cannot be inspected.
Compatibility matrix
Platform support, with evidence labels
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
Inspect first. Install second.
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/gadievron/raptor --skill ".claude/skills/audit"Inspect the Agent Skill "audit" from https://github.com/gadievron/raptor/blob/e63c1b0ae449516f50ab510226ceb09a0edb3895/.claude/skills/audit/SKILL.md at commit e63c1b0ae449516f50ab510226ceb09a0edb3895. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
What the source asks the agent to do
- 01
[CONFIG]
Model: Opus for all code review. Sonnet for orchestration plumbing only.
Model: Opus for all code review. Sonnet for orchestration plumbing only.Unit of review: directory (subsystem), not individual function.Context slice: function source + 1-hop callers + 1-hop callees + checklist metadata. - 02
[EXEC] Execution Rules
0. No env-var prefixes on commands. NEVER write OUTPUTDIR=... libexec/raptor-audit ... or VAR=val command. It breaks permission patterns. Capture OUTPUTDIR from raptor-run-lifecycle start output and pass it via --out flags on every subsequent command. 1. Read code before reasoni…
No env-var prefixes on commands. NEVER write OUTPUTDIR=... libexec/raptor-audit ... or VAR=val command. It breaks permission patterns. Capture OUTPUTDIR from raptor-run-lifecycle start output and pass it via --out flags…Read code before reasoning. Never describe or hypothesize about code you haven't read with the Read tool.LLM generates hypotheses; tools validate. Never directly classify code as vulnerable — that gets 37% accuracy. Form a hypothesis, generate a mechanical test, run it, evaluate the result. - 03
[GATES] Must-Pass Gates
G1 [HYPOTHESIS-FIRST]: Every suspicion MUST be framed as a testable hypothesis before any finding is emitted. "X looks dangerous" is not a hypothesis. "If input Y reaches sink Z without check W, CWE-N applies" is.
G1 [HYPOTHESIS-FIRST]: Every suspicion MUST be framed as a testable hypothesis before any finding is emitted. "X looks dangerous" is not a hypothesis. "If input Y reaches sink Z without check W, CWE-N applies" is.G2 [TOOL-GROUNDED]: Every finding MUST have at least one mechanical validation (Semgrep match, CodeQL path, Coccinelle hit, SMT sat result, or compilation test). Ungrounded findings are annotation-only (suspicious), nev…G3 [NO-SELF-CRITIQUE-LOOP]: Iteration without tool feedback is prohibited. If re-reviewing, generate a NEW tool invocation. - 04
[STYLE]
Status values in JSON: snakecase (clean, dormant, suspicious, finding, error)
Status values in JSON: snakecase (clean, dormant, suspicious, finding, error)Status in human output: Title Case (Clean, Suspicious, Finding, Error)No red/green indicators (perspective-dependent) - 05
[STRATEGIES]
Review strategies are selected per-function based on file paths, parameter types, and return types. Multiple strategies can apply to the same function.
Review strategies are selected per-function based on file paths, parameter types, and return types. Multiple strategies can apply to the same function.Strategy details and CVE exemplars are in .claude/skills/audit/review.md.
Permission review
Static risk signals and limitations
No configured static risk pattern was detected
This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.
Evidence record
Why each signal appears
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 79/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 3,413 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Provenance and original SKILL.md
- Repository
- gadievron/raptor
- Skill path
- .claude/skills/audit/SKILL.md
- Commit
- e63c1b0ae449516f50ab510226ceb09a0edb3895
- License
- NOASSERTION
- Collected
- 2026-07-28
- Default branch
- main
View the original SKILL.md
/audit Skill — Systematic Code Review
[CONFIG]
- Model: Opus for all code review. Sonnet for orchestration plumbing only.
- Unit of review: directory (subsystem), not individual function.
- Context slice: function source + 1-hop callers + 1-hop callees + checklist metadata.
- Checklist item fields:
name,kind("function"/"global"/"macro"/"class"),line_start,line_end,signature,checked_by,metadata(visibility,params,return_type,attributes). The field iskind, nottype. Source:core/inventory/extractors.CodeItem. - Findings format: standard
findings.json(same as/scan, fed to/validateunchanged). - Annotations: markdown per source file, structured metadata in HTML comments.
- Prerequisite:
/understand --mapmust have run first. Ifcontext-map.jsonis missing from the output directory (or project siblings), auto-run it before starting the review loop. - Scoping:
--scope <dir>restricts gap selection to a subdirectory (e.g.ipc/,net/ipv4/). All annotations and coverage records still write to the project-level output dir, so successive scoped runs accumulate into one audit trail.
[EXEC] Execution Rules
- No env-var prefixes on commands. NEVER write
OUTPUT_DIR=... libexec/raptor-audit ...orVAR=val command. It breaks permission patterns. CaptureOUTPUT_DIRfromraptor-run-lifecycle startoutput and pass it via--outflags on every subsequent command. - Read code before reasoning. Never describe or hypothesize about code you haven't read with the Read tool.
- LLM generates hypotheses; tools validate. Never directly classify code as vulnerable — that gets 37% accuracy. Form a hypothesis, generate a mechanical test, run it, evaluate the result.
- Pure self-critique is prohibited. All iteration MUST include tool feedback. "Review again" without running a tool is forbidden. Generate a new Semgrep rule, CodeQL query, or SMT check instead. Run all tool invocations through
libexec/raptor-audit sweep(or the Python APIpackages.semgrep.runner/packages.coccinelle.runner) — never callsemgreporspatchdirectly via Bash. This ensures results are logged to the audit trail automatically. - Tool evidence is the verdict. If a tool confirms a hypothesis, the finding includes the tool's output as proof. If a tool refutes it, the hypothesis is discarded — no "but I still think..."
- Annotations record what was tested, not opinions. Each annotation lists the hypotheses tested, the tools run, and their results. A reviewer can re-run the generated rules to verify.
- One status per function. Call
libexec/raptor-audit recordexactly once per reviewed function. Status isclean(no issues),dormant(real bug but currently unreachable/dead code),suspicious(concern but not confirmed),finding(tool-confirmed reachable vulnerability), orerror(review blocked). Usedormant— notclean— when a function has a genuine bug that is unreachable today (dead code, no callers, commented out). A dormant bug becomes a finding when reachability changes. - Findings need concrete evidence. A finding must cite: the vulnerable code (file:line), what assumption is violated, and the tool output that confirms it. No "this could be dangerous if..."
- Checker synthesis for patterns. When a confirmed finding suggests a repeatable pattern (e.g., "unchecked return used as index"), generate a codebase-wide Semgrep or Coccinelle rule and run it. One hypothesis → sweep the whole codebase.
- Run lifecycle. Start with
raptor-run-lifecycle start, end withraptor-run-lifecycle complete. On failure:raptor-run-lifecycle fail. - Do NOT narrate gate compliance. Only show substantive work — the hypothesis, the tool, the result. No "I am now following EXEC rule 2..."
[GATES] Must-Pass Gates
- G1 [HYPOTHESIS-FIRST]: Every suspicion MUST be framed as a testable hypothesis before any finding is emitted. "X looks dangerous" is not a hypothesis. "If input Y reaches sink Z without check W, CWE-N applies" is.
- G2 [TOOL-GROUNDED]: Every finding MUST have at least one mechanical validation (Semgrep match, CodeQL path, Coccinelle hit, SMT sat result, or compilation test). Ungrounded findings are annotation-only (
suspicious), neverfinding. - G3 [NO-SELF-CRITIQUE-LOOP]: Iteration without tool feedback is prohibited. If re-reviewing, generate a NEW tool invocation.
- G4 [EVIDENCE-IN-ANNOTATION]: The annotation body MUST include tool names and results, not just prose.
- G5 [READ-FIRST]: Code must be read with the Read tool before any hypothesis is formed about it.
- G6 [ASSUMPTION-TRUST]: For every function, identify what it trusts (inputs, return values, global state, caller guarantees) and ask what happens when each trust is violated.
- G7 [REACHABILITY]: Findings must be reachable. The
orchestratorchokepoint mechanically enforces this:- Two-signal hard gate: zero static callers AND binary oracle
absent(full DWARF) →orchestratorrefusesfinding, forcesdormant. The compiler deleted the function — the bug is real but unexploitable. - Soft gate: zero static callers, no binary oracle data →
orchestratorrequires--reach-viaexplaining how the function is reachable (callback, HTTP route, exported API, cross-language binding, dynamic dispatch). This prevents honeyslop (planted dead code with obvious bugs) from inflating finding counts. - Entry points (from context-map) and functions with static callers bypass this gate automatically.
- Two-signal hard gate: zero static callers AND binary oracle
[STYLE]
- Status values in JSON: snake_case (
clean,dormant,suspicious,finding,error) - Status in human output: Title Case (
Clean,Suspicious,Finding,Error) - No red/green indicators (perspective-dependent)
- Annotations are markdown prose — no JSON in annotation bodies
- Findings in
findings.jsonuse standard RAPTOR schema
[STRATEGIES]
Review strategies are selected per-function based on file paths, parameter types, and return types. Multiple strategies can apply to the same function.
| Strategy | When | Key questions |
|---|---|---|
| General | Default for all code | What does it trust? What happens when assumptions are violated? What's surprising? |
| Input handling | Parsers, protocol handlers, decoders | Input format/size assumptions? Length fields trusted before use? |
| Concurrency | Lock APIs, mutexes, atomics | Lock windows? Concurrent interleavings? Memory barriers? |
| Memory | Allocators, refcounts, pools | Ownership model? Symmetric refcounting? Cleanup on failure? |
| Auth/privilege | Permission checks, ACLs, credentials | Check bypass? Error path security? Unvalidated transitions? |
| Crypto | Crypto APIs, key material, RNG | Correct algorithm usage? Timing side channels? Key lifecycle? |
| Aliasing | splice, zero-copy, scatterlist, sk_buff | Alias assumptions? Who owns backing pages? Can another subsystem write through the alias? |
Strategy details and CVE exemplars are in .claude/skills/audit/review.md.
[CRITIQUE]
After reviewing a batch of functions, run the tool-grounded critique pass:
libexec/raptor-audit critique --out "$OUTPUT_DIR"
This mechanically identifies:
- Low sweep coverage: functions reviewed with <2 tool checks. Generate additional Semgrep/SMT/CodeQL tests for these.
- Mode 2 gaps: confirmed findings without codebase-wide rules. Write a generalized checker and run it via
rules save+rules run. - Suspicious with untried tools: suspicious functions where not all tool types were attempted. Try the suggested tools.
The critique pass produces action items, not prose. Each item should result in a new sweep call, never just "review again."
[CONTEXT]
The context slice (assembled by raptor-audit context) includes:
- Function source lines with line numbers
- 1-hop callers and callees from the call graph
- Checklist metadata (signature, visibility, parameters, return type, attributes)
- Reachable sinks from
context-map.json - Pre-computed trust surface questions (per-parameter, per-callee)
- Strategy exemplars: per-strategy CVE worked examples showing the reasoning chain that found the bug
- Flow traces: cross-function data flow paths from
/understand --tracethat pass through this function - Prior labeled attempts (if available) from the shared corpus
- Existing annotations (for re-review context)
The context is strategy-aware: a function taking (char *buf, size_t len) gets the input handling strategy exemplar (CVE-2023-0179) alongside the general exemplar. Functions in aliasing-relevant code get CVE-2026-31431 (CopyFail).
[REMIND]
- The LLM generates hypotheses and tools; deterministic analysis confirms or refutes.
- 37.6% MORE critical vulnerabilities after 5 iterations of self-refinement without tool feedback (IEEE-ISTAS 2025). Tool grounding is mandatory, not optional.
- A confirmed pattern should always generate a codebase-wide sweep rule (Mode 2 / KNighter pattern).
- Coverage records accumulate across runs. The gap list shrinks each time.
- Annotations persist in the project directory across runs. They're the audit trail.
- After each batch, run
critiqueto find gaps before moving on.
Alternatives
Compare before choosing
event4u-app/agent-config
code-review
Use when the user says "review this", "check my code", or wants feedback on changes. Reviews for correctness, quality, security, and coding standards.
affaan-m/ECC
intent-driven-development
Turn ambiguous or high-impact product and engineering changes into scoped, verifiable acceptance criteria before or alongside implementation. Use when a user asks to clarify a feature, define acceptance criteria, de-risk a security/data/migration/integration change, prepare implementation requirements for another agent, or make a complex request testable. Do not trigger for trivial edits, straightforward fixes, active debugging, code review, or implementation requests whose acceptance conditions
JasonColapietro/suede-creator-skills
suede-workflow-skills
Umbrella workflow for 67 public skills: Full Send, copy, design, code review, SEO, launch packaging, MCP QA, iOS and Android app shipping, and creator workflows. Loads the full public skill pack.
event4u-app/agent-config
git-workflow
Use when working with Git — branch naming, commit messages, PR creation, rebasing, or the code review process — even when the user says 'push this' or 'merge the branch' without naming Git.