Skip to content

Commit c077b30

Browse files
acreegerclaude
andcommitted
feat(recap): add 'fix' entry type for tracking code review resolutions
Add a new recap entry type 'fix' so agents can log when code review findings are addressed. Updated across type definitions, Zod schemas, all prompt templates, agent docs, and tests. Closes #960 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e3af03c commit c077b30

12 files changed

Lines changed: 35 additions & 16 deletions

src/mcp/CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Exposes issue/PR operations to agents. Provider-agnostic — routes to GitHub, L
1818

1919
### recap-server.ts
2020

21-
Manages the recap system — structured knowledge capture (decisions, insights, risks, artifacts) displayed in the VS Code sidebar.
21+
Manages the recap system — structured knowledge capture (decisions, insights, risks, fixes, artifacts) displayed in the VS Code sidebar.
2222

2323
**Tools:** `set_goal`, `set_complexity`, `add_entry`, `add_artifact`, `get_recap`, `set_loom_state`, `get_loom_state`
2424

src/mcp/recap-server.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,22 @@ describe('recap-server add_entry deduplication', () => {
9191
content: 'Found existing helper function',
9292
})
9393
})
94+
95+
it('should create a new fix entry and return skipped: false', async () => {
96+
const result = await addEntryWithDeduplication(
97+
readRecapMock,
98+
writeRecapMock,
99+
'fix',
100+
'Fixed null check in auth handler per review feedback'
101+
)
102+
expect(result.skipped).toBe(false)
103+
expect(result.id).toBe('test-uuid-123')
104+
expect(mockRecapFile.entries).toHaveLength(1)
105+
expect(mockRecapFile.entries?.[0]).toMatchObject({
106+
type: 'fix',
107+
content: 'Fixed null check in auth handler per review feedback',
108+
})
109+
})
94110
})
95111

