Skip to content

Commit a4cb1e7

Browse files
author
catlog22
committed
fix(planning-agent): relax task parser regex and inject Prior Analysis into CLI context
1. extractStructuredTasks regex: /### (TASK-\d+|T\d+):/ was too strict, failing when Gemini outputs fewer #'s or omits colon. Relaxed to /#{1,3}\s*(TASK-\d+|T\d+):?\s*/ to tolerate format variations. 2. CLI Command Template CONTEXT field: added explicit instruction to use Prior Analysis from task description as primary planning context when exploration files are absent.
1 parent 4f3ef5c commit a4cb1e7

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

.claude/agents/cli-lite-planning-agent.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ TASK:
174174
• Identify dependencies and execution phases
175175
• Generate complexity-appropriate fields (rationale, verification, risks, code_skeleton, data_flow)
176176
MODE: analysis
177-
CONTEXT: @**/* | Memory: {context_summary}
177+
CONTEXT: @**/* | Memory: {context_summary}. If task description contains '## Prior Analysis', treat it as primary planning context with pre-analyzed files, findings, and recommendations.
178178
EXPECTED:
179179
## Summary
180180
[overview]
@@ -257,8 +257,8 @@ function extractSection(cliOutput, header) {
257257
// Parse structured tasks from CLI output
258258
function extractStructuredTasks(cliOutput, complexity) {
259259
const tasks = []
260-
// Split by task headers (supports both TASK-NNN and T\d+ formats)
261-
const taskBlocks = cliOutput.split(/### (TASK-\d+|T\d+):/).slice(1)
260+
// Split by task headers (flexible: 1-3 #, optional colon, supports TASK-NNN and T\d+)
261+
const taskBlocks = cliOutput.split(/#{1,3}\s*(TASK-\d+|T\d+):?\s*/).slice(1)
262262

263263
for (let i = 0; i < taskBlocks.length; i += 2) {
264264
const rawId = taskBlocks[i].trim()

0 commit comments

Comments
 (0)