Threat Model Skill — Security skill for Claude Code
Claude Code skill: write the project's security constitution (assets, roles, trust boundaries, invariants, entry points) before scanning; triage findings by Source→Control→Sink; fix at the boundary wi.
How to install Threat Model Skill
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open fishbob889/threat-model-skill and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Threat Model Skill does
Claude Code skill: write the project's security constitution (assets, roles, trust boundaries, invariants, entry points) before scanning; triage findings by Source→Control→Sink; fix at the boundary with a regression test.
Alternatives in Security
- Security Threat Model — Generate repo-specific threat models identifying trust boundaries 14.6k ★
- Sanyuan Skills — Expert code review skill: SOLID, security, performance, error handling, boundary conditions 2.7k ★
- Maestro Odyssey — Long-running iterative cycle — one entry, seven modes (debug improve planex review security defensive ui) 530 ★
README
threat-model — a Claude Code skill: write the constitution before you run the scanner
[繁體中文說明 → README.zh-TW.md](README.zh-TW.md)
A security scanner without a threat model reports everything and nothing. This skill makes Claude Code first write down what must **never** happen in your project, then scan against that list, triage every finding by *Source → Control → Sink*, and fix at the boundary with a regression test that fails on the unmodified code.
It is the "five questions" method from OpenAI's Codex Security plugin and defuse's invariant-centric threat modeling, made tool-agnostic and packaged for Claude Code.
What it does
| Phase | What Claude does | What you get |
|---|---|---|
| A · Constitution | Answers the five questions from the code (assets, roles × data, trust boundaries, invariants, entry points) and asks you only what code cannot tell | docs/security/THREAT_MODEL.md with numbered invariants, each with an enforcement level (L1 documented / L3 tested / L5 runtime-blocked) and a way to verify it |
| B · Scan, two layers | Deterministic tools first (gitleaks, pip-audit, bandit, npm audit; each one either RAN or is reported SKIPPED), then a semantic pass driven by the invariants: "show me a request that violates INV-3" | Raw outputs in a scratch dir; candidates, not verdicts |
| C · Triage | Every candidate gets source / control (missing, bypassed, mis-scoped, incomplete) / sink / the invariant it violates / an executed reproducer / a mechanical severity | docs/security/findings.md, a ledger with stable IDs and states; anything with no invariant is routed to its owner instead of buried |
| D · Fix | Fix at the boundary, write a test that fails before and passes after, run both ways, promote the invariant's level, record proof gaps honestly | Commits that carry the test and the updated model together |
Design points that matter in practice:
- The roles matrix is a test, not a table. The skill has Claude walk the framewor
Related Skills
Audit Deadcode
Comprehensive dead code audit — finds all unused files, functions, classes, and variables by walking the call
Global Audit
Whole-service audit via a parallel fan-out of 11 independent domain LENSES (layers, security/IDOR, state-sync,
Resilience Audit
Reliability / failure-mode audit — why distributed and async systems fall over: single points of failure, miss
Edge Cases
Act as a rigorous senior Perl SDET. Write a comprehensive set of destructive, pathological, boundary-condition
Client Security Review
Review browser, SPA, Electron, and mobile trust boundaries: DOM, origins, IPC, navigation, storage, and server
Game Localization
Engine-agnostic game localization pipeline for AI agents: detect engine -> extract text -> translate with cont
Related Agents
Architecture Compliance Reviewer
Read-only reviewer for PR diffs against ARCHITECTURE.md entries. Mechanically checks PAT-xxx pattern complianc
Recon
Maps a repository's attack surface — structure, entry points, dependencies, trust boundaries. Use this first o
Data Flow Analyzer
Analyzes data flow from source to vulnerability sink, mapping trust boundaries, API contracts, environment pro