feat: implement feature-driven artifact architecture for brainstorm-plan-execute pipeline

Restructure brainstorm artifacts from role-dimension to feature-dimension
to eliminate information loss at the brainstorm→plan boundary. Key changes:

- artifacts.md: Add Phase 4.5 Feature Decomposition in guidance-specification
- conceptual-planning-agent.md: Name sub-docs by feature (analysis-F-{id}-{slug}.md)
- role-analysis.md: Pass feature list to Phase 3 agent prompts
- synthesis.md: Add Phase 6 parallel feature spec generation + feature-index.json
- task-generate-agent.md: Inject feature-index.json path into agent prompts
- context-search-agent.md: Flatten brainstorm_artifacts structure (feature_index,
  feature_specs, cross_cutting_specs as top-level fields)
- action-planning-agent.md: Add feature-index driven on-demand loading, plan-time
  expansion for pre_analysis commands, fix cross_cutting_specs string array access
This commit is contained in:
catlog22
2026-02-11 16:32:30 +08:00
parent 8475a724ae
commit 5a4350beb4
7 changed files with 891 additions and 74 deletions

View File

@@ -339,7 +339,25 @@ if (dir_exists(brainstormDir)) {
path: `${brainstormDir}/synthesis-specification.md`,
exists: file_exists(`${brainstormDir}/synthesis-specification.md`),
content: Read(`${brainstormDir}/synthesis-specification.md`) || null
}
},
// Feature index (optional - top level, matches action-planning-agent expected access pattern)
feature_index: file_exists(`${brainstormDir}/feature-specs/feature-index.json`) ? {
path: `${brainstormDir}/feature-specs/feature-index.json`,
exists: true,
content: Read(`${brainstormDir}/feature-specs/feature-index.json`) || null
} : undefined,
// Feature spec files (optional - individual feature specifications)
feature_specs: dir_exists(`${brainstormDir}/feature-specs`)
? glob(`${brainstormDir}/feature-specs/F-*-*.md`).map(file => ({
path: file,
content: Read(file)
}))
: undefined,
// Cross-cutting specs (optional - cross-cutting concern analyses from roles)
cross_cutting_specs: glob(`${brainstormDir}/*/analysis-cross-cutting.md`).map(file => ({
path: file,
content: Read(file)
}))
};
}
```
@@ -462,7 +480,24 @@ Calculate risk level based on:
"path": ".workflow/WFS-xxx/.brainstorming/synthesis-specification.md",
"exists": true,
"content": "# Synthesis Specification\n\n## Cross-Role Integration\n..."
}
},
"feature_index": {
"path": ".workflow/WFS-xxx/.brainstorming/feature-specs/feature-index.json",
"exists": true,
"content": "{\"version\":\"1.0\",\"features\":[...]}"
},
"feature_specs": [
{
"path": ".workflow/WFS-xxx/.brainstorming/feature-specs/F-001-auth.md",
"content": "# Feature Spec: F-001 - Auth\n..."
}
],
"cross_cutting_specs": [
{
"path": ".workflow/WFS-xxx/.brainstorming/system-architect/analysis-cross-cutting.md",
"content": "# Cross-Cutting: Architecture Decisions\n..."
}
]
},
"conflict_detection": {
"risk_level": "medium",