Attack Flow Generator
Generate SITF-compliant attack flow JSON files from attack descriptions or incident reports.
Usage
/attack-flow <attack-name> [source]
attack-name: Identifier for the attack (e.g., "s1ngularity", "solarwinds")
source: URL, "websearch" for auto-research, or omit to use conversation context
Arguments: $ARGUMENTS
Instructions
When this skill is invoked:
Phase 1: Research
If source is "websearch" or a URL, gather attack details:
- Attack timeline and phases
- Entry point and initial access method
- Lateral movement and persistence techniques
- Data exfiltration or impact
- Affected components (CI/CD, VCS, Registry, Endpoint, Production)
If source is omitted, use context from the current conversation.
Phase 2: Technique Mapping
Read techniques.json to get the full technique library.
For each attack step, find the best matching technique:
- Match by action semantics, not surface keywords
- Example: Uploading stolen data to repos → T-V003 (Secret Exfiltration), NOT T-V008 (Malicious Hosting)
- Example: Accessing VCS with stolen creds → T-V001 must come BEFORE any VCS actions
If no matching technique exists:
- Create a placeholder node with
"type": "technique-gap"
- Include suggested technique metadata in the data field
- Note in output that
/technique-proposal should be run for gaps
Phase 3: Layout Calculation
Apply these layout rules:
Rule 1: Component Layout (Left-to-Right by Attack Flow)
- Order components by their sequence in the attack chain, not by standard SITF order
- If attack flows CI/CD → Registry → Endpoint → VCS, layout left-to-right accordingly
- Minimum horizontal gap between components: 80-100px
- Component x-positions: Use increments of ~300px starting from x=0
Rule 2: Technique Ordering (Top-to-Bottom)
- Primary: Order techniques by their sequence in the attack flow
- Secondary: Within same attack step, order by stage (Initial Access → Discovery → Post-Compromise)
- Vertical gap between techniques: ~130-150px
- First technique starts at y = component.y + 80
Rule 3: Technique-Component Alignment
- Every technique node MUST be visually positioned within its parent component
- Calculate x-position:
component.x + 30
- Validate technique.data.component matches parent component.data.componentId
Rule 4: Component Sizing
- Height = (technique_count × 150) + 120 (padding)
- Width = 230-250px
Rule 5: Edge Connections
- Connect source.bottom → target.top for vertical flows within component
- Connect source.right → target.left for cross-component flows
- Add labels for significant transitions ("Second wave", etc.)
- Use
"type": "smoothstep" for all edges
Phase 4: JSON Generation
Generate the attack flow JSON with this structure:
{
"metadata": {
"name": "Attack Name",
"created": "ISO-8601 timestamp",
"version": "1.0",
"framework": "SITF",
"description": "Brief attack description"
},
"nodes": [
// Entry points, components, techniques, exit points
],
"edges": [
// Connections between nodes
]
}
Node types:
entryPoint: Attack entry (Phishing, Vulnerability Exploit, Stolen Credentials, etc.)
component: SITF component container (endpoint, vcs, cicd, registry, production)
technique: Attack technique from techniques.json
technique-gap: Placeholder for missing technique (flag for /technique-proposal)
exitPoint: Attack outcome (Future Breach, Persistence, Secondary Supply Chain Attack, etc.)
Phase 5: Validation
Run this checklist before outputting:
[ ] Valid JSON structure (parse test passes)
[ ] Required fields present: metadata.{name,created,version,framework}, nodes[], edges[]
[ ] All node IDs are unique
[ ] All edge source/target reference valid node IDs
[ ] All techniques positioned within their component boundaries (x/y validation)
[ ] Techniques ordered by attack flow sequence
[ ] Initial Access techniques appear first when order is ambiguous
[ ] All technique IDs exist in techniques.json OR flagged as technique-gap
[ ] Exit points connected to terminal techniques
[ ] No orphaned nodes (every non-entry node has incoming edge)
Phase 6: Output
- Write the JSON file to
sample-flows/<attack-name>.json
- Validate the JSON with Python:
python3 -c "import json; json.load(open('file'))"
- Provide a summary table of the attack flow
- If any technique-gaps exist, list them and recommend running
/technique-proposal
Example
/attack-flow s1ngularity websearch
This will:
- Search for s1ngularity attack details
- Map attack steps to SITF techniques
- Generate
sample-flows/s1ngularity.json
- Output attack flow summary
1---2name: attack-flow3description: Generate SITF-compliant attack flow JSON files from attack descriptions or incident reports. Use when analyzing supply chain attacks, breaches, or security incidents.4---56# Attack Flow Generator78Generate SITF-compliant attack flow JSON files from attack descriptions or incident reports.910## Usage1112```13/attack-flow <attack-name> [source]14```1516- `attack-name`: Identifier for the attack (e.g., "s1ngularity", "solarwinds")17- `source`: URL, "websearch" for auto-research, or omit to use conversation context1819Arguments: $ARGUMENTS2021## Instructions2223When this skill is invoked:2425### Phase 1: Research26271. If source is "websearch" or a URL, gather attack details:28 - Attack timeline and phases29 - Entry point and initial access method30 - Lateral movement and persistence techniques31 - Data exfiltration or impact32 - Affected components (CI/CD, VCS, Registry, Endpoint, Production)33342. If source is omitted, use context from the current conversation.3536### Phase 2: Technique Mapping37381. Read `techniques.json` to get the full technique library.39402. For each attack step, find the best matching technique:41 - Match by **action semantics**, not surface keywords42 - Example: Uploading stolen data to repos → T-V003 (Secret Exfiltration), NOT T-V008 (Malicious Hosting)43 - Example: Accessing VCS with stolen creds → T-V001 must come BEFORE any VCS actions44453. If no matching technique exists:46 - Create a placeholder node with `"type": "technique-gap"`47 - Include suggested technique metadata in the data field48 - Note in output that `/technique-proposal` should be run for gaps4950### Phase 3: Layout Calculation5152Apply these layout rules:5354#### Rule 1: Component Layout (Left-to-Right by Attack Flow)55- Order components by their **sequence in the attack chain**, not by standard SITF order56- If attack flows CI/CD → Registry → Endpoint → VCS, layout left-to-right accordingly57- Minimum horizontal gap between components: 80-100px58- Component x-positions: Use increments of ~300px starting from x=05960#### Rule 2: Technique Ordering (Top-to-Bottom)61- **Primary**: Order techniques by their **sequence in the attack flow**62- **Secondary**: Within same attack step, order by stage (Initial Access → Discovery → Post-Compromise)63- Vertical gap between techniques: ~130-150px64- First technique starts at y = component.y + 806566#### Rule 3: Technique-Component Alignment67- Every technique node MUST be visually positioned within its parent component68- Calculate x-position: `component.x + 30`69- Validate technique.data.component matches parent component.data.componentId7071#### Rule 4: Component Sizing72- Height = (technique_count × 150) + 120 (padding)73- Width = 230-250px7475#### Rule 5: Edge Connections76- Connect source.bottom → target.top for vertical flows within component77- Connect source.right → target.left for cross-component flows78- Add labels for significant transitions ("Second wave", etc.)79- Use `"type": "smoothstep"` for all edges8081### Phase 4: JSON Generation8283Generate the attack flow JSON with this structure:8485```json86{87 "metadata": {88 "name": "Attack Name",89 "created": "ISO-8601 timestamp",90 "version": "1.0",91 "framework": "SITF",92 "description": "Brief attack description"93 },94 "nodes": [95 // Entry points, components, techniques, exit points96 ],97 "edges": [98 // Connections between nodes99 ]100}101```102103Node types:104- `entryPoint`: Attack entry (Phishing, Vulnerability Exploit, Stolen Credentials, etc.)105- `component`: SITF component container (endpoint, vcs, cicd, registry, production)106- `technique`: Attack technique from techniques.json107- `technique-gap`: Placeholder for missing technique (flag for /technique-proposal)108- `exitPoint`: Attack outcome (Future Breach, Persistence, Secondary Supply Chain Attack, etc.)109110### Phase 5: Validation111112Run this checklist before outputting:113114```115[ ] Valid JSON structure (parse test passes)116[ ] Required fields present: metadata.{name,created,version,framework}, nodes[], edges[]117[ ] All node IDs are unique118[ ] All edge source/target reference valid node IDs119[ ] All techniques positioned within their component boundaries (x/y validation)120[ ] Techniques ordered by attack flow sequence121[ ] Initial Access techniques appear first when order is ambiguous122[ ] All technique IDs exist in techniques.json OR flagged as technique-gap123[ ] Exit points connected to terminal techniques124[ ] No orphaned nodes (every non-entry node has incoming edge)125```126127### Phase 6: Output1281291. Write the JSON file to `sample-flows/<attack-name>.json`1302. Validate the JSON with Python: `python3 -c "import json; json.load(open('file'))"`1313. Provide a summary table of the attack flow1324. If any technique-gaps exist, list them and recommend running `/technique-proposal`133134## Example135136```137/attack-flow s1ngularity websearch138```139140This will:1411. Search for s1ngularity attack details1422. Map attack steps to SITF techniques1433. Generate `sample-flows/s1ngularity.json`1444. Output attack flow summary