threat-modeling

threat-modeling is a skill for Claude Code, Codex from jamestorrevillas/dev-skills. It costs 68 tokens per session (778 once invoked), scanned A, original, MIT.

A security review method for finding ways an attacker could misuse a system before it is built. It uses STRIDE, a checklist covering identity forgery, data changes, denial of service, data exposure, and unauthorized access.

In plain words
What is it for?
Use it to review a feature, service, or system; identify protected data and services; map how data moves; and plan defenses against likely attacks.
Why use it?
It helps reveal security weaknesses early, when changing the design is usually easier than repairing a finished system.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to review a feature, service, or system; identify protected data and services; map how data moves; and plan defenses against likely attacks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jamestorrevillas/dev-skills/threat-modeling
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add jamestorrevillas/dev-skills --skill threat-modeling
Clone the repo
git clone --depth 1 https://github.com/jamestorrevillas/dev-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for threat-modeling

README.md
[![agentmods](https://agentmods.dev/badge/skills/jamestorrevillas/dev-skills/threat-modeling/github.svg)](https://agentmods.dev/skills/jamestorrevillas/dev-skills/threat-modeling)
Your own site
<a href="https://agentmods.dev/skills/jamestorrevillas/dev-skills/threat-modeling"><img src="https://agentmods.dev/badge/skills/jamestorrevillas/dev-skills/threat-modeling/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for threat-modeling

Your own site · 80×15
<a href="https://agentmods.dev/skills/jamestorrevillas/dev-skills/threat-modeling"><img src="https://agentmods.dev/badge/skills/jamestorrevillas/dev-skills/threat-modeling.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 778 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00068 $0.00778
Opus 5 $0.00034 $0.00389
Sonnet 5 $0.00014 $0.00156
Haiku 4.5 $0.00007 $0.00078

Measured 9d ago against content hash 2c1d25e64dcb, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

threat-modeling scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/skills/threat-modeling/SKILL.md · 79 lines

How it starts

The opening of the file, as written. The whole thing — 79 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Threat Modeling

Core Mindset

Think like an attacker, build like a defender.

Threat modeling is done BEFORE building, not after. Security retrofitted is always weaker and more expensive than security designed in.


The STRIDE Framework

For every component, ask: can an attacker do this?

Threat Definition Example
Spoofing Pretend to be someone else Forged JWT token
Tampering Modify data in transit or at rest SQL injection, request body modification
Repudiation Deny performing an action No audit log of who deleted a record
Information Disclosure Access data they shouldn't Over-fetching API, verbose error messages
Denial of Service Make system unavailable No rate limiting on auth endpoint
Elevation of Privilege Gain unauthorized access level IDOR (accessing other users' data)

Threat Modeling Process

1. DEFINE SCOPE       — What are we modeling? (feature, service, system)
2. IDENTIFY ASSETS    — What are we protecting? (data, services, credentials)
3. DRAW DATA FLOWS    — How does data move through the system?
4. IDENTIFY THREATS   — Apply STRIDE to each component and data flow
5. ASSESS RISK        — Likelihood × Impact for each threat
6. MITIGATE           — For each high-risk threat, define a control
7. VERIFY             — Confirm controls are implemented and working

Attack Surface Analysis

For any new feature, identify:

  • Entry points — Where does user input enter the system?
  • Trust boundaries — Where does data cross privilege levels?
  • Data stores — What sensitive data is stored and where?
  • External dependencies — What third-party services are called?

OWASP Top 10 (Quick Reference)

# Threat Quick Check
A01 Broken Access Control Is every endpoint checking authorization?
A02 Cryptographic Failures Is sensitive data encrypted at rest and in transit?
A03 Injection Are all queries parameterized? All inputs validated?
A04 Insecure Design Was security considered in the design phase?
A05 Security Misconfiguration Are defaults hardened? Are secrets in env vars?
A06 Vulnerable Components Are dependencies up to date? Any known CVEs?
A07 Auth Failures Is auth implemented correctly? Session management secure?
A08 Software Integrity Are supply chain and build pipeline trusted?
A09 Logging Failures Are security events logged? Are logs protected?
A10 SSRF Can users cause server to make requests to internal resources?

Read the full file on GitHub · 79 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 79 lines · 0 tokens per session scan A 2c1d25e64dcb

Subscribe to this mod's changes

threat-modeling is a skill published in the GitHub repository jamestorrevillas/dev-skills (3 stars, last pushed 5mo ago), licensed MIT. It adds 68 tokens to every session and 778 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

rework-rate

Measure and interpret PR rework rate — the emerging 5th DORA metric.

bradygaster/squad · 20 tokens

go-dependency-audit

Go dependency audit specialist for CVE scanning (govulncheck), license risk triage, outdated dependency detection, upgrade impact analysis, and supply chain security. ALWAYS use when auditing go.mod dependencies, running govulncheck, checking license compatibility, planning dependency upgrades, or investigating supply…

johnqtcg/awesome-skills · 102 tokens

pg-migration

PostgreSQL schema migration safety reviewer and DDL generator. ALWAYS use when writing, reviewing, or planning PostgreSQL schema changes — ALTER TABLE, CREATE/DROP INDEX, column type changes, constraint additions, RLS policy changes, or any DDL touching production tables. Covers lock-level analysis, CREATE INDEX…

johnqtcg/awesome-skills · 135 tokens

api-integration-test

Create, maintain, and run gated Go integration tests for internal APIs and service-to-service clients (HTTP/gRPC). Use for endpoint verification, contract checks with real runtime config, opt-in execution, timeout/retry safety, and integration failure triage in Go services.

johnqtcg/awesome-skills · 58 tokens

go-benchmark

Go performance benchmarking and pprof profiling specialist. ALWAYS use when writing benchmark functions (testing.B), generating or reading pprof profiles, interpreting flame graphs, finding memory allocation hotspots, comparing implementations with benchstat, or measuring ns/op / B/op / allocs/op. In Go code contexts…

johnqtcg/awesome-skills · 90 tokens

create-pr

Create evidence-backed pull requests to the GitHub main branch with strict preflight, quality, and security gates. Use when users ask to create/submit/open/update a PR to main (including private repos), decide draft vs ready state, and provide reviewer-ready context for team review.

johnqtcg/awesome-skills · 59 tokens