Skip to content

Commit d04ddc7

Browse files
committed
Add recap guidance to agent templates and prompts. Fixes #347
- Add Loom Recap documentation to issue analyzer, planner, and combined analyze-and-plan agent templates - Update ignite command to filter tools based on workflow type (exclude set_goal for issues, include for PRs and regular workflows) - Add recap guidance sections to issue, PR, and regular workflow prompts explaining how to use recap tools effectively - Update test expectations to reflect new tool filtering logic for different workflow types
1 parent 4110cb1 commit d04ddc7

File tree

8 files changed

+154
-12
lines changed

8 files changed

+154
-12
lines changed

src/commands/ignite.test.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -775,12 +775,12 @@ describe('IgniteCommand', () => {
775775

776776
const launchClaudeCall = launchClaudeSpy.mock.calls[0]
777777
expect(launchClaudeCall[1]).toHaveProperty('allowedTools')
778+
// For issue workflows, set_goal is excluded (issue title provides context)
778779
expect(launchClaudeCall[1].allowedTools).toEqual([
779780
'mcp__issue_management__get_issue',
780781
'mcp__issue_management__get_comment',
781782
'mcp__issue_management__create_comment',
782783
'mcp__issue_management__update_comment',
783-
'mcp__recap__set_goal',
784784
'mcp__recap__add_entry',
785785
'mcp__recap__get_recap',
786786
])
@@ -829,14 +829,15 @@ describe('IgniteCommand', () => {
829829

830830
const launchClaudeCall = launchClaudeSpy.mock.calls[0]
831831
expect(launchClaudeCall[1]).toHaveProperty('allowedTools')
832+
// For PR workflows, set_goal is included at the end (user's purpose unclear)
832833
expect(launchClaudeCall[1].allowedTools).toEqual([
833834
'mcp__issue_management__get_issue',
834835
'mcp__issue_management__get_comment',
835836
'mcp__issue_management__create_comment',
836837
'mcp__issue_management__update_comment',
837-
'mcp__recap__set_goal',
838838
'mcp__recap__add_entry',
839839
'mcp__recap__get_recap',
840+
'mcp__recap__set_goal',
840841
])
841842
} finally {
842843
process.cwd = originalCwd
@@ -868,7 +869,7 @@ describe('IgniteCommand', () => {
868869
}
869870
})
870871

871-
it('should NOT pass tool filtering for regular workflows', async () => {
872+
it('should pass recap tools for regular workflows', async () => {
872873
const launchClaudeSpy = vi.spyOn(claudeUtils, 'launchClaude').mockResolvedValue(undefined)
873874

874875
const originalCwd = process.cwd
@@ -882,7 +883,12 @@ describe('IgniteCommand', () => {
882883
await command.execute()
883884

884885
const launchClaudeCall = launchClaudeSpy.mock.calls[0]
885-
expect(launchClaudeCall[1].allowedTools).toBeUndefined()
886+
// Regular workflows should allow recap tools (including set_goal since no issue/PR context)
887+
expect(launchClaudeCall[1].allowedTools).toEqual([
888+
'mcp__recap__set_goal',
889+
'mcp__recap__add_entry',
890+
'mcp__recap__get_recap',
891+
])
886892
expect(launchClaudeCall[1].disallowedTools).toBeUndefined()
887893
} finally {
888894
process.cwd = originalCwd
@@ -909,12 +915,12 @@ describe('IgniteCommand', () => {
909915
expect(launchClaudeCall[1]).toHaveProperty('allowedTools')
910916
expect(launchClaudeCall[1]).toHaveProperty('disallowedTools')
911917
expect(launchClaudeCall[1].mcpConfig).toBeInstanceOf(Array)
918+
// For issue workflows, set_goal is excluded (issue title provides context)
912919
expect(launchClaudeCall[1].allowedTools).toEqual([
913920
'mcp__issue_management__get_issue',
914921
'mcp__issue_management__get_comment',
915922
'mcp__issue_management__create_comment',
916923
'mcp__issue_management__update_comment',
917-
'mcp__recap__set_goal',
918924
'mcp__recap__add_entry',
919925
'mcp__recap__get_recap',
920926
])

src/commands/ignite.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,22 +167,34 @@ export class IgniteCommand {
167167
logger.debug('Generated MCP configuration for issue management', { provider })
168168

169169
// Configure tool filtering for issue/PR workflows
170-
allowedTools = [
170+
// Note: set_goal is only allowed for PR workflow (user's purpose unclear)
171+
// For issue workflow, the issue title provides context so set_goal is not needed
172+
const baseTools = [
171173
'mcp__issue_management__get_issue',
172174
'mcp__issue_management__get_comment',
173175
'mcp__issue_management__create_comment',
174176
'mcp__issue_management__update_comment',
175-
'mcp__recap__set_goal',
176177
'mcp__recap__add_entry',
177178
'mcp__recap__get_recap',
178179
]
180+
allowedTools = context.type === 'pr'
181+
? [...baseTools, 'mcp__recap__set_goal']
182+
: baseTools
179183
disallowedTools = ['Bash(gh api:*), Bash(gh issue view:*), Bash(gh pr view:*), Bash(gh issue comment:*)']
180184

181185
logger.debug('Configured tool filtering for issue/PR workflow', { allowedTools, disallowedTools })
182186
} catch (error) {
183187
// Log warning but continue without MCP
184188
logger.warn(`Failed to generate MCP config: ${error instanceof Error ? error.message : 'Unknown error'}`)
185189
}
190+
} else {
191+
// Regular/branch workflow - allow recap tools (including set_goal since no issue/PR context)
192+
allowedTools = [
193+
'mcp__recap__set_goal',
194+
'mcp__recap__add_entry',
195+
'mcp__recap__get_recap',
196+
]
197+
logger.debug('Configured tool filtering for regular workflow', { allowedTools })
186198
}
187199

188200
// Step 4.5.1: Generate recap MCP config (always added for all workflow types)

templates/agents/iloom-issue-analyze-and-plan.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,29 @@
11
---
22
name: iloom-issue-analyze-and-plan
33
description: Combined analysis and planning agent for SIMPLE tasks. This agent performs lightweight analysis and creates an implementation plan in one streamlined phase. Only invoked for tasks pre-classified as SIMPLE (< 5 files, <200 LOC, no breaking changes, no DB migrations). Use this agent when you have a simple issue that needs quick analysis followed by immediate planning.
4-
tools: Bash, Glob, Grep, Read, Edit, Write, NotebookEdit, WebFetch, TodoWrite, WebSearch, BashOutput, KillShell, SlashCommand, ListMcpResourcesTool, ReadMcpResourceTool, mcp__context7__resolve-library-id, mcp__context7__get-library-docs, mcp__figma-dev-mode-mcp-server__get_code, mcp__figma-dev-mode-mcp-server__get_variable_defs, mcp__figma-dev-mode-mcp-server__get_code_connect_map, mcp__figma-dev-mode-mcp-server__get_screenshot, mcp__figma-dev-mode-mcp-server__get_metadata, mcp__figma-dev-mode-mcp-server__add_code_connect_map, mcp__figma-dev-mode-mcp-server__create_design_system_rules, Bash(git show:*),mcp__issue_management__update_comment, mcp__issue_management__get_issue, mcp__issue_management__get_comment, mcp__issue_management__create_comment
4+
tools: Bash, Glob, Grep, Read, Edit, Write, NotebookEdit, WebFetch, TodoWrite, WebSearch, BashOutput, KillShell, SlashCommand, ListMcpResourcesTool, ReadMcpResourceTool, mcp__context7__resolve-library-id, mcp__context7__get-library-docs, mcp__figma-dev-mode-mcp-server__get_code, mcp__figma-dev-mode-mcp-server__get_variable_defs, mcp__figma-dev-mode-mcp-server__get_code_connect_map, mcp__figma-dev-mode-mcp-server__get_screenshot, mcp__figma-dev-mode-mcp-server__get_metadata, mcp__figma-dev-mode-mcp-server__add_code_connect_map, mcp__figma-dev-mode-mcp-server__create_design_system_rules, Bash(git show:*), mcp__issue_management__update_comment, mcp__issue_management__get_issue, mcp__issue_management__get_comment, mcp__issue_management__create_comment, mcp__recap__get_recap, mcp__recap__add_entry
55
color: teal
66
model: sonnet
77
---
88

99
You are Claude, an AI assistant specialized in combined analysis and planning for simple issues. You excel at efficiently handling straightforward tasks that have been pre-classified as SIMPLE by the complexity evaluator.
1010

11+
## Loom Recap
12+
13+
The recap panel helps users stay oriented without reading all your output. Capture key findings using the Recap MCP tools:
14+
- `recap.get_recap` - Check existing entries to avoid duplicates
15+
- `recap.add_entry` - Log with appropriate type
16+
17+
**During analysis, log:**
18+
- **insight**: Technical discoveries - "Config parsing happens before env vars are loaded"
19+
- **risk**: Things that could go wrong - "Removing this validation will allow malformed input to reach the database"
20+
21+
**During planning, log:**
22+
- **decision**: Significant choices - "Using WebSocket instead of polling for real-time updates"
23+
- **assumption**: Bets you're making - "Assuming no backwards compat needed"
24+
25+
**Never log** workflow status, complexity classifications, or phase information.
26+
1127
**Your Core Mission**: For SIMPLE tasks only, you will perform lightweight technical analysis AND create a focused implementation plan in one streamlined phase. **Target: <5 minutes to read Section 1. If your visible output exceeds this, you are being too detailed.**
1228

1329
**IMPORTANT**: You are only invoked for pre-classified SIMPLE tasks. Do NOT second-guess the complexity assessment - trust that the evaluator has correctly classified this as a simple task.

templates/agents/iloom-issue-analyzer.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: iloom-issue-analyzer
33
description: Use this agent when you need to analyze and research issues, bugs, or enhancement requests. The agent will investigate the codebase, recent commits, and third-party dependencies to identify root causes WITHOUT proposing solutions. Ideal for initial issue triage, regression analysis, and documenting technical findings for team discussion.\n\nExamples:\n<example>\nContext: User wants to analyze a newly reported bug in issue #42\nuser: "Please analyze issue #42 - users are reporting that the login button doesn't work on mobile"\nassistant: "I'll use the issue-analyzer agent to investigate this issue and document my findings."\n<commentary>\nSince this is a request to analyze an issue, use the Task tool to launch the issue-analyzer agent to research the problem.\n</commentary>\n</example>\n<example>\nContext: User needs to understand a regression that appeared after recent changes\nuser: "Can you look into issue #78? It seems like something broke after yesterday's deployment"\nassistant: "Let me launch the issue-analyzer agent to research this regression and identify what changed."\n<commentary>\nThe user is asking for issue analysis and potential regression investigation, so use the issue-analyzer agent.\n</commentary>\n</example>
4-
tools: Bash, Glob, Grep, Read, Edit, Write, NotebookEdit, WebFetch, TodoWrite, WebSearch, BashOutput, KillShell, SlashCommand, ListMcpResourcesTool, ReadMcpResourceTool, mcp__context7__resolve-library-id, mcp__context7__get-library-docs, mcp__figma-dev-mode-mcp-server__get_code, mcp__figma-dev-mode-mcp-server__get_variable_defs, mcp__figma-dev-mode-mcp-server__get_code_connect_map, mcp__figma-dev-mode-mcp-server__get_screenshot, mcp__figma-dev-mode-mcp-server__get_metadata, mcp__figma-dev-mode-mcp-server__add_code_connect_map, mcp__figma-dev-mode-mcp-server__create_design_system_rules ,Bash(git show:*),mcp__issue_management__update_comment, mcp__issue_management__get_issue, mcp__issue_management__get_comment, mcp__issue_management__create_comment
4+
tools: Bash, Glob, Grep, Read, Edit, Write, NotebookEdit, WebFetch, TodoWrite, WebSearch, BashOutput, KillShell, SlashCommand, ListMcpResourcesTool, ReadMcpResourceTool, mcp__context7__resolve-library-id, mcp__context7__get-library-docs, mcp__figma-dev-mode-mcp-server__get_code, mcp__figma-dev-mode-mcp-server__get_variable_defs, mcp__figma-dev-mode-mcp-server__get_code_connect_map, mcp__figma-dev-mode-mcp-server__get_screenshot, mcp__figma-dev-mode-mcp-server__get_metadata, mcp__figma-dev-mode-mcp-server__add_code_connect_map, mcp__figma-dev-mode-mcp-server__create_design_system_rules, Bash(git show:*), mcp__issue_management__update_comment, mcp__issue_management__get_issue, mcp__issue_management__get_comment, mcp__issue_management__create_comment, mcp__recap__get_recap, mcp__recap__add_entry
55
color: pink
66
model: sonnet
77
---
@@ -10,6 +10,18 @@ You are Claude, an elite issue analyst specializing in deep technical investigat
1010

1111
**Your Core Mission**: Analyze issues to identify root causes and document key findings concisely. You research but you do not solve or propose solutions - your role is to provide the technical intelligence needed for informed decision-making.
1212

13+
## Loom Recap
14+
15+
The recap panel helps users stay oriented without reading all your output. Capture key discoveries using the Recap MCP tools:
16+
- `recap.get_recap` - Check existing entries to avoid duplicates
17+
- `recap.add_entry` - Log with type: `insight` or `risk`
18+
19+
**Log these:**
20+
- **insight**: Technical discoveries - "Auth module depends on session middleware being initialized first"
21+
- **risk**: Things that could go wrong - "Removing this function breaks the CLI's --verbose flag"
22+
23+
**Never log** workflow status, complexity classifications, or what phases you skipped.
24+
1325
## Core Workflow
1426

1527
### Step 1: Fetch the Issue

templates/agents/iloom-issue-planner.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
11
---
22
name: iloom-issue-planner
33
description: Use this agent when you need to analyze issues and create detailed implementation plans. This agent specializes in reading issue context, understanding requirements, and creating focused implementation plans with specific file changes and line numbers. The agent will document the plan as a comment on the issue without executing any changes. Examples: <example>Context: The user wants detailed implementation planning for an issue.\nuser: "Analyze issue #42 and create an implementation plan"\nassistant: "I'll use the issue-planner agent to analyze the issue and create a detailed implementation plan"\n<commentary>Since the user wants issue analysis and implementation planning, use the issue-planner agent.</commentary></example> <example>Context: The user needs a plan for implementing a feature described in an issue.\nuser: "Read issue #15 and plan out what needs to be changed"\nassistant: "Let me use the issue-planner agent to analyze the issue and document a comprehensive implementation plan"\n<commentary>The user needs issue analysis and planning, so the issue-planner agent is the right choice.</commentary></example>
4-
tools: Bash, Glob, Grep, Read, Edit, Write, NotebookEdit, WebFetch, TodoWrite, WebSearch, BashOutput, KillShell, SlashCommand, ListMcpResourcesTool, ReadMcpResourceTool, mcp__context7__resolve-library-id, mcp__context7__get-library-docs, mcp__figma-dev-mode-mcp-server__get_code, mcp__figma-dev-mode-mcp-server__get_variable_defs, mcp__figma-dev-mode-mcp-server__get_code_connect_map, mcp__figma-dev-mode-mcp-server__get_screenshot, mcp__figma-dev-mode-mcp-server__get_metadata, mcp__figma-dev-mode-mcp-server__add_code_connect_map, mcp__figma-dev-mode-mcp-server__create_design_system_rules, Bash(git show:*),mcp__issue_management__update_comment, mcp__issue_management__get_issue, mcp__issue_management__get_comment, mcp__issue_management__create_comment
4+
tools: Bash, Glob, Grep, Read, Edit, Write, NotebookEdit, WebFetch, TodoWrite, WebSearch, BashOutput, KillShell, SlashCommand, ListMcpResourcesTool, ReadMcpResourceTool, mcp__context7__resolve-library-id, mcp__context7__get-library-docs, mcp__figma-dev-mode-mcp-server__get_code, mcp__figma-dev-mode-mcp-server__get_variable_defs, mcp__figma-dev-mode-mcp-server__get_code_connect_map, mcp__figma-dev-mode-mcp-server__get_screenshot, mcp__figma-dev-mode-mcp-server__get_metadata, mcp__figma-dev-mode-mcp-server__add_code_connect_map, mcp__figma-dev-mode-mcp-server__create_design_system_rules, Bash(git show:*), mcp__issue_management__update_comment, mcp__issue_management__get_issue, mcp__issue_management__get_comment, mcp__issue_management__create_comment, mcp__recap__get_recap, mcp__recap__add_entry
55
color: blue
66
model: sonnet
77
---
88

99
You are Claude, an AI assistant designed to excel at analyzing issues and creating detailed implementation plans. Analyze the context and respond with precision and thoroughness. Think harder as you execute your tasks.
1010

11+
## Loom Recap
12+
13+
The recap panel helps users stay oriented without reading all your output. Capture decisions and assumptions using the Recap MCP tools:
14+
- `recap.get_recap` - Check existing entries to avoid duplicates
15+
- `recap.add_entry` - Log with type: `decision` or `assumption`
16+
17+
**Log these:**
18+
- **decision**: Significant choices - "Adding new CLI flag rather than environment variable for this config"
19+
- **assumption**: Bets you're making - "Assuming backwards compat not needed since atomically deployed"
20+
21+
**Never log** workflow status, phase information, or that a plan was created.
22+
1123
## Core Mission
1224

1325
Your primary task is to:

templates/prompts/issue-prompt.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,31 @@ Before sending any response, verify it doesn't contain:
2020

2121
---
2222

23+
## Loom Recap
24+
25+
**IMPORTANT: The recap is NOT a work log. It's a knowledge capture system for the USER.**
26+
27+
The recap panel is visible to the user in VS Code. They don't care about your internal process. They care about:
28+
29+
1. **Decisions** - Choices that affect the codebase: "Using X pattern because Y"
30+
2. **Insights** - Things discovered that someone picking this up later would need to know: "The auth module depends on Z"
31+
3. **Risks** - Things that could go wrong: "This assumes X, will break if Y"
32+
4. **Assumptions** - Bets you're making: "Assuming backwards compat not needed"
33+
34+
Use these Recap MCP tools:
35+
- `recap.get_recap` - Call before adding entries to check what's already captured
36+
- `recap.add_entry` - Call with type (decision/insight/risk/assumption) and concise content
37+
38+
**NEVER log:**
39+
- What phases you skipped
40+
- Complexity classifications
41+
- Status updates ("implementation complete", "tests pass")
42+
- Anything about your own workflow process
43+
44+
**Self-check before adding:** If your entry mentions "enhancement", "complexity evaluation", "SIMPLE/COMPLEX", "word count", "skipping", or "phase" - it's process noise. Don't add it.
45+
46+
---
47+
2348
{{#IF FIRST_TIME_USER}}
2449
## First-Time User Context
2550

@@ -322,6 +347,7 @@ Only execute if workflow plan determined NEEDS_ANALYSIS AND complexity is COMPLE
322347
1. Execute: @agent-iloom-issue-analyzer ISSUE_NUMBER with the following instructions about assumptions:
323348
- Before making assumptions, scan ALL issue comments for previously asked questions and their answers. Document any assumptions clearly in question tables with your own answers.
324349
2. Upon completion: Extract issue+comment link from agent output and provide link to issue comment (including comment ID)
350+
- Use `recap.add_entry` to log significant technical findings (type: "insight" for dependencies/constraints, type: "risk" for problems identified)
325351
{{#IF INTERACTIVE_MODE}}
326352
2.5. Extract and validate assumptions (batched validation):
327353
- Read the agent's issue comment output
@@ -394,6 +420,7 @@ Execute combined analyze-and-plan agent:
394420
2. Execute: @agent-iloom-issue-analyze-and-plan ISSUE_NUMBER with the following instructions about assumptions:
395421
- Before making assumptions, scan ALL issue comments for previously asked questions and their answers. Document any assumptions clearly in question tables with your own answers.
396422
3. Upon completion: Extract issue+comment link from agent output and provide link to issue comment (including comment ID)
423+
- Use `recap.add_entry` to log key technical discoveries (type: "insight") and design decisions (type: "decision")
397424
{{#IF INTERACTIVE_MODE}}
398425
3.5. Extract and validate assumptions (batched validation):
399426
- Read the agent's issue comment output
@@ -433,6 +460,7 @@ Only execute if workflow plan determined NEEDS_PLANNING AND complexity is COMPLE
433460
1. Execute: @agent-iloom-issue-planner ISSUE_NUMBER with the following instructions about assumptions:
434461
- Before making assumptions, scan ALL issue comments for previously asked questions and their answers. Document any assumptions clearly in question tables with your own answers.
435462
2. Upon completion: Extract issue+comment link from agent output and provide link to issue comment (including comment ID)
463+
- Use `recap.add_entry` to log key architectural decisions (e.g., type: "decision", content: "Chose approach A over B due to X constraint")
436464
{{#IF INTERACTIVE_MODE}}
437465
2.5. Extract and validate assumptions (batched validation):
438466
- Read the agent's issue comment output
@@ -481,6 +509,7 @@ Only execute if workflow plan determined NEEDS_IMPLEMENTATION:
481509
- **CRITICAL**: The implementation plan in the issue comments contains exact file paths and line numbers. You MUST use these exact locations - DO NOT search for files when the plan specifies them. Extract file locations from the plan in Step 1.5 before implementing.
482510
- The implementation plan is located in comment ID [COMMENT_ID] (if planning phase was executed). Read this comment first in Step 1.5 to extract file specifications.
483511
3. Upon completion: Mark todo #16 as completed
512+
- If implementation revealed unexpected issues or required pivots, use `recap.add_entry` to log them (type: "insight" or "risk")
484513
4. Provide summary and links to any issue comments created - do not open them. All links MUST include comment-id which can be obtained from agent output.
485514
5. Mark todo #17 as completed
486515

0 commit comments

Comments
 (0)