refactor(agents): deduplicate agent invocation prompts and strengthen project artifact consumption

Remove duplicated content from caller prompts that repeat agent spec definitions:
- EXECUTION METHOD MAPPING, CLI EXECUTION ID strategies, Quantification Rules
- MANDATORY FIRST STEPS (now internalized in cli-explore-agent)
- relevant_files schema details, Phase execution flow re-specifications
- plan.json/task JSON field listings (reference schemas instead)

Strengthen project-tech.json and project-guidelines.json consumption:
- context-search-agent: add Phase 1.1b mandatory project context loading
- cli-explore-agent: add Autonomous Initialization with 4 self-contained steps
- action-planning-agent: strengthen Phase 1 Step 0 with detailed usage guidance
- All caller prompts: add/reinforce PROJECT CONTEXT (MANDATORY) sections

Agent specs modified: action-planning-agent, cli-explore-agent, context-search-agent
Caller prompts slimmed: 04-task-generation, 05-tdd-task-generation,
  02-context-gathering, 01-lite-plan, collaborative-plan-with-file,
  05-test-cycle-execute
This commit is contained in:
catlog22
2026-02-25 18:44:51 +08:00
parent 5c51315a7e
commit db5797faa3
9 changed files with 213 additions and 330 deletions

View File

@@ -129,19 +129,13 @@ const taskTypeSpecificReads = {
const taskTypeGuidance = {
"test-gen": `
- Review task.context.requirements for test scenarios
- Analyze codebase to understand implementation
- Generate tests covering: happy paths, edge cases, error handling
- Follow existing test patterns and framework conventions
- Read task.context.requirements for test scenarios
- Generate tests following existing patterns and framework conventions
`,
"test-fix": `
- Run test command from task.context or project config
- Capture: pass/fail counts, error messages, stack traces
- Assess criticality for each failure:
* high: core functionality broken, security issues
* medium: feature degradation, data integrity issues
* low: edge cases, flaky tests, env-specific issues
- Save structured results to test-results.json
- Execute multi-layer test suite (follow your Layer-Aware Diagnosis spec)
- Save structured results to ${session.test_results_path}
- Apply criticality assessment per your spec (high/medium/low)
`,
"test-fix-iteration": `
- Load fix_strategy from task.context.fix_strategy
@@ -249,6 +243,10 @@ Task(
## Strategy
${selectedStrategy} - ${strategyDescription}
## PROJECT CONTEXT (MANDATORY)
1. Read: .workflow/project-tech.json (tech stack, test framework, build system)
2. Read: .workflow/project-guidelines.json (constraints — apply as HARD CONSTRAINTS on fixes)
## MANDATORY FIRST STEPS
1. Read test results: ${session.test_results_path}
2. Read test output: ${session.test_output_path}