Agent Skillstrailofbits/skills › audit-context-building

audit-context-building

GitHub

在审计或架构审查前构建代码上下文,分析函数假设、保证及依赖关系。用于熟悉代码库时梳理系统结构,识别未验证的假设和开放问题,为后续漏洞挖掘提供基础。

plugins/audit-context-building/skills/audit-context-building/SKILL.md trailofbits/skills

Trigger Scenarios

开始代码审计 进行威胁建模 执行架构审查 对不熟悉代码库进行分析

Install

npx skills add trailofbits/skills --skill audit-context-building -g -y
More Options

Non-standard path

npx skills add https://github.com/trailofbits/skills/tree/main/plugins/audit-context-building/skills/audit-context-building -g -y

Use without installing

npx skills use trailofbits/skills@audit-context-building

指定 Agent (Claude Code)

npx skills add trailofbits/skills --skill audit-context-building -a claude-code -g -y

安装 repo 全部 skill

npx skills add trailofbits/skills --all -g -y

预览 repo 内 skill

npx skills add trailofbits/skills --list

SKILL.md

Frontmatter
{
    "name": "audit-context-building",
    "description": "Understand a codebase before looking for bugs in it - what each function assumes, what it guarantees, and what it depends on elsewhere. Use when starting an audit, threat model, or architecture review on unfamiliar code, and before any vulnerability-hunting pass.",
    "allowed-tools": "Task Read Grep Glob"
}

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 defines it, and 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 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.

Version History

  • 9b28133 Current 2026-08-20 09:16

Same Skill Collection

plugins/building-secure-contracts/skills/algorand-vulnerability-scanner/SKILL.md
plugins/building-secure-contracts/skills/cairo-vulnerability-scanner/SKILL.md
plugins/building-secure-contracts/skills/cosmos-vulnerability-scanner/SKILL.md
plugins/building-secure-contracts/skills/solana-vulnerability-scanner/SKILL.md
plugins/building-secure-contracts/skills/substrate-vulnerability-scanner/SKILL.md
plugins/building-secure-contracts/skills/ton-vulnerability-scanner/SKILL.md
plugins/burpsuite-project-parser/skills/burpsuite-project-parser/SKILL.md
plugins/c-review/skills/c-review/SKILL.md
plugins/claude-in-chrome-troubleshooting/skills/chrome-mcp-troubleshooting/SKILL.md
plugins/constant-time-analysis/skills/constant-time-analysis/SKILL.md
plugins/culture-index/skills/interpreting-culture-index/SKILL.md
plugins/devcontainer-setup/skills/devcontainer-setup/SKILL.md
plugins/differential-review/skills/differential-review/SKILL.md
plugins/dimensional-analysis/skills/dimensional-analysis/SKILL.md
plugins/dwarf-expert/skills/dwarf-expert/SKILL.md
plugins/firebase-apk-scanner/skills/firebase-apk-scanner/SKILL.md
plugins/fp-check/skills/fp-check/SKILL.md
plugins/gh-cli/skills/gh-cli/SKILL.md
plugins/git-cleanup/skills/git-cleanup/SKILL.md
plugins/goal-prompt/skills/goal-prompt/SKILL.md
plugins/let-fate-decide/skills/let-fate-decide/SKILL.md
plugins/modern-cpp/skills/modern-cpp/SKILL.md
plugins/modern-python/skills/modern-python/SKILL.md
plugins/mutation-testing/skills/mutation-testing/SKILL.md
plugins/open-sourcing/skills/open-sourcing/SKILL.md
plugins/rust-review/skills/rust-review/SKILL.md
plugins/second-opinion/skills/second-opinion/SKILL.md
plugins/semgrep-rule-creator/skills/semgrep-rule-creator/SKILL.md
plugins/semgrep-rule-variant-creator/skills/semgrep-rule-variant-creator/SKILL.md
plugins/sharp-edges/skills/sharp-edges/SKILL.md
plugins/skill-improver/skills/skill-improver/SKILL.md
plugins/spec-to-code-compliance/skills/spec-to-code-compliance/SKILL.md
plugins/static-analysis/skills/sarif-parsing/SKILL.md
plugins/supply-chain-risk-auditor/skills/supply-chain-risk-auditor/SKILL.md
plugins/testing-handbook-skills/skills/address-sanitizer/SKILL.md
plugins/testing-handbook-skills/skills/aflpp/SKILL.md
plugins/testing-handbook-skills/skills/atheris/SKILL.md
plugins/testing-handbook-skills/skills/cargo-fuzz/SKILL.md
plugins/testing-handbook-skills/skills/coverage-analysis/SKILL.md
plugins/testing-handbook-skills/skills/fuzzing-dictionary/SKILL.md
plugins/testing-handbook-skills/skills/fuzzing-obstacles/SKILL.md
plugins/testing-handbook-skills/skills/harness-writing/SKILL.md
plugins/testing-handbook-skills/skills/libafl/SKILL.md
plugins/testing-handbook-skills/skills/libfuzzer/SKILL.md
plugins/testing-handbook-skills/skills/ossfuzz/SKILL.md
plugins/testing-handbook-skills/skills/ruzzy/SKILL.md
plugins/testing-handbook-skills/skills/testing-handbook-generator/SKILL.md
plugins/testing-handbook-skills/skills/wycheproof/SKILL.md
plugins/trailmark/skills/crypto-protocol-diagram/SKILL.md

Metadata

Files
0
Version
7dee682
Hash
222efa73
Indexed
2026-08-20 09:16

ホーム - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-30 06:28
浙ICP备14020137号-1 $お客様$