Audit context building

From 0x-Shashi/WEB3-AUDIT-SKILLS · View interactive version

Audit context building is an AI agent skill from the GitHub repository 0x-Shashi/WEB3-AUDIT-SKILLS. 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.

How to use this skill

Skill file

Audit Context Building Skill

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.


Why Context Building Matters

| 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 |

Time Allocation

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 |


Capabilities

Architecture Mapping

Function-Level Analysis

Protocol Understanding

Risk Surface Identification


When to Use

| 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 |


Workflows

Resources

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.