Skip to main content
skill CX Codex

threat-model-generation — Claude Code skill

threat-model-generation — a skill for Claude Code, Codex, Cursor, and other agents that builds a STRIDE threat model from a repository's codebase.

no license 151 installs ★ 129 updated 2026-10-25

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add Factory-AI/factory-plugins --skill threat-model-generation -a claude-code
Open on GitHub

What threat-model-generation does

The skill reads dependency manifests — package.json, requirements.txt, go.mod, Cargo.toml — maps services and entry points, and traces external interfaces: REST, GraphQL, webhooks, and OAuth integrations. Trust boundaries are separated into three zones: public (untrusted), authenticated (partially trusted), and internal (trusted).

Each major component goes through all six STRIDE categories — Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, and Elevation of Privilege. For every identified threat, the skill records the attack scenario, the vulnerable components, code patterns to watch for, existing mitigations, and a severity rating: CRITICAL, HIGH, MEDIUM, or LOW. The resulting security-config.json lets you define at which severity level merges get blocked or the security team gets notified.

Passing compliance requirements (SOC2, GDPR, HIPAA) folds them into the config. If .factory/threat-model.md already exists, the skill updates it rather than starting over — so it fits into post-architecture-change workflows without losing prior context.

What it helps with

  • generate an initial STRIDE threat model for a new repository
  • refresh the threat model after significant API or component changes
  • produce documentation for a security audit or compliance review
  • configure merge-blocking thresholds by threat severity level
  • build a vulnerability pattern library tailored to the project's tech stack

Example prompts for the agent

  • Build a STRIDE threat model for this repository and save it to .factory/threat-model.md
  • Update the existing threat model — a new microservice was added since the last version
  • Generate .factory/security-config.json with GDPR compliance requirements and the security team email

How to install threat-model-generation

1Skills CLI (Vercel)

npx skills add Factory-AI/factory-plugins --skill threat-model-generation -a claude-code

2Manually: put the files in place

~/.claude/skills/threat-model-generation/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/threat-model-generation/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about threat-model-generation

How do I install threat-model-generation in Claude Code?

Run npx skills add Factory-AI/factory-plugins --skill threat-model-generation -a claude-code. The skill file will be placed at ~/.claude/skills/threat-model-generation/SKILL.md.

What does the threat-model-generation skill do?

It scans the repository and produces two files: .factory/threat-model.md with a full STRIDE analysis per component, and .factory/security-config.json with severity thresholds for blocking merges and alerting the security team.

Does it work with an existing threat model file?

Yes. If .factory/threat-model.md already exists, the skill updates it in place. Compliance frameworks and security team contacts are optional inputs that get written into the config.

Similar skills

All skills for Security →

From the same set17

The whole set →
human-writing The human-writing skill spots formulaic AI-style wording and revises it while keeping the intended meaning. Use it when editing docs, emails, blog posts, or PRDs. CX Codex +1 630installs frontend-design The frontend-design skill guides an agent through planning and building web interfaces, from layout and type to responsive states. Use it for a new site or a visual refresh. CX Codex +1 172installs security-review security-review scans code changes for security flaws using STRIDE threat modeling, validates exploitability, and outputs structured reports for downstream patching. CX Codex +1 168installs visual-design visual-design is a Claude Code skill that uses nanobanana CLI to create or edit project visuals and Slidev to build presentations. It covers asset, diagram, photo-editing, and slide-deck requests. CX Codex +1 167installs ban-type-assertions ban-type-assertions is a Claude Code skill that blocks TypeScript as assertions and guides their replacement with compiler-checked code. It runs when a package adopts the ban or needs existing lint violations fixed. CX Codex +1 151installs fix-knip-unused-exports fix-knip-unused-exports resolves knip “Unused exports” violations by removing or relocating exports that have no production consumers. Use when npm run knip reports unused code. CX Codex +1 147installs skill-creation skill-creation converts past session breakthroughs into reusable agent skills inside SKILL.md files. Helps extract repeatable patterns and refine existing instructions. CX Codex +1 142installs autoresearch The autoresearch skill runs repeated code experiments against a measurable target. Use it for tuning tests, builds, bundle size, or ML training results. CX Codex +1 137installs

Project sponsors

Companies that keep this analytics open