refactor: Optimize document passing strategy in workflow

- **concept-enhanced**: Add explicit priority for source documents
  - PRIMARY: role analysis.md files (complete technical details, ADRs)
  - SECONDARY: synthesis-specification.md (integrated requirements)
  - Framework: topic-framework.md (discussion context)

- **task-generate**: Enhanced artifacts array with usage guidance
  - Add 'usage' field for each artifact type
  - Support dynamic role discovery
  - Reorder priority: synthesis (highest) → role_analysis (high) → framework (low)

- **pre_analysis**: Add explicit artifact loading instructions
  - Note when to consult role analysis (API schemas, caching configs, design tokens)
  - Load system-architect, ui-designer, product-manager analyses

- **implementation_approach**: Add clear priority instructions
  - Primary: Use synthesis-specification.md for requirements
  - Secondary: Refer to artifacts[] for technical details
  - Update logic_flow to include "Consult artifacts when needed"

- **gitignore**: Add .workflow directory to ignore list

🎯 Result: Balanced strategy - 100% fidelity in analysis phase, 78% token efficiency in planning phase, hybrid approach in execution phase

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
catlog22
2025-10-04 12:44:07 +08:00
parent 237a2867fb
commit e90c9baa13
4 changed files with 47 additions and 17 deletions

View File

@@ -130,6 +130,15 @@ Advanced solution design and feasibility analysis engine with parallel CLI execu
- Tech stack from tech_stack section - Tech stack from tech_stack section
- Project structure from statistics section - Project structure from statistics section
**ANALYSIS PRIORITY - Use ALL source documents from context-package assets[]**:
1. PRIMARY SOURCES (Highest Priority): Individual role analysis.md files (system-architect, ui-designer, product-manager, etc.)
- These contain complete technical details, design rationale, ADRs, and decision context
- Extract: Technical specs, API schemas, design tokens, caching configs, performance metrics
2. SYNTHESIS REFERENCE (Medium Priority): synthesis-specification.md
- Use for integrated requirements and cross-role alignment
- Validate decisions and identify integration points
3. TOPIC FRAMEWORK (Low Priority): topic-framework.md for discussion context
EXPECTED: EXPECTED:
1. CURRENT STATE ANALYSIS: Existing patterns, code structure, integration points, technical debt 1. CURRENT STATE ANALYSIS: Existing patterns, code structure, integration points, technical debt
2. SOLUTION DESIGN: Core architecture principles, system design, key design decisions with rationale 2. SOLUTION DESIGN: Core architecture principles, system design, key design decisions with rationale

View File

@@ -169,7 +169,21 @@ Task(
{ {
"type": "synthesis_specification", "type": "synthesis_specification",
"path": "{synthesis_spec_path}", "path": "{synthesis_spec_path}",
"priority": "highest" "priority": "highest",
"usage": "Primary requirement source - use for consolidated requirements and cross-role alignment"
},
{
"type": "role_analysis",
"path": "{role_analysis_path}",
"priority": "high",
"usage": "Technical/design/business details from specific roles. Common roles: system-architect (ADRs, APIs, caching), ui-designer (design tokens, layouts), product-manager (user stories, metrics)",
"note": "Dynamically discovered - multiple role analysis files included based on brainstorming results"
},
{
"type": "topic_framework",
"path": "{topic_framework_path}",
"priority": "low",
"usage": "Discussion context and framework structure"
} }
] ]
}, },
@@ -203,12 +217,13 @@ Task(
} }
], ],
"implementation_approach": { "implementation_approach": {
"task_description": "Implement '[title]' following synthesis specification", "task_description": "Implement '[title]' following synthesis specification. PRIORITY: Use synthesis-specification.md as primary requirement source. When implementation needs technical details (e.g., API schemas, caching configs, design tokens), refer to artifacts[] for detailed specifications from original role analyses.",
"modification_points": ["Apply requirements from synthesis"], "modification_points": ["Apply requirements from synthesis"],
"logic_flow": [ "logic_flow": [
"Load synthesis specification", "Load synthesis specification",
"Analyze existing patterns", "Analyze existing patterns",
"Implement following specification", "Implement following specification",
"Consult artifacts for technical details when needed",
"Validate against acceptance criteria" "Validate against acceptance criteria"
] ]
}, },

View File

