跳到正文
cccskills
免费在 GitHub 公开

threat-model

Create a threat model for a codebase by interviewing its owner, deriving risks from code and past vulnerability evidence, or combining both approaches. The result is a structured THREAT_MODEL.md that maps threats, entry points, and recommended mitigations.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

Build a threat model for a target codebase. Three modes: "interview" walks an application owner through the four-question framework and produces a threat model from their answers; "bootstrap" derives a threat model from the code plus past vulnerabilities (CVEs, git history, pentest reports) when no owner is available; "bootstrap-then-interview" chains the two when both owner and codebase are present. All write THREAT_MODEL.md in a shared schema. Use when asked to "threat model", "build a threat model", "map the attack surface", or "what should we be worried about in this codebase".

实测评分 未实测

查看安装方法

适用场景

  • Mapping a codebase's attack surface
  • Documenting risks for a new system design
  • Assessing inherited or third-party code
  • Combining code-based analysis with an owner interview

包含的文件(5)

  • SKILL.md8.0 KB
  • bootstrap.md21.6 KB
  • interview.md9.0 KB
  • README.md5.6 KB
  • schema.md6.7 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

threat-model

A threat model answers "what could go wrong with this system, who would do it, and what should we do about it?" independently of whether any specific bug has been found yet. It is the map; vulnerability discovery is the metal detector. A good threat model tells the pipeline where to look and tells triage which findings matter.

Litmus test: If patching one line of code makes an entry disappear, it was a vulnerability, not a threat. A threat ("attacker achieves RCE via untrusted media parsing") still stands after every known bug is fixed; a vulnerability ("dr_wav.h:412 doesn't bounds-check chunk_size") does not. This skill produces threats. Vulnerabilities appear only as evidence that raises a threat's likelihood score.

Invocation: /threat-model [bootstrap-then-interview|bootstrap|interview] <target-dir> [flags]


Step 0 — Safety preamble (always runs first)

This skill performs static analysis only. It reads source, git history, and any vulnerability reports the user supplies, and writes a single output file (docs/security/THREAT_MODEL.md). It does not build, execute, fuzz, or modify the target, and does not make network requests against the target's infrastructure.

