К основному содержанию
скилл CX Codex

threat-model · pproenca — скилл для Claude Code: что делает и как установить

Скилл threat-model строит модель угроз кодовой базы, отслеживая путь недоверенных данных до приёмников и собирая отдельные уязвимости в цепочки атак.

MIT 243 установок ★ 227 обновлён 2026-08-15

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add pproenca/dot-skills --skill threat-model -a claude-code
Открыть на GitHub

Что делает threat-model

Скилл анализирует поверхность атаки и границы доверия в проекте. Вместо абстрактных догадок он отслеживает путь пользовательских данных от точки входа до опасного вызова (sink). Анализ проходит в 10 фаз: от описания компонентов и разбора межъязыковых интерфейсов (FFI вроде Swift и C) до объединения находок в цепочки эксплойтов.

Работать можно в двух режимах: полный аудит репозитория или дифференциальный анализ свежих коммитов. Для инвентаризации входов и приёмников применяются вспомогательные скрипты scripts/trace-data-flows.sh <project-root> и scripts/scan-patterns.sh <project-root>.

Итоги сохраняются в отчёт THREAT-MODEL.md и машиночитаемый файл findings.json. Если findings.json уже был создан ранее, скилл считывает его, чтобы отследить статус проблем и вовремя заметить регрессии безопасности.

Какие задачи решает

  • построить модель угроз для репозитория перед релизом или при архитектурных изменениях
  • проследить путь недоверенных данных от точки входа до приёмника в коде
  • сгруппировать уязвимости по общей первопричине вместо точечных правок
  • составить цепочки атак из нескольких мелких дефектов безопасности
  • проверить границы доверия на стыках языков вроде Swift и C или Rust и C

Примеры запросов агенту

  • Проведи полный threat model для текущего репозитория
  • Сделай diff analysis безопасности для последних коммитов
  • Оцени attack surface и trust boundaries перед внедрением авторизации

Как установить threat-model

1Через Skills CLI (Vercel)

npx skills add pproenca/dot-skills --skill threat-model -a claude-code

2Вручную: положить файлы

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

Папка скилла целиком; для одного проекта — .claude/skills/threat-model/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о threat-model

Как установить threat-model в Claude Code?

Выполните команду npx skills add pproenca/dot-skills --skill threat-model -a claude-code.

Что создаёт скилл threat-model?

Он формирует структурированный файл findings.json для отслеживания статусов проблем и читаемый отчёт THREAT-MODEL.md из шести разделов.

Чем отличается режим diff analysis от полного аудита?

Режим diff ограничивает проверку диапазоном изменённого кода в git и обновляет существующий findings.json, фиксируя закрытые уязвимости или регрессии.

Исходный текст

SKILL.md · MIT
---
name: threat-model
description: Security threat modeling, attack surface mapping, and trust boundary analysis on a codebase. Triggers on 'threat model', 'security review', 'attack surface', 'trust boundaries', or when assessing a project's security posture. Also trigger when the user is about to build security-sensitive features (auth, crypto, file I/O, network services, native bridges) and needs to understand the threat landscape first — even if they don't explicitly say "threat model." Also triggers on 'what changed' or 'diff analysis' for incremental security review of recent commits.
---
# Threat Model

Produces structured, evidence-backed security threat models for any codebase. Goes beyond surface enumeration by tracing untrusted data through actual code paths, clustering findings by root cause, and constructing exploit chains that combine individual findings into higher-severity attack paths.

## When to Apply

- User asks to threat model, security review, or map attack surfaces for a codebase
- Starting work on security-sensitive features (auth, crypto, file I/O, networking, native bridges)
- Evaluating a new codebase or major architectural change for security implications
- Reviewing a PR or recent commits for security regressions (incremental/diff mode)
- After a security incident to reassess the threat landscape

## Workflow Overview

```
Phase 0 (conditional): Diff Analysis — if git range provided, scope to changed code
Phase 1:  Codebase Survey        → Understand what the project is and does
Phase 2:  Component Mapping      → Identify components, data flows, and language bridges
Phase 3:  Asset Identification   → Determine what needs protecting
Phase 4:  Trust Boundaries       → Classify inputs by trust level, inventory entry points
Phase 5:  Data Flow Tracing      → Follow untrusted values from entry to sink ← key technique
Phase 6:  Attack Surface Enum    → Document surfaces with traced evidence
Phase 7:  Pattern Clustering     → Group 3+ similar findings by root cause
Phase 8:  Exploit Chains         → Combine findings into multi-step attack paths
Phase 9:  Calibration            → Rate with chain-adjusted and systemic severity
Phase 10: Output                 → Write structured THREAT-MODEL.md
```

