model
This skill should be used when the user asks to "create threat model", "threat model architecture", "map security architecture", "build threat model", "STRIDE analysis", "data flow diagram", "DFD security", or "attack tree analysis". Also triggers when the user wants a systematic identification of threats against the application architecture, trust boundaries, data flows, or component interactions.
What this skill does
# Threat Modeling Full architecture-level threat modeling with automated discovery, data flow mapping, STRIDE-per-component analysis, and attack tree generation. Produces persistent, incremental threat models stored in `.appsec/model/` that evolve as the codebase changes. ## Supported Flags Read `../../shared/schemas/flags.md` for the full flag specification. | Flag | Model Behavior | |------|---------------| | `--scope` | Default `full`. Threat models benefit from whole-system visibility. Narrow scopes produce partial models with a warning. | | `--depth quick` | Component inventory and trust boundary identification only. | | `--depth standard` | Full threat model: components, data flows, STRIDE analysis, mitigations. | | `--depth deep` | Standard + attack trees, cross-component threat chains, external dependency threats. | | `--depth expert` | Deep + DREAD scoring, attack simulation narratives, compliance mapping. | | `--severity` | Filter reported threats by severity in output. | | `--format` | Default `md`. Use `json` for structured model data. | | `--diff` | Incremental mode: only analyze changes since last model. Compare against `.appsec/model/current.json`. | ## Workflow ### Step 1: Discovery Automatically discover the application architecture by analyzing the codebase: #### Component Discovery Identify all significant components: 1. **Services**: Separate processes, microservices (from docker-compose, k8s manifests, service configs). 2. **APIs**: REST controllers, GraphQL resolvers, gRPC services. 3. **Data stores**: Databases, caches, file storage, message queues. 4. **External dependencies**: Third-party APIs, SaaS integrations, CDNs, auth providers. 5. **Background workers**: Job processors, cron tasks, event consumers. 6. **Client applications**: Web frontends, mobile apps, CLI tools. 7. **Infrastructure**: Load balancers, reverse proxies, API gateways (from config files). #### Trust Boundary Discovery Identify boundaries where trust levels change: 1. **Network boundaries**: Internet to DMZ, DMZ to internal, internal to database tier. 2. **Authentication boundaries**: Public vs authenticated, user vs admin. 3. **Process boundaries**: Between services, between containers. 4. **Data classification boundaries**: Where PII/secrets move between storage/transit. ### Step 2: Data Flow Mapping Generate Mermaid data flow diagrams (DFDs) at two levels: Generate Mermaid DFDs at two levels: Level 0 (system context -- actors, application, external systems) and Level 1 (component detail with trust boundary subgraphs showing internal services, data stores, and message queues). Annotate each data flow with: - Protocol (HTTPS, gRPC, TCP, etc.) - Authentication method - Data classification (public, internal, confidential, restricted) - Encryption status (in transit, at rest) ### Step 3: STRIDE-per-Component Analysis Apply STRIDE to each component and data flow: | STRIDE | Question | |--------|----------| | **S**poofing | Can an attacker impersonate this component or a user of it? | | **T**ampering | Can data in transit or at rest be modified without detection? | | **R**epudiation | Can actions be performed without an audit trail? | | **I**nformation Disclosure | Can sensitive data leak from this component? | | **D**enial of Service | Can this component be made unavailable? | | **E**levation of Privilege | Can an attacker gain higher access through this component? | For each component, generate a threat table: For each component, produce a table with columns: #, STRIDE category, Threat description, Severity, Mitigation, Status (Mitigated/Partial/Gap/Accepted). ### Step 4: Attack Tree Generation At `--depth deep` and above, generate attack trees for high-value targets: For each high-value target (e.g., "Exfiltrate User PII"), produce a numbered attack tree with branches for direct access, application-layer attacks, and infrastructure attacks. Each leaf node references severity and mitigation status from the STRIDE analysis. ### Step 5: Identify Mitigations and Gaps For each threat identified: 1. **Check if mitigated**: Search the codebase for security controls that address the threat. 2. **Assess mitigation quality**: Is the control properly implemented? Complete? Tested? 3. **Mark status**: - `Mitigated`: Security control exists and is properly implemented. - `Partial`: Control exists but is incomplete or has known weaknesses. - `Gap`: No mitigation found. This becomes a finding. - `Accepted`: Risk acknowledged and accepted (noted in threat model). ### Step 6: Incremental Mode (--diff) When `--diff` flag is set: 1. Load the previous model from `.appsec/model/current.json`. 2. Detect changes: - New components added. - Components removed. - Data flows added or changed. - Trust boundaries modified. 3. Run STRIDE analysis only on new/changed components and flows. 4. Merge results into the existing model. 5. Highlight what changed in the output. Output a changelog showing NEW, CHANGED, and REMOVED components with threat counts for each. ### Step 7: Persist Model Save the threat model to `.appsec/model/`: | File | Contents | |------|----------| | `current.json` | Full structured model (components, flows, threats, mitigations) | | `threat-model.md` | Human-readable report with Mermaid diagrams | | `dfd-level0.mmd` | Level 0 Mermaid DFD source | | `dfd-level1.mmd` | Level 1 Mermaid DFD source | | `attack-trees.md` | Attack tree documentation | | `history/<timestamp>.json` | Snapshot for diffing (incremental mode) | ### Step 8: Emit Findings for Gaps For each threat with status `Gap`, emit a finding using `../../shared/schemas/findings.md`: - Map STRIDE category to the appropriate `references.stride` value. - Severity based on threat analysis (impact and likelihood). - Location points to the component/file most relevant to the gap. ## Output Format Findings follow `../../shared/schemas/findings.md`. Finding ID prefix: **TM** (e.g., `TM-001`). - `metadata.tool`: `"model"` - `metadata.framework`: `"stride"` (or specific framework if used) - `references.stride`: The STRIDE category letter ## Pragmatism Notes - Threat models are living documents. Encourage incremental updates (`--diff`) rather than full rebuilds. - Not every theoretical threat warrants a finding. Focus on threats that are plausible given the application's deployment context. - A microservice behind a service mesh has different threats than an internet-facing monolith. Adjust analysis accordingly. - Component discovery is heuristic. Label the model as based on code analysis, not authoritative architecture documentation. - DFDs should be useful, not exhaustive. Omit trivial flows (e.g., logging to stdout) unless they carry sensitive data. - If the codebase is a library (not a deployed application), model threats to consumers of the library rather than infrastructure threats. - STRIDE is the default framework. If the user requests PASTA, LINDDUN, or another framework, defer to those specialized skills.
Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.