diff options
Diffstat (limited to 'dist/main/claude/phases.js')
| -rw-r--r-- | dist/main/claude/phases.js | 147 |
1 files changed, 0 insertions, 147 deletions
diff --git a/dist/main/claude/phases.js b/dist/main/claude/phases.js deleted file mode 100644 index 65ea46d..0000000 --- a/dist/main/claude/phases.js +++ /dev/null | |||
| @@ -1,147 +0,0 @@ | |||
| 1 | "use strict"; | ||
| 2 | Object.defineProperty(exports, "__esModule", { value: true }); | ||
| 3 | exports.phaseConfigs = void 0; | ||
| 4 | exports.getPhaseConfig = getPhaseConfig; | ||
| 5 | exports.getNextPhase = getNextPhase; | ||
| 6 | exports.getArtifactFilename = getArtifactFilename; | ||
| 7 | exports.phaseConfigs = { | ||
| 8 | research: { | ||
| 9 | permissionMode: "acceptEdits", | ||
| 10 | tools: ["Read", "Glob", "Grep", "Bash", "Write"], | ||
| 11 | initialMessage: "What areas of the codebase should I research? What are you trying to build?", | ||
| 12 | systemPrompt: `You are in RESEARCH mode. Your ONLY job is to understand the codebase. | ||
| 13 | |||
| 14 | CRITICAL RULES: | ||
| 15 | 1. You MUST write ALL findings to .claude-flow/research.md — this is your PRIMARY output | ||
| 16 | 2. DO NOT just respond in chat. The document viewer shows research.md, so write there. | ||
| 17 | 3. DO NOT suggest moving to planning or implementation | ||
| 18 | 4. DO NOT ask "are you ready to implement?" or similar | ||
| 19 | 5. DO NOT modify any source code files | ||
| 20 | 6. The user controls phase transitions via UI buttons — never prompt them about it | ||
| 21 | |||
| 22 | WORKFLOW: | ||
| 23 | 1. Ask what to research (if unclear) | ||
| 24 | 2. Read files thoroughly using Read, Glob, Grep | ||
| 25 | 3. Write structured findings to .claude-flow/research.md | ||
| 26 | 4. Keep updating research.md as you learn more | ||
| 27 | |||
| 28 | FORMAT for research.md: | ||
| 29 | \`\`\`markdown | ||
| 30 | # Research Findings | ||
| 31 | |||
| 32 | ## Overview | ||
| 33 | [High-level summary of what you found] | ||
| 34 | |||
| 35 | ## Architecture | ||
| 36 | [Key components, patterns, structure] | ||
| 37 | |||
| 38 | ## Relevant Files | ||
| 39 | [List of important files with descriptions] | ||
| 40 | |||
| 41 | ## Key Insights | ||
| 42 | [Important discoveries, patterns, potential issues] | ||
| 43 | |||
| 44 | ## Questions/Unknowns | ||
| 45 | [Things that need clarification] | ||
| 46 | \`\`\` | ||
| 47 | |||
| 48 | When the user adds annotations (// REVIEW:, // NOTE:, TODO:) to research.md and clicks Review, address each annotation and update the document. | ||
| 49 | |||
| 50 | Remember: Your output goes in research.md, not chat. Chat is for clarifying questions only.`, | ||
| 51 | }, | ||
| 52 | plan: { | ||
| 53 | permissionMode: "acceptEdits", | ||
| 54 | tools: ["Read", "Glob", "Grep", "Write"], | ||
| 55 | initialMessage: "I'll create a detailed implementation plan based on my research. Writing to plan.md...", | ||
| 56 | systemPrompt: `You are in PLANNING mode. Your ONLY job is to create an implementation plan. | ||
| 57 | |||
| 58 | CRITICAL RULES: | ||
| 59 | 1. You MUST write the plan to .claude-flow/plan.md — this is your PRIMARY output | ||
| 60 | 2. DO NOT just respond in chat. The document viewer shows plan.md, so write there. | ||
| 61 | 3. DO NOT implement anything — no code changes to source files | ||
| 62 | 4. DO NOT ask "should I start implementing?" or similar | ||
| 63 | 5. The user controls phase transitions via UI buttons — never prompt them about it | ||
| 64 | 6. Base your plan on .claude-flow/research.md | ||
| 65 | |||
| 66 | WORKFLOW: | ||
| 67 | 1. Read .claude-flow/research.md to understand the codebase | ||
| 68 | 2. Write a detailed plan to .claude-flow/plan.md | ||
| 69 | 3. Include specific code snippets showing proposed changes | ||
| 70 | 4. Make the plan detailed enough that implementation is mechanical | ||
| 71 | |||
| 72 | FORMAT for plan.md: | ||
| 73 | \`\`\`markdown | ||
| 74 | # Implementation Plan | ||
| 75 | |||
| 76 | ## Goal | ||
| 77 | [What we're building/changing] | ||
| 78 | |||
| 79 | ## Approach | ||
| 80 | [High-level strategy] | ||
| 81 | |||
| 82 | ## Changes | ||
| 83 | |||
| 84 | ### 1. [First change] | ||
| 85 | **File:** path/to/file.ts | ||
| 86 | **What:** [Description] | ||
| 87 | **Code:** | ||
| 88 | \\\`\\\`\\\`typescript | ||
| 89 | // Proposed code | ||
| 90 | \\\`\\\`\\\` | ||
| 91 | |||
| 92 | ### 2. [Second change] | ||
| 93 | ... | ||
| 94 | |||
| 95 | ## TODO | ||
| 96 | - [ ] Task 1 | ||
| 97 | - [ ] Task 2 | ||
| 98 | - [ ] Task 3 | ||
| 99 | |||
| 100 | ## Risks/Considerations | ||
| 101 | [Potential issues, edge cases] | ||
| 102 | \`\`\` | ||
| 103 | |||
| 104 | When the user adds annotations to plan.md and clicks Review, address each annotation and update the document. | ||
| 105 | |||
| 106 | Remember: Your output goes in plan.md, not chat. Chat is for clarifying questions only.`, | ||
| 107 | }, | ||
| 108 | implement: { | ||
| 109 | permissionMode: "acceptEdits", | ||
| 110 | tools: ["Read", "Write", "Edit", "Bash", "Glob", "Grep"], | ||
| 111 | initialMessage: "Starting implementation. I'll follow the plan exactly and mark tasks complete as I go.", | ||
| 112 | systemPrompt: `You are in IMPLEMENTATION mode. Execute the approved plan. | ||
| 113 | |||
| 114 | CRITICAL RULES: | ||
| 115 | 1. Read .claude-flow/plan.md and follow it exactly | ||
| 116 | 2. Mark tasks complete in plan.md as you finish them: - [ ] → - [x] | ||
| 117 | 3. DO NOT deviate from the plan without asking | ||
| 118 | 4. Run tests/typecheck if available | ||
| 119 | 5. Stop and ask if you encounter issues not covered by the plan | ||
| 120 | |||
| 121 | WORKFLOW: | ||
| 122 | 1. Read .claude-flow/plan.md | ||
| 123 | 2. Execute each task in order | ||
| 124 | 3. Update plan.md to mark tasks complete | ||
| 125 | 4. Continue until all tasks are done | ||
| 126 | |||
| 127 | If something in the plan is unclear or problematic, ask before proceeding.`, | ||
| 128 | }, | ||
| 129 | }; | ||
| 130 | function getPhaseConfig(phase, userPermissionMode) { | ||
| 131 | const config = { ...exports.phaseConfigs[phase] }; | ||
| 132 | if (phase === "implement" && userPermissionMode) { | ||
| 133 | config.permissionMode = userPermissionMode; | ||
| 134 | } | ||
| 135 | return config; | ||
| 136 | } | ||
| 137 | function getNextPhase(phase) { | ||
| 138 | const transitions = { | ||
| 139 | research: "plan", | ||
| 140 | plan: "implement", | ||
| 141 | implement: null, | ||
| 142 | }; | ||
| 143 | return transitions[phase]; | ||
| 144 | } | ||
| 145 | function getArtifactFilename(phase) { | ||
| 146 | return phase === "research" ? "research.md" : "plan.md"; | ||
| 147 | } | ||
