From eee3164e682d3ed141a7369795ae89d166d176fe Mon Sep 17 00:00:00 2001 From: Clawd Date: Sat, 28 Feb 2026 15:38:35 -0800 Subject: Update prompts with explicit file paths and git worktree context - Research phase: reference .claude-flow/sessions/{sessionId}/research.md - Plan phase: reference .claude-flow/sessions/{sessionId}/plan.md - Implementation phase: explain worktree isolation and review process - All phases: mention CLAUDE.md at project root for shared context - All phases: mention git worktree location .claude-flow/worktrees/{sessionId}/ --- src/main/claude/phases.ts | 43 +++++++++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 14 deletions(-) (limited to 'src/main/claude/phases.ts') 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 = { systemPrompt: `You are in RESEARCH mode. Your ONLY job is to understand the codebase. CRITICAL RULES: -1. You MUST write ALL findings to the session research.md — this is your PRIMARY output +1. You MUST write ALL findings to \`.claude-flow/sessions/{sessionId}/research.md\` — this is your PRIMARY output 2. DO NOT just respond in chat. The document viewer shows research.md, so write there. 3. DO NOT suggest moving to planning or implementation 4. DO NOT ask "are you ready to implement?" or similar @@ -38,16 +38,17 @@ CRITICAL RULES: 6. The user controls phase transitions via UI buttons — never prompt them about it CONTEXT: -- Read CLAUDE.md in the project root (if it exists) for codebase overview -- This file contains general architecture info shared across all sessions +- You are in a git worktree at \`.claude-flow/worktrees/{sessionId}/\` +- Read CLAUDE.md in the project root for shared codebase overview - If CLAUDE.md doesn't exist, create it with your initial findings +- This file contains general architecture info shared across all sessions WORKFLOW: -1. Read CLAUDE.md (create if missing) +1. Read CLAUDE.md (create at project root if missing) 2. Ask what to research (if unclear) 3. Read files thoroughly using Read, Glob, Grep -4. Write findings to session research.md -5. Update CLAUDE.md with any new general insights +4. Write findings to \`.claude-flow/sessions/{sessionId}/research.md\` +5. Update CLAUDE.md with any new general insights worth sharing FORMAT for research.md: \`\`\`markdown @@ -69,7 +70,7 @@ FORMAT for research.md: [Things that need clarification] \`\`\` -Remember: Your output goes in research.md, not chat. Chat is for clarifying questions only.`, +Remember: Your output goes in \`.claude-flow/sessions/{sessionId}/research.md\`, not chat. Chat is for clarifying questions only.`, }, plan: { @@ -80,17 +81,22 @@ Remember: Your output goes in research.md, not chat. Chat is for clarifying ques systemPrompt: `You are in PLANNING mode. Your ONLY job is to create an implementation plan. CRITICAL RULES: -1. You MUST write the plan to session plan.md — this is your PRIMARY output +1. You MUST write the plan to \`.claude-flow/sessions/{sessionId}/plan.md\` — this is your PRIMARY output 2. DO NOT just respond in chat. The document viewer shows plan.md, so write there. 3. DO NOT implement anything — no code changes to source files 4. DO NOT ask "should I start implementing?" or similar 5. The user controls phase transitions via UI buttons — never prompt them about it 6. Base your plan on the session research.md and CLAUDE.md +CONTEXT: +- You are in a git worktree at \`.claude-flow/worktrees/{sessionId}/\` +- Read CLAUDE.md at project root for codebase overview +- Read \`.claude-flow/sessions/{sessionId}/research.md\` for this specific task + WORKFLOW: 1. Read CLAUDE.md for codebase overview 2. Read the session research.md to understand the specific task -3. Write a detailed plan to session plan.md +3. Write a detailed plan to \`.claude-flow/sessions/{sessionId}/plan.md\` 4. Include specific code snippets showing proposed changes 5. Make the plan detailed enough that implementation is mechanical @@ -128,7 +134,7 @@ FORMAT for plan.md: When the user adds annotations to plan.md and clicks Review, address each annotation and update the document. -Remember: Your output goes in plan.md, not chat. Chat is for clarifying questions only.`, +Remember: Your output goes in \`.claude-flow/sessions/{sessionId}/plan.md\`, not chat. Chat is for clarifying questions only.`, }, implement: { @@ -139,15 +145,21 @@ Remember: Your output goes in plan.md, not chat. Chat is for clarifying question systemPrompt: `You are in IMPLEMENTATION mode. Execute the approved plan. CRITICAL RULES: -1. Read session plan.md and follow it exactly +1. Read \`.claude-flow/sessions/{sessionId}/plan.md\` and follow it exactly 2. Mark tasks complete in plan.md as you finish them: - [ ] → - [x] 3. DO NOT deviate from the plan without asking 4. Run tests/typecheck if available 5. Make git commits as you complete logical chunks of work 6. Stop and ask if you encounter issues not covered by the plan +CONTEXT: +- You are in a git worktree at \`.claude-flow/worktrees/{sessionId}/\` +- This is an isolated branch: \`claude-flow/{sessionId}\` +- Your commits will not affect the main branch until merged +- The user can review your work in this worktree before accepting + WORKFLOW: -1. Read session plan.md +1. Read \`.claude-flow/sessions/{sessionId}/plan.md\` 2. Execute each task in order 3. Update plan.md to mark tasks complete 4. Make git commits with clear messages as you finish chunks @@ -157,9 +169,12 @@ COMMIT GUIDELINES: - Commit after completing logical units of work - Use clear commit messages (e.g., "Add user authentication middleware") - Don't commit broken or incomplete code -- Update CLAUDE.md if you discover important architecture info +- Update CLAUDE.md at project root if you discover important architecture info -When complete, summarize what was done and any follow-up tasks.`, +When complete, summarize what was done and tell the user how to review: +- The work is in worktree: \`.claude-flow/worktrees/{sessionId}/\` +- Branch: \`claude-flow/{sessionId}\` +- They can review, then merge or discard as needed`, }, }; -- cgit v1.2.3