## How to Use

1. Read [methodology](references/methodology.md) for the detailed approach at each phase
2. Read [output format](references/output-format.md) for the document structure (6 sections)
3. Consult [attack patterns](references/attack-patterns.md) for technology-specific patterns
4. Run `scripts/trace-data-flows.sh <project-root>` to inventory entry points and sinks
5. Optionally run `scripts/scan-patterns.sh <project-root>` for security-relevant code patterns

## Analytical Techniques

These techniques are the skill's core value — they encode analytical methods that produce findings the model wouldn't generate from general knowledge alone.

| Technique | When to Read | What It Adds |
|-----------|-------------|-------------|
| [Data Flow Tracing](references/techniques/data-flow-tracing.md) | Phase 5 — always | Traces untrusted input from entry to sink through actual code. Produces evidence-backed findings instead of theoretical risks |
| [Pattern Clustering](references/techniques/pattern-clustering.md) | Phase 7 — after enumeration | Groups related findings by root cause. Recommends systemic fixes instead of individual patches |
| [Exploit Chains](references/techniques/exploit-chains.md) | Phase 8 — after clustering | Combines findings into multi-step attack paths rated by terminal impact |
| [Bridge Analysis](references/techniques/bridge-analysis.md) | Phase 6 — when FFI/bridges found | Systematic checklist for cross-language boundaries (Swift↔C, Rust↔C, Rails↔NGINX) |
| [Diff Analysis](references/techniques/diff-analysis.md) | Phase 0 — for incremental review | Scopes analysis to changed code, identifies regressions |

## Key Principles

- **Evidence over speculation**: Every finding should include a data flow trace showing how untrusted input reaches the vulnerable operation. "XSS is possible" is speculation. "RFC markdown → marked.parse() → innerHTML at line 917 with no sanitizer" is evidence.
- **Systemic over individual**: When 3+ findings share a root cause, the systemic finding is more important than any individual finding. Fix the root cause, not the symptoms.
- **Chains over singletons**: Rate combined attack paths by their terminal impact. Three medium findings that chain into critical impact are a critical finding.
- **Existing mitigations matter**: Document what's already protected, not just what's missing.
- **Context-aware calibration**: Severity depends on deployment context. Always include scope notes.

## Output

Produces **two files** (configurable via config.json):

- **`findings.json`** — Structured, machine-readable findings. Source of truth. Consumed by `threat-patch` for automated remediation. Tracks finding state across runs (open → patched → verified → closed).
- **`THREAT-MODEL.md`** — Human-readable view generated from findings.json. 6 sections: Overview, Trust Boundaries, Attack Surfaces, Systemic Findings, Exploit Chains, Criticality Calibration.

### Pipeline Integration

```
threat-model → findings.json → threat-patch (consumes findings, generates fixes)
     ↑                                          ↓
     └── threat-model --diff (re-analyzes, updates finding status) ←── git commits
```

When `findings.json` exists from a prior run, the skill reads it to:
- Track which findings are still open vs patched
- Calibrate severity against prior ratings
- Detect regressions (fixed findings that reappeared)

## Two Modes

| Mode | Trigger | What It Does |
|------|---------|-------------|
| **Full analysis** | "threat model this codebase" | Analyzes entire codebase, produces fresh findings.json + THREAT-MODEL.md |
| **Diff analysis** | "what changed since last review" / git range provided | Scopes to changed code, updates existing findings.json with new/resolved/regressed findings |

Diff mode is the daily driver for ongoing projects. Full mode runs once (or periodically).

## References

| File | When to Read |
|------|-------------|
| [references/methodology.md](references/methodology.md) | Before starting — the 10-phase workflow |
| [references/output-format.md](references/output-format.md) | When writing output — 6-section template |
| [references/findings-schema.md](references/findings-schema.md) | When writing findings.json — structured schema |
| [references/attack-patterns.md](references/attack-patterns.md) | When enumerating surfaces — technology patterns |
| [references/techniques/](references/techniques/) | During specific phases — analytical techniques |

