skills/audit-context-building/SKILL.md
Systematically build comprehensive understanding of a protocol before code-level analysis. Use when starting a new audit engagement, mapping trust boundaries and external dependencies, or when needing to identify all privileged roles and protocol invariants before manual review.
npx skillsauth add 0x-shashi/web3-audit-skills skills/audit-context-buildingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
4 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Systematically build comprehensive understanding of a protocol before diving into code-level analysis. Rushing into code without context leads to missed vulnerabilities, wasted time, and incomplete coverage.
| Without Context | With Context | |-----------------|-------------| | Miss cross-contract interactions | Map all trust boundaries before reading code | | Spend time on low-risk functions | Prioritize functions handling value | | Overlook admin-only backdoors | Know every privileged role and its power | | Miss assumptions about external protocols | Document all external dependencies upfront | | Can't identify broken invariants | Invariants identified before code review |
For a typical DeFi protocol audit:
| Phase | Time % | Activity | |-------|--------|----------| | Context building | 15-20% | Architecture mapping, docs review, invariants | | Function-level analysis | 40-50% | Line-by-line code review with context | | Cross-cutting concerns | 20-25% | Reentrancy, access control, value flows | | Reporting | 10-15% | Writing findings, severity classification |
| Trigger | Action | |---------|--------| | Starting a new audit | Full pre-audit context workflow | | Reviewing unfamiliar protocol type | Architecture analysis first | | Auditing upgradeable contracts | Storage layout + proxy analysis | | Multi-contract system | Contract interaction mapping | | Post-deployment review | Focus on live state + deployed config |
development
Systematically hunt for every variant of a discovered vulnerability across the entire codebase. Use when a bug is found and all instances of the same root cause pattern must be identified, or when performing variant analysis during competitive audits on Code4rena or Sherlock.
testing
Use when the user wants to audit TON smart contracts for security vulnerabilities, scan FunC or Tact contracts for message chain replay, bounce handling, or gas issues, review TON DeFi protocols for actor-model concurrency flaws, or analyze asynchronous message passing security.
tools
Analyze ERC20/ERC721/ERC1155 token implementations for non-standard behavior, fee-on-transfer mechanics, rebasing logic, blacklists, pausability, and integration risks. Use when reviewing protocols that interact with external tokens or implementing token-related features.
testing
Use when the user wants to audit Sui Move smart contracts, scan Sui-specific patterns including object ownership, shared objects, or dynamic fields, review Sui DeFi protocols for object model security issues, or analyze Sui-specific transaction and consensus patterns.