autoresearch
Autonomous experiment loop for optimization research. Use when the user wants to: - Optimize a metric through systematic…
Scan code changes for security vulnerabilities using STRIDE threat modeling, validate findings for exploitability, and output structured results for downstream patch generation. Supports PR review, scheduled scans, and full repository audits.
$ npx -y skills add factory-ai/factory-plugins --skill security-review --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/security-reviewContext preview
The summary Claude sees to decide when to auto-load this skill.
Scan code changes for security vulnerabilities using STRIDE threat modeling, validate findings for exploitability, and output structured results for downstream patch generation. Supports PR review, scheduled scans, and full repository audits.
name: security-review description: Scan code changes for security vulnerabilities using STRIDE threat modeling, validate findings for exploitability, and output structured results for downstream patch generation. Supports PR review, scheduled scans, and full repository audits. version: 1.0.0 tags: [security, vulnerability, STRIDE, CVE, audit, review]
You are a senior security engineer conducting a focused security review using LLM-powered reasoning and STRIDE threat modeling. This skill scans code for vulnerabilities and validates findings for exploitability.
┌──────────────────────┐
│ threat-model- │ ← Generates STRIDE threat model
│ generation │
└─────────┬────────────┘
↓ .factory/threat-model.md
┌──────────────────────┐
│ security-review │ ← THIS SKILL (scan + validate)
│ (commit-scan + │
│ validation) │
└─────────┬────────────┘
↓ validated-findings.json
┌──────────────────────┐
│ security-patch- │ ← Generates fixes
│ generation │
└──────────────────────┘| Input | Description | Required | Default | |-------|-------------|----------|---------| | Mode | `pr`, `weekly`, `full`, `staged`, `commit-range` | No | `pr` (auto-detected) | | Base branch | Branch to diff against | No | Auto-detected from PR | | CVE lookback | How far back to check dependency CVEs | No | 12 months | | Severity threshold | Minimum severity to report | No | `medium` |
# Check if threat model exists
if [ -f ".factory/threat-model.md" ]; then
echo "Threat model found"
# Check age
LAST_MODIFIED=$(stat -f %m .factory/threat-model.md 2>/dev/null || stat -c %Y .factory/threat-model.md)
DAYS_OLD=$(( ($(date +%s) - $LAST_MODIFIED) / 86400 ))
if [ $DAYS_OLD -gt 90 ]; then
echo "WARNING: Threat model is $DAYS_OLD days old. Consider regenerating."
fi
else
echo "No threat model found. Generate one first using threat-model-generation skill."
fi**If missing:**
**If outdated (>90 days):**
# PR mode - scan PR diff git diff --name-only origin/HEAD... git diff --merge-base origin/HEAD # Weekly mode - last 7 days on default branch git log --since="7 days ago" --name-only --pretty=format: | sort -u # Full mode - entire repository find . -type f \( -name "*.js" -o -name "*.ts" -o -name "*.py" -o -name "*.go" -o -name "*.java" \) | head -500 # Staged mode - staged changes only git diff --staged --name-only
Document:
Load the threat model and scan code for vulnerabilities in each STRIDE category:
Look for:
Look for:
Look for:
Look for:
Look for:
Look for:
# SQL Injection (Tampering)
sql = f"SELECT * FROM users WHERE id = {user_id}" # VULNERABLE
cursor.execute("SELECT * FROM users WHERE id = ?", (user_id,)) # SAFE
# Command Injection (Tampering)
os.system(f"ping {user_input}") # VULNERABLE
subprocess.run(["ping", "-c", "1", user_input]) # SAFE
# XSS (Tampering)
element.innerHTML = userInput; // VULNERABLE
element.textContent = userInput; // SAFE
# IDOR (Information Disclosure)
def get_doc(doc_id):
return Doc.query.get(doc_id) # VULNERABLE - no ownership check
# Path Traversal (Tampering)
file_path = f"/uploads/{user_filename}" # VULNERABLE
filename = os.path.basename(user_input) # SAFEScan dependencies for known CVEs:
# Node.js npm audit --json 2>/dev/null # Python pip-audit --format json 2>/dev/null # Go govulncheck -json ./... 2>/dev/null # Rust cargo audit --json 2>/dev/null
For each vulnerability: 1. Confirm version is affected 2. Search codebase for usage of vulnerable APIs 3. Classify reachability: `REACHABLE`, `POTENTIALLY_REACHABLE`, `NOT_REACHABLE`
Output `s
Official Factory plugins marketplace containing curated skills, droids, and tools.
Autonomous experiment loop for optimization research. Use when the user wants to: - Optimize a metric through systematic…
Create a pull request with Conventional Commits formatting, a templated body, and local verification. Use when the user asks to…
Follow up on an existing PR by rebasing on the base branch, addressing reviewer comments, fixing CI issues, and pushing updates.…
Intercept and debug HTTP traffic from any CLI, service, or script using HTTP Toolkit. Use when you need to inspect LLM API calls,…
Control terminal TUIs, browsers, and native desktop apps for testing, demos, QA, and computer-use tasks. Use when you need to…
Automate browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to: -…