Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Analyze a codebase and produce a structured threat model at .turbo/threat-model.md covering assets, trust boundaries, attack surfaces with existing mitigations, attacker stories, and calibrated severity. Use when the user asks to "create a threat model", "threat model", "threat model this codebase", "security analysis", "analyze the attack surface", "what are the threats", or "identify security risks".
.claude/skills/tobihagemann-create-threat-model/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-14 | ✗→✓ | ▲ Improved | 37% | 0% |
| case-15 | ✗→✓ | ▲ Improved | 38% | 0% |
| case-12 | ✓→✗ | ▼ Worse | -24% | 0% |
| case-17 | ✓→✗ | ▼ Worse | 58% | 0% |
| case-20 | ✓→✗ | ▼ Worse | 20% | 0% |
Analyze the current codebase and produce a structured threat model at .turbo/threat-model.md.
The threat model describes the current state of the codebase: what it protects, where trust boundaries are, how it can be attacked, what defenses exist, and how severe each risk is. It is descriptive, not prescriptive. Do not include remediation recommendations.
Optional: $ARGUMENTS may specify scope (directories, modules, or focus areas). When scope is provided, limit reconnaissance and code discovery to the specified directories or modules. Still produce all four sections, but title the overview to reflect the narrowed scope and note what is excluded.
Build a mental model of the system before analyzing threats.
SECURITY.md, audit reports, threat models, or changelog entries mentioning CVEs.Search the codebase for code that handles security-sensitive operations. Do not read every file. Use targeted searches.
Categories to search for:
For each flow found, note the relevant files and trace data from input to processing to output.
Read references/analysis-guide.md for detailed guidance by application type and platform.
Write to .turbo/threat-model.md (create .turbo/ if needed). The document has exactly four sections. Adapt depth to the codebase: a small CLI tool needs less detail than a multi-component crypto system.
Write 1-2 paragraphs covering:
For codebases with unique security properties (zero-knowledge design, client-side crypto, opportunistic encryption), call them out explicitly.
Assets: What has value to an attacker. Be specific: name data types, key material, tokens, metadata. Group naturally (user data, secrets, integrity artifacts).
Trust boundaries: Where trust levels change. Each boundary gets a bold name, a colon, 1-2 sentences explaining what crosses it, and a parenthetical code reference. Typical boundaries: untrusted storage/network, local OS/filesystem, IPC, admin configuration, identity provider, database.
Inputs by control tier:
Assumptions: Explicit statements about what must be true for the security model to hold. Include environmental assumptions (OS isolation, entropy sources), dependency assumptions (crypto library correctness), and operational assumptions (caller protects passwords). 2-4 bullets.
Organize into subsections by attack surface area (not by STRIDE category or component). Each subsection follows this structure:
### [3.N] [Surface Name]
**Surface**: What is exposed and where (1-2 sentences with file references).
**Entry points and sinks**
- `path:line` (untrusted input) → `path:line` (dangerous operation): what enters and what it reaches. When a surface has no code-level entry point, or nothing dangerous behind it, say so here.
**Hot files**
- `path` (1-3 files whose logic concentrates this surface, beyond the lines cited above)
**Mitigations**
- What the code already does to defend this surface (observations, not recommendations).
**Attacker stories**
- Concrete scenario: "[Attacker type] does [action] to [goal]: [consequence and severity context]."Decomposition heuristic: One surface per distinct trust boundary crossing or distinct attacker capability. If two areas share the same entry points AND mitigations, merge them. If a single surface needs more than 3-4 unrelated risk/mitigation pairs, split it. Typical range: 4-9 surfaces.
For each surface, document:
path:line, plus the Hot files a reviewer must read end-to-end. When a surface has no code-level entry point or nothing dangerous behind it, say so rather than listing an empty fieldEnd section 3 with: A brief note on vulnerability classes that are less relevant for this application type, explaining why (e.g., "Web-specific issues like XSS and CSRF do not apply because this is a local library without network endpoints").
Group findings into four tiers. Each tier has 2-4 items, each a single sentence describing the impact (not the attack vector).
Close with a calibration paragraph explaining how the application's deployment model and trust boundaries influence severity. For the attacker-position-vs-impact matrix and application-type adjustments, consult references/analysis-guide.md.
Before presenting the output, validate:
path:line in that surface's entry points or sinks.Fix any gaps, then present the threat model to the user.
## for the four top-level sections (numbered 1-4), ### for attack surface subsections, and **bold** for sub-headings within subsections.| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-16 | pass→pass | 17,572 | 15,176 | -14% | 1 | 1 | 0% | 2,646 | 4,234 | +60% | 0 | 0 | — |
case-01 | pass→pass | 23,782 | 30,002 | +26% | 1 | 1 | 0% | 2,775 | 5,890 | +112% | 0 | 0 | — |
case-02 | fail→fail | 6,069 | 5,862 | -3% | 1 | 1 | 0% | 300 | 2,648 | +783% | 0 | 0 | — |
case-03 | fail→fail | 3,693 | 3,506 | -5% | 1 | 1 | 0% | 238 | 2,290 | +862% | 0 | 0 | — |
case-04 | fail→fail | 26,429 | 7,354 | -72% | 1 | 1 | 0% | 3,817 | 2,458 | -36% | 0 | 0 | — |
case-05 | fail→fail | 12,875 | 3,340 | -74% | 1 | 1 | 0% | 2,121 | 2,294 | +8% | 0 | 0 | — |
case-06 | fail→fail | 17,862 | 4,202 | -76% | 1 | 1 | 0% | 2,922 | 2,265 | -22% | 0 | 0 | — |
case-07 | fail→fail | 20,833 | 4,159 | -80% | 1 | 1 | 0% | 3,752 | 2,243 | -40% | 0 | 0 | — |
case-08 | fail→fail | 15,140 | 3,927 | -74% | 1 | 1 | 0% | 2,537 | 2,332 | -8% | 0 | 0 | — |
case-09 | pass→pass | 15,340 | 18,968 | +24% | 1 | 1 | 0% | 2,433 | 4,077 | +68% | 0 | 0 | — |
case-10 | pass→pass | 10,904 | 3,916 | -64% | 1 | 1 | 0% | 1,702 | 2,686 | +58% | 0 | 0 | — |
case-11 | pass→pass | 13,318 | 5,320 | -60% | 1 | 1 | 0% | 2,075 | 2,840 | +37% | 0 | 0 | — |
case-12 | pass→fail | 19,033 | 4,612 | -76% | 1 | 1 | 0% | 3,024 | 2,297 | -24% | 0 | 0 | — |
case-13 | pass→pass | 14,729 | 13,054 | -11% | 1 | 1 | 0% | 2,212 | 2,772 | +25% | 0 | 0 | — |
case-14 | fail→pass | 11,688 | 5,213 | -55% | 1 | 1 | 0% | 1,837 | 2,517 | +37% | 0 | 0 | — |
case-15 | fail→pass | 15,633 | 17,103 | +9% | 1 | 1 | 0% | 2,580 | 3,573 | +38% | 0 | 0 | — |
case-17 | pass→fail | 10,587 | 3,549 | -66% | 1 | 1 | 0% | 1,623 | 2,561 | +58% | 0 | 0 | — |
case-18 | fail→fail | 10,449 | 3,743 | -64% | 1 | 1 | 0% | 1,721 | 2,302 | +34% | 0 | 0 | — |
case-19 | fail→fail | 9,103 | 2,389 | -74% | 1 | 1 | 0% | 1,394 | 2,400 | +72% | 0 | 0 | — |
case-20 | pass→fail | 11,681 | 6,332 | -46% | 1 | 1 | 0% | 2,284 | 2,735 | +20% | 0 | 0 | — |
case-21 | pass→fail | 14,276 | 5,869 | -59% | 1 | 1 | 0% | 2,500 | 2,400 | -4% | 0 | 0 | — |
case-22 | pass→fail | 11,674 | 12,417 | +6% | 1 | 1 | 0% | 1,872 | 3,056 | +63% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 10 counted toward the lift figure. The other 12 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of -14 percentage points is the difference between those two pass rates over the 10 comparable cases. 5 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.