How this skill is triggered — by the user, by Claude, or both
Slash command
/rust:auditing-rustThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Invoke the `rust:standardizing-rust` skill before proceeding. If that skill is unavailable, report the missing skill and continue with the closest available workflow.
Invoke the rust:standardizing-rust skill before proceeding. If that skill is unavailable, report the missing skill and continue with the closest available workflow.
Invoke the rust:standardizing-rust-tests skill before proceeding. If that skill is unavailable, report the missing skill and continue with the closest available workflow.
<quick_start>
spx/local/rust.md if it exists./standardizing-rust-tests and /testing-rust for test-shape context, then hand off evidence judgments to /auditing-rust-tests.CLAUDE.md, Cargo.toml, and rust-toolchain.toml when present.cargo fmt --check, cargo clippy --all-targets --all-features -- -D warnings, cargo test --all-targets.</quick_start>
<repo_local_overlay>
Standards are pre-loaded above. Check for spx/local/rust.md at the repository root. Read it if it exists and apply it as repo-local routing to the product's governing specs and decisions. A local overlay supplements skill behavior; it does not declare product truth.
</repo_local_overlay>
<essential_principles>
Automated gates are the entry ticket. If formatting, linting, or tests fail, reject immediately and stop. Manual review starts only after the code passes the mechanical bar.
Comprehension is the main job. Read names and signatures first, predict behavior, then read the body and look for surprises. Review time belongs to design and semantics, not restating what clippy already checked.
This skill audits implementation code. Test evidence quality belongs to /auditing-rust-tests. If test files are in scope, load /standardizing-rust-tests, verify they pass, then hand off evidence judgments to the test auditor.
The verdict is binary. APPROVED means every concern passes. REJECTED means at least one concern fails.
</essential_principles>
Execute the phases in order.
Phase 0: Scope and product config
CLAUDE.md and README.md for product commands and review constraintsCargo.toml and rust-toolchain.toml when presentPhase 1: Automated gates (blocking)
Run the repository's canonical validation command. If the repository does not publish one, use the fallback sequence from rules/validation-sequence.json.
Non-zero exit means REJECTED. Do not proceed to manual review.
Phase 2: Test execution (blocking)
Run the full test suite. If the repo has a stricter documented command, use it. Otherwise cargo test --all-targets is the minimum bar.
Any failing test means REJECTED. Do not proceed.
Phase 3: Code comprehension
Read every production file. Do not skim.
3.1 Per-function protocol
For each function or method:
Use this table to classify surprises:
| Surprise | What it suggests |
|---|---|
| parameter unused in body | dead parameter, trait-driven signature, or unfinished logic |
| function does more than its name promises | SRP violation or misleading name |
| function does less than its name promises | missing behavior or overclaiming name |
| cloned values with no ownership reason | unclear data flow or borrow-checker avoidance |
| branch appears impossible from call sites | dead branch or mismatched abstraction |
| error loses source context | weak error boundary |
3.2 Design evaluation
Evaluate the codebase for:
3.3 Module and use evaluation
Classify use paths like this:
| Pattern | Classification |
|---|---|
use std::collections::BTreeMap; | stdlib, not reviewed |
use serde::Deserialize; | external crate, not reviewed |
use crate::domain::UserId; | cross-module codebase import, review |
use super::parser::parse; | nearby private module import, review |
use super::super::shared::Config; | deep relative import, review aggressively |
Import rules:
crate:: for stable cross-module referencesself:: or super:: for nearby private modules that move togethersuper:: hops in production code are a rejection-level concern unless the module is a tightly scoped private leafUse references/false-positive-handling.md when a suspicious pattern might still be correct in context.
Phase 4: ADR and PDR compliance
Verify each relevant architectural or product constraint is reflected in the code shape. Undocumented deviations are REJECTED.
<reference_guides>
references/false-positive-handling.md -- when a surprise is legitimate in Rust contextreferences/example-audit.md -- complete APPROVED and REJECTED examplesrules/validation-sequence.json -- fallback validation sequence metadatarules/review-prompts.js -- fallback manual review promptsrules/security-signals.yaml -- fallback security review signals</reference_guides>
<output_format>
Emit the verdict as JSON conforming to the canonical schema in plugins/spec-tree/skills/auditing/scripts/verdict.py. The skill's entire output is the JSON verdict. The caller captures the JSON and routes it through emit_verdict.py with the requested --format (defaulting to markdown+json for PR-comment delivery).
The skill's overall is PASS iff every concern row is PASS or UNKNOWN (N/A maps to UNKNOWN); FAIL if any concern is FAIL. Findings carry severity REJECT for blocking violations.
{
"schema_version": 1,
"skill": "auditing-rust",
"target": "<scope-target>",
"overall": "PASS | FAIL | UNKNOWN",
"rows": [
{ "name": "automated-gates", "status": "PASS | FAIL | UNKNOWN", "findings": [] },
{ "name": "test-execution", "status": "PASS | FAIL | UNKNOWN", "findings": [] },
{ "name": "function-comprehension", "status": "PASS | FAIL | UNKNOWN", "findings": [] },
{ "name": "design-coherence", "status": "PASS | FAIL | UNKNOWN", "findings": [] },
{ "name": "import-structure", "status": "PASS | FAIL | UNKNOWN", "findings": [] },
{ "name": "adr-pdr-compliance", "status": "PASS | FAIL | UNKNOWN", "findings": [] }
],
"metadata": { "branch": "<branch>" }
}
Each finding carries file, line, rule (the concern name or specific violation), severity: "REJECT", and message (the one-line "why this fails"). Include correct-approach Rust samples and required-changes summary directly in the finding's message field — the JSON verdict is the complete output of this skill.
</output_format>
<success_criteria>
</success_criteria>
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub outcomeeng/plugins --plugin rust