Generate a STRIDE-based security threat model for a repository. Use when setting up security monitoring, after architecture changes, during /flux:scope, or for security audits. Triggers on /flux:threat-model.
From fluxnpx claudepluginhub nairon-ai/flux --plugin fluxThis skill uses the workspace's default tool permissions.
references/stride-template.mdDesigns and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Conducts multi-source web research with firecrawl and exa MCPs: searches, scrapes pages, synthesizes cited reports. For deep dives, competitive analysis, tech evaluations, or due diligence.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Generate a comprehensive security threat model for a repository using the STRIDE methodology. This skill analyzes the codebase architecture and produces an LLM-optimized threat model document that other security skills can reference.
Adapted from Factory AI security-engineer plugin.
On entry, set the session phase:
PLUGIN_ROOT="${DROID_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}}"
[ ! -d "$PLUGIN_ROOT/scripts" ] && PLUGIN_ROOT=$(ls -td ~/.claude/plugins/cache/nairon-flux/flux/*/ 2>/dev/null | head -1)
FLUXCTL="${PLUGIN_ROOT}/scripts/fluxctl"
$FLUXCTL session-phase set threat_model
On completion, reset:
$FLUXCTL session-phase set idle
Before running this skill, gather or confirm:
| Input | Description | Required |
|---|---|---|
| Repository path | Root directory to analyze | Yes (default: current directory) |
| Existing threat model | Path to existing .flux/threat-model.md if updating | No |
| Compliance requirements | Frameworks to consider (SOC2, GDPR, HIPAA, etc.) | No |
| Security contacts | Email addresses for security team notifications | No |
Follow these steps in order:
Scan the codebase to understand the system:
Identify languages and frameworks
package.json, requirements.txt, go.mod, Cargo.toml, etc.Map components and services
apps/, services/, packages/ directoriesIdentify external interfaces
Trace data flows
Define security zones:
Public Zone (untrusted)
Authenticated Zone (partially trusted)
Internal Zone (trusted)
Document where trust boundaries exist and what validates transitions between zones.
Classify data by sensitivity:
PII (Personally Identifiable Information)
Credentials & Secrets
Business-Critical Data
For each major component, analyze threats in all six categories:
For each identified threat:
Create a library of code patterns specific to this codebase's tech stack. See references/stride-template.md for the full template structure.
Create two files:
.flux/threat-model.mdUse the template in references/stride-template.md to generate a comprehensive threat model with:
The document should be written in natural language with code examples, optimized for LLM comprehension.
.flux/security-config.jsonGenerate configuration metadata:
{
"threat_model_version": "1.0.0",
"last_updated": "<ISO timestamp>",
"security_team_contacts": [],
"compliance_requirements": [],
"scan_frequency": "on_commit",
"severity_thresholds": {
"block_merge": ["CRITICAL"],
"require_review": ["HIGH", "CRITICAL"],
"notify_security_team": ["CRITICAL"]
},
"vulnerability_patterns": {
"enabled": [
"sql_injection",
"xss",
"command_injection",
"path_traversal",
"auth_bypass",
"idor"
],
"custom_patterns_path": null
}
}
The skill is complete when:
.flux/threat-model.md exists with all sections populated.flux/security-config.json exists with valid JSONRun these checks before completing:
# Verify threat model exists and is non-empty
test -s .flux/threat-model.md && echo "Threat model exists"
# Verify config is valid JSON
cat .flux/security-config.json | jq . > /dev/null && echo "Config is valid JSON"
# Check threat model has key sections
grep -q "## 1. System Overview" .flux/threat-model.md && echo "Has System Overview"
grep -q "## 5. Threat Analysis" .flux/threat-model.md && echo "Has Threat Analysis"
grep -q "## 6. Vulnerability Pattern Library" .flux/threat-model.md && echo "Has Pattern Library"
When called during /flux:scope, this skill:
references/stride-template.md