Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/mcp/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
16 changes: 16 additions & 0 deletions src/mcp/recap-server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
6 changes: 3 additions & 3 deletions src/mcp/recap-server.ts
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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'),
Expand Down Expand Up @@ -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(),
})
),
Expand Down
4 changes: 2 additions & 2 deletions src/mcp/recap-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion src/utils/mcp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export async function writeRecapFile(filePath: string, recap: Record<string, unk
/**
* Generate MCP configuration for recap server
*
* The recap server captures session context (goal, decisions, insights, risks, assumptions)
* The recap server captures session context (goal, decisions, insights, risks, fixes, assumptions)
* for the VS Code Loom Context Panel.
*
* @param loomPath - Absolute path to the loom workspace
Expand Down
2 changes: 2 additions & 0 deletions templates/agents/iloom-issue-implementer.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ After creating or updating any issue comment, use the Recap MCP tools:

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

**Do NOT log `fix` recap entries** — the orchestrator tracks which review findings were addressed.

{{#if SWARM_MODE}}
**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.
{{/if}}
Expand Down
9 changes: 6 additions & 3 deletions templates/prompts/issue-prompt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ 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_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:**
Expand Down Expand Up @@ -405,7 +406,7 @@ Always prepend: `"Your working directory is <worktree-path>. 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: "<your-worktree-path>"`), 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-<issue-number>): [descriptive summary of changes]"` — the commit message must summarize what was implemented (not just "fixes #NNN")
11. Set state to `done` (pass `worktreePath: "<your-worktree-path>"`), report structured result to orchestrator
{{else}}
Expand Down Expand Up @@ -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}}

Expand Down Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions templates/prompts/pr-prompt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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:**
Expand Down Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions templates/prompts/regular-prompt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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:**
Expand Down Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion templates/prompts/session-summary-prompt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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)

4 changes: 2 additions & 2 deletions templates/prompts/swarm-orchestrator-prompt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.)
Expand Down Expand Up @@ -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.
Expand Down
Loading