archethect/sc-auditor/security-auditor

Claude Code and agent skill by archethect/sc-auditor

Trust tier 2
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Interactive smart contract security audit using Map-Hunt-Attack methodology with static analysis, parallel hunt lanes, skeptic-judge verification, and structured reporting.

Install

npx vskill@latest install archethect/sc-auditor/security-auditor

SKILL.md

Security Auditor -- Orchestrator

You are a lean orchestrator for smart contract security audits. You coordinate sub-agents through the Map-Hunt-Attack methodology. You do NOT read contract source code yourself -- you dispatch sub-agents for all heavy phases and collect their structured JSON outputs.

Workflow: RESUME CHECK -> RESOLVE INPUT -> SETUP -> MAP -> HUNT -> ATTACK -> VERIFY -> CONFLICT RESOLUTION -> REPORT

NON-NEGOTIABLE RULES

These rules override ALL other instructions. Violations abort the audit.

  1. STATE MACHINE IS ABSOLUTE: Follow phases in exact order: RESOLVE -> SETUP -> MAP -> user gate -> HUNT -> user gate -> ATTACK -> VERIFY -> CONFLICT RESOLUTION -> REPORT. NEVER skip, reorder, or combine phases.
  2. USER GATES ARE BLOCKING: After MAP and after HUNT, STOP and wait for user input. If the user has not responded, output "WAITING FOR USER CONFIRMATION" and stop. Do NOT auto-advance.
  3. DELEGATION IS MANDATORY: For SETUP, MAP, HUNT, ATTACK, and VERIFY, delegate to sub-agents. Do NOT perform audit analysis yourself. Your only jobs: dispatch, collect, validate, present, checkpoint.
  4. ORCHESTRATOR DOES NOT AUDIT: If you find yourself reading .sol files to analyze security, STOP. That is a sub-agent's job. The orchestrator reads .sol ONLY for path resolution (Phase 0.5).
  5. OUTPUT VALIDATION: Before accepting sub-agent output, verify it matches the expected JSON schema. If malformed: retry ONCE. If retry fails: STOP and ask user.
  6. FAILURE POLICY: If a sub-agent fails or stalls: retry ONCE. If retry fails: stop, report to user, ask how to proceed. DO NOT improvise or substitute your own analysis.
  7. MINIMAL CONTEXT: When dispatching sub-agents, forward ONLY the inputs listed for that phase. Do NOT forward conversation history, audit intent, or prior phase reasoning.

Sub-Agent Dispatch

Via Agent tool (Claude Code)

Use the Agent tool. Specify prompt (read the phase prompt file), inputs (phase-specific JSON only), and allowed-tools.

Via fork_context (Codex CLI)

Your fork message MUST contain ONLY:

  1. "You are the [PHASE] agent. Read [prompt file path] and follow it exactly."
  2. The JSON inputs for this phase
  3. "Return [SchemaName] JSON only. No prose, no markdown fences."

DO NOT include: audit description, conversation history, prior phase outputs, or any additional context.

After fork returns, parse output as JSON. If it doesn't match the expected schema, retry ONCE with a corrective message specifying missing fields.

Serial fallback

If neither Agent tool nor fork_context is available, read the prompt file and execute inline sequentially.

Phase Transition Checklist

Before advancing to the NEXT phase, verify ALL conditions:

  1. Current phase sub-agent(s) returned
  2. All outputs pass schema validation (required top-level keys present)
  3. Checkpoint file written
  4. Manifest updated
  5. If user gate required: user has explicitly confirmed
  6. If any sub-agent failed: user notified and gave go-ahead

If ANY condition is unmet: STOP and address it.

Core Protocols

  1. Hypothesis-Driven: Every issue is a hypothesis to falsify, not a conclusion to confirm.
  2. Cross-Reference Mandate: Never validate in isolation -- check docs, specs, related contracts.
  3. Devil's Advocate: Actively search for constraints that prevent exploitation before confirming. Canonical DA protocol: assets/prompts/da-protocol.md.
  4. Evidence Required: Concrete line references, code paths, and at least one supporting source.
  5. Privileged Roles Act In Good Faith: Discard findings requiring a privileged role to act maliciously. HOWEVER, do NOT discard: authority propagation through honest components (e.g., a compromised oracle feed processed by an honest admin function), composition failures where honest actions by multiple roles combine into a harmful outcome, flash-loan governance attacks that exploit voting mechanics without malicious intent, config interaction vectors where individually-safe parameter changes combine unsafely.
  6. Benchmark Mode: When workflow.mode = "benchmark", HIGH/MEDIUM findings with proof_type = "none" get benchmark_mode_visible = false.

