Retrospective on a session or PR cycle: frictions from transcript + gh become optimization inbox entries. Triggers: "/we:retro", "retro", "post-mortem".
Install
npx skillscat add weside-ai/claude-code-plugin/retro Install via the SkillsCat registry.
/we:retro
- Apply
${CLAUDE_PLUGIN_ROOT}/references/privacy-guard.mdat every step that reads the transcript. - A retro captures; it never edits a rule, skill, instruction file or source file. Each finding
becomes an inbox entry per${CLAUDE_PLUGIN_ROOT}/references/optimization-store.md, and/we:optimizedecides it later. - Create no ticket unless the user asks.
Invocation: /we:retro (this branch and its last PR) · --pr <N> · --session <id> (read that
session's transcript instead of this one) · --auto (§ Auto mode: asks nothing, writes entries only).
Where entries go
- The repo's
.weside/optimization/inbox/, also for a finding about a plugin file (target_repo: plugin). - No store: manual → ask once whether to create it (
/we:setup§ Instruction loop), declined →
print the findings only;--auto→ write nothing and end with one line saying so. - The plugin's own checkout (
originmatchesrepositoryinplugin.json): print the findings, write nothing. --auto: where the store reference's § Staging says.
Auto mode
/we:orchestrate and /we:merged each decide by their own criteria whether a cycle earns a retro,
then dispatch it here the same way:
- Skip when PR
<N>is already covered: a claim fileclaims/pr-<N>in the staging directory
(${CLAUDE_PLUGIN_ROOT}/references/optimization-store.md§ Staging), or an evidence line namingPR #<N>in the inbox or the staging directory. touchthe claim file, then dispatchAgent(subagent_type="we:dev-medium", name="retro-<N>")
with the brief "Use the Skill tool with skillwe:retroand args--auto --pr <N> --session $CLAUDE_CODE_SESSION_ID. Work from ." The caller does not wait for it.
Gather (parallel)
- The transcript: in context, or
~/.claude/projects/<repo-id>/<session>.jsonl(after a compaction,
or the--sessionid), scoped to this cycle. Look for user corrections, nudges ("go on"), stops
that announced instead of acting, avoidable questions, loops on one problem, false "green" reports. - With authenticated
gh:gh pr view <N> --json commits,reviews,comments,statusCheckRollup,gh pr checks <N>, the failing part of each red run (gh run view <id> --log-failed). Withoutgh:git log --oneline origin/<default>..HEADand say that PR/CI data is missing. - The instruction files that loaded:
AGENTS.md/CLAUDE.md,.claude/rules/**(frontmatter and
first lines), the skills the cycle ran. ~/.claude/we-timing/<session>.jsonlfor the cycle's session (the--sessionid, else this one;
missing → say so): itsInstructionsLoadedlines name the rule files that loaded and why, itsPreToolUse(skill) andUserPromptExpansionlines the skills that ran;
cite them as evidence instead of inferring frompaths:frontmatter.
Findings
Each friction: what happened, the evidence (transcript turn, duration, commit range or run id), the
root cause, and the instruction line that caused it, or that was missing. A friction with no
instruction-file remedy is dropped.
Map each to an entry: target file (path-bound rule > always-loaded instruction file > docs/ >
plugin file), pattern (gap for a missing instruction; otherwise the audit id it matches, e.g.G2-volatile for a line the code contradicts, G2-conflict for two files that disagree,G2-recency for a rule that steered the session around a problem that was not there), action and
confidence (High when the transcript shows the user correcting it, else Medium). The entry body
carries the proposed lines. Evidence line: - <date> retro PR #<N> | session <id>: <fact>.
Write
- Per finding,
ls .weside/optimization/inbox/????-??-??-<key>.md(and staging): a hit gains an evidence
line. Before a
new file, read the inbox, staging andLEDGER.mdentries on the same target file; one that
describes the same failure gains the evidence line under its key (store reference § Inbox entry,
stable keys). Only then a new file. A target outside the repo is written astarget: ~/<path>. - Commit per
${CLAUDE_PLUGIN_ROOT}/references/optimization-store.md§ Layout (where store commits land), except--autoin staging. - Close with one line: entries created, entries repeated (with their new counts), where they are.