diff --git a/.claude/agents/issue-plan-agent.md b/.claude/agents/issue-plan-agent.md index 6768fe91..1090b0f1 100644 --- a/.claude/agents/issue-plan-agent.md +++ b/.claude/agents/issue-plan-agent.md @@ -182,47 +182,25 @@ function decomposeTasks(issue, exploration) { - Task validation (all 5 phases present) - Conflict detection (cross-issue file modifications) -**Solution Registration** (TWO-STEP: Write first, then bind): -```javascript -for (const issue of issues) { - const solutions = generatedSolutions[issue.id]; - const solPath = `.workflow/issues/solutions/${issue.id}.jsonl`; +**Solution Registration** (via CLI endpoint): - // Step 1: ALWAYS write ALL solutions to JSONL (append mode) - // Each solution on a new line, preserving existing solutions - for (const sol of solutions) { - // Ensure Solution ID format: SOL-{issue-id}-{seq} - const solutionJson = JSON.stringify({ - id: sol.id, // e.g., SOL-GH-123-1, SOL-GH-123-2 - description: sol.description, - approach: sol.approach, - tasks: sol.tasks, - exploration_context: sol.exploration_context, - analysis: sol.analysis, - score: sol.score, - is_bound: false, - created_at: new Date().toISOString() - }); - // Escape single quotes for shell safety: ' → '\'' - const safeJson = solutionJson.replace(/'/g, "'\\''"); - Bash(`echo '${safeJson}' >> "${solPath}"`); - } - - // Step 2: Bind decision based on solution count - if (solutions.length === 1) { - // Single solution → auto-bind by ID (NOT --solution flag) - Bash(`ccw issue bind ${issue.id} ${solutions[0].id}`); - bound.push({ issue_id: issue.id, solution_id: solutions[0].id, task_count: solutions[0].tasks.length }); - } else { - // Multiple solutions → already written, return for user selection - pending_selection.push({ - issue_id: issue.id, - solutions: solutions.map(s => ({ id: s.id, description: s.description, task_count: s.tasks.length })) - }); - } -} +**Step 1: Create solutions** +```bash +ccw issue solution --data '{"description":"...", "approach":"...", "tasks":[...]}' +# Output: {"id":"SOL-{issue-id}-1", ...} ``` +**CLI Features:** +| Feature | Description | +|---------|-------------| +| Auto-increment ID | `SOL-{issue-id}-{seq}` (e.g., `SOL-GH-123-1`) | +| Multi-solution | Appends to existing JSONL, supports multiple per issue | +| Trailing newline | Proper JSONL format, no corruption | + +**Step 2: Bind decision** +- **Single solution** → Auto-bind: `ccw issue bind ` +- **Multiple solutions** → Return for user selection (no bind) + #### Phase 5: Conflict Analysis (Gemini CLI) **Trigger**: When batch contains 2+ solutions diff --git a/.codex/prompts/issue-plan.md b/.codex/prompts/issue-plan.md index 3930fa6a..730b62d6 100644 --- a/.codex/prompts/issue-plan.md +++ b/.codex/prompts/issue-plan.md @@ -71,25 +71,22 @@ Task rules (from schema): ### Step 5: Register & bind solutions via CLI -Create an import JSON file per solution (NOT JSONL), then bind it: +**Create solution** (via CLI endpoint): +```bash +ccw issue solution --data '{"description":"...", "approach":"...", "tasks":[...]}' +# Output: {"id":"SOL-{issue-id}-1", ...} +``` -1. Write a file (example path): - - `.workflow/issues/solutions/_imports/-.json` -2. File contents shape (minimum): - ```json - { - "description": "High-level summary", - "approach": "Technical approach", - "tasks": [] - } - ``` -3. Register+bind in one step: - - `ccw issue bind --solution ` +**CLI Features:** +| Feature | Description | +|---------|-------------| +| Auto-increment ID | `SOL-{issue-id}-{seq}` (e.g., `SOL-GH-123-1`) | +| Multi-solution | Appends to existing JSONL, supports multiple per issue | +| Trailing newline | Proper JSONL format, no corruption | -If you intentionally generated multiple solutions for the same issue: -- Register each via `ccw issue bind --solution ` (do NOT bind yet). -- Present the alternatives in `pending_selection` and stop for user choice. -- Bind chosen solution with: `ccw issue bind `. +**Binding:** +- **Single solution**: Auto-bind: `ccw issue bind ` +- **Multiple solutions**: Present alternatives in `pending_selection`, wait for user choice ### Step 6: Detect cross-issue file conflicts (best-effort) diff --git a/.codex/prompts/issue-queue.md b/.codex/prompts/issue-queue.md index de4e4ca3..b77a0085 100644 --- a/.codex/prompts/issue-queue.md +++ b/.codex/prompts/issue-queue.md @@ -135,7 +135,6 @@ Group assignment: "execution_group": "P1", "depends_on": [], "semantic_priority": 0.8, - "assigned_executor": "codex", "files_touched": ["src/auth.ts"], "task_count": 3 }