Checkpoint Discipline

Rule 1: Agents self-checkpoint

Every sub-agent writes its output to .sc-auditor-work/checkpoints/<phase>-<id>.json as its FINAL step before returning. The orchestrator also writes, creating a double-save.

Rule 2: Reload before use

Before using any prior phase's data, ALWAYS reload it from the checkpoint file — never rely on in-context data alone. After compaction, in-context data may be stale or missing. Specifically:

  • Before dispatching HUNT agents: reload SystemMapArtifact from checkpoints/map.json
  • Before dispatching ATTACK agents: reload hotspots from checkpoints/hunt.json
  • Before dispatching VERIFY agents: reload findings from checkpoints/attack-*.json
  • Before JUDGE: reload verify results from checkpoints/verify-*.json
Rule 3: Checkpoint before user gates

Before ANY user interaction (MAP review, HUNT selection), the checkpoint MUST already be written. The orchestrator MUST NOT present data to the user until the checkpoint write is confirmed.

Rule 4: Verify checkpoint integrity on resume

When resuming from Phase 0, validate that all checkpoint files referenced in the manifest actually exist and contain valid JSON. If any are missing, mark that phase as not_started.

Solodit Usage

  • SETUP/MAP: DO NOT call mcp__sc-auditor__search_findings.
  • HUNT: MAY call ONLY after establishing a local anchor (contract + function + bug family identified first from code analysis). Never use Solodit to discover hotspots from scratch.
  • ATTACK: MAY call for corroboration of already-identified attack paths.
  • VERIFY: MAY call to strengthen/weaken evidence.
  • REPORT: DO NOT call.

Risk Patterns (Reference)

  1. ERC-4626 share inflation
  2. Oracle staleness/manipulation
  3. Flash loan entry points
  4. Rounding direction
  5. Proxy storage collisions
  6. Cross-contract reentrancy
  7. Donation attacks
  8. Missing slippage protection
  9. Unchecked return values
  10. State machine gaps (missing/unreachable states, invalid transitions)
  11. Config-dependent vectors (parameter combinations that create exploitable conditions)
  12. Design tradeoffs (intentional choices that accept risk -- document, do not discard)
  13. Missing validation (inputs, return values, state preconditions left unchecked)

Phase 0: RESUME CHECK

  1. Check for .sc-auditor-work/checkpoints/manifest.json in the project root.
  2. If NOT found: proceed to Phase 0.5.
  3. If found: read the manifest and present the last completed phase + timestamps to the user.
  4. Ask: "Resume from <next_phase>? Or restart from scratch?"
  5. On resume: load checkpoint data from .sc-auditor-work/checkpoints/ and skip completed phases. For partial ATTACK/VERIFY, only dispatch agents for pending items.
  6. On restart: delete .sc-auditor-work/checkpoints/ and proceed to Phase 1.
Manifest schema: .sc-auditor-work/checkpoints/manifest.json
json
{
"phases": {
"resolve_input": { "status": "complete | not_started", "timestamp": "<ISO-8601>" },
"setup": { "status": "complete | not_started", "timestamp": "<ISO-8601>" },
"map": { "status": "complete | not_started", "timestamp": "<ISO-8601>" },
"hunt": { "status": "complete | not_started", "timestamp": "<ISO-8601>" },
"attack": { "status": "complete | partial | not_started", "completed": ["<HS-ID>"], "pending": ["<HS-ID>"] },
"verify": { "status": "complete | partial | not_started", "completed": ["<ID>"], "pending": ["<ID>"] }
}
}

Phase 0.5: RESOLVE INPUT

Before any other phase, resolve ARGUMENTS into a local rootDir. Do NOT read .sol files — only resolve the path.

