skills/postmortem/SKILL.md
Auto-generates a structured postmortem from a completed campaign. Reads the campaign file, telemetry logs, and feature ledger. Produces a documented analysis of what broke, what the safety systems caught, and what patterns emerged. Can also be invoked manually for any incident.
npx skillsauth add special-place-administrator/citadel_codex postmortemInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
postmortem reads the artifacts a campaign produced and generates a structured postmortem. It doesn't require the user to remember what happened. The data is already in the campaign file, telemetry, and git history.
One of:
Collect data from all available sources:
From the campaign file (if it exists):
From telemetry (.citadel/telemetry/):
From git history:
From the session itself (if no campaign):
Identify patterns across the data:
What broke: List every failure, error, or unexpected outcome. For each: what happened, what caught it (hook/gate/human/nothing), what it cost (time, rework, tokens).
What the safety systems caught: Circuit breaker activations, quality gate blocks, anti-pattern warnings, typecheck failures. This is the "invisible value" section — problems prevented.
What drifted: Compare the campaign direction to what was built. Did scope expand? Did phases get skipped or reordered? Did the architecture change mid-build?
What patterns emerged: Recurring error types, files that kept needing fixes, phases that took longest, common anti-patterns.
Write to .citadel/postmortems/postmortem-{slug}-{date}.md:
# Postmortem: {Campaign Name or Session Description}
> Date: {ISO date}
> Campaign: {path to campaign file, or "ad-hoc session"}
> Duration: {time from first to last commit}
> Outcome: {completed | partial | parked}
## Summary
{2-3 sentences: what was attempted, what happened, what the result was}
## What Broke
{Numbered list. For each:}
### {N}. {Short description}
- **What happened:** {the failure}
- **Caught by:** {hook name / quality gate / human / nothing}
- **Cost:** {rework time, files affected, phases repeated}
- **Fix:** {what resolved it}
- **Infrastructure created:** {new hook rule, new anti-pattern, new end condition — or "none needed"}
## What Safety Systems Caught
{Things that WOULD have been problems without the hooks/gates}
| System | What It Caught | Times | Impact Prevented |
|--------|---------------|-------|-----------------|
| {hook/gate name} | {description} | {count} | {what would have happened} |
## Scope Analysis
- **Planned:** {what the campaign direction said}
- **Built:** {what the feature ledger shows}
- **Drift:** {none | minor | significant — with specifics}
## Patterns
{Recurring themes worth watching:}
- {pattern 1}
- {pattern 2}
## Recommendations
{Concrete next actions:}
1. {recommendation — e.g., "Add anti-pattern rule for X"}
2. {recommendation — e.g., "Phase Y needs tighter end conditions"}
## Numbers
| Metric | Value |
|--------|-------|
| Phases planned | {N} |
| Phases completed | {N} |
| Commits | {N} |
| Files changed | {N} |
| Circuit breaker trips | {N} |
| Quality gate blocks | {N} |
| Anti-pattern warnings | {N} |
| Rework cycles | {N} |
---HANDOFF---
- Postmortem: {name}
- Document: .citadel/postmortems/postmortem-{slug}-{date}.md
- Failures documented: {count}
- Safety catches: {count}
- Recommendations: {count}
---
development
GitHub issue and PR investigator. Pulls open issues/PRs, classifies them, searches the codebase for root cause or reviews contributed code, proposes fixes with file:line references, and optionally implements fixes. Handles both issues and pull requests.
development
Generate and verify tests — happy path, edge cases, error paths — using the project's own framework and patterns
development
Four-phase root cause analysis: observe, hypothesize, verify, fix. Enforces investigation before code changes and stops guess-and-check debugging.
testing
First-run experience for the harness. Detects the project stack, scaffolds the .citadel/ state directory, generates configuration, runs one real task as a demo, and prints a reference card of all available skills. Gets someone from install to first `do` command in 5 minutes.