96112
describe('when adding an entry with duplicate type and content', () => {

src/mcp/recap-server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* Loom Recap MCP Server
33
*
4-
* Captures session context (goal, decisions, insights, risks, assumptions)
4+
* Captures session context (goal, decisions, insights, risks, fixes, assumptions)
55
* for the VS Code Loom Context Panel.
66
*
77
* Environment variables:
@@ -234,7 +234,7 @@ server.registerTool(
234234
'Append an entry to the recap. If an entry with the same type and content already exists, it will be skipped.',
235235
inputSchema: {
236236
type: z
237-
.enum(['decision', 'insight', 'risk', 'assumption', 'other'])
237+
.enum(['decision', 'insight', 'risk', 'assumption', 'fix', 'other'])
238238
.describe('Entry type'),
239239
content: z.string().describe('Entry content'),
240240
worktreePath: z.string().optional().describe('Optional worktree path to scope recap to a specific loom'),
@@ -360,7 +360,7 @@ server.registerTool(
360360
z.object({
361361
id: z.string(),
362362
timestamp: z.string(),
363-
type: z.enum(['decision', 'insight', 'risk', 'assumption', 'other']),
363+
type: z.enum(['decision', 'insight', 'risk', 'assumption', 'fix', 'other']),
364364
content: z.string(),
365365
})
366366
),

src/mcp/recap-types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
*
44
* The Recap MCP captures session context that scrolls away during Claude sessions:
55
* - Goal: The original problem statement
6-
* - Entries: Decisions, insights, risks, assumptions discovered during the session
6+
* - Entries: Decisions, insights, risks, assumptions, fixes discovered during the session
77
*/
88

99
/** Entry types for recap entries */
10-
export type RecapEntryType = 'decision' | 'insight' | 'risk' | 'assumption' | 'other'
10+
export type RecapEntryType = 'decision' | 'insight' | 'risk' | 'assumption' | 'fix' | 'other'
1111

1212
/** Artifact types for tracking created items */
1313
export type RecapArtifactType = 'comment' | 'issue' | 'pr'

src/utils/mcp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ export async function writeRecapFile(filePath: string, recap: Record<string, unk
199199
/**
200200
* Generate MCP configuration for recap server
201201
*
202-
* The recap server captures session context (goal, decisions, insights, risks, assumptions)
202+
* The recap server captures session context (goal, decisions, insights, risks, fixes, assumptions)
203203
* for the VS Code Loom Context Panel.
204204
*
205205
* @param loomPath - Absolute path to the loom workspace

templates/agents/iloom-code-reviewer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ You are an expert code reviewer. Your task is to analyze code changes and provid
1717
- **Concise output**: Return structured review results suitable for the orchestrator to process.
1818
- **Autonomous handling**: If critical issues are found, report them but do NOT wait for user confirmation.
1919
- **IMPORTANT recap routing**: You are running inline in a swarm worker's context. You MUST pass `worktreePath` on ALL recap calls (`set_loom_state`, `add_entry`, `get_recap`). The worktree path is provided by the caller — look for it in your invocation prompt (e.g., "Your worktree path is ..."). Without `worktreePath`, recap entries go to the epic's recap file instead of the child's.
20-
- **Recap from findings**: After completing the review, log key findings as recap entries using `recap.add_entry`. For each critical finding (95-100 confidence), add a `risk` entry. For significant patterns or architectural concerns found across multiple files, add an `insight` entry. For architectural choices or trade-offs surfaced during review, add a `decision` entry. Always include `worktreePath` on these calls.
20+
- **Recap from findings**: After completing the review, log key findings as recap entries using `recap.add_entry`. For each critical finding (95-100 confidence), add a `risk` entry. For significant patterns or architectural concerns found across multiple files, add an `insight` entry. For architectural choices or trade-offs surfaced during review, add a `decision` entry. When a review finding is addressed in a subsequent implementation pass, the implementer should log a `fix` entry describing what was resolved. Always include `worktreePath` on these calls.
2121
{{/if}}
2222

2323
## Do NOT Review Temporal Information

templates/agents/iloom-issue-implementer.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ After creating or updating any issue comment, use the Recap MCP tools:
4343

4444
This enables the recap panel to show quick-reference links to artifacts created during the session.
4545

46+
- When addressing issues identified during code review, use `recap.add_entry` with type `fix` to log what was resolved (e.g., "Fixed null check in auth handler per review feedback").
47+
4648
{{#if SWARM_MODE}}
4749
**IMPORTANT**: You are running inline in a swarm worker's context. You MUST pass `worktreePath` on ALL recap calls (`add_artifact`, `add_entry`, `set_loom_state`, `get_recap`). The worktree path is provided by the caller — look for it in your invocation prompt (e.g., "Your worktree path is ..."). Without `worktreePath`, recap entries go to the epic's recap file instead of the child's.
4850
{{/if}}

templates/prompts/issue-prompt.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ The recap panel is visible to the user in VS Code. They don't care about your in
6868
Use these Recap MCP tools:
6969
- `recap.set_complexity` - Call when complexity is confirmed at ROUTING DECISION POINT (trivial/simple/complex)
7070
- `recap.get_recap` - Call before adding entries to check what's already captured
71-
- `recap.add_entry` - Call with type (decision/insight/risk/assumption) and concise content
71+
- `recap.add_entry` - Call with type (decision/insight/risk/assumption/fix) and concise content
7272
- `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.
7373

7474
**NEVER log:**
@@ -1413,7 +1413,7 @@ When the user requests help, **YOU MUST USE subagents** to preserve your context
14131413

14141414
After handling each request, summarize what was done and confirm you're still available.
14151415

1416-
Use `recap.add_entry` to capture decisions, risks, insights, or assumptions discovered during help sessions. Do not log status updates or task completions.
1416+
Use `recap.add_entry` to capture decisions, risks, insights, fixes, or assumptions discovered during help sessions. Do not log status updates or task completions.
14171417

14181418
### Epic Decomposition
14191419

templates/prompts/pr-prompt.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Use these Recap MCP tools:
4242
- `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")
4343
- `recap.set_complexity` - Call when task complexity is assessed (trivial/simple/complex)
4444
- `recap.get_recap` - Call before adding entries to check what's already captured
45-
- `recap.add_entry` - Call with type (decision/insight/risk/assumption) and concise content
45+
- `recap.add_entry` - Call with type (decision/insight/risk/assumption/fix) and concise content
4646
- `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.
4747

4848
**NEVER log:**
@@ -199,7 +199,7 @@ When the user requests help, **prefer subagents** to preserve your context windo
199199

200200
After handling each request, summarize what was done and confirm you're still available.
201201

202-
Use `recap.add_entry` to capture decisions, risks, insights, or assumptions discovered during help sessions. Do not log status updates or task completions.
202+
Use `recap.add_entry` to capture decisions, risks, insights, fixes, or assumptions discovered during help sessions. Do not log status updates or task completions.
203203

204204
### Epic Decomposition
205205

templates/prompts/regular-prompt.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Use these Recap MCP tools:
4242
- `recap.set_goal` - Call once at session start with the user's problem statement
4343
- `recap.set_complexity` - Call when complexity is confirmed at ROUTING DECISION POINT (trivial/simple/complex)
4444
- `recap.get_recap` - Call before adding entries to check what's already captured
45-
- `recap.add_entry` - Call with type (decision/insight/risk/assumption) and concise content
45+
- `recap.add_entry` - Call with type (decision/insight/risk/assumption/fix) and concise content
4646
- `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.
4747

4848
**NEVER log:**
@@ -800,7 +800,7 @@ When the user requests help, **prefer subagents** to preserve your context windo
800800

801801
After handling each request, summarize what was done and confirm you're still available.
802802

803-
Use `recap.add_entry` to capture decisions, risks, insights, or assumptions discovered during help sessions. Do not log status updates or task completions.
803+
Use `recap.add_entry` to capture decisions, risks, insights, fixes, or assumptions discovered during help sessions. Do not log status updates or task completions.
804804

805805
### Epic Decomposition
806806

0 commit comments

Comments
 (0)