# audit-context-building

Maps assumptions, guarantees, and call chains in unfamiliar source code before vulnerability hunting starts. Useful for audits and threat modeling.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 6800 installs · ★ 7805
- Author: trailofbits
- License: CC-BY-SA-4.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/trailofbits/skills/tree/HEAD/plugins/audit-context-building/skills/audit-context-building/SKILL.md
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/skills/audit-context-building

## What it does

This skill maps how functions behave before anyone starts hunting for bugs. It does not rate vulnerabilities, write exploit code, or suggest patches. Instead, it tracks what every routine assumes to be true, what guarantees it provides, and which outside functions it calls. When an assumption lacks any enforcement in the code, the record tags it as `nothing found`.

Context windows fill up fast. Because of that, the skill runs analysis through subagents rather than keeping entire call trees in the main chat. Running `/audit-context-building:audit-context <path>` inspects each function independently, saving structured notes to `audit-context/functions/` and a summary to `audit-context/DOSSIER.md`. For a single target, it routes work to `audit-context-building:function-analyzer`.

Running this on code you already know wastes tokens. It works best on fresh targets where the team needs an honest list of unverified assumptions before running security passes.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add trailofbits/skills --skill audit-context-building -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/audit-context-building/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/audit-context-building/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add trailofbits/skills --skill audit-context-building -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/audit-context-building/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add trailofbits/skills --skill audit-context-building -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/audit-context-building/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install trailofbits/skills audit-context-building
```

2. **Manually: put the files in place**
- File: `.github/skills/audit-context-building/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add trailofbits/skills --skill audit-context-building -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/trailofbits/skills --path plugins/audit-context-building/skills/audit-context-building
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/audit-context-building/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add trailofbits/skills --skill audit-context-building -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/trailofbits/skills/tree/HEAD/plugins/audit-context-building/skills/audit-context-building/SKILL.md

## When to use it
- map function assumptions and invariants before vulnerability hunting
- spot unchecked premises marked with nothing found
- generate architectural dossiers for unfamiliar codebases
- document unresolved call interactions and open questions

## Example prompts
- /audit-context-building:audit-context ./src
- Analyze this function with audit-context-building:function-analyzer
- /audit-context-building:audit-context contracts/

## Similar
- [git-guardrails-claude-code](https://affpapa.org/en/nevibecode/skills/git-guardrails-claude-code.md) — skill · 499069 installs
- [ponytail-review](https://affpapa.org/en/nevibecode/skills/ponytail-review.md) — skill · 57000 installs
- [ponytail-audit](https://affpapa.org/en/nevibecode/skills/ponytail-audit.md) — skill · 45400 installs
- [security-audit](https://affpapa.org/en/nevibecode/skills/cloudflare-security-audit.md) — skill · 54800 installs
- [security-and-hardening](https://affpapa.org/en/nevibecode/skills/security-and-hardening.md) — skill · 70200 installs
- [supabase](https://affpapa.org/en/nevibecode/skills/supabase.md) — skill · 8 installs

From the same set: [trailofbits/skills](https://affpapa.org/en/nevibecode/by/trailofbits/skills.md) — 77 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