Before proceeding, confirm and state in your first response:

  1. The target directory exists and is a local checkout you can read.
  2. You will not execute any code from the target directory.
  3. If --vulns points at a URL or you are asked to "fetch CVEs", you will query only public advisory databases (NVD, GitHub Security Advisories, the project's own issue tracker) and never the target's live deployment.

If the user asks you to validate a threat by running an exploit, decline. This repository vendors only the static skills; there is no execution pipeline here (Ouroboros adaptation).


Step 1 — Route to a mode

Parse $ARGUMENTS:

First tokenRoute to
interviewRead interview.md in this directory and follow it.
bootstrapRead bootstrap.md in this directory and follow it.
bootstrap-then-interviewBootstrap first, then interview seeded from the draft. See below.
anything else, or emptyAsk the user: "Is someone who owns or built this system available to answer questions in this session?" Yes and the codebase is checked out → recommend bootstrap-then-interview. Yes but no codebase → interview.md. No → bootstrap.md.

All modes write the same artifact (THREAT_MODEL.md, schema in schema.md) so downstream consumers (pipeline recon/judge, verifier agents) do not need to know which mode produced it.

interviewbootstrap
NeedsAn application owner present in the sessionA local checkout; optionally past vulns
MethodFour-question framework: conversational walk through what are we working on → what can go wrong → what are we going to do about it → did we do a good jobFive stages: parallel research swarm → synthesize sections 1-3 + vuln table → generalize vulns into threat classes → STRIDE gap-fill → emit
Best forNew systems, design reviews, systems where the risk lives in business logic the code doesn't showInherited systems, third-party code, OSS dependencies, anything with a CVE history
Provenance taginterviewbootstrap

Context durability. Interview mode is multi-turn; tool results from early reads may be evicted before you need them. To stay resilient:

  • Do not read interview.md or bootstrap.md in full up front. Read the mode file (or the relevant section of it) at the point you need it, one question or stage at a time.
  • If a re-read via the Read tool is refused as "file unchanged", the prior result was evicted; reload with cat <path> via Bash instead.

Interview backbone (so you can proceed even if interview.md is unavailable mid-session):

QQuestionFills schema sections
Q1What are we working on?section 1 context, section 2 assets, section 3 entry points
Q2What can go wrong?section 4 threat rows (id, threat, actor, surface, asset)
Q3What are we going to do about it?section 4 impact/likelihood/status/controls; section 5 deprioritized; section 8 recommended mitigations
Q4Did we do a good job?validate ranking, coverage check, section 6 open questions

bootstrap-then-interview mode

When the owner is available and the codebase is checked out, this is the recommended path: the owner's time goes to refining a code-grounded draft instead of describing the system from scratch.

  1. Tell the owner: "I'll read the code first and come back with a draft (about 5-10 min), then we'll walk it together. Want that, or would you rather start cold?" Only proceed if they opt in; otherwise fall back to interview.md.
  2. Read bootstrap.md and follow it end-to-end. Write docs/security/THREAT_MODEL.md.
  3. Immediately continue into interview mode: read interview.md and follow it with --seed docs/security/THREAT_MODEL.md in effect. The section 6 open questions from bootstrap become your Q1-Q4 prompts; the owner confirms, corrects, and adds rather than starting from nothing.
  4. Overwrite docs/security/THREAT_MODEL.md with the refined model. Set provenance mode: bootstrap-then-interview.

The same flow is available manually: run bootstrap first, then interview --seed <THREAT_MODEL.md> in a later session.


Step 2 — Shared output contract

All modes MUST emit docs/security/THREAT_MODEL.md conforming to schema.md in this directory. Read schema.md immediately before you write the file, not at routing time; in interview mode the gap between routing and emit can be many turns, and an early read will be evicted before it's used.

Ouroboros adaptation: every target uses the harness checkout's docs/security/THREAT_MODEL.md. Run from that checkout root with CHECKPOINT_ROOT unset or equal to it; never change the publication root to match the read target. This owner-facing model is intentionally tracked, unlike ignored scan and triage findings. For every mode, stage the content in a new operator-controlled payload file under the trusted payload staging contract and publish with python3 .claude/skills/_lib/checkpoint.py append docs/security/THREAT_MODEL.md --replace --from "<payload-file>". Do not use Write directly on the final report, and stop if the helper refuses.

After writing the file, print to the user:

  1. The path to THREAT_MODEL.md.
  2. The top 5 threats by likelihood × impact (id, one-line description, L×I).
  3. For bootstrap: any open questions the code could not answer (these seed a later interview pass).
  4. For interview: any owner statements that could not be verified in code (these seed follow-up code review).

References

  • docs/security/README.md for how this skill fits the Ouroboros security loop (Ouroboros adaptation; the upstream docs/security.md / docs/prompting.md live in the reference harness).

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

auto

免费

Turn a multi-file development task or technology migration into a specification with acceptance criteria, then launch background implementation and verification. The workflow clarifies missing requirements, reviews the specification, and tracks progress and blockers through linked jobs.

中文简介正在准备中。当前显示英语简介。

  • Implementing a feature across multiple files
  • Migrating a framework or programming language
  • Replacing authentication, storage, or API layers
Q00/ouroboros62752026年10月25日 更新

Register and search existing Git repositories and worktrees, then choose which projects Ouroboros interviews use as context. You can also generate a configuration containing verified build, test, and other check commands for the evaluation workflow.

中文简介正在准备中。当前显示英语简介。

  • Selecting existing projects as interview context
  • Finding registered repositories by topic
  • Rescanning after repositories are added or moved
Q00/ouroboros62752026年10月25日 更新

cancel

免费

Stop stuck Ouroboros executions or background jobs by ID, or cancel all running and paused executions in the current project. It reports whether cancellation is complete or has been requested, with guidance for checking the final status.

中文简介正在准备中。当前显示英语简介。

  • Stopping a stuck execution
  • Cancelling a background job by ID
  • Cancelling all active executions in a project
Q00/ouroboros62752026年10月25日 更新

evaluate

免费

Verify finished work against acceptance criteria using executable checks and a review of whether each requirement is met. Multiple models can review uncertain cases, and rejected work can enter an automated repair loop when the required Seed is available.

中文简介正在准备中。当前显示英语简介。

  • Checking finished work against its specification
  • Verifying observed behavior against acceptance criteria
  • Requesting multiple model reviews for uncertain results
Q00/ouroboros62752026年10月25日 更新

evolve

免费

Start and monitor an Ouroboros development loop that revises project concepts and acceptance criteria, the conditions for judging completion. Run and evaluate successive generations, focus revisions on failed criteria, inspect progress, or rewind to an earlier generation.

中文简介正在准备中。当前显示英语简介。

  • Refining a project through repeated execution and evaluation
  • Inspecting progress across generations
  • Rewinding a development loop to an earlier generation
Q00/ouroboros62752026年10月25日 更新

interview

免费

Turn a vague development idea into clear goals, constraints, and acceptance criteria through a guided interview. It checks unresolved decisions and confirms the agreed goal before moving toward a Seed, the requirements document used by Ouroboros.

中文简介正在准备中。当前显示英语简介。

  • Clarifying a vague idea before development
  • Defining completion criteria for a new feature
  • Agreeing on scope and constraints
Q00/ouroboros62752026年10月25日 更新

查看 Q00 的全部技能

报告此技能的问题