Retrospect

From mikeprasad/aria-knowledge · View interactive version

Retrospect is an AI agent skill from the GitHub repository mikeprasad/aria-knowledge. Run a structured retrospective on a commit, range, PR, release, deployment, or session after execution. Trigger on /retrospect, postmortem, release review, or what went wrong.

How to use this skill

Skill file

/retrospect โ€” Release retrospective with validation enforcement

Run a structured retrospective on a shipped commit range (or single commit, or current session). Produces a 10-section markdown report with per-fix verdicts, validation status, action recommendations, and re-diagnosis when fixes failed. Writes findings to knowledge/logs/retrospect/ and runs aria's standard intake. Source spec: docs/specs/2026-05-03-retrospect-skill-design.md.

When to use

Step 0: Inputs & Mode Detection

Parse the invocation arguments. The first positional argument is the scope keyword; subsequent positional arguments are scope-specific. Seven scopes plus a no-args default:

| Scope | Trigger | Backward-compat flag (still accepted) | Bundle source |

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

| (no args) | /retrospect | โ€” | Auto-range: last push on current branch โ€” git log @{push}..HEAD if upstream is set, else git log -10 and ask user to confirm range |

| commit | /retrospect commit <hash> | --commit <hash> | Single commit |

| range | /retrospect range <ref1>..<ref2> | --range <ref1>..<ref2> | git log <ref1>..<ref2> |

| pr | /retrospect pr <num> | --pr <num> | gh pr view <num> --json commits then resolve to commit SHAs |

| session | /retrospect session | --session | Files Claude has touched in the current conversation (read from session state, not git). No deploy yet โ€” all fixes auto-tag ๐Ÿšซ unvalidatable. |

| release (NEW) | /retrospect release | (none) | Commits since the most recent semver tag. git describe --tags --abbrev=0 to find the tag, then git log <tag>..HEAD. If no tags exist on the repo, fall back to auto-range and warn the user. |

| deployment (NEW) | /retrospect deployment | (none) | Commits since the last deployment marker โ€” see "Deployment detection cascade" below. |

Argument parsing rules:

Deployment detection cascade (Q2.1=3)