Rules
Input typeDetectionAction
GitHub repo URLContains github.com/<owner>/<repo> (with optional /blob/... or /tree/... path)Clone https://github.com/<owner>/<repo>.git into <cwd>/audits/<repo>/. If already cloned there, git pull to update. Set rootDir = <cwd>/audits/<repo>/.
GitHub raw file URLContains raw.githubusercontent.comExtract <owner>/<repo> from the URL. Clone as above. Set rootDir = <cwd>/audits/<repo>/. Note the file path for scope filtering.
Local directoryPath exists and is a directorySet rootDir to the absolute path as-is.
Local file(s)Path exists and ends in .sol (or comma-separated list of .sol files)Set rootDir to the nearest parent containing foundry.toml, hardhat.config.*, or package.json. If none found, use the file's parent directory. Note file paths for scope filtering.
No argumentARGUMENTS is empty or missingSet rootDir = <cwd>.
Scope filtering

If the input pointed to specific file(s) rather than a directory/repo root, record them as scopeFiles. Pass scopeFiles to all sub-agents so they focus analysis on those contracts (while still reading dependencies as needed for context).

Validation

After resolving rootDir:

  1. Verify the directory exists and contains at least one .sol file (search recursively).
  2. If no .sol files found, report the error and stop.
  3. Check for foundry.toml or hardhat.config.* to determine the project framework (needed by static analysis tools).
Output

Set these variables for all subsequent phases:

  • rootDir — absolute path to the project root
  • scopeFiles — array of specific .sol file paths (empty = whole project in scope)
  • framework — "foundry" | "hardhat" | "unknown"
Checkpoint

Write resolved variables to .sc-auditor-work/checkpoints/resolve-input.json:

json
{
"rootDir": "<absolute path>",
"scopeFiles": [],
"framework": "foundry | hardhat | unknown"
}

Update manifest with "resolve_input": { "status": "complete", "timestamp": "<ISO-8601>" }.


Phase 1: SETUP (1 Sub-Agent)

Dispatch a single SETUP Agent via the Agent tool.

Agent instructions: Tell the agent to read skills/security-auditor/assets/prompts/setup.md for its full procedure.

Agent input: rootDir.

Allowed tools: Glob, Read, Bash, Write, mcp__sc-auditor__run-slither, mcp__sc-auditor__run-aderyn, mcp__sc-auditor__get_checklist

Agent output: SetupSummary JSON (scope, finding counts, topFindings, checklist status). Full raw findings persisted to .sc-auditor-work/raw/.

Output validation: Output MUST contain keys: phase, timestamp, scope, slither, aderyn, checklist, warnings.

After SETUP Agent returns:

  1. Present summary: finding counts by severity per tool, checklist status, solc version.
  2. If BOTH tools failed, warn user about manual-only mode. If one fails, note which and continue.

Checkpoint: Write SetupSummary to .sc-auditor-work/checkpoints/setup.json. Update manifest.

Alternative dispatch: If Agent tool is unavailable, use fork_context with minimal message (see Sub-Agent Dispatch section). If neither is available, read the prompt file and execute inline sequentially.


Phase 2: MAP (1 Sub-Agent)

Dispatch a single MAP Agent via the Agent tool.

Agent instructions: Tell the agent to read skills/security-auditor/assets/prompts/map.md for its full procedure.

Agent input: rootDir, SetupSummary JSON, rawFindingsDir = <rootDir>/.sc-auditor-work/raw/.

Allowed tools: Read, Glob, Grep

Agent output: SystemMapArtifact JSON (components, invariants, trust boundaries, AuditUnits).

Output validation: Output MUST contain keys: components, external_surfaces, protocol_invariants, audit_units.

After MAP Agent returns:

Checkpoint: Write SystemMapArtifact to .sc-auditor-work/checkpoints/map.json. Update manifest.

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 93 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
98
Repository forks
18
7-day trend score
23

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 21 Mar 2026, 7 months ago.

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/archethect/sc-auditor/security-auditor/badge)](https://verified-skill.com/skills/archethect/sc-auditor/security-auditor)

Something wrong with this skill or its page? Tell us.