From solidity-function-audit-eval
Non-interactive eval variant of the per-function Solidity audit. Removes all interactive prompts for automated evaluation via `claude -p` mode. Reads design decisions from GROUND_TRUTH.md, skips Slither, always runs verification, stops after Verification.
How this skill is triggered — by the user, by Claude, or both
Slash command
/solidity-function-audit-eval:solidity-function-audit-evalThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Non-interactive variant of solidity-function-audit for automated evaluation. Runs the same 7-stage pipeline but removes all 12 interactive pause points: pre-seeds design decisions from GROUND_TRUTH.md, auto-confirms domains, skips Slither, always runs verification, and stops after Verification (no Stage 4/5).
Non-interactive variant of solidity-function-audit for automated evaluation. Runs the same 7-stage pipeline but removes all 12 interactive pause points: pre-seeds design decisions from GROUND_TRUTH.md, auto-confirms domains, skips Slither, always runs verification, and stops after Verification (no Stage 4/5).
Designed for invocation via claude -p with --dangerously-skip-permissions.
If docs/audit/function-audit/ exists, delete its contents and proceed (always overwrite — no archive/cancel prompt).
$ARGUMENTS as the project path if provided, otherwise use the current working directory.PROJECT_PATH for all subsequent steps.Use Glob for src/**/*.sol (excluding src/artifacts/) to find all source files. Then use Grep for contract \w+ and library \w+ to identify contract and library declarations. Do NOT Read entire source files — only Read a specific file when domain grouping is ambiguous. The goal is to know file paths + contract names.
Use Grep for function \w+\( in each discovered .sol file to find all function declarations. Use Grep context flags (-A 1 or -B 1) to determine visibility:
external and public functionsinternal functionsGroup functions into logical domains using these heuristics (in priority order):
Target 4-10 domains of 3-15 functions each. If the contract has fewer than 15 functions total, use a single domain. If natural grouping exceeds 10 domains, merge the smallest related domains.
mkdir -p docs/audit/function-audit/{stage0,stage1,stage2,stage3,verification}
Build the list of all .sol source file paths (absolute paths) for {source_file_list} placeholders.
Scan source files for DeFi-relevant patterns:
ERC20, ERC721, ERC1155, ERC4626, IERC20, SafeERC20 → set {has_tokens} true/falseUUPSUpgradeable, TransparentProxy, Initializable → set {has_proxies} true/falseAggregatorV3Interface, IOracle, TWAP → set {has_oracles} true/falseAfter each completed stage, write {output_root}/stage-checkpoint.md using the Write tool (full overwrite). Include:
PROJECT_PATH, OUTPUT_ROOTSTAGE_STATUS: key=value pairs for each stage. Write as a standalone line starting with STAGE_STATUS: — this line is machine-parsed by the PreCompact hook.DOMAINS: one line per domain with slug, name, and function listFLAGS: has_tokens, has_proxies, has_oraclesPATHS: design_decisions_file and all stage output file paths known so farFINDING_TOTALS with severity countsBefore each stage, read the checkpoint file to confirm all paths and domain groupings. If state has been lost, recover via:
Glob(pattern: "**/docs/audit/function-audit/stage-checkpoint.md")Read the project's GROUND_TRUTH.md file. Extract design_decisions_preset from the YAML frontmatter. Use Glob to find GROUND_TRUTH.md in the project root or parent directories.
If design_decisions_preset is found, write docs/audit/function-audit/stage0/design-decisions.md containing the preset values formatted as design decision categories:
upgradeabletoken_standardaccess_controloracle_usagenotesIf GROUND_TRUTH.md is not found or has no preset, run the automated extraction from resources/REVIEW_PROMPTS.md (Stage 0 section) using Grep patterns — but skip the interactive confirmation. Write whatever is detected.
Store the absolute path as {design_decisions_file}.
Update the session state checkpoint (Stage 0 complete). Proceed immediately to Stage 1 (skip Slither entirely).
Launch 3 Task agents, ALL with run_in_background: true, subagent_type: "general-purpose", and max_turns: 15.
Read the prompt templates from resources/STAGE_PROMPTS.md and fill in the placeholders:
{output_file} — the absolute path to the output markdown file{source_file_list} — the collected source file paths| Agent | Output File | Prompt Template |
|---|---|---|
| 1a: State Variable Map | docs/audit/function-audit/stage1/state-variable-map.md | Stage 1a from STAGE_PROMPTS.md |
| 1b: Access Control Map | docs/audit/function-audit/stage1/access-control-map.md | Stage 1b from STAGE_PROMPTS.md |
| 1c: External Call Map | docs/audit/function-audit/stage1/external-call-map.md | Stage 1c from STAGE_PROMPTS.md |
After launching all 3:
TaskOutput(block: true, timeout: 300000) on each agent to wait for completiondocs/audit/function-audit/stage1/*.md## ). If validation fails, note the file as INCOMPLETE in synthesis.Launch ONE Task agent per domain, ALL with run_in_background: true, subagent_type: "general-purpose", and max_turns: 25.
Read the Stage 2 prompt template from resources/STAGE_PROMPTS.md and fill in:
{domain_name} — the domain name{output_file} — docs/audit/function-audit/stage2/domain-{slug}.md{stage1_state_var_file} — absolute path to stage1/state-variable-map.md{stage1_access_control_file} — absolute path to stage1/access-control-map.md{stage1_external_call_file} — absolute path to stage1/external-call-map.md{design_decisions_file} — absolute path to stage0/design-decisions.md{slither_file} — empty string (Slither is skipped in eval mode){source_file_list} — source files relevant to this domain only{function_list} — the functions in this domain with their contract and line numbers{template_file} — absolute path to resources/FUNCTION_TEMPLATE.md{example_file} — absolute path to resources/EXAMPLE_OUTPUT.mdAfter launching all domain agents:
TaskOutput(block: true, timeout: 600000) on each agent (up to 10 minutes)docs/audit/function-audit/stage2/*.md## heading, contains ## Summary of Findings or ## Cross-Cutting Analysis, and has at least one severity tag. If validation fails, note the file as INCOMPLETE.Launch 4 Task agents, ALL with run_in_background: true, subagent_type: "general-purpose", and max_turns: 25.
Read the Stage 3 prompt templates from resources/STAGE_PROMPTS.md and fill in:
{output_file} — the absolute path to the output markdown file{stage1_file_list} — all 3 stage 1 file paths{stage2_file_list} — all stage 2 domain file paths{design_decisions_file} — absolute path to stage0/design-decisions.md{slither_file} — empty string (Slither skipped){source_file_list} — all source file paths| Agent | Output File | Prompt Template |
|---|---|---|
| 3a: State Consistency | docs/audit/function-audit/stage3/state-consistency.md | Stage 3a from STAGE_PROMPTS.md |
| 3b: Math & Rounding | docs/audit/function-audit/stage3/math-rounding.md | Stage 3b from STAGE_PROMPTS.md |
| 3c: Reentrancy & Trust | docs/audit/function-audit/stage3/reentrancy-trust.md | Stage 3c from STAGE_PROMPTS.md |
| 3d: Adversarial Sequences | docs/audit/function-audit/stage3/adversarial-sequences.md | Stage 3d from STAGE_PROMPTS.md |
After launching all 4:
TaskOutput(block: true, timeout: 600000) on each agent (up to 10 minutes)docs/audit/function-audit/stage3/*.md## heading, and has at least one severity tag. If validation fails, note the file as INCOMPLETE.After all 3 stages complete, perform synthesis (identical to the solo variant):
Grep(pattern: "\\*\\*(CRITICAL|HIGH|MEDIUM|LOW|INFO) -- ", path: "docs/audit/function-audit/", output_mode: "content") — all findingsGrep(pattern: "\\*\\*Verdict\\*\\*: \\*\\*", path: "docs/audit/function-audit/", output_mode: "content") — all verdictsCount findings per severity per file. Count per-function verdicts (SOUND, NEEDS_REVIEW, ISSUE_FOUND). Do NOT count domain-level overall verdicts in the per-function tally.
From the Grep results, extract each finding's severity, title, source file path, and parent function.
Write docs/audit/function-audit/INDEX.md with the standard format: stage sections, All Findings master table sorted by severity, totals.
Write docs/audit/function-audit/SUMMARY.md with executive summary, top findings, cross-cutting themes, and action items.
Update the session state checkpoint (Synthesis complete, add finding tallies). Proceed immediately to Verification.
Using the "All Findings" master table from INDEX.md, collect all CRITICAL, HIGH, and MEDIUM findings. Always run verification — no opt-in prompt.
mkdir -p docs/audit/function-audit/verification
mkdir -p test/audit-verification
For each CRITICAL/HIGH finding (CRITICALs first, then HIGHs):
resources/VERIFICATION_PROMPTS.md and fill in placeholders:
{finding_number}, {finding_severity}, {finding_title}, {finding_source_file}, {finding_function}{output_file} — docs/audit/function-audit/verification/finding-{NNN}.md{test_dir} — absolute path to {PROJECT_PATH}/test/audit-verification/{test_name} — AuditVerify_{NNN}_{ContractName}{source_file_list}, {stage1_file_list}, {design_decisions_file}subagent_type: "solidity-function-audit-eval:solidity-verifier", max_turns: 20TaskOutput(block: true, timeout: 480000) — do NOT launch next agent until completefinding-{NNN}.md is non-empty and contains one of [CONFIRMED], [REFUTED], [LIKELY-FP], [INCONCLUSIVE]If MEDIUM findings exist:
resources/VERIFICATION_PROMPTS.md and fill in {medium_findings_list}, {output_file} (verification/medium-findings.md), {source_file_list}, {stage1_file_list}, {design_decisions_file}subagent_type: "solidity-function-audit-eval:solidity-verifier", max_turns: 25TaskOutput(block: true, timeout: 600000)medium-findings.md is non-empty and contains ## headingWrite docs/audit/function-audit/verification/verification-summary.md with results table and verdict counts.
Update INDEX.md: add "Verification" section and "Verified" column to "All Findings" table. Update SUMMARY.md: add "Verification" section with verdict counts. Update session state checkpoint (Verification complete, add verdict tallies).
Write EVAL_COMPLETE as the final line in stage-checkpoint.md.
Output a one-line completion message: "Eval complete. INDEX.md and SUMMARY.md written to docs/audit/function-audit/."
Do NOT proceed to Stage 4 or Stage 5. Eval mode stops after Verification.
block: true and wait for agent completion.subagent_type: "general-purpose". Verification uses solidity-function-audit-eval:solidity-verifier. All prompts use absolute paths.INCOMPLETE — agent failed.grade.sh.npx claudepluginhub gonzaloetjo/solidity-audit-skills --plugin solidity-function-audit-evalOrchestrates interactive Solidity smart contract security audits using Map-Hunt-Attack methodology: static analysis (Slither, Aderyn), fuzzing (Echidna, Medusa, Halmos), verification, and reporting.
Generates project overviews and audit scopes for smart contract security by mapping structure, entry points, value flows, trust boundaries, and high-risk areas.
Orchestrates parallelized security audits of Cairo/Starknet code with deterministic preflight, agent-based scanning, and deduplicated reporting. Supports default, deep, and filename-specific modes.