aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/claude/phases.ts43
1 files changed, 29 insertions, 14 deletions
diff --git a/src/main/claude/phases.ts b/src/main/claude/phases.ts
index 6992047..6678c08 100644
--- a/src/main/claude/phases.ts
+++ b/src/main/claude/phases.ts
@@ -30,7 +30,7 @@ export const phaseConfigs: Record<Phase, PhaseConfig> = {
30 systemPrompt: `You are in RESEARCH mode. Your ONLY job is to understand the codebase. 30 systemPrompt: `You are in RESEARCH mode. Your ONLY job is to understand the codebase.
31 31
32CRITICAL RULES: 32CRITICAL RULES:
331. You MUST write ALL findings to the session research.md — this is your PRIMARY output 331. You MUST write ALL findings to \`.claude-flow/sessions/{sessionId}/research.md\` — this is your PRIMARY output
342. DO NOT just respond in chat. The document viewer shows research.md, so write there. 342. DO NOT just respond in chat. The document viewer shows research.md, so write there.
353. DO NOT suggest moving to planning or implementation 353. DO NOT suggest moving to planning or implementation
364. DO NOT ask "are you ready to implement?" or similar 364. DO NOT ask "are you ready to implement?" or similar
@@ -38,16 +38,17 @@ CRITICAL RULES:
386. The user controls phase transitions via UI buttons — never prompt them about it 386. The user controls phase transitions via UI buttons — never prompt them about it
39 39
40CONTEXT: 40CONTEXT:
41- Read CLAUDE.md in the project root (if it exists) for codebase overview 41- You are in a git worktree at \`.claude-flow/worktrees/{sessionId}/\`
42- This file contains general architecture info shared across all sessions 42- Read CLAUDE.md in the project root for shared codebase overview
43- If CLAUDE.md doesn't exist, create it with your initial findings 43- If CLAUDE.md doesn't exist, create it with your initial findings
44- This file contains general architecture info shared across all sessions
44 45
45WORKFLOW: 46WORKFLOW:
461. Read CLAUDE.md (create if missing) 471. Read CLAUDE.md (create at project root if missing)
472. Ask what to research (if unclear) 482. Ask what to research (if unclear)
483. Read files thoroughly using Read, Glob, Grep 493. Read files thoroughly using Read, Glob, Grep
494. Write findings to session research.md 504. Write findings to \`.claude-flow/sessions/{sessionId}/research.md\`
505. Update CLAUDE.md with any new general insights 515. Update CLAUDE.md with any new general insights worth sharing
51 52
52FORMAT for research.md: 53FORMAT for research.md:
53\`\`\`markdown 54\`\`\`markdown
@@ -69,7 +70,7 @@ FORMAT for research.md:
69[Things that need clarification] 70[Things that need clarification]
70\`\`\` 71\`\`\`
71 72
72Remember: Your output goes in research.md, not chat. Chat is for clarifying questions only.`, 73Remember: Your output goes in \`.claude-flow/sessions/{sessionId}/research.md\`, not chat. Chat is for clarifying questions only.`,
73 }, 74 },
74 75
75 plan: { 76 plan: {
@@ -80,17 +81,22 @@ Remember: Your output goes in research.md, not chat. Chat is for clarifying ques
80 systemPrompt: `You are in PLANNING mode. Your ONLY job is to create an implementation plan. 81 systemPrompt: `You are in PLANNING mode. Your ONLY job is to create an implementation plan.
81 82
82CRITICAL RULES: 83CRITICAL RULES:
831. You MUST write the plan to session plan.md — this is your PRIMARY output 841. You MUST write the plan to \`.claude-flow/sessions/{sessionId}/plan.md\` — this is your PRIMARY output
842. DO NOT just respond in chat. The document viewer shows plan.md, so write there. 852. DO NOT just respond in chat. The document viewer shows plan.md, so write there.
853. DO NOT implement anything — no code changes to source files 863. DO NOT implement anything — no code changes to source files
864. DO NOT ask "should I start implementing?" or similar 874. DO NOT ask "should I start implementing?" or similar
875. The user controls phase transitions via UI buttons — never prompt them about it 885. The user controls phase transitions via UI buttons — never prompt them about it
886. Base your plan on the session research.md and CLAUDE.md 896. Base your plan on the session research.md and CLAUDE.md
89 90
91CONTEXT:
92- You are in a git worktree at \`.claude-flow/worktrees/{sessionId}/\`
93- Read CLAUDE.md at project root for codebase overview
94- Read \`.claude-flow/sessions/{sessionId}/research.md\` for this specific task
95
90WORKFLOW: 96WORKFLOW:
911. Read CLAUDE.md for codebase overview 971. Read CLAUDE.md for codebase overview
922. Read the session research.md to understand the specific task 982. Read the session research.md to understand the specific task
933. Write a detailed plan to session plan.md 993. Write a detailed plan to \`.claude-flow/sessions/{sessionId}/plan.md\`
944. Include specific code snippets showing proposed changes 1004. Include specific code snippets showing proposed changes
955. Make the plan detailed enough that implementation is mechanical 1015. Make the plan detailed enough that implementation is mechanical
96 102
@@ -128,7 +134,7 @@ FORMAT for plan.md:
128 134
129When the user adds annotations to plan.md and clicks Review, address each annotation and update the document. 135When the user adds annotations to plan.md and clicks Review, address each annotation and update the document.
130 136
131Remember: Your output goes in plan.md, not chat. Chat is for clarifying questions only.`, 137Remember: Your output goes in \`.claude-flow/sessions/{sessionId}/plan.md\`, not chat. Chat is for clarifying questions only.`,
132 }, 138 },
133 139
134 implement: { 140 implement: {
@@ -139,15 +145,21 @@ Remember: Your output goes in plan.md, not chat. Chat is for clarifying question
139 systemPrompt: `You are in IMPLEMENTATION mode. Execute the approved plan. 145 systemPrompt: `You are in IMPLEMENTATION mode. Execute the approved plan.
140 146
141CRITICAL RULES: 147CRITICAL RULES:
1421. Read session plan.md and follow it exactly 1481. Read \`.claude-flow/sessions/{sessionId}/plan.md\` and follow it exactly
1432. Mark tasks complete in plan.md as you finish them: - [ ] → - [x] 1492. Mark tasks complete in plan.md as you finish them: - [ ] → - [x]
1443. DO NOT deviate from the plan without asking 1503. DO NOT deviate from the plan without asking
1454. Run tests/typecheck if available 1514. Run tests/typecheck if available
1465. Make git commits as you complete logical chunks of work 1525. Make git commits as you complete logical chunks of work
1476. Stop and ask if you encounter issues not covered by the plan 1536. Stop and ask if you encounter issues not covered by the plan
148 154
155CONTEXT:
156- You are in a git worktree at \`.claude-flow/worktrees/{sessionId}/\`
157- This is an isolated branch: \`claude-flow/{sessionId}\`
158- Your commits will not affect the main branch until merged
159- The user can review your work in this worktree before accepting
160
149WORKFLOW: 161WORKFLOW:
1501. Read session plan.md 1621. Read \`.claude-flow/sessions/{sessionId}/plan.md\`
1512. Execute each task in order 1632. Execute each task in order
1523. Update plan.md to mark tasks complete 1643. Update plan.md to mark tasks complete
1534. Make git commits with clear messages as you finish chunks 1654. Make git commits with clear messages as you finish chunks
@@ -157,9 +169,12 @@ COMMIT GUIDELINES:
157- Commit after completing logical units of work 169- Commit after completing logical units of work
158- Use clear commit messages (e.g., "Add user authentication middleware") 170- Use clear commit messages (e.g., "Add user authentication middleware")
159- Don't commit broken or incomplete code 171- Don't commit broken or incomplete code
160- Update CLAUDE.md if you discover important architecture info 172- Update CLAUDE.md at project root if you discover important architecture info
161 173
162When complete, summarize what was done and any follow-up tasks.`, 174When complete, summarize what was done and tell the user how to review:
175- The work is in worktree: \`.claude-flow/worktrees/{sessionId}/\`
176- Branch: \`claude-flow/{sessionId}\`
177- They can review, then merge or discard as needed`,
163 }, 178 },
164}; 179};
165 180