When invoked as /retrospect deployment, attempt to resolve the deployment marker by trying these signals in order. First success wins; on no-success, fall through to the prompt.

  1. GitHub Releases โ€” gh release view --json publishedAt,tagName 2>/dev/null (most recent release). If returned, treat the release tag as the marker; bundle = git log <tag>..HEAD.
  2. Semver tags โ€” git tag --sort=-creatordate | head -1. If a tag matches v?\d+\.\d+\.\d+ (and step 1 returned nothing), use it as the marker.
  3. Last commit on main (or master) โ€” git log -1 --format=%H origin/main (or origin/master if main doesn't exist). Treat as the marker; bundle = git log <sha>..HEAD. This catches projects without releases or tags.
  4. Prompt user โ€” if none of the above resolved (e.g., no remote, no tags, no gh auth), ask: "I couldn't auto-detect the last deployment for /retrospect deployment. Provide a marker (commit hash, tag, or ISO timestamp), or type auto-range to fall back to last-push behavior."

Print the resolved marker source ("Detected via gh release: v1.4.2 (2026-05-01)") in the Anchor block (ยง4.1) so the user can verify what the skill thought "deployment" meant.

After mode detection, gather:

  1. Goal โ€” Ask the user: "What was this release/range supposed to fix? (One sentence is fine.)" If they don't reply, fall back to commit message subjects + PR description.
  2. Tickets โ€” Scan commit messages with regex \b([A-Z]{2,}-\d+)\b for ticket IDs (the pattern is vendor-neutral โ€” it matches DEV-123, PROJ-45, JIRA-9 alike). If any are found AND a project-tracker MCP is available, fetch each ticket's Product/Technical Intake + recent comments. If a project-tracker MCP is unavailable, note "ticket context unavailable" but continue.
  3. Post-deploy outcome โ€” Ask the user: "For each fix, what's the post-ship evidence? (โœ… closed / โš  partial / โŒ failed / โ“ untested)" Show the per-commit list and accept inline replies. If user can't supply evidence for any fix, mark those โ“ and note that ยง10 will recommend instrumentation.

If scope is session (or invoked via --session), skip post-deploy outcome (no production yet) and tag all fixes ๐Ÿšซ unvalidatable; their actions will resolve to HOLD-PENDING-DEPLOY.

Step 0.5: Active Knowledge Surfacing

If the user's config (~/.claude/aria-knowledge.local.md) has active_knowledge_surfacing: true (default as of v2.15.0), surface relevant tagged knowledge BEFORE Steps 1-3 so loaded files inform pattern selection and evidence sourcing. If the field is false, skip this step entirely (note Active surfacing: disabled in the Anchor block).

Algorithm:

  1. Build references. The CLI reads what the scope is about itself; you hand it references, never text:

2โ€“6. Rank and select (one CLI call โ€” do not re-implement it). Run the surfacing CLI with those references, every argument in single quotes: if an ARIA SURFACE โ€” "<path>" line reached you at session start, use that path, as sh '<path>'; otherwise use ARIA_PLUGIN_ROOT="${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}"; sh "${ARIA_PLUGIN_ROOT}/bin/aria-surface.sh" with the same arguments. Pass --file and --git-range together when the scope has both:

sh '<path>' --git-range '<a>..<b>'
sh '<path>' --file '<file path>'

โ›” Never put task text โ€” a goal sentence, a PR title, a commit subject, pasted text โ€” on the command line, in a heredoc or through a pipe: the shell runs backticks, $(โ€ฆ) and $VAR there. A path or a ref range is a reference you chose, and single quotes keep it literal; the CLI reads the range's commit subjects, or the file's headings and first lines, itself. It reads the tag index, matches tags (including the configured-project vocabulary and aliases) and ranks the candidates; it prints line 1 tags: <matched tags> followed by up to 5 ranked paths, one per line, relative to <knowledge_folder> (resolve <knowledge_folder> from the config's knowledge_folder field). It prints nothing when surfacing does not fire (no matching tag, or below the firing rule) โ€” in that case note Active surfacing: 0 matches (below threshold) in the Anchor block and skip to Step 1. โ›” If it prints unavailable: <reason> (no config, no index, an unreadable index, or an internal error), or the command is not found or exits non-zero, note Active surfacing: unavailable (<the reason or error>) in the Anchor block instead โ€” never Active surfacing: 0 matches, which would claim the index was searched โ€” and skip to Step 1. The ranking lives in that script alone: never re-order, re-cap or re-filter its output.

  1. Ledger filter (best-effort). The ledger is the file named by ledger= in this session's ARIA CONFIG line โ€” the session-start hook names it, in the private per-user state directory, with this session's own id. If that file exists, read it and drop any matched paths already listed there โ€” they were surfaced by an earlier hook/skill in this session. โ›” If ledger= is none, or no ARIA CONFIG line reached you, or the file is absent, skip nothing: proceed UNFILTERED and say so in the surfacing block (Ledger: none for this session โ€” proceeding unfiltered). โ›” Never substitute a path of your own: another session's ledger DROPS files never surfaced to this session, so the filter would suppress exactly the knowledge this step exists to load. The ledger records paths RELATIVE to <knowledge_folder>, the same form the index lists them in and (in Claude Code) the CLI prints them in, so compare paths against ledger lines exactly as printed; do not resolve them first.
  1. Read matched files. For each remaining path (up to 5), resolve it against <knowledge_folder> to an absolute path before Read (the tool needs an absolute path; paths come relative), then Read the full file into context. Read the top 5 as ranked. Then, if none of the paths you read is under logs/retrospect/, look under the tags on the CLI's tags: line in ## Tag Index of <knowledge_folder>/index.md for logs/retrospect/ lines and Read at most ONE โ€” the most recent by its dated filename โ€” and say in the surfacing block that it was added for loop closure (past retros inform new retros on the same topic). Never reorder or drop any of the top 5.
  1. Summarize. Before Step 1's Anchor Block, emit a 3-line surfacing block:

```

Active Knowledge Surfacing:

Tags matched: <tag1> <tag2> ...

Files loaded: <N> (<file1>, <file2>, ...)

Relevance: <one sentence per file: why this informs the retrospective>

```

  1. Carry-forward. These loaded files become input to Step 2 (Load Pattern Libraries โ€” past retros may already have catalogued the relevant failure-mode patterns) and Step 3.5 (Evidence-Sourcing Pass โ€” they may already provide validation or falsification for fixes in this range).
  1. Tracked artifacts surfacing (added v2.16.1). After Step 10's carry-forward, ALSO surface CODEMAP + STITCH for the analyzed range's project. The shared lib at ${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}/bin/lib-tracked-artifacts.sh implements equivalent logic for hooks; this step inlines the algorithm for skill-context portability.

a. Detect project tag from changed file paths. Run git diff --name-only <range> for the analyzed bundle. For each changed file, check whether any projects_list[<tag>].path appears as substring. Count matches per tag; pick the tag with the most matches. Tie-breaker: explicit project flag if provided. If no detection (e.g., bundle touches knowledge folder only, no project files), skip the rest of Step 11.

b. Resolve project root via Bash. Parse projects_list: from ~/.claude/aria-knowledge.local.md frontmatter (comma-separated tag:path). For the detected tag, compute project_root = $HOME/Projects/<path>. If directory doesn't exist, skip.

c. CODEMAP directory load (if {project_root}/CODEMAP.md exists). Compute boundary via awk '/^## [0-9]+\.|^---$/ && NR>5 {print NR; exit}' "{project_root}/CODEMAP.md"; Read limit = (end - 1) (fallback 50 if awk empty). Compute age = (today - mtime).days; read codemap_staleness_threshold_days (default 14). If age > 2*threshold, refuse and emit [refused โ€” run /codemap update first]. Else if age > threshold, annotate [STALE โ€” consider /codemap update]. Else fresh. Unless refused: Read {project_root}/CODEMAP.md offset=0 limit=<end-1>.

d. STITCH load (only if {project_root}/STITCH.md exists โ€” multi-repo signal). Same staleness logic with stitch_staleness_threshold_days (default 30). Unless refused: Read {project_root}/STITCH.md (full file).

e. Ledger dedup. Use the same ledger โ€” the file named by ledger= in ARIA CONFIG (see item 7). Before loading in (c)/(d), grep ledger for each artifact path; if found, silent skip (already surfaced by earlier T-1/T-2/T-3 trigger) and emit Tracked artifacts: (already loaded earlier this session for {tag}) in the surfacing block. After loading, append loaded paths to the ledger. If ledger= is none or absent, skip the dedup and load.

f. Output. Extend the Step 9 surfacing block with a 4th line:

```

Tracked artifacts: CODEMAP directory + STITCH for {tag} ({N} / {M} days fresh)

```

Variants: CODEMAP directory only for single-repo (no STITCH); (no CODEMAP for {tag}) if missing; [STALE โ€” consider /codemap update] annotation; (already loaded earlier this session) if ledger-deduped; (none โ€” no project detected) if (a) returned nothing.

g. Carry-forward. The loaded artifacts become available to Steps 3+ โ€” particularly Step 3 (Enumerate Fixes; CODEMAP sections map changed files to features/responsibilities) and Step 3.5 (Evidence-Sourcing Pass; CODEMAP can validate that a fix actually touches the expected feature surface).

Skip Step 11 entirely if active_knowledge_surfacing: false (already gated above).

Step 1: Print the Anchor Block

Before producing any verdict, emit the anchor so the rest of the report can be traced to inputs:

Anchor:
  Goal:    <stated goal>
  Mode:    <auto-range | commit | range | pr | session | release | deployment>
  Range:   <commit range descriptor, e.g. v0.4.2..HEAD, 12 commits, 38 files>
  Tickets: <ABC-123 (Acceptance: ...), ABC-456 (...) | (none) | (unavailable)>
  Outcome: <user-supplied per-fix status table | (untested) | (per-session โ€” no deploy)>

Step 2: Load Pattern Libraries

Read the canonical pattern library at <knowledge_folder>/rules/retrospect-patterns.md (resolved per ~/.claude/aria-knowledge.local.md knowledge_folder).

If the bundle is detected to belong to a known project (commits include paths under a configured projects_list[<tag>].project_root), additionally read <knowledge_folder>/projects/<tag>/retrospect-patterns.md if it exists.

Hold both pattern lists in context for use in ยง4.4 (Failure-Mode Pattern Check). Do not run pattern detection yet โ€” this step is just loading.

Step 3: Enumerate Fixes & Preliminary Triage

For the loaded bundle, enumerate each fix. A fix is one of:

Number them #1, #2, โ€ฆ in commit order. For each fix, capture:

If session scope, enumerate by file-touch sets that resolve a single concern (Claude's judgment from session context). Preliminary Bundle-verified? = N/A and Preliminary Validated? = ๐Ÿšซ unvalidatable (no deploy yet).

After preliminary triage, list every fix whose Preliminary Bundle-verified? is ๐Ÿคท โ€” these are candidates for Step 3.5's bundle-marker pass. Separately, list every fix whose Preliminary Validated? is โš  partial / โ“ unvalidated / ๐Ÿšซ unvalidatable โ€” these are candidates for Step 3.5's outcome pass. โŒ Invalidated fixes skip Step 3.5 (they go directly to REVERT/REDO-MINIMAL in ยง4.3 unless the user contests the falsification). โœ… Validated fixes also skip Step 3.5 (already confirmed).

Step 3.5: Evidence-Sourcing Pass

Two sub-passes that run in order before the report is rendered. Goal: convert as many ๐Ÿคท / โš  / โ“ / ๐Ÿšซ candidates from Step 3 to โœ… or โŒ as possible before ยง4.2 emits its bundle-verification verdict and ยง4.3 emits its per-fix Validated? verdict.

This step can be skipped with the --no-source flag for a quick structural review. When skipped, all preliminary statuses pass through to ยง4.2 and ยง4.3 unchanged and ยง4.10 lists every gap as NOT-ATTEMPTED.

The synchronous-barrier discipline applies: if a sub-pass surfaces a USER-INPUT ask, hold for response. Default to one ask at a time unless the user asks for a batch.

3.5.1: Bundle-Marker Sub-Pass (resolves ๐Ÿคท)

For each fix from Step 3 with Preliminary Bundle-verified? = ๐Ÿคท, attempt to confirm the fix's code is present in the deployed bundle.

Auto-source candidates (most retrospects fall here):

USER-INPUT escape hatch:

Record per fix using the same shape as /prospect's 3.5.2:

Fix #N โ€” bundle-marker result:
  Question:           Did fix #N's code reach the deployed bundle?
  Tool used:          <Bash curl <url> | WebFetch <url> | gh run view <id> | mcp__vercel__get_logs | ASK <surfaced-to-user>>
  Finding:            <one-paragraph factual summary, with URL anchor or grep hit>
  Verdict:            UPGRADED-TO-โœ… verified | UPGRADED-TO-โŒ NOT-IN-BUNDLE | NO-MOVEMENT-CAPABILITY | NO-MOVEMENT-STRUCTURAL | INCONCLUSIVE
  New Bundle-verified?: <updated tag>

When this sub-pass completes, every fix has a final Bundle-verified? value (โœ… verified / ๐Ÿคท unverified / โŒ not-in-bundle). ยง4.2 emits this state directly. โŒ NOT-IN-BUNDLE is a strong signal โ€” the fix definitively did not ship; its action defaults to REVERT or RESHIP-AND-VERIFY in ยง4.3.

3.5.2: Outcome Sub-Pass (resolves โš  partial / โ“ unvalidated / ๐Ÿšซ unvalidatable)

For each fix from Step 3 with Preliminary Validated? = โš  / โ“ / ๐Ÿšซ AND Bundle-verified? โ‰  ๐Ÿคท (a fix that didn't ship can't be outcome-validated), attempt to confirm the fix's outcome in production.

Generate the decisive question โ€” what observable evidence would change the verdict from โš /โ“/๐Ÿšซ to โœ… Validated or โŒ Invalidated? Format:

Fix #N: <subject>
  Preliminary Validated?:  <โš /โ“/๐Ÿšซ>
  Decisive question:        <one-line โ€” "what observable evidence would close this?">
  Answer source:            AUTO-SOURCEABLE | USER-INPUT | MIXED
  Sourcing plan:            <tools/queries to run>

Auto-source candidates (retrospect-specific):

USER-INPUT escape hatch (and when to demote to it):

Surface format mirrors /prospect's 3.5.3 exactly:

[ASK #M of K] Fix #N โ€” <subject> (<short-sha>)

Why this matters:
  <one-line โ€” what changes about Fix #N's verdict if we know this>

What I tried autonomously (if MIXED):
  <one-line โ€” e.g., "Queried Vercel logs since deploy; found 0 occurrences of the targeted error and 4 of an adjacent error. Ambiguous โ€” need your read on whether the adjacent one is a regression.">

Citations / context inline:
  <log excerpts, ticket comment quotes, test output โ€” whatever the answer depends on>

Options:
  1) <option, with one-line consequence>
  2) <option, with one-line consequence>
  3) Other โ€” describe in reply
  4) Skip โ€” leave fix #N at <preliminary status>; it will HOLD-PENDING-EVIDENCE in ยง4.10

Same rules as /prospect's 3.5.3: neutral framing, separate Recommendation line allowed below options, per-question explicit pick, bare-number replies pick, "Skip" defaults to HOLD-PENDING-EVIDENCE / HOLD-PENDING-DEPLOY / HOLD-PENDING-VERIFICATION as appropriate.

Record per fix:

Fix #N โ€” outcome result:
  Question:           <repeat decisive question>
  Tool used:          <listed>
  Finding:            <factual summary with citations>
  User pick (if any): <option N | "skip" | "other: <text>">
  Verdict:            UPGRADED-TO-โœ… Validated | UPGRADED-TO-โš  partial | UPGRADED-TO-โŒ Invalidated | NO-MOVEMENT-CAPABILITY | NO-MOVEMENT-STRUCTURAL | INCONCLUSIVE

โ›” A no-movement verdict MUST pick one of the two โ€” in both sub-passes (3.5.1 bundle-marker and 3.5.2 outcome). They respond to a better pass in opposite directions, so a pooled tally cannot be interpreted later: a falling unresolved rate becomes indistinguishable from a shift in what kind of claims the range happened to contain.

โš  Classify at the moment you stop, while you still know why you stopped โ€” not afterwards from the residual's Attempt status label. Measured 2026-08-22 across 5 such entries, 3 were mislabelled: they carried ATTEMPTED-FAILED while describing an on-device recording, a package fetch, and an SSH read of a live box.

  New Validated?:     <updated tag with sub-tag where applicable>

3.5.3: Constraints (apply to both sub-passes)

3.5.4: Pass Summary

When both sub-passes complete, emit a one-block summary before moving to Step 4:

Evidence-Sourcing Pass complete.

Bundle-marker sub-pass (ยง3.5.1):
  Candidates examined:        <N>
  Upgraded to โœ… verified:     <N>
  Upgraded to โŒ not-in-bundle: <N>
  No movement (still ๐Ÿคท):       <N>
  Skipped by user:             <N>

Outcome sub-pass (ยง3.5.2):
  Candidates examined:        <N>
  Upgraded to โœ… Validated:    <N>
  Upgraded to โš  partial:       <N>
  Upgraded to โŒ Invalidated:  <N>
  No movement (still โš /โ“/๐Ÿšซ): <N>
  Skipped by user:             <N>

Total tool calls:             ~<N>
Skipped by --no-source:       <N> (entire pass)

The post-pass values feed ยง4.2 (Bundle-verified?) and ยง4.3 (Validated?). The residual ๐Ÿคท / โš  / โ“ / ๐Ÿšซ plus their attempt-status feed ยง4.10.

Step 4: Produce the 10-Section Retrospective Report

Render a markdown document with the 10 sections below in order. Each section heading uses ### N. <title> format. Sections that don't apply to the current scope are emitted with a one-line "N/A: <reason>" โ€” never silently skipped.

4.1. Section 1 โ€” Anchor & Inputs

Re-emit the anchor block from Step 1, verbatim, as Section 1 of the report. This makes the report self-contained when read outside the chat.

4.2. Section 2 โ€” Bundle-Verification Gate

For each fix from Step 3, emit the post-Step-3.5.1 Bundle-verified? status. ยง4.2 is the bundle-deployment ledger; its values come directly from Step 3.5.1's Bundle-Marker Sub-Pass, which already attempted to source the marker autonomously and surfaced any USER-INPUT asks that were needed.

Three possible statuses per fix:

Render as a clear list per fix:

Fix #N: <subject> (<short-sha>)  โ†’  <โœ… Verified | ๐Ÿคท Bundle-unverified | โŒ Not-in-bundle>
  Source: <Step 3.5.1 tool/finding citation, e.g., "curl <url> | grep '[CSB-DIAG-042]' โ†’ 1 hit">
  (For ๐Ÿคท) Reason: <Step 3.5.1 verdict tag>
  (For โŒ) Implication: <RESHIP-AND-VERIFY or REVERT, deferred to ยง4.3 action>

If the scope is session, this section emits "N/A: session scope (no deploy yet)." Step 3.5.1 is also a no-op in this scope.

4.3. Section 3 โ€” Per-Fix Verdict

For each fix from Step 3 that passed ยง4.2 (bundle verified or session mode), emit a horizontal-rule-separated block with these fields. Mirror the formatting style of the baseline review tag taxonomy (โœ…, โš  partial, โš  over-engineered, โš  theory-wrong, โš  counterproductive).

Required fields:

Optional fields:

Render each fix as a block, not a wide table:

Fix #N: <subject> (<short-sha>)
Status:                <tag>
Necessary?:            <YES/NO/UNCLEAR> โ€” <reason>
Complications:         <list or None>
Minimal alternative:   <description>
Maintenance cost:      <description>
Validated?:            <status>  (post-Step-3.5.2)
Evidence sourced (optional): <one-line with citation>
Action:                <action>
Rule cite (optional):  <rule>
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

Hard rule (action gating):

The hard rule mirrors /prospect's discipline: actions cannot upgrade past their evidence floor. Step 3.5 has already attempted to lift evidence floors; what remains is genuine residual uncertainty that gates action selection.

4.4. Section 4 โ€” Failure-Mode Pattern Check

Run the bundle against both pattern libraries loaded in Step 2 (canonical + project-specific if applicable). Detection is judgment-based โ€” read each pattern's "Detection cues" and assess whether the bundle, commit messages, or session transcript exhibits them.

For each pattern hit, emit:

[PATTERN] <pattern-name> (source: rules/retrospect-patterns.md | projects/<proj>/retrospect-patterns.md)
  Evidence: <what in the bundle/transcript triggered the hit>
  Counter-discipline: <one-line reminder of the pattern's counter-discipline>

If no patterns hit, emit: "No catalogued failure-mode patterns detected. (See ยง9 for novel patterns.)"

4.5. Section 5 โ€” Cross-Change Tally

Emit raw counts only โ€” no interpretation in v1.

Tally:
  Fixes shipped:                    <N>
  Validated (โœ…):                    <N>   (post-Step-3.5.2)
  Partially validated (โš ):           <N>   (post-Step-3.5.2)
  Invalidated (โŒ):                  <N>   (post-Step-3.5.2)
  Unvalidated (โ“):                  <N>   (post-Step-3.5.2)
  Unvalidatable (๐Ÿšซ):                <N>   (post-Step-3.5.2)
  Bundle-verified (โœ…):              <N>   (post-Step-3.5.1, ยง4.2)
  Bundle-unverified (๐Ÿคท):            <N>   (post-Step-3.5.1, ยง4.2)
  Not-in-bundle (โŒ):                 <N>   (post-Step-3.5.1, ยง4.2)
  Theory-driven refactors:          <N>
  Required by ticket acceptance:    <N>
  Discovered-during-process:        <N>
  Pattern hits this run:            <N>

Evidence-Sourcing Pass โ€” bundle-marker sub-pass (ยง3.5.1):
  Candidates examined:              <N>
  Upgraded to โœ… verified:           <N>
  Upgraded to โŒ not-in-bundle:      <N>
  No movement (still ๐Ÿคท):            <N>
  Skipped by user:                  <N>

Evidence-Sourcing Pass โ€” outcome sub-pass (ยง3.5.2):
  Candidates examined:              <N>
  Upgraded to โœ… Validated:          <N>
  Upgraded to โš  partial:             <N>
  Upgraded to โŒ Invalidated:        <N>
  No movement (still โš /โ“/๐Ÿšซ):       <N>
  Skipped by user:                  <N>

Sourcing pass overall:
  Total tool calls:                 ~<N>
  Skipped by --no-source:           <N>   (entire pass)

A "theory-driven refactor" is a fix that rewrote working code based on a hypothesis rather than a confirmed bug location. Discovered-during-process means the fix addresses a bug found while working on something else (not the original goal).

Interpretation of these counts is left to ยง4.6, ยง4.7, and ยง4.9.

4.6. Section 6 โ€” Re-frame Check

Three questions, in order. Answer each in 1โ€“2 sentences with the supporting evidence.

  1. Is the original problem statement still right? Or did the bundle reveal that the user-reported bug is a different bug than the bundle was aimed at?
  2. Was the bug correctly scoped? Single bug, or multiple bugs presenting as one?
  3. Is the user-reproducible scenario still the right test? Or has the testing surface drifted?

If the answer to #1 is "no," explicitly note: "Re-frame triggered. Hold all fixes targeting the previous problem statement pending re-diagnosis (ยง4.7)."

4.7. Section 7 โ€” Re-diagnosis

