diff --git a/src/mcp/CLAUDE.md b/src/mcp/CLAUDE.md index 19170215..40320c2b 100644 --- a/src/mcp/CLAUDE.md +++ b/src/mcp/CLAUDE.md @@ -18,7 +18,7 @@ Exposes issue/PR operations to agents. Provider-agnostic — routes to GitHub, L ### recap-server.ts -Manages the recap system — structured knowledge capture (decisions, insights, risks, artifacts) displayed in the VS Code sidebar. +Manages the recap system — structured knowledge capture (decisions, insights, risks, fixes, artifacts) displayed in the VS Code sidebar. **Tools:** `set_goal`, `set_complexity`, `add_entry`, `add_artifact`, `get_recap`, `set_loom_state`, `get_loom_state` diff --git a/src/mcp/recap-server.test.ts b/src/mcp/recap-server.test.ts index 9a2a1be8..46a54f57 100644 --- a/src/mcp/recap-server.test.ts +++ b/src/mcp/recap-server.test.ts @@ -91,6 +91,22 @@ describe('recap-server add_entry deduplication', () => { content: 'Found existing helper function', }) }) + + it('should create a new fix entry and return skipped: false', async () => { + const result = await addEntryWithDeduplication( + readRecapMock, + writeRecapMock, + 'fix', + 'Fixed null check in auth handler per review feedback' + ) + expect(result.skipped).toBe(false) + expect(result.id).toBe('test-uuid-123') + expect(mockRecapFile.entries).toHaveLength(1) + expect(mockRecapFile.entries?.[0]).toMatchObject({ + type: 'fix', + content: 'Fixed null check in auth handler per review feedback', + }) + }) }) describe('when adding an entry with duplicate type and content', () => { diff --git a/src/mcp/recap-server.ts b/src/mcp/recap-server.ts index 729d2f4f..04f439e4 100644 --- a/src/mcp/recap-server.ts +++ b/src/mcp/recap-server.ts @@ -1,7 +1,7 @@ /** * Loom Recap MCP Server * - * Captures session context (goal, decisions, insights, risks, assumptions) + * Captures session context (goal, decisions, insights, risks, fixes, assumptions) * for the VS Code Loom Context Panel. * * Environment variables: @@ -234,7 +234,7 @@ server.registerTool( 'Append an entry to the recap. If an entry with the same type and content already exists, it will be skipped.', inputSchema: { type: z - .enum(['decision', 'insight', 'risk', 'assumption', 'other']) + .enum(['decision', 'insight', 'risk', 'assumption', 'fix', 'other']) .describe('Entry type'), content: z.string().describe('Entry content'), worktreePath: z.string().optional().describe('Optional worktree path to scope recap to a specific loom'), @@ -360,7 +360,7 @@ server.registerTool( z.object({ id: z.string(), timestamp: z.string(), - type: z.enum(['decision', 'insight', 'risk', 'assumption', 'other']), + type: z.enum(['decision', 'insight', 'risk', 'assumption', 'fix', 'other']), content: z.string(), }) ), diff --git a/src/mcp/recap-types.ts b/src/mcp/recap-types.ts index 8954c640..c4da0c0e 100644 --- a/src/mcp/recap-types.ts +++ b/src/mcp/recap-types.ts @@ -3,11 +3,11 @@ * * The Recap MCP captures session context that scrolls away during Claude sessions: * - Goal: The original problem statement - * - Entries: Decisions, insights, risks, assumptions discovered during the session + * - Entries: Decisions, insights, risks, assumptions, fixes discovered during the session */ /** Entry types for recap entries */ -export type RecapEntryType = 'decision' | 'insight' | 'risk' | 'assumption' | 'other' +export type RecapEntryType = 'decision' | 'insight' | 'risk' | 'assumption' | 'fix' | 'other' /** Artifact types for tracking created items */ export type RecapArtifactType = 'comment' | 'issue' | 'pr' diff --git a/src/utils/mcp.ts b/src/utils/mcp.ts index 3521a8c5..d4486624 100644 --- a/src/utils/mcp.ts +++ b/src/utils/mcp.ts @@ -199,7 +199,7 @@ export async function writeRecapFile(filePath: string, recap: Record. cd there before doi 7a. Run artifact review on implementation output via /iloom-swarm-artifact-reviewer skill {{/if}}{{/if}} 8. Set state to `code_review` (pass `worktreePath: ""`), run code review via /iloom-swarm-code-reviewer skill -9. If critical/high issues found, auto-fix and optionally re-review +9. If critical/high issues found, auto-fix and log a `fix` recap entry for each finding addressed 10. Stage and commit all changes: `git add -A && git commit -m "feat(issue-): [descriptive summary of changes]"` — the commit message must summarize what was implemented (not just "fixes #NNN") 11. Set state to `done` (pass `worktreePath: ""`), report structured result to orchestrator {{else}} @@ -1255,9 +1256,11 @@ This section is about reviewing code changes for quality, security, and complian 3. If critical, high, or medium priority issues found: {{#if ONE_SHOT_MODE}} - Automatically implement the recommended fixes for critical, high, and medium priority issues without asking + - After fixing each issue, log a `fix` recap entry describing what was resolved (e.g., `recap.add_entry({ type: "fix", content: "Fixed missing null check in auth handler" })`) {{else}} - Ask the user: "Issues found. Do you want to proceed anyway, or address these first?" - Wait for user response before continuing + - After fixing each issue, log a `fix` recap entry describing what was resolved (e.g., `recap.add_entry({ type: "fix", content: "Fixed missing null check in auth handler" })`) {{/if}} {{/if}} @@ -1413,7 +1416,7 @@ When the user requests help, **YOU MUST USE subagents** to preserve your context After handling each request, summarize what was done and confirm you're still available. -Use `recap.add_entry` to capture decisions, risks, insights, or assumptions discovered during help sessions. Do not log status updates or task completions. +Use `recap.add_entry` to capture decisions, risks, insights, fixes, or assumptions discovered during help sessions. Do not log status updates or task completions. ### Epic Decomposition diff --git a/templates/prompts/pr-prompt.txt b/templates/prompts/pr-prompt.txt index 7dbdd729..306f400b 100644 --- a/templates/prompts/pr-prompt.txt +++ b/templates/prompts/pr-prompt.txt @@ -37,12 +37,13 @@ The recap panel is visible to the user in VS Code. They don't care about your in 2. **Insights** - Things discovered that someone picking this up later would need to know: "The auth module depends on Z" 3. **Risks** - Things that could go wrong: "This assumes X, will break if Y" 4. **Assumptions** - Bets you're making: "Assuming backwards compat not needed" +5. **Fixes** - Code review findings you addressed: "Fixed null check in auth handler per review feedback" Use these Recap MCP tools: - `recap.set_goal` - Call once after understanding why the user is working on this PR (e.g., "Review PR for security concerns", "Fix failing tests") - `recap.set_complexity` - Call when task complexity is assessed (trivial/simple/complex) - `recap.get_recap` - Call before adding entries to check what's already captured -- `recap.add_entry` - Call with type (decision/insight/risk/assumption) and concise content +- `recap.add_entry` - Call with type (decision/insight/risk/assumption/fix) and concise content - `recap.add_artifact` - After creating/updating comments, issues, or PRs, log them with type, primaryUrl, and description. Duplicates with the same primaryUrl will be replaced. **NEVER log:** @@ -199,7 +200,7 @@ When the user requests help, **prefer subagents** to preserve your context windo After handling each request, summarize what was done and confirm you're still available. -Use `recap.add_entry` to capture decisions, risks, insights, or assumptions discovered during help sessions. Do not log status updates or task completions. +Use `recap.add_entry` to capture decisions, risks, insights, fixes, or assumptions discovered during help sessions. Do not log status updates or task completions. ### Epic Decomposition diff --git a/templates/prompts/regular-prompt.txt b/templates/prompts/regular-prompt.txt index e799082d..dfd458b6 100644 --- a/templates/prompts/regular-prompt.txt +++ b/templates/prompts/regular-prompt.txt @@ -37,12 +37,13 @@ The recap panel is visible to the user in VS Code. They don't care about your in 2. **Insights** - Things discovered that someone picking this up later would need to know: "The auth module depends on Z" 3. **Risks** - Things that could go wrong: "This assumes X, will break if Y" 4. **Assumptions** - Bets you're making: "Assuming backwards compat not needed" +5. **Fixes** - Code review findings you addressed: "Fixed null check in auth handler per review feedback" Use these Recap MCP tools: - `recap.set_goal` - Call once at session start with the user's problem statement - `recap.set_complexity` - Call when complexity is confirmed at ROUTING DECISION POINT (trivial/simple/complex) - `recap.get_recap` - Call before adding entries to check what's already captured -- `recap.add_entry` - Call with type (decision/insight/risk/assumption) and concise content +- `recap.add_entry` - Call with type (decision/insight/risk/assumption/fix) and concise content - `recap.add_artifact` - After creating/updating comments, issues, or PRs, log them with type, primaryUrl, and description. Duplicates with the same primaryUrl will be replaced. **NEVER log:** @@ -800,7 +801,7 @@ When the user requests help, **prefer subagents** to preserve your context windo After handling each request, summarize what was done and confirm you're still available. -Use `recap.add_entry` to capture decisions, risks, insights, or assumptions discovered during help sessions. Do not log status updates or task completions. +Use `recap.add_entry` to capture decisions, risks, insights, fixes, or assumptions discovered during help sessions. Do not log status updates or task completions. ### Epic Decomposition diff --git a/templates/prompts/session-summary-prompt.txt b/templates/prompts/session-summary-prompt.txt index 5213d12b..5f818176 100644 --- a/templates/prompts/session-summary-prompt.txt +++ b/templates/prompts/session-summary-prompt.txt @@ -32,6 +32,7 @@ You are generating a summary of THIS conversation - the development session you - **Insights**: Discoveries that future developers need to know - **Risks**: Things that could go wrong - **Assumptions**: Bets being made about the implementation +- **Fixes**: Code review issues that were identified and resolved When there are conflicts between the recap and conversation transcript, give weight to the most recent timestamp. @@ -145,6 +146,6 @@ Keep the visible themes section brief (3-5 bullet points, one sentence each). Th ## VALIDATION CHECKLIST - FAILING THIS LIST MEANS FAILING THE TASK: * Did you ouput ONLY the markdown with no commentary before or after? {{#if COMPACT_SUMMARIES}}* Did you use the information in the "Previous Conversation Context" section?{{/if}} -{{#if RECAP_DATA}}* Did you incorporate the decisions, insights, risks, and assumptions from the "Session Recap" section?{{/if}} +{{#if RECAP_DATA}}* Did you incorporate the decisions, insights, risks, fixes, and assumptions from the "Session Recap" section?{{/if}} * Did you avoid process noise? (No mentions of: workflow phases, complexity classifications, git commands, test/build results, or descriptions of what you DID vs what was LEARNED) diff --git a/templates/prompts/swarm-orchestrator-prompt.txt b/templates/prompts/swarm-orchestrator-prompt.txt index e5284788..9a00e918 100644 --- a/templates/prompts/swarm-orchestrator-prompt.txt +++ b/templates/prompts/swarm-orchestrator-prompt.txt @@ -23,7 +23,7 @@ You are a **coordinator**, not an executor. Your job is to schedule work, track The recap panel is visible to the user in VS Code. Use these Recap MCP tools to capture knowledge: -- `recap.add_entry` - Call with type (decision/insight/risk/assumption) and concise content. **Pass `worktreePath` when the entry is about a specific child issue** to route it to the child's recap file. +- `recap.add_entry` - Call with type (decision/insight/risk/assumption/fix) and concise content. **Pass `worktreePath` when the entry is about a specific child issue** to route it to the child's recap file. - `recap.get_recap` - Call before adding entries to check what's already captured. **Pass `worktreePath` to read a specific child's recap.** - `recap.add_artifact` - After creating/updating comments, issues, or PRs, log them with type, primaryUrl, and description. Duplicates with the same primaryUrl will be replaced. **Pass `worktreePath` when the artifact belongs to a child issue.** - `recap.set_loom_state` - Update the loom state (in_progress, done, failed, etc.) @@ -542,7 +542,7 @@ IMPORTANT: Only fix the specific issues identified in the review findings. Do NO ```` **Handle the subagent result:** -- If the fix agent succeeds: log "Post-swarm review: N findings addressed, fix committed." +- If the fix agent succeeds: log a `fix` recap entry for each finding addressed (e.g., `recap.add_entry({ type: "fix", content: "Fixed missing null check in auth handler" })`). Then log "Post-swarm review: N findings addressed, fix committed." - If the fix agent fails: log the failure and continue. Auto-fix failure is non-blocking. **Single pass only.** Do NOT re-review after fixing. This prevents infinite review-fix loops.