User Input
$ARGUMENTS
You MUST consider the user input before proceeding (if not empty). Treat it as optional scope guidance, such as a focus area, a pasted transcript summary, or a preferred disposition.
Outline
Run a retrospective on the current agent session while the work is still fresh in context. The goal is to identify concrete improvements to the repository's context-management surface area: AGENTS.md, CLAUDE.md, .claude/settings.json, .agents/skills/, .agents/commands/, .specify/templates/, dev/knowledge/, dev/guides/, dev/guidelines/, dev/adr/, and product or architecture decisions that caused avoidable friction.
This command closes the loop from "the agent struggled with X" to "X is captured as an approved repo improvement, dedicated PR, GitHub issue, or local-only note."
Operating Constraints
- Stay read-only until the user approves the report and any disposition buckets. Do not edit files, commit, push, or create GitHub issues before approval.
- Present the full retrospective before taking action. Ask for explicit approval per disposition bucket:
fix-now, open-pr, github-issue, and local-only.
- For
fix-now, present a diff preview or precise patch plan before writing files. Apply only the approved changes.
- For
github-issue, defer to the existing create-issue skill when available; if it is unavailable, use gh issue create only after the user approves the exact issue content.
- Respect
AGENTS.md guardrails. Ask First topics, including database migrations, GraphQL schema changes, new dependencies, CI/CD workflow changes, and authentication or authorization changes, are never auto-applied. Route them to open-pr or github-issue.
- Never edit generated files. If a finding points at generated output, identify the source template or generator instead.
- Do not treat personal preferences as repo policy. Use
local-only for non-project-specific workflow preferences.
Phase 1: Resolve Session Context
- Identify the repository root and current branch:
- Run
git rev-parse --show-toplevel.
- Run
git branch --show-current.
- Run
git status --short to understand whether there are existing edits.
- Determine whether the session is inside an active spec-kit feature:
- Try
.specify/scripts/bash/check-prerequisites.sh --json --paths-only.
- If it succeeds, record
FEATURE_DIR and use FEATURE_DIR/retrospective.md as the report path.
- If it fails or the project is not on a spec-kit feature branch, continue as an ad-hoc session and use
.claude/retrospectives/YYYYMMDD-HHMMSS-<short-branch-or-session-slug>.md as the report path.
- Load only the context needed to classify findings:
- Root
AGENTS.md and any area-specific AGENTS.md touched this session.
CLAUDE.md and .claude/settings.json if present.
- Relevant skill prompts in
.agents/skills/ and commands in .agents/commands/.
- Relevant spec-kit templates in
.specify/templates/.
- Relevant
dev/knowledge/, dev/guides/, dev/guidelines/, or dev/adr/ pages.
- Current diff and recent commands from the conversation context.
Phase 2: Identify Findings
Review the current conversation and repository context for friction that was avoidable through better shared context. Organize findings into exactly these categories:
- Instructions / Configuration Gaps
- Missing, unclear, duplicated, or contradictory guidance in
AGENTS.md, CLAUDE.md, .claude/settings.json, skill prompts, commands, or spec-kit templates.
- Required repo workflows that the agent had to infer or rediscover.
- Documentation Gaps
- Missing or stale content in
dev/knowledge/, dev/guides/, dev/guidelines/, or dev/adr/.
- Docs that contradicted current code or left out required verification steps.
- Architectural Friction
- Product, architecture, or code choices that forced repeated workarounds.
- Candidates for ADRs, refactors, or product follow-up.
- Mistakes & Corrections
- Wrong turns taken during the session.
- The guardrail, instruction, template change, or test that would have prevented the mistake.
Prefer concrete findings over broad observations. Each finding must cite the session event or repository location that motivated it.
Phase 3: Assign Dispositions
For each finding, propose one disposition:
| Disposition |
Use When |
Action After Approval |
fix-now |
Small, low-risk repo context updates that belong on the current branch and do not touch Ask First topics. |
Show diff preview, then edit files only after approval. |
open-pr |
Context or harness changes that should be reviewed separately from the current feature branch, or anything touching Ask First topics. |
Draft a branch/PR plan. Do not branch, commit, push, or open a PR unless explicitly approved. |
github-issue |
Larger work, ambiguous ownership, product/architecture debt, ADR candidates needing human authorship, or work outside current scope. |
Use the create-issue skill to draft each issue; create only after approval. |
local-only |
Personal workflow preferences or notes that should not become repo policy. |
Record only in approved local .specify/memory/report locations supported by the runtime. |
Disposition rules:
- If a finding involves database schema or migration changes, GraphQL schema changes, new dependencies, CI/CD workflows, authentication, authorization, or generated files, do not assign
fix-now.
- If a finding needs product or architecture ownership, prefer
github-issue unless the user explicitly asks for a dedicated PR.
- If a finding is already fully covered by existing docs or instructions, do not include it as a finding; mention it only in a brief "No action" note if helpful.
Phase 4: Produce Review Report
Before writing any files, present the retrospective in chat using this structure:
## Session Retrospective
**Scope**: <current feature, branch, or ad-hoc session>
**Proposed report path**: <path>
### Findings
| ID | Category | Evidence | Improvement | Disposition |
|----|----------|----------|-------------|-------------|
| R1 | Instructions / Configuration Gaps | <specific session event or file path> | <concrete change> | fix-now |
### Disposition Buckets
#### fix-now
- R1: <target file and change summary>
#### open-pr
- R2: <branch or PR scope>
#### github-issue
- R3: <issue title>
#### local-only
- R4: <memory/report note>
### Approval Request
Reply with one or more approved buckets, for example:
- `approve report only`
- `approve fix-now`
- `approve github-issue R3`
- `approve all except open-pr`
The report must include concrete findings in all four categories. If a category genuinely has no findings, include the category with None found and a one-sentence reason.
Phase 5: Save Report
Save the retrospective report only after the user approves report only, a disposition bucket, or all.
Report path:
- Active spec-kit feature:
specs/<current-feature>/retrospective.md.
- Ad-hoc session:
.claude/retrospectives/YYYYMMDD-HHMMSS-<short-branch-or-session-slug>.md.
If the report path already exists, append a numeric suffix rather than overwriting it.
Phase 6: Execute Approved Dispositions
Process only the buckets the user approved.
fix-now
- Show a diff preview or exact patch plan for the approved findings.
- Wait for confirmation if the preview changes the original scope.
- Apply edits with normal repository editing rules.
- Run relevant validation. For prompt, command, and Markdown-only changes, at minimum verify paths exist and the command can be discovered from the extension manifest and runtime command file. Run broader lint or tests when touched files are covered by existing automation.
open-pr
- Draft the proposed branch name, PR title, PR body summary, and changed file list.
- Ask for explicit approval before creating a branch, committing, pushing, or opening a PR.
- If approved, use the repository's normal PR workflow.
github-issue
- For each approved finding, invoke the
create-issue skill with the finding as source material.
- Present the exact issue title/body/labels for approval.
- Create issues only after approval.
local-only
- Record the note only in runtime-supported local memory or in the approved retrospective report.
- Do not add local-only preferences to repo files unless the user explicitly reclassifies them as repo policy.
Completion
After approved actions are complete, provide a brief summary:
- Report path
- Actions taken
- Validation run
- Any remaining unapproved buckets
1---2name: speckit-opsmill-retrospect3description: Run a session retrospective that surfaces context-management gaps and routes them to approved follow-up actions.4---56## User Input78```text9$ARGUMENTS10```1112You **MUST** consider the user input before proceeding (if not empty). Treat it as optional scope guidance, such as a focus area, a pasted transcript summary, or a preferred disposition.1314## Outline1516Run a retrospective on the current agent session while the work is still fresh in context. The goal is to identify concrete improvements to the repository's context-management surface area: `AGENTS.md`, `CLAUDE.md`, `.claude/settings.json`, `.agents/skills/`, `.agents/commands/`, `.specify/templates/`, `dev/knowledge/`, `dev/guides/`, `dev/guidelines/`, `dev/adr/`, and product or architecture decisions that caused avoidable friction.1718This command closes the loop from "the agent struggled with X" to "X is captured as an approved repo improvement, dedicated PR, GitHub issue, or local-only note."1920## Operating Constraints2122- Stay read-only until the user approves the report and any disposition buckets. Do not edit files, commit, push, or create GitHub issues before approval.23- Present the full retrospective before taking action. Ask for explicit approval per disposition bucket: `fix-now`, `open-pr`, `github-issue`, and `local-only`.24- For `fix-now`, present a diff preview or precise patch plan before writing files. Apply only the approved changes.25- For `github-issue`, defer to the existing `create-issue` skill when available; if it is unavailable, use `gh issue create` only after the user approves the exact issue content.26- Respect `AGENTS.md` guardrails. Ask First topics, including database migrations, GraphQL schema changes, new dependencies, CI/CD workflow changes, and authentication or authorization changes, are never auto-applied. Route them to `open-pr` or `github-issue`.27- Never edit generated files. If a finding points at generated output, identify the source template or generator instead.28- Do not treat personal preferences as repo policy. Use `local-only` for non-project-specific workflow preferences.2930## Phase 1: Resolve Session Context31321. Identify the repository root and current branch:33 - Run `git rev-parse --show-toplevel`.34 - Run `git branch --show-current`.35 - Run `git status --short` to understand whether there are existing edits.362. Determine whether the session is inside an active spec-kit feature:37 - Try `.specify/scripts/bash/check-prerequisites.sh --json --paths-only`.38 - If it succeeds, record `FEATURE_DIR` and use `FEATURE_DIR/retrospective.md` as the report path.39 - If it fails or the project is not on a spec-kit feature branch, continue as an ad-hoc session and use `.claude/retrospectives/YYYYMMDD-HHMMSS-<short-branch-or-session-slug>.md` as the report path.403. Load only the context needed to classify findings:41 - Root `AGENTS.md` and any area-specific `AGENTS.md` touched this session.42 - `CLAUDE.md` and `.claude/settings.json` if present.43 - Relevant skill prompts in `.agents/skills/` and commands in `.agents/commands/`.44 - Relevant spec-kit templates in `.specify/templates/`.45 - Relevant `dev/knowledge/`, `dev/guides/`, `dev/guidelines/`, or `dev/adr/` pages.46 - Current diff and recent commands from the conversation context.4748## Phase 2: Identify Findings4950Review the current conversation and repository context for friction that was avoidable through better shared context. Organize findings into exactly these categories:51521. **Instructions / Configuration Gaps**53 - Missing, unclear, duplicated, or contradictory guidance in `AGENTS.md`, `CLAUDE.md`, `.claude/settings.json`, skill prompts, commands, or spec-kit templates.54 - Required repo workflows that the agent had to infer or rediscover.552. **Documentation Gaps**56 - Missing or stale content in `dev/knowledge/`, `dev/guides/`, `dev/guidelines/`, or `dev/adr/`.57 - Docs that contradicted current code or left out required verification steps.583. **Architectural Friction**59 - Product, architecture, or code choices that forced repeated workarounds.60 - Candidates for ADRs, refactors, or product follow-up.614. **Mistakes & Corrections**62 - Wrong turns taken during the session.63 - The guardrail, instruction, template change, or test that would have prevented the mistake.6465Prefer concrete findings over broad observations. Each finding must cite the session event or repository location that motivated it.6667## Phase 3: Assign Dispositions6869For each finding, propose one disposition:7071| Disposition | Use When | Action After Approval |72|-------------|----------|-----------------------|73| `fix-now` | Small, low-risk repo context updates that belong on the current branch and do not touch Ask First topics. | Show diff preview, then edit files only after approval. |74| `open-pr` | Context or harness changes that should be reviewed separately from the current feature branch, or anything touching Ask First topics. | Draft a branch/PR plan. Do not branch, commit, push, or open a PR unless explicitly approved. |75| `github-issue` | Larger work, ambiguous ownership, product/architecture debt, ADR candidates needing human authorship, or work outside current scope. | Use the `create-issue` skill to draft each issue; create only after approval. |76| `local-only` | Personal workflow preferences or notes that should not become repo policy. | Record only in approved local .specify/memory/report locations supported by the runtime. |7778Disposition rules:7980- If a finding involves database schema or migration changes, GraphQL schema changes, new dependencies, CI/CD workflows, authentication, authorization, or generated files, do not assign `fix-now`.81- If a finding needs product or architecture ownership, prefer `github-issue` unless the user explicitly asks for a dedicated PR.82- If a finding is already fully covered by existing docs or instructions, do not include it as a finding; mention it only in a brief "No action" note if helpful.8384## Phase 4: Produce Review Report8586Before writing any files, present the retrospective in chat using this structure:8788```markdown89## Session Retrospective9091**Scope**: <current feature, branch, or ad-hoc session>92**Proposed report path**: <path>9394### Findings9596| ID | Category | Evidence | Improvement | Disposition |97|----|----------|----------|-------------|-------------|98| R1 | Instructions / Configuration Gaps | <specific session event or file path> | <concrete change> | fix-now |99100### Disposition Buckets101102#### fix-now103104- R1: <target file and change summary>105106#### open-pr107108- R2: <branch or PR scope>109110#### github-issue111112- R3: <issue title>113114#### local-only115116- R4: <memory/report note>117118### Approval Request119120Reply with one or more approved buckets, for example:121122- `approve report only`123- `approve fix-now`124- `approve github-issue R3`125- `approve all except open-pr`126```127128The report must include concrete findings in all four categories. If a category genuinely has no findings, include the category with `None found` and a one-sentence reason.129130## Phase 5: Save Report131132Save the retrospective report only after the user approves `report only`, a disposition bucket, or `all`.133134Report path:135136- Active spec-kit feature: `specs/<current-feature>/retrospective.md`.137- Ad-hoc session: `.claude/retrospectives/YYYYMMDD-HHMMSS-<short-branch-or-session-slug>.md`.138139If the report path already exists, append a numeric suffix rather than overwriting it.140141## Phase 6: Execute Approved Dispositions142143Process only the buckets the user approved.144145### fix-now1461471. Show a diff preview or exact patch plan for the approved findings.1482. Wait for confirmation if the preview changes the original scope.1493. Apply edits with normal repository editing rules.1504. Run relevant validation. For prompt, command, and Markdown-only changes, at minimum verify paths exist and the command can be discovered from the extension manifest and runtime command file. Run broader lint or tests when touched files are covered by existing automation.151152### open-pr1531541. Draft the proposed branch name, PR title, PR body summary, and changed file list.1552. Ask for explicit approval before creating a branch, committing, pushing, or opening a PR.1563. If approved, use the repository's normal PR workflow.157158### github-issue1591601. For each approved finding, invoke the `create-issue` skill with the finding as source material.1612. Present the exact issue title/body/labels for approval.1623. Create issues only after approval.163164### local-only1651661. Record the note only in runtime-supported local memory or in the approved retrospective report.1672. Do not add local-only preferences to repo files unless the user explicitly reclassifies them as repo policy.168169## Completion170171After approved actions are complete, provide a brief summary:172173- Report path174- Actions taken175- Validation run176- Any remaining unapproved buckets