© pproenca · MIT · pproenca/dot-skills

Похожие скиллы

Все скиллы по теме «Безопасность» →

Сначала — threat-model от других авторов.

threat-model официальный anthropics Строит модель угроз кодовой базы и записывает результат в THREAT_MODEL.md. Запускается в трёх режимах: интервью с владельцем, анализ кода по CVE и git-истории, или оба подряд. CX Codex +1 1 300установок threat-model официальный OpenAI Скилл threat-model для Codex создаёт архитектурную модель угроз репозитория. Инструмент запускается при вызове $threat-model или на этапе анализа безопасности. CX Codex GP ChatGPT +1 32установок threat-model jmanico Скилл threat-model для Claude Code строит модель угроз репозитория и сохраняет отчёты в threat-model/. Запускается по запросу на STRIDE, PASTA, LINDDUN, privacy-анализ или проверку изменений. CX Codex +1 ★ 640звёзд репо threat-model haabe Скилл threat-model проводит моделирование угроз по методологии STRIDE для систем, LLM-сервисов и плагинов. Помогает найти уязвимости ещё на этапе проектирования архитектуры. CX Codex +1 ★ 54звёзд репо threat-model-analyst официальный github Скилл threat-model-analyst проводит STRIDE-A-анализ репозитория или системы и готовит модель угроз. При повторном запуске сравнивает изменения с прошлым отчётом. CX Codex +1 1 500установок threat-model-generator patricio0312rev Скилл threat-model-generator строит модель угроз по STRIDE: выписывает активы, находит угрозы, подбирает меры защиты и считает остаточный риск. CX Codex +1 270установок tm7-threat-model официальный github Скилл tm7-threat-model для GitHub Copilot, который генерирует файлы .tm7 для Microsoft Threat Modeling Tool v7.3+. Включается, когда нужно создать или изменить модель угроз в формате STRIDE. CX Codex +1 29установок create_stride_threat_model danielmiessler Промпт create_stride_threat_model анализирует архитектурные документы и строит модель угроз по методологии STRIDE с таблицей рисков, границами доверия и мерами защиты. GP ChatGPT ★ 44 690звёзд репо multi-agentic-threat-model OWASP Скилл multi-agentic-threat-model моделирует угрозы для мультиагентных систем по 7-уровневой архитектуре CSA MAESTRO и руководству OWASP. CX Codex +1 188установок security-threat-model lyndonkl Скилл security-threat-model помогает разобрать архитектуру сервиса по методологии STRIDE, найти границы доверия и защитить чувствительные данные перед релизом или аудитом. CX Codex +1 109установок

Из того же набора139

Весь набор →
rails-application-ui-blocks Скилл rails-application-ui-blocks собирает страницы Ruby on Rails и обновляет ERB-шаблоны готовыми блоками UI без потери Stimulus и Turbo. CX Codex +1 257установок rust-implement Скилл rust-implement организует написание Rust-кода в четыре прохода: от проектирования типов и сигнатур до чистки и запуска скрипта проверки. CX Codex +1 254установок domain-architect Скилл domain-architect определяет бизнес-домены в Swift-проекте через возможности продукта, а не через имена папок. Строит карту слоёв каждого домена — от типов до UI. CX Codex +1 249установок app-planner Скилл app-planner составляет дизайн-план приложения в Markdown по паттернам Apple Design DNA перед разработкой. Делит проект на майлстоуны для сессий сборки. CX Codex +1 244установок opencode-ts Скилл opencode-ts помогает писать, проверять и рефакторить TypeScript-код в проектах на Effect. Он задаёт рабочий процесс и сверяет изменения с архитектурой проекта. CX Codex +1 240установок exec-plan Скилл exec-plan организует жизненный цикл автономных планов разработки в Markdown для задач длиннее одной сессии или с правками более трёх файлов. CX Codex +1 239установок graph-schema Скилл graph-schema для Claude Code помогает проектировать, проверять и перерабатывать схемы графовых баз данных. Он включается при моделировании узлов и связей или переносе предметной области в граф. CX Codex +1 239установок clean-code-ts-react Скилл clean-code-ts-react переносит принципы Clean Code Роберта Мартина на TypeScript 5.x и React 19. Помогает на код-ревью, при рефакторинге и проектировании компонентов или функций. CX Codex +1 238установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой