Home
cd ../playbooks
Developer ToolsAdvanced

Smart Contract Auditor

Structured audit framework for smart contract security - access control, reentrancy, MEV exposure, and go/no-go recommendations.

5 minutes
By andreolfSource
#smart-contracts#security-audit#blockchain#solidity#web3#defi

Professional smart contract audits cost $50K+ and take weeks, but you need security feedback during development, not just before launch. This playbook provides a structured audit framework that checks access control, reentrancy, integer overflow, MEV exposure, and delivers go/no-go recommendations.

Who it's for: blockchain developers wanting continuous security feedback during smart contract development, DeFi teams building internal audit processes between expensive external audits, security-focused Solidity engineers creating pre-audit checklists for their contracts, Web3 protocol teams evaluating third-party contract integrations for security risks, smart contract bootcamp students learning systematic vulnerability identification

Example

"Run a security audit on our DEX router contract" → Audit framework pipeline: systematic vulnerability checklist (reentrancy, access control, integer overflow, front-running), function-by-function security analysis with severity ratings, state variable mutation tracking across external calls, recommended fixes with code snippets, and executive summary with go/no-go deployment recommendation

CLAUDE.md Template

New here? 3-minute setup guide → | Already set up? Copy the template below.

Or install from your terminal:
npx ccplaybooks add smart-contract-auditor
SYSTEM
You are a senior smart contract auditor. You are strict, practical, and specific.

CONTEXT
Project: {{project}}
Chain: {{chain}}
Scope: {{scope}}
Threat model: {{threat_model}}
Risk tolerance: {{risk}}
Date: {{date}} (UTC {{time_utc}})

INPUT

Get new playbooks like this one

One email a week with new Claude Code workflows. Free, like everything here.

No spam. Unsubscribe anytime.

README.md

What This Does

Acts as a senior smart contract auditor. You provide contract code or diffs, and it produces an actionable audit report with categorized findings, an 8-point security checklist, and a go/no-go shipping recommendation.


Quick Start

Step 1: Download the Template

Click Download above to get the CLAUDE.md file.

Step 2: Provide Context

Fill in the template variables: project name, chain, scope, threat model, and risk tolerance.

Step 3: Run the Audit

claude

Say: "Audit this contract" and paste or reference your contract code.


What Gets Checked

Area Details
Access Control Role validation, modifier usage, unauthorized access vectors
Reentrancy CEI pattern, guards, external call safety
Arithmetic Overflow/underflow, precision loss, rounding
External Calls Return values, gas limits, untrusted contracts
Upgradability Upgrade mechanism, admin keys, timelocks
Oracles Price manipulation, stale data, fallbacks
MEV Frontrunning, slippage, ordering dependencies
ERC Compliance Standard adherence, interface completeness

Example Output

## Executive Risk Summary
- Overall risk: High
- Top 3 risks:
  - Unprotected admin function allows rug pull
  - Missing reentrancy guard on withdraw()
  - Oracle price can be manipulated via flash loan

## Findings
### Critical
- Title: Unprotected withdrawAll()
  - Impact: Admin can drain contract
  - Exploit scenario: Call withdrawAll() with owner key
  - Root cause: No timelock or multisig requirement
  - Fix: Add 48h timelock + multisig
  - Test to add: Verify timelock enforced on withdrawAll

## Go or No Go
- Recommendation: No Go
- Conditions to ship: Fix critical finding, add timelock

Tips

  • Scope matters: Narrow the scope to changed files for faster, more focused audits
  • Provide threat model: The more specific your threat model, the better the findings
  • Iterate: Run follow-up questions on specific findings for deeper analysis
  • Combine with tools: Feed in Slither or Mythril output for cross-validation

Commands

"Audit this contract for security issues"
"Focus on access control and reentrancy"
"What are the top 3 exploit scenarios?"
"Give me the go/no-go recommendation"
"Check ERC-20 compliance"

$Related Playbooks

Developer Tools

React Native Video (v6 & v7)

Give correct react-native-video guidance by detecting the installed major version first — v6's imperative <Video> component and v7's completely different useVideoPlayer/VideoView player-object model share a name but no API, and mixing them up is the single most common mistake when helping with this library.

5 minutes
Intermediate
Developer Tools

React Three Fiber Animation Reference

Animate React Three Fiber scenes correctly — useFrame fundamentals with render priority, full GLTF animation control via useAnimations (playback, crossfade, event listeners, speed-based blending between Idle/Walk/Run), @react-spring/three physics animations with gesture and chain integration, and the five performance rules that keep per-frame updates from triggering React re-renders.

10 minutes
Intermediate
Developer Tools

Three.js Scroll World Builder

Build a scroll-controlled real-time Three.js experience as one persistent 3D world instead of stacked sections — a scene-ledger data model for authoring chapters, native-scroll-to-deterministic-state mapping with separate exact and smoothed progress, cinematic camera composition, a measurable per-device performance budget, and mandatory reduced-motion and WebGL-failure fallbacks.

20 minutes
Advanced
Developer Tools

Visual Explainer HTML Pages

Have Claude Code explain architectures, diffs and plans as self-contained HTML pages with labeled Mermaid diagrams and a deliberate design pass, instead of walls of chat text, terminal ASCII or generic AI-looking pages.

5 minutes
Intermediate
Developer Tools

Web Animation Design Principles

Design web animations that feel natural and purposeful — a decision-first easing blueprint (ease-out for entrances, ease-in-out for movement, ease for hover), duration and frequency rules, spring configuration, the GPU-only performance rule, and mandatory prefers-reduced-motion accessibility patterns with working CSS and Framer Motion code.

5 minutes
Intermediate
Developer Tools

Web Technique to Skill Extractor

Turn a one-off web visual or interaction technique into a reusable, well-scoped skill — the one-sentence mechanism test that separates a real technique from mere styling, a mechanism-vs-staging sort for what belongs in the skill versus the demo, rules anchored to named failures instead of adjectives, and a demo craft bar that treats the acceptance reference as a target, not inspiration.

10 minutes
Advanced
Developer Tools

Tool Interface Design for Agents

Design agent-facing tools as contracts an agent must infer entirely from the description alone — the consolidation principle over narrow overlapping tools, architectural reduction toward primitives, actionable error-recovery messages, and an 8-point audit checklist.

10 minutes
Advanced
Developer Tools

Ralph Wiggum Autonomous Loop

Self-referential development loop that keeps Claude iterating on the same task until it hits a completion promise or an iteration cap — a Stop hook that blocks exit and re-feeds the same prompt.

5 minutes
Advanced
Developer Tools

Vercel Analytics & Speed Insights Setup

Wire up Vercel Analytics, Speed Insights, and SPA routing rewrites into a React/Vite project in one pass — including the routing fix most people miss.

5 minutes
Beginner
Developer Tools

Unslop UI Skill for Claude: Kill the AI Design Tells

A frontend guardrail built from a 3.2M-post Reddit analysis of what people actually call AI slop, with a build mode that forces design decisions up front and an audit mode that scans existing code for the tells

10 minutes
Intermediate
Developer Tools

Prompt Optimizer (EARS)

Transform vague prompts into precise, well-structured specifications using EARS (Easy Approach to Requirements Syntax) — ideal for AI-generated code, products, and docs.

10 minutes
Intermediate
Developer Tools

Promptfoo Evaluation

Configure and run LLM evaluations with Promptfoo — build promptfooconfig.yaml, write Python custom assertions, implement llm-rubric judges, and compare models systematically.

15 minutes
Intermediate

Browse all Developer Tools playbooks →