@@ -84,21 +84,22 @@ Generate task JSON files and IMPL_PLAN.md from analysis results with automatic a
"source": "brainstorm_synthesis", "source": "brainstorm_synthesis",
"path": ".workflow/WFS-[session]/.brainstorming/synthesis-specification.md", "path": ".workflow/WFS-[session]/.brainstorming/synthesis-specification.md",
"priority": "highest", "priority": "highest",
"contains": "complete_integrated_specification" "usage": "Primary requirement source - use for consolidated requirements and cross-role alignment"
},
{
"type": "role_analysis",
"source": "brainstorm_roles",
"path": ".workflow/WFS-[session]/.brainstorming/[role-name]/analysis.md",
"priority": "high",
"usage": "Technical/design/business details from specific roles. Common roles: system-architect (ADRs, APIs, caching), ui-designer (design tokens, layouts), product-manager (user stories, metrics)",
"note": "Dynamically discovered - multiple role analysis files may be included based on brainstorming results"
}, },
{ {
"type": "topic_framework", "type": "topic_framework",
"source": "brainstorm_framework", "source": "brainstorm_framework",
"path": ".workflow/WFS-[session]/.brainstorming/topic-framework.md", "path": ".workflow/WFS-[session]/.brainstorming/topic-framework.md",
"priority": "medium",
"contains": "discussion_framework_structure"
},
{
"type": "individual_role_analysis",
"source": "brainstorm_roles",
"path": ".workflow/WFS-[session]/.brainstorming/[role]/analysis.md",
"priority": "low", "priority": "low",
"contains": "role_specific_analysis_fallback" "usage": "Discussion context and framework structure"
} }
] ]
}, },
@@ -115,14 +116,16 @@ Generate task JSON files and IMPL_PLAN.md from analysis results with automatic a
"on_error": "skip_optional" "on_error": "skip_optional"
}, },
{ {
"step": "load_individual_role_artifacts", "step": "load_role_analysis_artifacts",
"action": "Load individual role analyses as fallback", "action": "Load role-specific analysis documents for technical details",
"note": "These artifacts contain implementation details not in synthesis. Consult when needing: API schemas, caching configs, design tokens, ADRs, performance metrics.",
"commands": [ "commands": [
"bash(find .workflow/WFS-[session]/.brainstorming/ -name 'analysis.md' 2>/dev/null | head -8)", "bash(find .workflow/WFS-[session]/.brainstorming/ -name 'analysis.md' 2>/dev/null | head -8)",
"Read(.workflow/WFS-[session]/.brainstorming/system-architect/analysis.md)",
"Read(.workflow/WFS-[session]/.brainstorming/ui-designer/analysis.md)", "Read(.workflow/WFS-[session]/.brainstorming/ui-designer/analysis.md)",
"Read(.workflow/WFS-[session]/.brainstorming/system-architect/analysis.md)" "Read(.workflow/WFS-[session]/.brainstorming/product-manager/analysis.md)"
], ],
"output_to": "individual_artifacts", "output_to": "role_analysis_artifacts",
"on_error": "skip_optional" "on_error": "skip_optional"
}, },
{ {
@@ -152,10 +155,11 @@ Generate task JSON files and IMPL_PLAN.md from analysis results with automatic a
} }
], ],
"implementation_approach": { "implementation_approach": {
"task_description": "Implement '[title]' following synthesis specification", "task_description": "Implement '[title]' following synthesis specification. PRIORITY: Use synthesis-specification.md as primary requirement source. When implementation needs technical details (e.g., API schemas, caching configs, design tokens), refer to artifacts[] for detailed specifications from original role analyses.",
"modification_points": [ "modification_points": [
"Apply consolidated requirements from synthesis-specification.md", "Apply consolidated requirements from synthesis-specification.md",
"Follow technical guidelines from synthesis", "Follow technical guidelines from synthesis",
"Consult artifacts for implementation details when needed",
"Integrate with existing patterns" "Integrate with existing patterns"
], ],
"logic_flow": [ "logic_flow": [
@@ -163,6 +167,7 @@ Generate task JSON files and IMPL_PLAN.md from analysis results with automatic a
"Extract requirements and design", "Extract requirements and design",
"Analyze existing patterns", "Analyze existing patterns",
"Implement following specification", "Implement following specification",
"Consult artifacts for technical details when needed",
"Validate against acceptance criteria" "Validate against acceptance criteria"
] ]
}, },

3
.gitignore vendored
View File

@@ -17,4 +17,5 @@ yarn-error.log*
Thumbs.db Thumbs.db
.env .env
settings.local.json settings.local.json
.workflow