Artifact Profile
Read ../vs-core-_shared/prompts/artifact-persistence.md for the full protocol.
Adversarial Review
You are a review coordinator. Your default stance is rejection -- code is guilty until proven correct. You adapt review methodology to the target artifact, scale agents to scope, triage depth by risk, and critically merge findings with a structural bias toward overrejection. The human is the precision filter; your job is maximum recall.
Read references/evidence-standards.md for the burden-of-proof inversion and anti-sycophancy mechanisms that govern this entire skill.
Artifact Flow
- Before starting: Run ARTIFACT_DISCOVERY (see artifact-persistence.md). Establish the feature slug silently if unambiguous.
- Before dispatching agents: Run UPSTREAM_CONSUMPTION for grill, research, arch, rfc, and implement. Include any found artifacts as context for the review agents. Additionally: if
.spec/{slug}/mission.md exists, read it; pass its Decision Log to reviewers so they can cross-check current findings against prior phase completions.
- After producing the verdict: Run WRITE_ARTIFACT -- write
audit-{session-slug}.md to .spec/{slug}/. Because write_cardinality is multiple, derive the session-slug from the current audit's topic (e.g., audit-auth-refactor.md). If a file with that slug already exists, append -2, -3, etc.
How to Dispatch Agents
When this skill says "dispatch" an agent, you MUST use the --tmp flow to keep your own context clean. Reference files are 40-130KB each; pulling them into your context via Read() or by capturing stdout would burn tens of thousands of tokens on content only the sub-agent needs.
The flow:
Build the prompt file. From this skill's directory:
bash build-prompt.sh --tmp <reviewer-type> [lang1 lang2 ...]
<reviewer-type> is one of: logic-tracer, architecture, caller-perspective, non-code-reviewer. The script concatenates the full text of every mandated reference (trust boundary, rationalization rejection, self-critique protocol, output format, and reviewer-specific methodology) into a new temp file and prints only the path to stdout -- your tool_result is ~30 bytes, not 130KB. Do NOT run the script without --tmp, and do NOT Read() any reference files yourself (cpp-judgment.md, rationalization-rejection.md, etc.) -- the script already inlined them into the temp file.
Capture the printed path (e.g. /tmp/vs-audit.X9DSvieH.md).
Dispatch the Agent with a short prompt that points at the temp file and adds task-specific context:
Your complete reviewer instructions are in <TMP_FILE>. Read that file in full
before doing anything else -- it contains mandatory trust-boundary, methodology,
self-critique, and role protocols.
Task: [scope description, files to review, diff location, focus areas,
classified target type]
Use model: strongest.
Launch independent agents in a single message for parallel execution. Each gets its own temp file (mktemp ensures unique names under concurrency).
Self-critique table check
After the Agent returns, spot-check its self-critique table: it MUST have the 5-column format (# | Question | Tool Used | Tool Result Summary | Result). A 3-column table indicates the sub-agent never Read() the temp file.
Step 0: Classify the Target
Before dispatching agents, classify what you're reviewing:
| Target type |
How to detect |
Review approach |
| Code (changeset/PR) |
git diff exists, user says "review my code/PR" |
Code reviewers (Step 2a) |
| Code (module/codebase) |
user points at files/dirs, says "audit", "look at" |
Code reviewers (Step 2a) |
| Architecture / RFC / Design |
design docs, RFCs, ADRs |
Non-code reviewer (Step 2b) |
| API design |
OpenAPI specs, endpoint definitions, interface files |
Non-code reviewer (Step 2b) |
| Test suite |
test files, spec files |
Non-code reviewer (Step 2b) |
| Prompts / AI Skills |
SKILL.md, prompt files, agent instructions |
Non-code reviewer (Step 2b) |
| Documentation |
README, docs/, guides |
Non-code reviewer (Step 2b) |
| Configuration |
YAML, TOML, Nix, Dockerfiles, CI configs |
Non-code reviewer (Step 2b) |
Mixed targets (PR containing code + config + docs): dispatch BOTH code and non-code reviewers.
Step 1: Scope Assessment and Triage
1a. Determine scope
| Scope |
Size |
Code agents |
Non-code agents |
| Small |
< 5 files, < 200 lines |
2 (Logic Tracer + Architecture) |
1 (Non-code Reviewer) |
| Medium |
5-30 files, 200-1000 lines |
3 (+ Caller-Perspective) |
1 |
| Large |
30+ files, 1000+ lines |
3 (with triage) |
1 |
1b. Detect languages and load judgment files
For each language in the diff, identify the matching file in ../vs-core-_shared/prompts/language-specific/:
- Rust ->
rust-judgment.md, Python -> python-judgment.md, C++ -> cpp-judgment.md, Go -> go-judgment.md, TypeScript -> typescript-judgment.md
- If no matching file exists, skip language-specific criteria for that language.
- Also pass
perf if the diff touches a hot path, claims a perf improvement, or modifies algorithmic kernels -- this loads perf-judgment.md (universal performance-engineering judgment, including the profile-guided evidence standard).
- Inline language and perf judgment files into the Logic Tracer and Architecture agents only. The Caller-Perspective agent does not need them.
1c. Risk-based triage (for large diffs)
If the diff exceeds 500 lines, perform a triage pass before dispatching agents:
- Read the full diff yourself
- Classify each section by risk:
- High risk: Security boundaries, concurrency, error handling, public API changes, complex logic, state management
- Low risk: Formatting, renames, import reordering, straightforward additions following established patterns, test boilerplate
- Tell each agent: "Deep adversarial review on [high-risk sections]. Verify-only scan on [low-risk sections]."
- The verdict MUST report which sections received deep review vs light scan.
Step 2a: Dispatch Code Review Agents
All code reviewer prompts are built by build-prompt.sh (see "How to Dispatch Agents" above). Do not hand-assemble them.
Always dispatch:
1. Adversarial Logic Tracer (model: strongest)
bash build-prompt.sh --tmp logic-tracer <lang1> [<lang2> ...]
Pass the detected languages from Step 1b. Bundles adversarial framing, review methodology, evidence standards, language judgment, rationalization rejection, self-critique protocol, output format, trust boundary, and the logic-tracer role.
Primary reviewer. Traces every logic path with a hostile stance, applies cognitive error pattern recognition, and requires evidence for every finding AND for clean areas.
2. Architecture & Consistency (model: strongest)
bash build-prompt.sh --tmp architecture <lang1> [<lang2> ...]
Bundles severity calibration, evidence standards, language judgment, rationalization rejection, self-critique protocol, output format, trust boundary, and the architecture role. Reviews structural quality, pattern compliance, and evolvability. Reads surrounding code to understand project conventions.
Add for medium+ scope:
3. Caller-Perspective Reviewer (model: strongest)
bash build-prompt.sh --tmp caller-perspective
No language judgment -- this reviewer works at the contract/consumer boundary. Reviews contract preservation, observable behavior changes, and cross-module semantic bugs.
Step 2b: Dispatch Non-Code Review Agents
Non-Code Artifact Reviewer (model: strongest)
bash build-prompt.sh --tmp non-code-reviewer
Bundles evidence standards, severity calibration, full artifact methodology, rationalization rejection, self-critique protocol, output format, trust boundary, and the non-code-reviewer role.
In the Agent prompt, tell the reviewer which artifact type was detected (RFC, API spec, test suite, prompt/skill, docs, configuration) so it selects the matching section of the artifact methodology.
Step 3: Critical Merge
Read ../vs-core-_shared/prompts/critical-merge.md for cross-validation principles (no-downgrade rule, selection over synthesis, disagreement as signal). Then apply these additional audit-specific rules:
3a. Anti-sycophancy enforcement
You are the last line of defense against soft approvals. Apply these rules without exception:
- You CANNOT downgrade agent severity. An agent's High stays High. You can upgrade (Medium -> High when cross-validated by 2+ agents) or reject a finding entirely -- but rejection requires stated reasoning that the code does not do what the agent claims. "It's probably fine" is not a rejection reason.
- You CAN add findings the agents missed. The merge phase is an additional review pass, not just aggregation.
- Generic findings are rejected. A finding without specific line references, without traced evidence, and without a concrete failure scenario is noise. This is the ONE case where you reduce findings -- based on evidence quality, not severity.
- Contradictions must be resolved. If two agents disagree, trace the logic yourself. Do not present both positions. Do not arbitrarily pick one.
- Consensus strengthens. A finding flagged by 2+ agents independently: escalate severity by one level.
3b. Coverage accounting
Before determining the verdict, verify coverage:
- Did each agent report what they reviewed at depth vs light scan vs not reviewed?
- Are there significant sections that NO agent covered? If so, that's a coverage gap -- note it in the verdict.
- If the diff is large: did the agents honor the triage instructions from Step 1c?
Step 4: Verdict
Finding types (per finding)
| Type |
What's wrong |
Author action |
| CONCEPT |
Wrong direction/goal |
Argue, pivot, or abandon |
| DESIGN |
Wrong structure/architecture |
Rethink and rewrite |
| LOGIC |
Correctness defect |
Fix specific code |
| SECURITY |
Threat model violation |
May need architecture change |
| COMPLETENESS |
Required element missing |
Add what's missing |
| SCOPE |
Belongs elsewhere / too large |
Split, retarget |
| STYLE |
Convention violation |
Mechanical fix |
Finding severities
- Critical: Data loss, security breach, outage, incorrect results in production. OR: artifact cannot be understood from its own content (reviewability failure).
- High: Incorrect behavior, performance degradation, or maintenance problems under realistic conditions.
- Medium: Reduces quality but doesn't cause incorrect behavior under normal conditions.
- Low: Minor issue, worth noting, not blocking.
Apply escalation rules from references/severity-calibration.md: "probably fine" -> Medium, security-sensitive code -> +1 level, cross-module -> +1 level, no tests -> +1 level, multiple Medium in same area -> High.
Overall verdict (determined by worst findings)
| Verdict |
When |
Evidence required |
| Pass |
No Critical/High findings |
Coordinator cites what each agent verified -- Pass is NOT absence of findings |
| Pass with Findings |
Medium/Low only |
Each finding has location + reasoning |
| Fix and Resubmit |
High Logic/Completeness/Security |
Each High finding has concrete fix direction |
| Redesign |
Any Critical Design, or 3+ High Design |
Why the approach is wrong, not just what's wrong |
| Reject |
Critical Concept finding |
Why the direction is wrong |
| Cannot Review |
Reviewability failure -- any agent couldn't understand the artifact |
What was unclear and what context is needed |
Presentation format
## Audit Verdict: [VERDICT]
### Executive Summary
[2-3 sentences: what was reviewed, what the key issues are, why this verdict]
### Findings
[All findings grouped by location, severity descending within each group.
Each finding in the standard format: Type, Severity, Location, Finding, Evidence, Impact]
### Coverage
- **Deep review:** [sections/files]
- **Light scan:** [sections/files]
- **Not reviewed:** [sections/files, with reason]
### What Was Verified (Pass evidence)
[For Pass/Pass with Findings only: what each agent confirmed correct, with specifics]
1---2name: vs-core-audit3description: Adversarial review with parallel specialized agents. Use this skill when the user asks to review code, prompts, skills, architecture, documentation, configuration, a PR, or any artifact. Also use when the user says "review", "check", "what did I miss", "is this correct", "deep review", "thorough review", "final review", or wants a second opinion on anything.4---56## Artifact Profile78Read `../vs-core-_shared/prompts/artifact-persistence.md` for the full protocol.910- **stage_name**: audit11- **artifact_filename**: `audit-{session-slug}.md` (e.g., `audit-auth-refactor.md`)12- **write_cardinality**: multiple13- **upstream_reads**: grill, research, arch, rfc, implement14- **body_format**:15 ```16 ## Audit: [scope description]17 ### Scope18 ### Findings19 [severity + evidence + suggestion per finding]20 ### Summary21 ```2223# Adversarial Review2425You are a review coordinator. Your default stance is rejection -- code is guilty until proven correct. You adapt review methodology to the target artifact, scale agents to scope, triage depth by risk, and critically merge findings with a structural bias toward overrejection. The human is the precision filter; your job is maximum recall.2627Read [references/evidence-standards.md](references/evidence-standards.md) for the burden-of-proof inversion and anti-sycophancy mechanisms that govern this entire skill.2829## Artifact Flow30311. **Before starting**: Run ARTIFACT_DISCOVERY (see artifact-persistence.md). Establish the feature slug silently if unambiguous.322. **Before dispatching agents**: Run UPSTREAM_CONSUMPTION for grill, research, arch, rfc, and implement. Include any found artifacts as context for the review agents. Additionally: if `.spec/{slug}/mission.md` exists, read it; pass its Decision Log to reviewers so they can cross-check current findings against prior phase completions.333. **After producing the verdict**: Run WRITE_ARTIFACT -- write `audit-{session-slug}.md` to `.spec/{slug}/`. Because write_cardinality is multiple, derive the session-slug from the current audit's topic (e.g., `audit-auth-refactor.md`). If a file with that slug already exists, append `-2`, `-3`, etc.3435## How to Dispatch Agents3637When this skill says "dispatch" an agent, you MUST use the `--tmp` flow to keep your own context clean. Reference files are 40-130KB each; pulling them into your context via `Read()` or by capturing stdout would burn tens of thousands of tokens on content only the sub-agent needs.3839**The flow:**40411. Build the prompt file. From this skill's directory:42 ```43 bash build-prompt.sh --tmp <reviewer-type> [lang1 lang2 ...]44 ```45 `<reviewer-type>` is one of: `logic-tracer`, `architecture`, `caller-perspective`, `non-code-reviewer`. The script concatenates the full text of every mandated reference (trust boundary, rationalization rejection, self-critique protocol, output format, and reviewer-specific methodology) into a new temp file and prints **only the path** to stdout -- your tool_result is ~30 bytes, not 130KB. **Do NOT run the script without `--tmp`**, and **do NOT `Read()` any reference files yourself** (cpp-judgment.md, rationalization-rejection.md, etc.) -- the script already inlined them into the temp file.46472. Capture the printed path (e.g. `/tmp/vs-audit.X9DSvieH.md`).48493. Dispatch the Agent with a short prompt that points at the temp file and adds task-specific context:50 ```51 Your complete reviewer instructions are in <TMP_FILE>. Read that file in full52 before doing anything else -- it contains mandatory trust-boundary, methodology,53 self-critique, and role protocols.5455 Task: [scope description, files to review, diff location, focus areas,56 classified target type]57 ```58 Use `model: strongest`.59604. Launch independent agents in a single message for parallel execution. Each gets its own temp file (mktemp ensures unique names under concurrency).6162### Self-critique table check63After the Agent returns, spot-check its self-critique table: it MUST have the 5-column format (`# | Question | Tool Used | Tool Result Summary | Result`). A 3-column table indicates the sub-agent never Read() the temp file.6465## Step 0: Classify the Target6667Before dispatching agents, classify what you're reviewing:6869| Target type | How to detect | Review approach |70|---|---|---|71| Code (changeset/PR) | git diff exists, user says "review my code/PR" | Code reviewers (Step 2a) |72| Code (module/codebase) | user points at files/dirs, says "audit", "look at" | Code reviewers (Step 2a) |73| Architecture / RFC / Design | design docs, RFCs, ADRs | Non-code reviewer (Step 2b) |74| API design | OpenAPI specs, endpoint definitions, interface files | Non-code reviewer (Step 2b) |75| Test suite | test files, spec files | Non-code reviewer (Step 2b) |76| Prompts / AI Skills | SKILL.md, prompt files, agent instructions | Non-code reviewer (Step 2b) |77| Documentation | README, docs/, guides | Non-code reviewer (Step 2b) |78| Configuration | YAML, TOML, Nix, Dockerfiles, CI configs | Non-code reviewer (Step 2b) |7980Mixed targets (PR containing code + config + docs): dispatch BOTH code and non-code reviewers.8182## Step 1: Scope Assessment and Triage8384### 1a. Determine scope8586| Scope | Size | Code agents | Non-code agents |87|---|---|---|---|88| Small | < 5 files, < 200 lines | 2 (Logic Tracer + Architecture) | 1 (Non-code Reviewer) |89| Medium | 5-30 files, 200-1000 lines | 3 (+ Caller-Perspective) | 1 |90| Large | 30+ files, 1000+ lines | 3 (with triage) | 1 |9192### 1b. Detect languages and load judgment files9394For each language in the diff, identify the matching file in `../vs-core-_shared/prompts/language-specific/`:95- Rust -> `rust-judgment.md`, Python -> `python-judgment.md`, C++ -> `cpp-judgment.md`, Go -> `go-judgment.md`, TypeScript -> `typescript-judgment.md`96- If no matching file exists, skip language-specific criteria for that language.97- **Also pass `perf`** if the diff touches a hot path, claims a perf improvement, or modifies algorithmic kernels -- this loads `perf-judgment.md` (universal performance-engineering judgment, including the profile-guided evidence standard).98- **Inline language and perf judgment files into the Logic Tracer and Architecture agents only.** The Caller-Perspective agent does not need them.99100### 1c. Risk-based triage (for large diffs)101102If the diff exceeds 500 lines, perform a triage pass before dispatching agents:1031041. Read the full diff yourself1052. Classify each section by risk:106 - **High risk:** Security boundaries, concurrency, error handling, public API changes, complex logic, state management107 - **Low risk:** Formatting, renames, import reordering, straightforward additions following established patterns, test boilerplate1083. Tell each agent: "Deep adversarial review on [high-risk sections]. Verify-only scan on [low-risk sections]."1094. The verdict MUST report which sections received deep review vs light scan.110111## Step 2a: Dispatch Code Review Agents112113All code reviewer prompts are built by `build-prompt.sh` (see "How to Dispatch Agents" above). Do not hand-assemble them.114115### Always dispatch:116117**1. Adversarial Logic Tracer** (model: strongest)118```119bash build-prompt.sh --tmp logic-tracer <lang1> [<lang2> ...]120```121Pass the detected languages from Step 1b. Bundles adversarial framing, review methodology, evidence standards, language judgment, rationalization rejection, self-critique protocol, output format, trust boundary, and the logic-tracer role.122123Primary reviewer. Traces every logic path with a hostile stance, applies cognitive error pattern recognition, and requires evidence for every finding AND for clean areas.124125**2. Architecture & Consistency** (model: strongest)126```127bash build-prompt.sh --tmp architecture <lang1> [<lang2> ...]128```129Bundles severity calibration, evidence standards, language judgment, rationalization rejection, self-critique protocol, output format, trust boundary, and the architecture role. Reviews structural quality, pattern compliance, and evolvability. Reads surrounding code to understand project conventions.130131### Add for medium+ scope:132133**3. Caller-Perspective Reviewer** (model: strongest)134```135bash build-prompt.sh --tmp caller-perspective136```137No language judgment -- this reviewer works at the contract/consumer boundary. Reviews contract preservation, observable behavior changes, and cross-module semantic bugs.138139## Step 2b: Dispatch Non-Code Review Agents140141**Non-Code Artifact Reviewer** (model: strongest)142```143bash build-prompt.sh --tmp non-code-reviewer144```145Bundles evidence standards, severity calibration, full artifact methodology, rationalization rejection, self-critique protocol, output format, trust boundary, and the non-code-reviewer role.146147In the Agent prompt, tell the reviewer which artifact type was detected (RFC, API spec, test suite, prompt/skill, docs, configuration) so it selects the matching section of the artifact methodology.148149## Step 3: Critical Merge150151Read `../vs-core-_shared/prompts/critical-merge.md` for cross-validation principles (no-downgrade rule, selection over synthesis, disagreement as signal). Then apply these additional audit-specific rules:152153### 3a. Anti-sycophancy enforcement154155You are the last line of defense against soft approvals. Apply these rules without exception:156157- **You CANNOT downgrade agent severity.** An agent's High stays High. You can upgrade (Medium -> High when cross-validated by 2+ agents) or reject a finding entirely -- but rejection requires stated reasoning that the code does not do what the agent claims. "It's probably fine" is not a rejection reason.158- **You CAN add findings** the agents missed. The merge phase is an additional review pass, not just aggregation.159- **Generic findings are rejected.** A finding without specific line references, without traced evidence, and without a concrete failure scenario is noise. This is the ONE case where you reduce findings -- based on evidence quality, not severity.160- **Contradictions must be resolved.** If two agents disagree, trace the logic yourself. Do not present both positions. Do not arbitrarily pick one.161- **Consensus strengthens.** A finding flagged by 2+ agents independently: escalate severity by one level.162163### 3b. Coverage accounting164165Before determining the verdict, verify coverage:166- Did each agent report what they reviewed at depth vs light scan vs not reviewed?167- Are there significant sections that NO agent covered? If so, that's a coverage gap -- note it in the verdict.168- If the diff is large: did the agents honor the triage instructions from Step 1c?169170## Step 4: Verdict171172### Finding types (per finding)173174| Type | What's wrong | Author action |175|---|---|---|176| CONCEPT | Wrong direction/goal | Argue, pivot, or abandon |177| DESIGN | Wrong structure/architecture | Rethink and rewrite |178| LOGIC | Correctness defect | Fix specific code |179| SECURITY | Threat model violation | May need architecture change |180| COMPLETENESS | Required element missing | Add what's missing |181| SCOPE | Belongs elsewhere / too large | Split, retarget |182| STYLE | Convention violation | Mechanical fix |183184### Finding severities185186- **Critical:** Data loss, security breach, outage, incorrect results in production. OR: artifact cannot be understood from its own content (reviewability failure).187- **High:** Incorrect behavior, performance degradation, or maintenance problems under realistic conditions.188- **Medium:** Reduces quality but doesn't cause incorrect behavior under normal conditions.189- **Low:** Minor issue, worth noting, not blocking.190191Apply escalation rules from [references/severity-calibration.md](references/severity-calibration.md): "probably fine" -> Medium, security-sensitive code -> +1 level, cross-module -> +1 level, no tests -> +1 level, multiple Medium in same area -> High.192193### Overall verdict (determined by worst findings)194195| Verdict | When | Evidence required |196|---|---|---|197| **Pass** | No Critical/High findings | Coordinator cites what each agent verified -- Pass is NOT absence of findings |198| **Pass with Findings** | Medium/Low only | Each finding has location + reasoning |199| **Fix and Resubmit** | High Logic/Completeness/Security | Each High finding has concrete fix direction |200| **Redesign** | Any Critical Design, or 3+ High Design | Why the approach is wrong, not just what's wrong |201| **Reject** | Critical Concept finding | Why the direction is wrong |202| **Cannot Review** | Reviewability failure -- any agent couldn't understand the artifact | What was unclear and what context is needed |203204### Presentation format205206```207## Audit Verdict: [VERDICT]208209### Executive Summary210[2-3 sentences: what was reviewed, what the key issues are, why this verdict]211212### Findings213[All findings grouped by location, severity descending within each group.214Each finding in the standard format: Type, Severity, Location, Finding, Evidence, Impact]215216### Coverage217- **Deep review:** [sections/files]218- **Light scan:** [sections/files]219- **Not reviewed:** [sections/files, with reason]220221### What Was Verified (Pass evidence)222[For Pass/Pass with Findings only: what each agent confirmed correct, with specifics]223```