# Pre audit threat model

> Pre audit threat model is an open-source agent skill for security. Builds a pre-audit threat model for a Solidity protocol before any scanner runs. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/mtarcure/claude-vibe-squad/tree/main/.agents/skills/pre-audit-threat-model
- **Repository:** https://github.com/mtarcure/claude-vibe-squad
- **GitHub stars:** 227
- **License:** MIT
- **Skill name:** pre-audit-threat-model
- **Collection:** https://github.com/mtarcure/claude-vibe-squad
- **Categories:** [security](https://ai-powered.com/categories/security)
- **Listing updated:** 2026-12-02

## About

This skill performs an audit-readiness pass over a Solidity codebase before other audit tooling is used. It counts source files, nSLOC, test files and fuzz or invariant configs, attempts coverage in the background without treating tool failures as blockers, and runs a git history scan for fix-commit candidates, late changes and tech-debt markers.

The workflow reads each in-scope contract and classifies every externally callable state-changing function as permissionless, role-gated or admin-only, using a grep gate to find function signatures including multi-line ones. It also maps privileged roles, pause coverage and value flows, and pulls stated invariants and trust assumptions from spec or whitepaper docs, tagging them as spec-derived while marking unstated ones as auditor-derived.

Outputs are written to an x-ray folder: a JSON architecture file, a markdown report covering actors, trust boundaries, invariants and attack surfaces, and an entry-point list. The skill expects a Solidity project with Foundry or Hardhat layout and a git checkout; it recommends the agent use the project's existing toolchain rather than fetching remote tools.

## When your agent uses it

> Use as the first pass on a new Solidity engagement, before any scanner runs, building an audit-readiness x-ray that enumerates permissionless entry points, maps every actor and privileged role, and extracts the protocol's stated invariants so downstream passes have a target list. Reach for it when asked to x-ray, prep, or find where to start on a protocol.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/mtarcure/claude-vibe-squad/tree/HEAD/.agents/skills/pre-audit-threat-model)
- [License: MIT](https://github.com/mtarcure/claude-vibe-squad/tree/HEAD/.agents/skills/pre-audit-threat-model)

## Features

- **Permissionless entry point mapping:** Lists externally callable state-changing functions and classifies each by access level using a grep-verified scan.
- **Actor and role mapping:** Identifies privileged roles and the operational actions and fund-moving powers each one holds.
- **Invariant extraction:** Collects stated protocol invariants and trust assumptions from specs, marking code-verified and auditor-derived claims apart.
- **Test presence measurement:** Counts test, fuzz, invariant and formal verification configs and attempts coverage without making it a gate.
- **Git history scan:** Flags fix-like commits, late-stage changes, forked dependencies and test co-change rates.
- **Structured x-ray outputs:** Writes an architecture JSON, a threat model report and an entry-point document for downstream audit passes.

## Good for

- Prepare a new Solidity protocol for a security audit
- Find which public functions can be called by anyone
- Map the privileged roles and what each can do to user funds
- Extract the protocol's stated invariants as an audit checklist
- Summarize a DeFi codebase before deeper review

## Install

### Claude Code

Copy the skill folder to `~/.claude/skills/pre-audit-threat-model` to use it in all your projects:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/pre-audit-threat-model &&
cp -R "$tmp/.agents/skills/pre-audit-threat-model" ~/.claude/skills/pre-audit-threat-model &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/pre-audit-threat-model` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/pre-audit-threat-model` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/pre-audit-threat-model &&
cp -R "$tmp/.agents/skills/pre-audit-threat-model" ~/.agents/skills/pre-audit-threat-model &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/pre-audit-threat-model` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/pre-audit-threat-model` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/pre-audit-threat-model &&
cp -R "$tmp/.agents/skills/pre-audit-threat-model" ~/.cursor/skills/pre-audit-threat-model &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/pre-audit-threat-model` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/mtarcure/claude-vibe-squad.git --path .agents/skills/pre-audit-threat-model
```

Or copy the folder to `~/.gemini/skills/pre-audit-threat-model` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/pre-audit-threat-model`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/pre-audit-threat-model &&
cp -R "$tmp/.agents/skills/pre-audit-threat-model" ~/.copilot/skills/pre-audit-threat-model &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/pre-audit-threat-model` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git
```

Then copy `claude-vibe-squad/.agents/skills/pre-audit-threat-model` into your agent's skills folder as `pre-audit-threat-model`. Agents that support SKILL.md read one folder per skill.

## FAQ

### When does Pre audit threat model trigger?

It is meant as the first pass on a new Solidity engagement and is triggered when asked to x-ray, prep, audit-readiness check, or find where to start on a protocol.

### Does Pre audit threat model run security scanners?

No. It builds the threat model before any scanner runs, though it may run coverage and a git history scan.

### What does Pre audit threat model need to run?

A Solidity project, read from foundry.toml or hardhat config, and a git repository. Coverage uses forge or an already-installed Hardhat.

### What files does Pre audit threat model produce?

It writes architecture.json, x-ray.md and entry-points.md into an x-ray folder.

### How do I install Pre audit threat model in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/pre-audit-threat-model to use it in all your projects, or to .claude/skills/pre-audit-threat-model in one project.

### Does Pre audit threat model run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Pre audit threat model?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Pre audit threat model?

The closest alternatives to Pre audit threat model are Audit prep assistant, Evm audit flow, Security audit, Signature validation audit and Defi amm security.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Audit prep assistant](https://ai-powered.com/skills/audit-prep-assistant): Audit prep assistant is an open-source agent skill for security.
- [Evm audit flow](https://ai-powered.com/skills/evm-audit-flow): Evm audit flow is an open-source agent skill for security.
- [Security audit](https://ai-powered.com/skills/security-audit): Security audit is an open-source agent skill for security.
- [Signature validation audit](https://ai-powered.com/skills/signature-validation-audit): Signature validation audit is an open-source agent skill for security.
- [Defi amm security](https://ai-powered.com/skills/defi-amm-security): Defi amm security is an open-source agent skill for security.
- [Audit context building](https://ai-powered.com/skills/audit-context-building): Audit context building is an open-source agent skill for security.
- [Audit integrity](https://ai-powered.com/skills/audit-integrity): Audit integrity is an open-source agent skill for security.
- [Multi stance audit fanout](https://ai-powered.com/skills/multi-stance-audit-fanout): Multi stance audit fanout is an open-source agent skill for security.

---
Source: https://ai-powered.com/skills/pre-audit-threat-model
