Postmortem

From FriendlyInternet/nuxt-crouton · View interactive version

Postmortem is an AI agent skill from the GitHub repository FriendlyInternet/nuxt-crouton. At the close of an epic (or a difficult issue), post a postmortem roundup comment โ€” what went well, what was hard (backed by evidence), and 1โ€“3 concrete proposals to improve the skills/flows โ€” then offer to turn accepted proposals into their own `workflow`-labeled tasks, and end with a `๐Ÿ”ญ Next` han

How to use this skill

Skill file

Postmortem โ€” learn from the epic, tighten the loop

Turns a just-finished epic (or a difficult issue) into a short, honest **retro

comment on the epic**, plus an offer to spin the good ideas into tracked

workflow tasks. The point isn't ceremony โ€” it's that **the loop only gets

tighter if we feed each run's friction back into the skills and flows**. See

epic #403.

This runs after the github-tasks "## ๐Ÿงช Verify the whole thing" rollup

(verify = does it work?) and before the epic is closed (postmortem =

how did building it go, and how do we improve?).

When to use

What it produces

A single comment on the epic (add_issue_comment) with three sections, and

โ€” on your go-ahead โ€” one or more new issues labelled workflow.

Step 1 โ€” Resolve scope

children merged cleanly vs. needed re-work.

Step 2 โ€” Mine the difficulty signals (evidence, not vibes)

For each child issue (and its PR), pull what the available tools can give. Each signal

below lists how to get it and how precise it is โ€” be honest about the gaps, and

never imply a measurement you didn't make.

| Signal | How to get it (GitHub MCP) | Precision |

|---|---|---|

| Time-in-progress | get_sub_issues โ†’ per child created_at โ†’ closed_at | rough (proxy for build effort) |

| Sign-off rounds | issue_read get_comments on the child's PR โ†’ count revisions on the <!-- ui-proposal:* --> / <!-- schema-review:* --> sticky thread + review replies | good (markers are explicit) |

| Asked-for-help / blocks | get_comments โ†’ count @-mention + "blocked" comments; get_labels โ†’ is status:blocked still on it | good for count |

