skills/security-threat-model/SKILL.md
Repository-grounded threat modeling that enumerates trust boundaries, assets, attacker capabilities, abuse paths, and mitigations, and writes a concise Markdown threat model. Trigger only when the user explicitly asks to threat model a codebase or path, enumerate threats/abuse paths, or perform AppSec threat modeling. Do not trigger for general architecture summaries, code review, or non-security design work.
npx skillsauth add euxx/claude-skills-for-copilot security-threat-modelInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Deliver an actionable AppSec-grade threat model specific to the repository or a project path. Anchor every architectural claim to evidence in the repo; keep assumptions explicit. Prioritize realistic attacker goals and concrete impacts over generic checklists.
Ask the user (or infer and mark as assumptions):
If the user provided a path argument, scope the model to that sub-path.
Use file search, grep -rI (skip binaries), or ripgrep rg (skips binaries by
default) to locate security-relevant surfaces:
evalFor each threat assign:
Risk priority guidance (illustrative):
Before producing the final report:
Produce valid Markdown following the required output format below. Write it to a
file named <repo-or-dir-name>-threat-model.md (use the basename of the repo
root, or the in-scope directory if asked to model a sub-path). Then summarize
the top findings to the user.
Run a quality check before writing:
Use flowchart TD or flowchart LR only. Rules:
--> arrows; edge labels limited to plain words via -->|label|.A["Label"]); avoid A(Label) shape syntax.title lines or style directives.mermaid block.## Executive summary
One paragraph: top risk themes and highest-risk areas.
## Scope and assumptions
In-scope paths, out-of-scope items, explicit assumptions, open questions.
## System model
### Primary components
### Data flows and trust boundaries
Arrow-style bullets (e.g., Internet → API Server). For each boundary: data
types, channel/protocol, security guarantees, input validation.
#### Diagram
<mermaid flowchart>
## Assets and security objectives
Table: Asset | Why it matters | Security objective (C/I/A)
## Attacker model
### Capabilities
### Non-capabilities
## Entry points and attack surfaces
Table: Surface | How reached | Trust boundary | Notes | Evidence (repo path/symbol)
## Top abuse paths
5–10 numbered multi-step sequences: attacker goal → steps → impact.
## Threat model table
Columns: Threat ID | Threat source | Prerequisites | Threat action | Impact |
Impacted assets | Existing controls (evidence) | Gaps | Recommended mitigations |
Detection ideas | Likelihood | Impact severity | Priority
Rules: Threat IDs as TM-001, TM-002, …; Priority one of critical/high/medium/low.
## Criticality calibration
Define critical/high/medium/low for this repo's context. Include 2–3 examples
per level tailored to the repo's assets and exposure.
## Focus paths for security review
2–30 repo-relative paths with one-sentence reason each.
## Quality checklist
Short checklist confirming coverage of entry points, trust boundaries,
runtime/CI separation, user clarifications, and assumptions.
testing
Analyzes type design quality by rating encapsulation, invariant expression, usefulness, and enforcement. Helps design types that make invalid states unrepresentable. Use when reviewing new types or data models.
testing
Reviews test coverage quality from a behavioral perspective, identifying critical gaps and test quality issues. Does not check line coverage — checks meaningful scenario coverage. Use after adding or modifying tests.
development
Audits error handling for silent failures, inadequate user feedback, and unjustified fallback behavior. Finds issues in catch blocks, fallbacks, and error paths. Use after modifying error handling code.
tools
Orchestrates a comprehensive code review using up to 6 specialist skills. Dispatches code-review, code-simplifier, comment-analyzer, silent-failure-hunter, type-design-analyzer, and test-analyzer based on the scope of changes. Use for thorough end-to-end review of code changes.