List the surviving hypotheses for the actual root cause (only run this section if any fix's post-Step-3.5.2 Validated? is โŒ Invalidated or โš  partial, OR ยง4.6 triggered re-frame). For each hypothesis:

Hypothesis: <one-line statement>
  Used by fixes: <#1, #3, #5>
  Evidence FOR:    <observations consistent with this hypothesis โ€” INCLUDE Step 3.5.2 sourced findings with citations>
  Evidence AGAINST: <observations inconsistent โ€” INCLUDE Step 3.5.2 sourced findings>
  Sourcing attempted: <YES (see Step 3.5.2 result for fixes #N) | NO (auto-sourcing skipped, declined, or not categorized as auto-sourceable)>
  Confidence:      LOW / MEDIUM / HIGH
  To confirm:      <specific signal to look for โ€” feeds ยง4.10>

Evidence FOR/AGAINST must integrate any findings from Step 3.5.2's outcome sub-pass. If Step 3.5.2 produced a finding that moved a fix to โš  partial (e.g., closed-part-of-target upgrade from โ“), cite that finding here as Evidence FOR the partial-success hypothesis AND as Evidence AGAINST the full-fix-worked hypothesis. If Step 3.5.2 produced a contradicting finding the user contested or overrode, note both perspectives.

Discarded hypotheses (ones the bundle's outcomes OR Step 3.5.2's sourcing proved wrong) are listed separately under "Hypotheses ruled out by this retrospective or sourcing pass" with one-line reasons and source citations where applicable. This is learning, not waste โ€” captures what was considered AND what evidence retired it.

If all fixes are post-Step-3.5.2 โœ… validated and ยง4.6 didn't trigger, this section emits "N/A: all fixes validated (Step 3.5.2 closed all gaps)."

4.8. Section 8 โ€” Action Verdict

Per fix, the action determined in ยง4.3. Render as a clear list:

Action verdict:
  Fix #1: <ACTION>  โ€” <one-line reason>
  Fix #2: <ACTION>  โ€” <one-line reason>
  ...

For REVERT actions, provide the exact git revert <sha> command. For REDO-MINIMAL actions, provide the minimal alternative diff (from ยง4.3). For FOLLOWUP-TICKET actions, draft a ticket title + Product/Technical Intake skeleton. For RESHIP-AND-VERIFY actions (introduced when ยง4.2 emitted โŒ Not-in-bundle), provide: (a) the re-deploy command appropriate to the project (gh workflow run deploy.yml --ref main, vercel --prod, project-specific deploy script โ€” pick from aria-config.md's projects_list[<tag>] if present, otherwise prompt user), and (b) a one-line directive: "After re-deploy, re-run /retrospect deployment to confirm the bundle now contains the fix and validate outcome."

End with an Overall recommendation in 1โ€“3 sentences.

4.9. Section 9 โ€” Process Retrospective

What the prior decision-making should have done differently. Format per item:

What I did:               <observed behavior>
What I should have done:  <better behavior>
Trigger condition:        <how to detect this situation in the future>
Pattern reference:        <pattern-name from library | (novel)>

If a behavior matches an existing pattern in the library, cite it. If a behavior is novel (not in either pattern library), prompt the user:

"Identified a new failure-mode pattern: <pattern-name>. Add to:

1) Canonical (rules/retrospect-patterns.md) โ€” applies project-agnostic

2) Project-specific (projects/<proj>/retrospect-patterns.md)

3) No โ€” surface in this report only

Choose: "

If user chooses 1 or 2, append a new entry to the corresponding file using the format defined in rules/retrospect-patterns.md ("Pattern entry format" section). The new entry's "First identified" field is today's date and the current retrospective's filename.

4.10. Section 10 โ€” Next-Step Evidence Ask (Residual)

Anti-speculation barrier. This section lists ONLY the residual evidence asks โ€” the questions Step 3.5 either could not source autonomously, the user deferred, or were not attempted. Items resolved during Step 3.5 (โœ… upgrades, โš  partials with Step 3.5.2 evidence, or โŒ falsifications) DO NOT appear here โ€” they're recorded in ยง4.3 (Evidence sourced field), ยง4.7 (Evidence FOR/AGAINST), and ยง4.5 (Evidence-Sourcing Pass tally blocks).

For each remaining ๐Ÿคท / โš  / โ“ / ๐Ÿšซ fix, emit the residual ask with its attempt-status:

For Fix #N (<subject>) โ€” current status: <๐Ÿคท / โš  partial / โ“ / ๐Ÿšซ>
  Attempt status:    NOT-ATTEMPTED | ATTEMPTED-FAILED | DEFERRED-BY-USER | SKIPPED-BY--no-source
  Sub-pass:          BUNDLE-MARKER (ยง3.5.1) | OUTCOME (ยง3.5.2)
  Why residual:      <one-line โ€” e.g., "Auto-source attempted via Bash curl <bundle-url>; URL returned 403. Demoted to USER-INPUT; user picked Skip.">
  What's needed:     - <specific instrumentation step 1 โ€” log query, repro test, ticket comment, deploy log inspection, etc.>
                     - <specific instrumentation step 2>
                     - <add a unique [<TAG>-DIAG] marker so deployment verification is possible>
  Who can resolve:   <USER | AUTOMATED-RETRY-LATER (e.g., re-query logs after 1h) | EXTERNAL-PARTY <name> (e.g., QA team, customer report)>

Then group the residual asks by surviving hypothesis (from ยง4.7) so the user can see which hypothesis each piece of evidence would advance:

To confirm Hypothesis A (<short label, from ยง4.7>):
  - Fix #N residual: <one-line>
  - Fix #M residual: <one-line>

To confirm Hypothesis B (<short label>):
  - ...

