From 659fb48c08ced79e9880c6b21e2cff7736cfe8c5 Mon Sep 17 00:00:00 2001 From: catlog22 Date: Fri, 13 Feb 2026 11:50:42 +0800 Subject: [PATCH] fix: resolve data flow inconsistencies found in post-migration review - test-fix-agent: remove flow_control references, use pre_analysis and convergence.criteria - code-developer: shared_context reads from plan.json instead of task meta --- .claude/agents/code-developer.md | 13 +++++-------- .claude/agents/test-fix-agent.md | 6 +++--- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.claude/agents/code-developer.md b/.claude/agents/code-developer.md index 3c395a87..94b1f72a 100644 --- a/.claude/agents/code-developer.md +++ b/.claude/agents/code-developer.md @@ -53,9 +53,6 @@ Task JSON Fields (unified flat structure): ├── description → What to implement (goal + requirements) ├── convergence.criteria[] → How to verify (validation commands) ├── focus_paths[] → Where to focus (directories/files) -├── meta.shared_context → Tech stack and conventions (if present) -│ ├── tech_stack[] → Technologies used (skip auto-detection if present) -│ └── conventions[] → Coding conventions to follow ├── artifacts[] → Additional context sources ├── pre_analysis[] → Context gathering steps (execute first) ├── implementation[] → Implementation steps (execute sequentially) @@ -66,7 +63,7 @@ Task JSON Fields (unified flat structure): 1. Read task JSON from provided path 2. Extract `description` as implementation goals 3. Extract `convergence.criteria` as verification criteria -4. If `meta.shared_context.tech_stack` exists → skip auto-detection, use provided stack +4. Read plan.json from session dir → extract `shared_context.tech_stack` and `shared_context.conventions` (skip auto-detection if present) 5. Process `pre_analysis` and `implementation` if present **Pre-Analysis: Smart Tech Stack Loading**: @@ -105,8 +102,8 @@ STEP 1: Parse Task JSON (if path provided) → Extract and store in memory: • [requirements] ← description • [acceptance_criteria] ← convergence.criteria[] - • [tech_stack] ← meta.shared_context.tech_stack[] (skip auto-detection if present) - • [conventions] ← meta.shared_context.conventions[] + • [tech_stack] ← plan.json shared_context.tech_stack[] (skip auto-detection if present) + • [conventions] ← plan.json shared_context.conventions[] • [focus_paths] ← focus_paths[] STEP 2: Execute Pre-Analysis (if pre_analysis exists in Task JSON) @@ -241,7 +238,7 @@ function buildCliHandoffPrompt(preAnalysisResults, task, taskJsonPath) { .map(([key, value]) => `### ${key}\n${value}`) .join('\n\n'); - const conventions = task.meta?.shared_context?.conventions?.join(' | ') || ''; + const conventions = plan?.shared_context?.conventions?.join(' | ') || ''; const constraints = `Follow existing patterns | No breaking changes${conventions ? ' | ' + conventions : ''}`; return ` @@ -252,7 +249,7 @@ Complete implementation based on pre-analyzed context and task JSON. Read full task definition: ${taskJsonPath} ## TECH STACK -${task.meta?.shared_context?.tech_stack?.map(t => `- ${t}`).join('\n') || 'Auto-detect from project files'} +${plan?.shared_context?.tech_stack?.map(t => `- ${t}`).join('\n') || 'Auto-detect from project files'} ## PRE-ANALYSIS CONTEXT ${contextSection} diff --git a/.claude/agents/test-fix-agent.md b/.claude/agents/test-fix-agent.md index d94601fb..d231854b 100644 --- a/.claude/agents/test-fix-agent.md +++ b/.claude/agents/test-fix-agent.md @@ -56,8 +56,8 @@ You will execute tests across multiple layers, analyze failures with layer-speci jq --arg ts "$(date -Iseconds)" '.status="in_progress" | .status_history += [{"from":.status,"to":"in_progress","changed_at":$ts}]' IMPL-X.json > tmp.json && mv tmp.json IMPL-X.json ``` -### Flow Control Execution -When task JSON contains `flow_control` field, execute preparation and implementation steps systematically. +### Task Execution Flow +When task JSON contains `pre_analysis` and `implementation` fields, execute preparation and implementation steps systematically. **Pre-Analysis Steps** (`pre_analysis`): 1. **Sequential Processing**: Execute steps in order, accumulating context @@ -91,7 +91,7 @@ When task JSON contains implementation_approach array: - `"agent"` (default) → Agent direct execution: - Parse `modification_points` as files to modify - Follow `logic_flow` for test-fix iteration - - Use test_commands from flow_control for test execution + - Use test_commands from convergence.criteria for test execution ### 1. Context Assessment & Test Discovery