Skip to main content
ClaudeWave
Skill7k repo starsupdated yesterday

audit-context-building

The audit-context-building skill enables Claude to perform methodical, line-by-line code analysis that constructs detailed architectural understanding before vulnerability identification. Use this skill when preparing for security audits, architecture reviews, or threat modeling where deep comprehension of code structure, assumptions, and data flows is essential to prevent misinterpretations and context loss during later analysis phases.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/trailofbits/skills /tmp/audit-context-building && cp -r /tmp/audit-context-building/plugins/audit-context-building/skills/audit-context-building ~/.claude/skills/audit-context-building
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# Audit Context Building

Build understanding, not verdicts. This runs before anyone hunts for bugs, and feeds that work.

## When to Use

At the start of an audit, a threat model, or an architecture review, when the code is unfamiliar. Also when
an earlier pass produced findings nobody could judge, because no one had mapped out how the system fits
together.

## When NOT to Use

Do not name vulnerabilities, suggest fixes, write proofs-of-concept, or rate severity. Those belong to the
hunting phase, which runs next and with the whole picture in hand. When the code counts on something and
nothing checks it, record that plainly and move on — whether it matters is decided later.

Not worth the tokens on code you already understand.

## Do not analyze in this context

The analysis is long, and this context needs to survive to use it. Dispatch it:

- **A codebase, or more than one function** — run `/audit-context-building:audit-context <path>`. It orients,
  analyzes each function in its own subagent, and writes `audit-context/DOSSIER.md` plus one file per
  function under `audit-context/functions/`. Only compact records return here.
- **A single function** — dispatch the `audit-context-building:function-analyzer` agent at it. It writes its
  prose to disk and returns a record.

Then work from what comes back: the index, the unenforced assumptions, the open questions. Read a function's
file when you need its detail.

The workflow is what enforces this, not this text: a subagent bound to a return schema cannot return prose.
Treat this section as routing, and route.

## What comes back, and how to read it

Each record lists what must always be true (with the line that shows it), what the function takes on faith
(with whatever establishes it), which functions it calls and what it needs from each, and anything still
unclear. The dossier adds the rules that span several functions, who can reach what, and where the
complicated parts cluster.

Two things matter more than the rest:

- **Assumptions marked `nothing found`.** The code counts on something being true and nothing anywhere makes
  it true. This is the most useful thing to hand the hunting phase.
- **The open questions.** An honest list of what is still unclear beats a confident answer that turns out to
  be wrong. Carry them forward instead of closing them out.

Where two records disagree, both are quoted rather than quietly reconciled. That is a fact about the code,
not a flaw in the analysis.

## The format

[ANALYSIS_FORMAT.md](resources/ANALYSIS_FORMAT.md) defines it, and
[FUNCTION_MICRO_ANALYSIS_EXAMPLE.md](resources/FUNCTION_MICRO_ANALYSIS_EXAMPLE.md) works through examples in
C and Solidity. Read them when extending this plugin or deciding whether a record can be trusted.

The format is the same whatever the target. What changes is what fills each slot, and what counts as a call
you cannot see inside. [DOMAIN_NOTES.md](resources/DOMAIN_NOTES.md) maps that across smart contracts, C and
C++, decompiled firmware, and web services — read it when the target is not plain source code.

**The rule that matters most: follow the calls.** Whether a function is correct usually depends on something
another function does, and you cannot see that from the caller alone. A limit looks enforced because the
value came back from a function whose name suggests it was checked. So read the function being called, follow
every path through it rather than only the one that succeeds, and say what makes each assumption true. When
nothing does, use those words: `nothing found`. Every claim cites a line, or becomes an open question.
agentic-actions-auditorSkill

Audits GitHub Actions workflows for security vulnerabilities in AI agent integrations including Claude Code Action, Gemini CLI, OpenAI Codex, and GitHub AI Inference. Detects attack vectors where attacker-controlled input reaches AI agents running in CI/CD pipelines, including env var intermediary patterns, direct expression injection, dangerous sandbox configurations, and wildcard user allowlists. Use when reviewing workflow files that invoke AI coding agents, auditing CI/CD pipeline security for prompt injection risks, or evaluating agentic action configurations.

ask-questions-if-underspecifiedSkill

Clarify requirements before implementing. Use when serious doubts arise.

algorand-vulnerability-scannerSkill

Scans Algorand smart contracts for 11 common vulnerabilities including rekeying attacks, unchecked transaction fees, missing field validations, and access control issues. Use when auditing Algorand projects (TEAL/PyTeal).

audit-prep-assistantSkill

Prepares codebases for security review using Trail of Bits' checklist. Helps set review goals, runs static analysis tools, increases test coverage, removes dead code, ensures accessibility, and generates documentation (flowcharts, user stories, inline comments). Use when preparing your own codebase to be audited by someone else, getting a repository review-ready before an external security review, deciding what to fix before auditors start, or asking what assessors need from a project. For understanding unfamiliar code you are about to audit, use audit-context-building instead.

cairo-vulnerability-scannerSkill

Scans Cairo/StarkNet smart contracts for 6 critical vulnerabilities including felt252 arithmetic overflow, L1-L2 messaging issues, address conversion problems, and signature replay. Use when auditing StarkNet projects.

code-maturity-assessorSkill

Systematic code maturity assessment using Trail of Bits' 9-category framework. Analyzes codebase for arithmetic safety, auditing practices, access controls, complexity, decentralization, documentation, MEV risks, low-level code, and testing, then produces a scorecard with evidence-based ratings and a priority-ordered roadmap. Use when assessing or scoring the maturity of a smart contract or blockchain codebase, producing a maturity scorecard or evaluation, or judging how mature, well-tested, or well-documented such a project is against a rubric.

cosmos-vulnerability-scannerSkill

Scans Cosmos SDK blockchain modules and CosmWasm contracts for consensus-critical vulnerabilities — chain halts, fund loss, state divergence. 25 core + 16 IBC + 10 EVM + 3 CosmWasm patterns. Use when auditing custom x/ modules, reviewing IBC integrations, or assessing pre-launch chain security. Updated for SDK v0.53.x.

guidelines-advisorSkill

Smart contract development advisor based on Trail of Bits' best practices. Analyzes codebase to generate documentation/specifications, review architecture, check upgradeability patterns, assess implementation quality, identify pitfalls, review dependencies, and evaluate testing. Use when asking whether a smart contract project follows development best practices, reviewing on-chain/off-chain split, upgradeability, or delegatecall proxy patterns against guidelines, or seeking recommendations on contract design, inheritance, events, documentation, dependencies, or test strategy.