Install any skill in seconds. Free to start, no credit card required.
Get Started Free →The Diamond Model of Intrusion Analysis provides a structured framework for analyzing cyber intrusions by examining four core features - Adversary, Capability, Infrastructure, and Victim. This skill covers implementing the Diamond Model programmatically to classify and correlate intrusion events, build activity threads, and generate pivot-ready intelligence.
.claude/skills/implementing-diamond-model-analysis/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-10 | ✗→✓ | ▲ Improved | — | — |
| case-01 | ✗→✓ | ▲ Improved | — | — |
| case-12 | ✗→✓ | ▲ Improved | — | — |
| case-16 | ✗→✓ | ▲ Improved | — | — |
| case-13 | ✗→✓ | ▲ Improved | — | — |
The Diamond Model of Intrusion Analysis provides a structured framework for analyzing cyber intrusions by examining four core features: Adversary, Capability, Infrastructure, and Victim. This skill covers implementing the Diamond Model programmatically to classify and correlate intrusion events, build activity threads linking related events, create activity-attack graphs, and generate pivot-ready intelligence from intrusion data.
networkx, stix2, graphviz librariespythonfrom dataclasses import dataclass, field from datetime import datetime from typing import Optional import json import uuid @dataclass class DiamondEvent: adversary: str = "" capability: str = "" infrastructure: str = "" victim: str = "" timestamp: str = "" phase: str = "" result: str = "" direction: str = "" methodology: str = "" confidence: int = 0 notes: str = "" event_id: str = field(default_factory=lambda: str(uuid.uuid4())[:8]) mitre_techniques: list = field(default_factory=list) iocs: list = field(default_factory=list) def to_dict(self): return { "event_id": self.event_id, "adversary": self.adversary, "capability": self.capability, "infrastructure": self.infrastructure, "victim": self.victim, "timestamp": self.timestamp, "phase": self.phase, "result": self.result, "direction": self.direction, "methodology": self.methodology, "confidence": self.confidence, "mitre_techniques": self.mitre_techniques, "iocs": self.iocs, "notes": self.notes, }
pythonimport networkx as nx class DiamondAnalysis: def __init__(self): self.events = [] self.graph = nx.DiGraph() def add_event(self, event: DiamondEvent): self.events.append(event) self.graph.add_node(event.event_id, **event.to_dict()) def build_activity_thread(self): """Link events chronologically into activity threads.""" sorted_events = sorted(self.events, key=lambda e: e.timestamp) for i in range(len(sorted_events) - 1): self.graph.add_edge( sorted_events[i].event_id, sorted_events[i + 1].event_id, relationship="followed_by", ) def find_pivots(self): """Find pivot points where events share infrastructure or capabilities.""" pivots = {"infrastructure": {}, "capability": {}, "adversary": {}} for event in self.events: if event.infrastructure: pivots["infrastructure"].setdefault(event.infrastructure, []).append(event.event_id) if event.capability: pivots["capability"].setdefault(event.capability, []).append(event.event_id) if event.adversary: pivots["adversary"].setdefault(event.adversary, []).append(event.event_id) return { k: {pk: pv for pk, pv in v.items() if len(pv) > 1} for k, v in pivots.items() } def generate_report(self): return { "total_events": len(self.events), "unique_adversaries": len(set(e.adversary for e in self.events if e.adversary)), "unique_victims": len(set(e.victim for e in self.events if e.victim)), "unique_infrastructure": len(set(e.infrastructure for e in self.events if e.infrastructure)), "pivots": self.find_pivots(), "events": [e.to_dict() for e in self.events], }
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-03 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-06 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-10 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-08 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-07 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-11 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-05 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-02 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-01 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-18 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-22 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-12 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-09 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-20 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-21 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-04 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-16 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-13 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-14 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-15 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-17 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-19 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +27 percentage points is the difference between those two pass rates over the 22 comparable cases.
The per-case answers from this run were removed by the retention sweep, so the case table below shows the verdicts without the text either arm produced. The counts above were recorded at the time and are unaffected. Answers are now kept for 180 days.
Other measured skills in the registry, with their headline benchmark lift.