Attempt-status meanings (mirror /prospect's ยง4.10):

If all fixes are post-Step-3.5 โœ… Validated and ยง4.2 emitted โœ… Verified for all, emit: "N/A: all fixes validated and bundle-verified (Step 3.5 closed all gaps). Proceed to next work."

If Step 3.5 was skipped via --no-source, prefix every entry with "(Sourcing pass skipped โ€” re-run /retrospect <scope> without --no-source to attempt autonomous resolution.)"

End the section with this verbatim warning:

Do not ship another speculative fix until at least one item in this section is satisfied. If a new fix is proposed without new evidence, re-run /retrospect.

Step 5: Validation Status Taxonomy (reference)

When assigning Validated? in ยง4.3, choose one of the 5 statuses below. Bundle-unverified (๐Ÿคท) is a precondition gate handled in ยง4.2, not a status.

| Status | Definition | Required sub-tag (in report) |

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

| โœ… Validated | Evidence shows the fix achieved its stated goal in the deployed state | Evidence type: log event \| reproduction-then-fix-verified \| production instrumentation \| deployed-state check. "Code review confirmed" is not validation. |

| โš  Partially validated | Evidence shows the fix changed something, but didn't fully close the bug | Sub-tag: closed-part-of-target \| closed-different-bug |

| โŒ Invalidated | Evidence shows the fix did NOT close the bug, or introduced a regression | Sub-tag: didnt-fix \| introduced-regression |

| โ“ Unvalidated โ€” evidence requestable | No evidence yet, but the skill can describe the specific test/check that would validate | (none) |

| ๐Ÿšซ Unvalidatable | Cannot be validated from current vantage point (requires production traffic, edge case not yet reproduced) | (none) |

When emitting a Validated? value, always include the required sub-tag where applicable. Examples:

Step 6: Write Outputs

After Step 4 produces the report, write outputs to the configured destinations:

Always

Default (configurable in `~/.claude/aria-knowledge.local.md` under `retrospect:` block โ€” to be added when needed)

Prepend a structured YAML frontmatter block to the report before writing. Schema:

```yaml


type: retrospect

date: <YYYY-MM-DD>

scope: <commit | range | pr | session | release | deployment | auto-range>

goal: <one-line stated goal from ยง4.1 Anchor>

tickets: [<ABC-123>, <ABC-456>] # empty list if none

fixes_count: <N>

model: <model executing this gate, e.g. claude-opus-5 โ€” or unrecorded if unknown>

effort: <output of printf '%s\n' "${CLAUDE_EFFORT:-unrecorded}" โ€” run it, copy verbatim; never infer or guess>

sourcing_pass:

bundle_marker:

candidates: <N>

upgraded_verified: <N>

upgraded_not_in_bundle: <N>

no_movement: <N> # pooled total; MUST equal the two below

no_movement_capability: <N> # attempted, could not settle โ€” a better pass may resolve

no_movement_structural: <N> # needs a live deploy read / running system / a human

outcome:

candidates: <N>

upgraded_validated: <N>

upgraded_partial: <N>

upgraded_invalidated: <N>

no_movement: <N> # pooled total; MUST equal the two below

no_movement_capability: <N>

no_movement_structural: <N>

patterns_hit: [<pattern-name-1>, <pattern-name-2>] # from ยง4.4; empty list if none

overall_outcome: <closed | partial | unresolved | mixed> # derived from ยง4.5 tally + ยง4.8 overall recommendation

related: [<paths to overlapping prior runs โ€” see below>]

tags: [retrospect, <scope>, <project-tag-if-detected>, <pattern-tag-if-applicable>]


```

effort: is read, never inferred. Run printf '%s\n' "${CLAUDE_EFFORT:-unrecorded}" in Bash and copy the output verbatim. Where the runtime sets $CLAUDE_EFFORT (Claude Code does, in each Bash subprocess, to the effort level in effect when it starts; a subagent sees its own level), that output is the recorded level; where it is unset the command prints unrecorded โ€” record that rather than a guess. You cannot see your own effort setting (self-reported values disagreed with the harness record on 24% of 140 matched logs).

overall_outcome derivation: closed if every fix's post-Step-3.5 Validated? is โœ…; unresolved if any fix is โŒ Invalidated or โŒ Not-in-bundle; partial if any fix is โš  partial AND none are โŒ; mixed for any other combination.

related auto-detection (Q1.2=1, ticket-based): Before writing, glob <knowledge_folder>/logs/prospect/*.md AND <knowledge_folder>/logs/retrospect/*.md for files whose frontmatter tickets: array shares at least one ticket ID with the current report's tickets. Record their paths (relative to <knowledge_folder>/) in the related: array. If no tickets in the current report, leave related: empty. Cap at 10 most-recent overlaps.

tags: field: always includes retrospect and the scope keyword. Add a project tag when the bundle is detected to belong to a configured project (commits/files match a projects_list[<tag>].project_root). Add pattern-name tags for any ยง4.4 hits. These tags make the file discoverable via /index and /context (per Q1.3=1 โ€” /index extends its scan to logs/{prospect,retrospect}/).

Project-scoped intake goes to projects/<proj>/; agnostic intake goes to the shared knowledge tree. Follow the standard aria intake confirmation flow (suggest, user reviews, write on approval).

Opt-in

Pattern library write-backs

If ยง4.9 produced a novel pattern and the user approved adding it, the pattern entry is written to either:

Pattern write-backs are separate from intake โ€” they go directly to the patterns file, not through backlog review.

Step 7: Soft-Suggest Trigger Logic (Claude-side judgment)

When the skill is not directly invoked, Claude monitors user messages for cues that suggest a retrospective is warranted. When detected AND the current session has shipped recent fixes (commits in the last hour or since the last /retrospect), Claude offers โ€” never auto-executes โ€” /retrospect.

Cues (non-exhaustive, judgment-based):

Standard offer (paraphrase as appropriate):

"It sounds like the last release didn't fully close the bug. Before I propose another fix, want me to run /retrospect on the change set first? That'll force a validation check + re-diagnosis pass before we ship anything new."

Cue weight is judgment, not regex. When the cue is faint, just acknowledge and proceed. When the cue is clear, offer. Never auto-execute from a cue โ€” always ask.

This logic also fires the pushback-as-cue pattern (see rules/retrospect-patterns.md) โ€” they share the same trigger surface.

Over-build lens (opt-in: `--lens=overbuild`)

Off unless --lens=overbuild is passed. When off, this skill behaves exactly as documented above โ€” zero behavior change. When on, after the standard per-fix pass, run one additional pass over the in-scope diff:

  1. Load the rubric. Read rules/overbuild-patterns.md (same knowledge_folder/template path used for retrospect-patterns.md). Hold the ladder + smell list.
  2. Walk each diff hunk against the ladder, then the smell detection cues.
  3. Marker-respect. If a hunk carries an aria:simplification marker matching aria:simplification โ€” .+ | limitation: .+ | upgrade: .+, report it as resolved (marked) and do NOT flag it. An obvious simplification with NO marker is the unmarked-simplification smell.
  4. Emit findings in the existing per-fix block style, each REQUIRING: the failed ladder rung, the matched smell name, and a concrete leaner alternative. A finding that cannot name the smaller version is suppressed (matches this skill's existing "name the smaller version or it's not a finding" discipline).
  5. Verdict mapping. Over-build findings map to the existing verdict vocabulary: dependency-for-a-oneliner/framework-for-a-function โ†’ recommend revert-and-shrink; unmarked-simplification โ†’ recommend add-the-marker (not a revert).

Findings append to the report as an ### Over-build lens subsection; they never alter the non-lens verdicts.

Step 8: Validation Gates

Before finalizing the retrospective, verify:

  1. Anchor printed? ยง4.1 must contain Goal, Mode, Range, Tickets, Outcome lines. For deployment scope, must also include the resolved marker source (per Step 0's deployment-detection cascade).
  2. Evidence-Sourcing Pass run (or explicitly skipped)? Step 3.5 must have addressed every preliminary ๐Ÿคท candidate (3.5.1 bundle-marker sub-pass) and every preliminary โš /โ“/๐Ÿšซ candidate (3.5.2 outcome sub-pass) โ€” each must end with one of: UPGRADED-TO-โœ… / UPGRADED-TO-โŒ / NO-MOVEMENT / INCONCLUSIVE / DEFERRED-BY-USER / SKIPPED-BY--no-source. No silent skips. The pass summary (Step 3.5.4) must be emitted.
  3. Bundle-verification gate run? ยง4.2 must address every fix from Step 3 with one of three values (โœ… Verified / ๐Ÿคท Bundle-unverified / โŒ Not-in-bundle), reflecting post-Step-3.5.1 state. Each per-fix render must cite the Step 3.5.1 source.
  4. Per-fix verdicts complete? Every fix has all required fields (Status, Necessary?, Complications, Minimal alternative, Maintenance cost, Validated?, Action). Validated? values reflect post-Step-3.5.2 state. Missing field = incomplete report.
  5. Validation hard rule respected? No fix has Action: KEEP unless post-Step-3.5.2 Validated? is โœ… or โš  partial. โŒ Not-in-bundle (ยง4.2) โ†’ RESHIP-AND-VERIFY or REVERT. ๐Ÿคท Bundle-unverified โ†’ HOLD-PENDING-VERIFICATION. โ“/๐Ÿšซ โ†’ HOLD-PENDING-EVIDENCE / HOLD-PENDING-DEPLOY. Verify the full hard-rule ladder from ยง4.3 before emitting.
  6. Pattern check ran? ยง4.4 must reference both pattern libraries (canonical + project-specific if applicable).
  7. Tally consistent? Counts in ยง4.5 must match the per-fix data in ยง4.3 (post-Step-3.5.2) and ยง4.2 (post-Step-3.5.1). The two Evidence-Sourcing Pass blocks in ยง4.5 must match Step 3.5.4's summary verbatim.
  8. Hypotheses present when needed? ยง4.7 is required if any fix's post-Step-3.5.2 Validated? was โŒ Invalidated or โš  partial, or ยง4.6 triggered re-frame. Evidence FOR/AGAINST must integrate Step 3.5.2 findings where applicable.
  9. Action verdict complete? ยง4.8 must have an action for every fix in ยง4.3. RESHIP-AND-VERIFY actions must include the project-appropriate re-deploy command + the re-run-/retrospect directive.
  10. Residual evidence asks correctly scoped? ยง4.10 must list ONLY residual items (NOT-ATTEMPTED / ATTEMPTED-FAILED / DEFERRED-BY-USER / SKIPPED-BY--no-source). Items resolved by Step 3.5 (โœ… upgrades, โš  partials with ยง3.5.2 evidence, or โŒ falsifications) must NOT appear in ยง4.10. Cross-check: every ยง4.10 entry must have current status of ๐Ÿคท / โš  / โ“ / ๐Ÿšซ.
  11. Outputs written? Confirm the persistent log was written to disk at <knowledge_folder>/logs/retrospect/<YYYY-MM-DD>-<scope>-<slug>.md, with structured YAML frontmatter (type, date, scope, goal, tickets, fixes_count, sourcing_pass, patterns_hit, overall_outcome, related, tags) prepended. Confirm intake suggestions were surfaced.
  12. related: cross-refs computed? If the report contains tickets, the related: frontmatter array must list overlapping prior runs (capped at 10) from logs/prospect/ and logs/retrospect/. If empty (no tickets), confirm the empty-list state explicitly.

If any check fails, self-correct once. If self-correction can't close the gap (e.g., the user must supply evidence), surface the gap explicitly in the report rather than silently skipping.

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.