1---2name: gsd-forensics3description: Post-mortem investigation for failed GSD workflows — diagnoses what went wrong.4---5
6
7<objective>
8Investigate what went wrong during a GSD workflow execution. Analyzes git history, `.planning/` artifacts, and file system state to detect anomalies and generate a structured diagnostic report.
9
10Purpose: Diagnose failed or stuck workflows so the user can understand root cause and take corrective action.
11Output: Forensic report saved to `.planning/forensics/`, presented inline, with optional issue creation.
12</objective>
13
14<execution_context>
15@~/.claude/gsd-core/workflows/forensics.md
16</execution_context>
17
18<context>
19**Data sources:**
20- `git log` (recent commits, patterns, time gaps)
21- `git status` / `git diff` (uncommitted work, conflicts)
22- `.planning/STATE.md` (current position, session history)
23- `.planning/ROADMAP.md` (phase scope and progress)
24- `.planning/phases/*/` (PLAN.md, SUMMARY.md, VERIFICATION.md, CONTEXT.md)
25- `.planning/reports/SESSION_REPORT.md` (last session outcomes)
26
27**User input:**
28- Problem description: $ARGUMENTS (optional — will ask if not provided)
29</context>
30
31<process>
32Execute end-to-end.
33</process>
34
35<success_criteria>
36- Evidence gathered from all available data sources
37- At least 4 anomaly types checked (stuck loop, missing artifacts, abandoned work, crash/interruption)
38- Structured forensic report written to `.planning/forensics/report-{timestamp}.md`
39- Report presented inline with findings, anomalies, and recommendations
40- Interactive investigation offered for deeper analysis
41- GitHub issue creation offered if actionable findings exist
42</success_criteria>
43
44<critical_rules>
45- **Read-only investigation:** Do not modify project source files during forensics. Only write the forensic report and update STATE.md session tracking.
46- **Redact sensitive data:** Strip absolute paths, API keys, tokens from reports and issues.
47- **Ground findings in evidence:** Every anomaly must cite specific commits, files, or state data.
48- **No speculation without evidence:** If data is insufficient, say so — do not fabricate root causes.
49</critical_rules>