| Blocked duration | not exposed directly (label add/remove timestamps aren't in these MCP methods) โ†’ approximate from the gap between the blocking comment and the resuming comment | weak โ€” state it's an approximation |

| Re-work / commit churn | list_commits on the PR branch โ†’ many "fix"/"oops" rounds = friction | available now |

| Fix-bot attempts | the claude/issue-* retry count (from #336 watch-to-merge) | only when #336 is live โ†’ say "n/a" otherwise |

| Reopens | issue_read get per child โ†’ reopened-after-close | approx |

| Run records (pipeline-data) | runs, silent runs, rounds, time to main, owner touches beyond ok โ€” node scripts/epic-numbers-run.mjs <epic> <outDir> --records-dir <dir> (from git archive origin/pipeline-data records), computed by scripts/lib/epic-numbers.mjs (#3253) | exact; no records before 2026-11-04 โ€” say so, never write zeros |

| Ticket steps vs diff | per child: the ticket's numbered/bulleted steps (steps.md from the same CLI) against gh pr diff <pr> | judgment โ€” list only the steps not done |

Aggregate into 3โ€“5 "what was hard" lines, each tied to a specific child + its signal.

Prefer a few true signals over a complete-looking guess; where a signal is unavailable,

write "n/a (not measurable with current tooling)" rather than inventing a number.

Step 3 โ€” Write the roundup comment

Keep it terse and human-first (the github-tasks two-audience convention). Three

sections:

issue (e.g. *"#NN sat blocked 3 days waiting on a sibling; the schema gate took

2 revision rounds"*). Cite silent runs and high round counts from the run records by link.

as not done / dropped with reason (link to the note) / dropped without a note; end with

one line all other N steps done (#3253).

write it yourself there; by hand, paste numbers.md from the CLI above.

flow** that would remove that friction next time. Each proposal = a candidate

workflow task with a one-line "why".

paste-ready next-session prompt. End the roundup with this so it's the first

thing visible when the epic is reopened.

Lead the comment with a machine-readable marker so automation can detect that

this epic has had its postmortem without parsing the prose. Put it on the very

first line (it's an HTML comment โ€” invisible in the rendered view, present in the

raw body via the API):

<!-- postmortem:done epic=#NN -->

The "ready to close vs needs postmortem" labeller (#763, label-ready-epics.mjs)

greps the epic's comments for postmortem:done: present โ‡’ status:ready-to-close,

absent โ‡’ status:needs-postmortem. Use the real epic number for #NN.

In CI (postmortem.yml, #3425) the model only writes the body; the trusted post step adds the marker, posts, flips the labels; the auto-close job then closes the epic if it is on main and its test card is ok'd (or it has none) (#3012). It also appends the ๐Ÿ“Š Numbers block (or a "Numbers didn't run" line) and stores epics/<N>.json on pipeline-data; neither ever blocks the post or the close (#3253). The model adds the ๐Ÿงพ Ticket steps vs diff section. To try it on an epic that already has a postmortem, dispatch postmortem.yml with dry_run (posts nothing; the body lands in the job summary). A failed run posts <!-- postmortem:skipped epic=#NN --> instead. Markers only count from the pipeline bots or an owner/member/collaborator.

Post it with add_issue_comment on the epic.

Flip the labels immediately (don't wait for the daily cron). Right after posting,

add status:ready-to-close and remove status:needs-postmortem on the epic

(issue_write / label tools) so the review queue updates now โ€” label-ready-epics

stays as the daily safety net. The epic then closes by itself once it is on main and its test card is ok'd (or it has

none) (#3012); /close-epic (the close-epic job in on-comment.yml, #856) is the

fallback โ€” mention it in ๐Ÿ”ญ Next only when the epic is stuck.

Step 4 โ€” Dedup against existing follow-ups, then offer to turn proposals into work

(pipeline run: list where each proposal is tracked or mark it new โ€” not minted; never create issues)

First, dedup โ€” don't mint duplicates. Before proposing anything new, search for an

existing home for each proposal: an open follow-up / "harden X" epic or issues that

already capture it. Use search_issues with the proposal's keywords (and label:epic),

and check the source epic's own linked follow-ups. If a proposal is already tracked,

link to that issue/epic in the roundup instead of opening a new one; add only a

genuinely-new proposal to that epic as a sub-issue (sub_issue_write). The roundup

should state, per proposal, where it's tracked (existing #NN, or "new").

Why this matters: the #274 dogfood found its proposals already lived in epic #291 โ€”

the right move was to link #291, not open parallel workflow issues.

Then ask the human (plain): *"Open the remaining (untracked) proposals as workflow

tasks?"* On a yes, for each accepted, not-already-tracked proposal create an issue

with issue_write:

Don't open issues the human didn't accept; don't pad with filler โ€” 1โ€“3 real ones beat ten

generic ones; and **never open a workflow issue that duplicates an existing follow-up

epic** โ€” link it instead.

Step 5 โ€” Propagate the change to neighbouring issues

The epic's decisions often land on other tickets โ€” a sibling epic, a consumer, something it

supersedes. Tell them, so nobody works around a change they didn't know happened.

plus a keyword search_issues on the change (reuse the Step-4 dedup search).

(e.g. "#515's release now wires to this App โ€” see #NN"). This is how live work wires into the

change instead of around it.

terse "superseded / updated by #NN" forward-pointer for later archaeology. Never for mere

topical relevance (dead-ticket noise).

mentions (same spirit as the Step-4 dedup). Each comment carries the ๐Ÿค– provenance header and

is informational (won't trip agent-resume triggers).

Step 6 โ€” Hand off the next session (the `๐Ÿ”ญ Next` block)

A postmortem must not dead-end โ€” it points at what to do next, so there's no "now what?" gap

between sessions (#615). Compose a ๐Ÿ”ญ Next block and include it as the closing section of

the Step-3 roundup (so it's visible the moment the epic is reopened), **and echo the same block in

your chat reply** so it can be pasted straight into a new session.

  1. Pick the next epic. From the initiative tree this epic belongs to (e.g. the [Initiative]

parent) and the open label:epic list, choose the most sensible next one:

highest-priority open flow epic;

State the choice + a one-line why. If there's no obvious next epic, say so and offer

2โ€“3 candidates rather than guessing.

  1. Emit a paste-ready prompt. A fenced block a human can drop into a fresh session, containing:

session needs (branch, preview URL, an open PR left as a testbed).

touch packages/ without approval ยท deploy STAGING only.

  1. Post + echo. The ๐Ÿ”ญ Next block is the last section of the roundup comment (Step 3); repeat

it verbatim in the chat reply.

Then report: the epic comment URL, the workflow issues opened (with URLs), the neighbour

issues cross-linked, and the chosen next epic. This closes the learning loop and opens the next โ€”

the proposals are on the board, the change is wired to everything it touches, and the next session

has a runway.

Conventions & gotchas

posted (the github-tasks epic-close walk-up sequences this).

and @mention the owner rather than blocking on a prompt; the owner converts

proposals to issues by replying.

trip the agent-resume triggers (resume-on-comment.yml ignores bot authors).

complete-looking but guessed one.

link in the roundup, not a fresh workflow issue (proven by the #274 dogfood,

whose learnings already lived in #291).

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.