mtarcure/claude-vibe-squad/pre-audit-threat-model
Claude Code and agent skill by mtarcure/claude-vibe-squad
- community
Checking that the SKILL.md file is still in the repository.
Use as the first pass on a new Solidity engagement, before any scanner runs, building an audit-readiness x-ray that enumerates permissionless entry points, maps every actor and privileged role, and extracts the protocol's stated invariants so downstream passes have a target list. Reach for it when asked to x-ray, prep, or find where to start on a protocol.
Install
npx vskill@latest install mtarcure/claude-vibe-squad/pre-audit-threat-modelSKILL.md
pre-audit-threat-model
Audit-readiness x-ray. Build the threat model BEFORE running any tooling so every later pass has an entry-point list, an actor map, and a stated invariant set to evaluate against.
When to use
- First skill on any new Solidity engagement. Always.
- Operator says "x-ray", "audit readiness", "prep this protocol", "summarize this protocol",
or "where do I start".
- Re-run when the codebase changes meaningfully (new contract, new role, new external
integration); the cached x-ray.md is otherwise the source of truth.
Pipeline (3 steps, sequential)
Step 1 — Enumerate and measure
- Detect source dir: read
foundry.tomlsrc=first, elsehardhat.config.*, else try
src/ then contracts/.
- Count: source files, nSLOC (no
~prefix in the report), test files, test functions,
stateful-fuzz files, foundry-invariant files, echidna/medusa/halmos/certora configs, fork tests. These signal test presence — never infer "no tests" from coverage tool failure.
- Run coverage in background (
forge coverage, or a project-localhardhat coverageonly if
the project already has Hardhat installed — never npx-fetch a remote tool). If the toolchain is missing, surface the failure reason and continue — coverage is not a gate.
- Run a git-security scan: branch shape (linear / merged / squashed-import), fix-commit
candidates (commits whose message matches fix|patch|vuln|exploit|audit), late changes (commits in the final 10% of history), forked deps, tech-debt markers (TODO/FIXME density), test co-change rate per source file.
- Glob for spec/whitepaper docs and extract only stated invariants, actor definitions,
trust assumptions, economic properties. Tag spec-derived claims (per spec) so auditors can tell code-verified from spec-stated.
Step 2 — Read source and classify entry points
- Read every in-scope
.sol. Skipinterfaces/, vendored copies of OZ/Uniswap libs,
tests/mocks. For each contract record: type & inheritance, roles & access control, value-holding state vars, external calls, fund flows, invariant comments, require/assert statements.
- Entry-point grep gate (PCRE — Bash, not the Grep tool):
``bash # single-line signatures grep -rnP 'function\s+\w+\s*\([^)]*\)\s+(external|public)(?!.*\b(view|pure)\b)' src/ --include='*.sol' # multi-line signatures (visibility on closing-paren line) grep -rnP '^\s*\)\s+(external|public)(?!.*\b(view|pure)\b)' src/ --include='*.sol' -B5 ``
- Classify EACH grep hit by reading its body: permissionless (no modifier AND no
internal msg.sender check), role-gated (modifier or internal restriction — acceptOwnership style counts), or admin-only. nonReentrant alone is NOT access control. The grep list is the source of truth — subagent summaries lose.
- Centralization analysis per privileged role: enumerate operational actions, distinguish
role-transfer delays from action delays, mark which actions can extract user funds.
- Pause-coverage analysis: which critical functions are
whenNotPaused, which aren't.
Integrate gaps into the relevant role's attack surface — do NOT make a standalone "Centralization Risks" section (that duplicates Actors / Trust Boundaries / Attack Surfaces).
Step 3 — Write outputs
Write three files into x-ray/ in a single message (parallel writes):
x-ray/architecture.json— contracts, edges, roles, value flows for SVG rendering.x-ray/x-ray.md— under 500 lines. Sections: Overview, Threat & Trust Model, Invariants,
Actors, Permissionless Entry Points (grep-verified list only), Trust Boundaries, Key Attack Surfaces, Integrations & Composability, Tests & Coverage, Git History, Verdict.
x-ray/entry-points.md— protocol flow paths first (`destination ← writer-of-precondition
← ... ← deployment` arrow chains), then per-access-level detail blocks.
Verification rules
- Permissionless list: grep-verified only. If a subagent summary disagrees, grep wins.
- Security claims: before writing "check X is missing", grep for every write site of
the variable in question and confirm against those write sites. Qualify anything you cannot verify with could not confirm.
- Branch scoping: state the analyzed branch in the header (`Analyzed branch: <name> at
<commit>`). Never describe code state from other branches.
- Test presence vs coverage: enumeration counts test files even if coverage failed.
Never claim "no tests" from a coverage tool failure.
- Backwards-compatibility code: only classify code as legacy if (a) no active callers
exist, (b) no NatSpec documents the behavior as intentional, (c) git history shows the mechanism was removed. Otherwise it is current design.
Anti-patterns
- Do NOT skip the grep gate — subagent contract summaries miss multi-line signatures.
- Do NOT make a standalone Centralization Risks subsection — distribute into Actors / Trust
Boundaries / Attack Surfaces.
- Do NOT fabricate invariants the code does not state or imply; mark unstated ones as
"auditor-derived" so downstream skills know which are protocol-claimed.
- Do NOT block downstream audit work on coverage tool failure.
Recording (chrono-vault)
The task packet's injected memory contract owns the exact call shape, sequence, and fields - see wirework-reflect. Do not copy a record(...) example or add fields (including source_task) from memory; the server binds them, and a baked example violates the run's authenticated schema. Memory is best-effort telemetry and never gates the work. What is worth recording here is the task-specific outcome: nSLOC, entry points, permissionless count, roles, invariants, integrations, branch@commit.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingmodel-lanes/gemini/.agents/skills/pre-audit-threat-model/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/mtarcure/claude-vibe-squad/pre-audit-threat-model)