mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-05 01:50:27 +08:00
Refactor TDD Workflow: Update phases, introduce conflict resolution, and enhance task generation
- Revised TDD workflow to reduce phases from 7 to 6, integrating conflict resolution as an optional phase. - Updated phase descriptions and execution logic to ensure automatic progression through phases based on TodoList status. - Removed the concept-enhanced command and its associated documentation, streamlining the analysis process. - Enhanced task generation to prioritize conflict resolution strategies and incorporate context package loading. - Updated UI design documentation to reflect changes in role analysis and design system references. - Improved error handling and validation checks across various commands to ensure robustness in execution.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -20,12 +20,12 @@ allowed-tools: SlashCommand(*), TodoWrite(*), Read(*), Bash(*)
|
||||
1. **Start Immediately**: First action is TodoWrite initialization, second action is Phase 1 execution
|
||||
2. **No Preliminary Analysis**: Do not read files before Phase 1
|
||||
3. **Parse Every Output**: Extract required data for next phase
|
||||
4. **Sequential Execution**: Each phase depends on previous output
|
||||
5. **Complete All Phases**: Do not return until Phase 7 completes (with concept verification)
|
||||
4. **Auto-Continue via TodoList**: Check TodoList status to execute next pending phase automatically
|
||||
5. **Track Progress**: Update TodoWrite after every phase completion
|
||||
6. **TDD Context**: All descriptions include "TDD:" prefix
|
||||
7. **Quality Gate**: Phase 5 concept verification ensures clarity before task generation
|
||||
7. **Quality Gate**: Phase 4 conflict resolution (optional, auto-triggered) validates compatibility before task generation
|
||||
|
||||
## 7-Phase Execution (with Concept Verification)
|
||||
## 6-Phase Execution (with Conflict Resolution)
|
||||
|
||||
### Phase 1: Session Discovery
|
||||
**Command**: `/workflow:session:start --auto "TDD: [structured-description]"`
|
||||
@@ -41,10 +41,32 @@ TEST_FOCUS: [Test scenarios]
|
||||
|
||||
**Parse**: Extract sessionId
|
||||
|
||||
**TodoWrite**: Mark phase 1 completed, phase 2 in_progress
|
||||
|
||||
**After Phase 1**: Return to user showing Phase 1 results, then auto-continue to Phase 2
|
||||
|
||||
---
|
||||
|
||||
### Phase 2: Context Gathering
|
||||
**Command**: `/workflow:tools:context-gather --session [sessionId] "TDD: [structured-description]"`
|
||||
|
||||
**Parse**: Extract contextPath
|
||||
**Use Same Structured Description**: Pass the same structured format from Phase 1
|
||||
|
||||
**Input**: `sessionId` from Phase 1
|
||||
|
||||
**Parse Output**:
|
||||
- Extract: context-package.json path (store as `contextPath`)
|
||||
- Typical pattern: `.workflow/[sessionId]/.process/context-package.json`
|
||||
|
||||
**Validation**:
|
||||
- Context package path extracted
|
||||
- File exists and is valid JSON
|
||||
|
||||
**TodoWrite**: Mark phase 2 completed, phase 3 in_progress
|
||||
|
||||
**After Phase 2**: Return to user showing Phase 2 results, then auto-continue to Phase 3
|
||||
|
||||
---
|
||||
|
||||
### Phase 3: Test Coverage Analysis
|
||||
**Command**: `/workflow:tools:test-context-gather --session [sessionId]`
|
||||
@@ -63,34 +85,49 @@ TEST_FOCUS: [Test scenarios]
|
||||
- Prevents duplicate test creation
|
||||
- Enables integration with existing tests
|
||||
|
||||
### Phase 4: TDD Analysis
|
||||
**Command**: `/workflow:tools:concept-enhanced --session [sessionId] --context [contextPath]`
|
||||
**TodoWrite**: Mark phase 3 completed, phase 4 in_progress
|
||||
|
||||
**Note**: Generates ANALYSIS_RESULTS.md with TDD-specific structure:
|
||||
- Feature list with testable requirements
|
||||
- Test cases for Red phase
|
||||
- Implementation requirements for Green phase
|
||||
- Refactoring opportunities
|
||||
- Task dependencies and execution order
|
||||
**After Phase 3**: Return to user showing test coverage results, then auto-continue to Phase 4
|
||||
|
||||
**Parse**: Verify ANALYSIS_RESULTS.md contains TDD breakdown sections
|
||||
---
|
||||
|
||||
### Phase 5: Concept Verification (NEW QUALITY GATE)
|
||||
**Command**: `/workflow:concept-verify --session [sessionId]`
|
||||
### Phase 4: Conflict Resolution (Optional - auto-triggered by conflict risk)
|
||||
|
||||
**Purpose**: Verify conceptual clarity before TDD task generation
|
||||
- Clarify test requirements and acceptance criteria
|
||||
- Resolve ambiguities in expected behavior
|
||||
- Validate TDD approach is appropriate
|
||||
**Trigger**: Only execute when context-package.json indicates conflict_risk is "medium" or "high"
|
||||
|
||||
**Behavior**:
|
||||
- If no ambiguities found → Auto-proceed to Phase 6
|
||||
- If ambiguities exist → Interactive clarification (up to 5 questions)
|
||||
- After clarifications → Auto-proceed to Phase 6
|
||||
**Command**: `SlashCommand(command="/workflow:tools:conflict-resolution --session [sessionId] --context [contextPath]")`
|
||||
|
||||
**Parse**: Verify concept verification completed (check for clarifications section in ANALYSIS_RESULTS.md or synthesis file if exists)
|
||||
**Input**:
|
||||
- sessionId from Phase 1
|
||||
- contextPath from Phase 2
|
||||
- conflict_risk from context-package.json
|
||||
|
||||
### Phase 6: TDD Task Generation
|
||||
**Parse Output**:
|
||||
- Extract: Execution status (success/skipped/failed)
|
||||
- Verify: CONFLICT_RESOLUTION.md file path (if executed)
|
||||
|
||||
**Validation**:
|
||||
- File `.workflow/[sessionId]/.process/CONFLICT_RESOLUTION.md` exists (if executed)
|
||||
|
||||
**Skip Behavior**:
|
||||
- If conflict_risk is "none" or "low", skip directly to Phase 5
|
||||
- Display: "No significant conflicts detected, proceeding to TDD task generation"
|
||||
|
||||
**TodoWrite**: Mark phase 4 completed (if executed) or skipped, phase 5 in_progress
|
||||
|
||||
**After Phase 4**: Return to user showing conflict resolution results (if executed) and selected strategies, then auto-continue to Phase 5
|
||||
|
||||
**Memory State Check**:
|
||||
- Evaluate current context window usage and memory state
|
||||
- If memory usage is high (>110K tokens or approaching context limits):
|
||||
- **Command**: `SlashCommand(command="/compact")`
|
||||
- This optimizes memory before proceeding to Phase 5
|
||||
- Memory compaction is particularly important after analysis phase which may generate extensive documentation
|
||||
- Ensures optimal performance and prevents context overflow
|
||||
|
||||
---
|
||||
|
||||
### Phase 5: TDD Task Generation
|
||||
**Command**:
|
||||
- Manual: `/workflow:tools:task-generate-tdd --session [sessionId]`
|
||||
- Agent: `/workflow:tools:task-generate-tdd --session [sessionId] --agent`
|
||||
@@ -108,7 +145,7 @@ TEST_FOCUS: [Test scenarios]
|
||||
- IMPL_PLAN.md contains workflow_type: "tdd" in frontmatter
|
||||
- Task count ≤10 (compliance with task limit)
|
||||
|
||||
### Phase 7: TDD Structure Validation & Action Plan Verification (RECOMMENDED)
|
||||
### Phase 6: TDD Structure Validation & Action Plan Verification (RECOMMENDED)
|
||||
**Internal validation first, then recommend external verification**
|
||||
|
||||
**Internal Validation**:
|
||||
@@ -166,18 +203,44 @@ TDD Configuration:
|
||||
## TodoWrite Pattern
|
||||
|
||||
```javascript
|
||||
// Initialize (7 phases now with concept verification)
|
||||
[
|
||||
{content: "Execute session discovery", status: "in_progress", activeForm: "Executing session discovery"},
|
||||
{content: "Execute context gathering", status: "pending", activeForm": "Executing context gathering"},
|
||||
{content: "Execute test coverage analysis", status: "pending", activeForm": "Executing test coverage analysis"},
|
||||
{content: "Execute TDD analysis", status: "pending", activeForm": "Executing TDD analysis"},
|
||||
{content: "Execute concept verification", status: "pending", activeForm": "Executing concept verification"},
|
||||
{content: "Execute TDD task generation", status: "pending", activeForm: "Executing TDD task generation"},
|
||||
{content: "Validate TDD structure", status: "pending", activeForm: "Validating TDD structure"}
|
||||
]
|
||||
// Initialize (Phase 4 added dynamically after Phase 3 if conflict_risk ≥ medium)
|
||||
TodoWrite({todos: [
|
||||
{"content": "Execute session discovery", "status": "in_progress", "activeForm": "Executing session discovery"},
|
||||
{"content": "Execute context gathering", "status": "pending", "activeForm": "Executing context gathering"},
|
||||
{"content": "Execute test coverage analysis", "status": "pending", "activeForm": "Executing test coverage analysis"},
|
||||
// Phase 4 todo added dynamically after Phase 3 if conflict_risk ≥ medium
|
||||
{"content": "Execute TDD task generation", "status": "pending", "activeForm": "Executing TDD task generation"},
|
||||
{"content": "Validate TDD structure", "status": "pending", "activeForm": "Validating TDD structure"}
|
||||
]})
|
||||
|
||||
// Update after each phase: mark current "completed", next "in_progress"
|
||||
// After Phase 3 (if conflict_risk ≥ medium, insert Phase 4 todo)
|
||||
TodoWrite({todos: [
|
||||
{"content": "Execute session discovery", "status": "completed", "activeForm": "Executing session discovery"},
|
||||
{"content": "Execute context gathering", "status": "completed", "activeForm": "Executing context gathering"},
|
||||
{"content": "Execute test coverage analysis", "status": "completed", "activeForm": "Executing test coverage analysis"},
|
||||
{"content": "Execute conflict resolution", "status": "in_progress", "activeForm": "Executing conflict resolution"},
|
||||
{"content": "Execute TDD task generation", "status": "pending", "activeForm": "Executing TDD task generation"},
|
||||
{"content": "Validate TDD structure", "status": "pending", "activeForm": "Validating TDD structure"}
|
||||
]})
|
||||
|
||||
// After Phase 3 (if conflict_risk is none/low, skip Phase 4, go directly to Phase 5)
|
||||
TodoWrite({todos: [
|
||||
{"content": "Execute session discovery", "status": "completed", "activeForm": "Executing session discovery"},
|
||||
{"content": "Execute context gathering", "status": "completed", "activeForm": "Executing context gathering"},
|
||||
{"content": "Execute test coverage analysis", "status": "completed", "activeForm": "Executing test coverage analysis"},
|
||||
{"content": "Execute TDD task generation", "status": "in_progress", "activeForm": "Executing TDD task generation"},
|
||||
{"content": "Validate TDD structure", "status": "pending", "activeForm": "Validating TDD structure"}
|
||||
]})
|
||||
|
||||
// After Phase 4 (if executed), continue to Phase 5
|
||||
TodoWrite({todos: [
|
||||
{"content": "Execute session discovery", "status": "completed", "activeForm": "Executing session discovery"},
|
||||
{"content": "Execute context gathering", "status": "completed", "activeForm": "Executing context gathering"},
|
||||
{"content": "Execute test coverage analysis", "status": "completed", "activeForm": "Executing test coverage analysis"},
|
||||
{"content": "Execute conflict resolution", "status": "completed", "activeForm": "Executing conflict resolution"},
|
||||
{"content": "Execute TDD task generation", "status": "in_progress", "activeForm": "Executing TDD task generation"},
|
||||
{"content": "Validate TDD structure", "status": "pending", "activeForm": "Validating TDD structure"}
|
||||
]})
|
||||
```
|
||||
|
||||
## Input Processing
|
||||
|
||||
@@ -1,229 +0,0 @@
|
||||
---
|
||||
name: concept-enhanced
|
||||
description: Architecture validation and implementation enhancement with CLI-powered analysis
|
||||
argument-hint: "--session WFS-session-id --context path/to/context-package.json"
|
||||
examples:
|
||||
- /workflow:tools:concept-enhanced --session WFS-auth --context .workflow/WFS-auth/.process/context-package.json
|
||||
- /workflow:tools:concept-enhanced --session WFS-payment --context .workflow/WFS-payment/.process/context-package.json
|
||||
---
|
||||
|
||||
# Architecture Validation Command (/workflow:tools:concept-enhanced)
|
||||
|
||||
## Overview
|
||||
Architecture validation and implementation enhancement engine with CLI-powered analysis. Validates existing architectural approaches and enhances implementation details through Gemini/Codex analysis.
|
||||
|
||||
**Scope**: Validation and enhancement only. Does NOT generate new designs, task breakdowns, or implementation plans.
|
||||
|
||||
**Usage**: Optional enhancement in `/workflow:plan` (requires `--cli-enhance` flag). Accepts context packages and validates architectural soundness.
|
||||
|
||||
## Core Philosophy & Responsibilities
|
||||
- **Agent Coordination**: Delegate validation execution to specialized agent (cli-execution-agent)
|
||||
- **Validation-Focused**: Verify architectural soundness, identify risks and quality issues
|
||||
- **Context-Driven**: Parse and validate context-package.json for precise validation
|
||||
- **Agent-Driven Tool Selection**: Agent autonomously selects Gemini/Codex based on validation needs
|
||||
- **Architecture Validation**: Verify design decisions, assess technical feasibility and risks
|
||||
- **Implementation Enhancement**: Identify optimization opportunities for performance, security, and quality
|
||||
- **Output Validation**: Verify ANALYSIS_RESULTS.md generation and quality
|
||||
- **Single Output**: Generate only ANALYSIS_RESULTS.md with validation findings and enhancement recommendations
|
||||
|
||||
## Analysis Strategy Selection
|
||||
|
||||
**Agent-Driven Strategy**: cli-execution-agent autonomously determines tool selection based on:
|
||||
- **Task Complexity**: Number of modules, integration scope, technical depth
|
||||
- **Tech Stack**: Frontend (Gemini-focused), Backend (Codex-preferred), Fullstack (hybrid)
|
||||
- **Validation Focus**: Architecture validation (Gemini), Feasibility verification (Codex), Quality assessment (both)
|
||||
|
||||
**Complexity Tiers** (Agent decides internally):
|
||||
- **Simple (≤3 modules)**: Gemini-only analysis
|
||||
- **Medium (4-6 modules)**: Gemini comprehensive analysis
|
||||
- **Complex (>6 modules)**: Gemini + Codex parallel execution
|
||||
|
||||
## Execution Lifecycle
|
||||
|
||||
### Phase 1: Validation & Preparation
|
||||
1. **Session Validation**: Verify `.workflow/{session_id}/` exists, load `workflow-session.json`
|
||||
2. **Context Package Validation**: Verify path, validate JSON format and structure
|
||||
3. **Task Analysis**: Extract keywords, identify domain/complexity, determine scope
|
||||
4. **Agent Preparation**: Prepare agent task prompt with complete analysis requirements
|
||||
|
||||
### Phase 2: Agent-Delegated Analysis
|
||||
|
||||
**Agent Invocation**:
|
||||
```javascript
|
||||
Task(
|
||||
subagent_type="cli-execution-agent",
|
||||
description="Enhanced solution design and feasibility analysis",
|
||||
prompt=`
|
||||
## Execution Context
|
||||
|
||||
**Session ID**: {session_id}
|
||||
**Mode**: Enhanced Analysis with CLI Tool Orchestration
|
||||
|
||||
## Input Context
|
||||
|
||||
**Context Package**: {context_path}
|
||||
**Session State**: .workflow/{session_id}/workflow-session.json
|
||||
**Project Standards**: CLAUDE.md
|
||||
|
||||
## Analysis Task
|
||||
|
||||
### Analysis Templates (Use these to guide CLI tool execution)
|
||||
- **Document Structure**: ~/.claude/workflows/cli-templates/prompts/workflow/analysis-results-structure.txt
|
||||
- **Gemini Analysis**: ~/.claude/workflows/cli-templates/prompts/workflow/gemini-solution-design.txt
|
||||
- **Codex Validation**: ~/.claude/workflows/cli-templates/prompts/workflow/codex-feasibility-validation.txt
|
||||
|
||||
### Execution Strategy
|
||||
1. **Load Context**: Read context-package.json to determine task complexity (module count, integration scope)
|
||||
2. **Gemini Analysis** (ALL tasks): Execute using gemini-solution-design.txt template
|
||||
- Output: .workflow/{session_id}/.process/gemini-solution-design.md
|
||||
3. **Codex Validation** (COMPLEX tasks >6 modules only): Execute using codex-feasibility-validation.txt template
|
||||
- Output: .workflow/{session_id}/.process/codex-feasibility-validation.md
|
||||
4. **Synthesize Results**: Combine outputs into ANALYSIS_RESULTS.md following analysis-results-structure.txt
|
||||
|
||||
### Output Requirements
|
||||
|
||||
**Intermediate Outputs**:
|
||||
- Gemini: \`.workflow/{session_id}/.process/gemini-solution-design.md\` (always required)
|
||||
- Codex: \`.workflow/{session_id}/.process/codex-feasibility-validation.md\` (complex tasks only)
|
||||
|
||||
**Final Output**:
|
||||
- \`.workflow/{session_id}/.process/ANALYSIS_RESULTS.md\` (synthesized, required)
|
||||
|
||||
**Required Sections** (7 sections per analysis-results-structure.txt):
|
||||
1. Executive Summary
|
||||
2. Current State Analysis
|
||||
3. Proposed Solution Design
|
||||
4. Implementation Strategy
|
||||
5. Solution Optimization
|
||||
6. Critical Success Factors
|
||||
7. Reference Information
|
||||
|
||||
### Synthesis Rules
|
||||
- Follow 7-section structure from analysis-results-structure.txt
|
||||
- Integrate Gemini insights as primary content
|
||||
- Incorporate Codex validation findings (if executed)
|
||||
- Resolve conflicts between tools with clear rationale
|
||||
- Generate confidence scores (1-5 scale) for all assessment dimensions
|
||||
- Provide final recommendation: PROCEED | PROCEED_WITH_MODIFICATIONS | RECONSIDER | REJECT
|
||||
|
||||
## Output
|
||||
Generate final ANALYSIS_RESULTS.md and report completion status:
|
||||
- Gemini analysis: [completed/failed]
|
||||
- Codex validation: [completed/skipped/failed]
|
||||
- Synthesis: [completed/failed]
|
||||
- Final output: .workflow/{session_id}/.process/ANALYSIS_RESULTS.md
|
||||
`
|
||||
)
|
||||
```
|
||||
|
||||
**Agent Execution Flow** (Internal to cli-execution-agent):
|
||||
1. Parse session ID and context path, load context-package.json
|
||||
2. Analyze task complexity (module count, integration scope)
|
||||
3. Discover additional context via MCP code-index
|
||||
4. Execute Gemini analysis (all tasks) with template-guided prompt
|
||||
5. Execute Codex validation (complex tasks >6 modules) with template-guided prompt
|
||||
6. Synthesize Gemini + Codex outputs into ANALYSIS_RESULTS.md
|
||||
7. Verify output file exists at correct path
|
||||
8. Return execution log path
|
||||
|
||||
**Command Execution**: Launch agent via Task tool, wait for completion
|
||||
|
||||
### Phase 3: Output Validation
|
||||
1. **File Verification**: Confirm `.workflow/{session_id}/.process/ANALYSIS_RESULTS.md` exists
|
||||
2. **Content Validation**: Verify required sections present (Executive Summary, Solution Design, etc.)
|
||||
3. **Quality Check**: Ensure design rationale, feasibility assessment, confidence scores included
|
||||
4. **Agent Log**: Retrieve agent execution log from `.workflow/{session_id}/.chat/`
|
||||
5. **Success Criteria**: File exists, contains all required sections, meets quality standards
|
||||
|
||||
## Analysis Results Format
|
||||
|
||||
**Template Reference**: `~/.claude/workflows/cli-templates/prompts/workflow/analysis-results-structure.txt`
|
||||
|
||||
Generated ANALYSIS_RESULTS.md focuses on **validation findings, quality assessment, and enhancement recommendations** (NOT new designs or task planning).
|
||||
|
||||
### Required Structure (7 Sections)
|
||||
|
||||
1. **Executive Summary**: Validation focus, tools used, overall assessment (X/5), recommendation status
|
||||
2. **Current State Analysis**: Architecture overview, compatibility/dependencies, critical findings
|
||||
3. **Architecture Validation**: Verify design soundness, assess feasibility, identify risks with rationale
|
||||
4. **Implementation Enhancement**: Code quality improvements, optimization opportunities, risk mitigation
|
||||
5. **Quality Optimization**: Performance, security, code quality recommendations
|
||||
6. **Critical Success Factors**: Technical requirements, quality metrics, validation criteria
|
||||
7. **Reference Information**: Tool analysis summary, context & resources
|
||||
|
||||
### Key Requirements
|
||||
|
||||
**Code Modification Targets**:
|
||||
- Existing files: `file:function:lines` (e.g., `src/auth/login.ts:validateUser:45-52`)
|
||||
- New files: `file` only (e.g., `src/auth/PasswordReset.ts`)
|
||||
- Unknown lines: `file:function:*`
|
||||
|
||||
**Validation Findings** (minimum 2):
|
||||
- Finding statement (what was validated/discovered)
|
||||
- Assessment (risks, quality issues, improvement opportunities)
|
||||
- Recommendations (specific actions to address findings)
|
||||
- Impact (implications on implementation)
|
||||
|
||||
**Assessment Scores** (1-5 scale):
|
||||
- Conceptual Integrity, Architectural Soundness, Technical Feasibility, Implementation Readiness
|
||||
- Overall Confidence score
|
||||
- Final Recommendation: PROCEED | PROCEED_WITH_MODIFICATIONS | RECONSIDER | REJECT
|
||||
|
||||
### Content Focus
|
||||
- ✅ Validation findings and quality assessment
|
||||
- ✅ Enhancement opportunities with specific recommendations
|
||||
- ✅ Risk identification and mitigation strategies
|
||||
- ✅ Optimization recommendations (performance, security, quality)
|
||||
- ❌ New design proposals or architectural changes
|
||||
- ❌ Task lists or implementation steps
|
||||
- ❌ Code examples or snippets
|
||||
- ❌ Project management timelines
|
||||
|
||||
## Execution Management
|
||||
|
||||
### Error Handling & Recovery
|
||||
1. **Pre-execution**: Verify session/context package exists and is valid
|
||||
2. **Agent Monitoring**: Track agent execution status via Task tool
|
||||
3. **Validation**: Check ANALYSIS_RESULTS.md generation on completion
|
||||
4. **Error Recovery**:
|
||||
- Agent execution failure → report error, check agent logs
|
||||
- Missing output file → retry agent execution once
|
||||
- Incomplete output → use agent logs to diagnose issue
|
||||
5. **Graceful Degradation**: If agent fails, report specific error and suggest manual analysis
|
||||
|
||||
### Agent Delegation Benefits
|
||||
- **Autonomous Tool Selection**: Agent decides Gemini/Codex based on complexity
|
||||
- **Context Discovery**: Agent discovers additional relevant files via MCP
|
||||
- **Prompt Enhancement**: Agent optimizes prompts with discovered patterns
|
||||
- **Error Handling**: Agent manages CLI tool failures internally
|
||||
- **Log Tracking**: Agent execution logs saved to `.workflow/{session_id}/.chat/`
|
||||
|
||||
## Integration & Success Criteria
|
||||
|
||||
### Input/Output Interface
|
||||
**Input**:
|
||||
- `--session` (required): Session ID (e.g., WFS-auth)
|
||||
- `--context` (required): Context package path
|
||||
|
||||
**Output**:
|
||||
- Single file: `ANALYSIS_RESULTS.md` at `.workflow/{session_id}/.process/`
|
||||
- No supplementary files (JSON, roadmap, templates)
|
||||
|
||||
### Quality & Success Validation
|
||||
**Quality Checks**: Completeness, consistency, feasibility validation
|
||||
|
||||
**Success Criteria**:
|
||||
- ✅ Validation-focused analysis (quality assessment, enhancement recommendations, NO new designs or task planning)
|
||||
- ✅ Single output file only (ANALYSIS_RESULTS.md)
|
||||
- ✅ Validation findings depth with assessment/recommendations/impact
|
||||
- ✅ Quality assessment (risks, improvement opportunities, readiness)
|
||||
- ✅ Enhancement strategies (performance, security, quality optimization)
|
||||
- ✅ Agent-driven tool selection (autonomous Gemini/Codex execution)
|
||||
- ✅ Robust error handling (validation, retry, graceful degradation)
|
||||
- ✅ Confidence scoring with clear recommendation status
|
||||
- ✅ Agent execution log saved to session chat directory
|
||||
|
||||
## Related Commands
|
||||
- `/context:gather` - Generate context packages required by this command
|
||||
- `/workflow:plan --cli-enhance` - Optionally call this command for validation enhancement
|
||||
- `/task:create` - Create specific tasks based on validation results
|
||||
@@ -72,25 +72,35 @@ Generate TDD-specific tasks from analysis results with complete Red-Green-Refact
|
||||
- If session metadata in memory → Skip loading
|
||||
- Else: Load `.workflow/{session_id}/workflow-session.json`
|
||||
|
||||
2. **Analysis Results Loading**
|
||||
- If ANALYSIS_RESULTS.md in memory → Skip loading
|
||||
- Else: Read `.workflow/{session_id}/.process/ANALYSIS_RESULTS.md`
|
||||
2. **Conflict Resolution Check** (NEW - Priority Input)
|
||||
- If CONFLICT_RESOLUTION.md exists → Load selected strategies
|
||||
- Else: Skip to brainstorming artifacts
|
||||
- Path: `.workflow/{session_id}/.process/CONFLICT_RESOLUTION.md`
|
||||
|
||||
3. **Artifact Discovery**
|
||||
- If artifact inventory in memory → Skip scanning
|
||||
- Else: Scan `.workflow/{session_id}/.brainstorming/` directory
|
||||
- Detect: role analysis documents, guidance-specification.md, role analyses
|
||||
|
||||
4. **Context Package Loading**
|
||||
- Load `.workflow/{session_id}/.process/context-package.json`
|
||||
- Load `.workflow/{session_id}/.process/test-context-package.json` (if exists)
|
||||
|
||||
### Phase 2: TDD Task JSON Generation
|
||||
|
||||
**Input**: Use `.process/ANALYSIS_RESULTS.md` directly (enhanced with TDD structure from concept-enhanced phase)
|
||||
**Input Sources** (priority order):
|
||||
1. **Conflict Resolution** (if exists): `.process/CONFLICT_RESOLUTION.md` - Selected resolution strategies
|
||||
2. **Brainstorming Artifacts**: Role analysis documents (system-architect, product-owner, etc.)
|
||||
3. **Context Package**: `.process/context-package.json` - Project structure and requirements
|
||||
4. **Test Context**: `.process/test-context-package.json` - Existing test patterns
|
||||
|
||||
**ANALYSIS_RESULTS.md includes**:
|
||||
**TDD Task Structure includes**:
|
||||
- Feature list with testable requirements
|
||||
- Test cases for Red phase
|
||||
- Implementation requirements for Green phase
|
||||
- Implementation requirements for Green phase (with test-fix cycle)
|
||||
- Refactoring opportunities
|
||||
- Task dependencies and execution order
|
||||
- Conflict resolution decisions (if applicable)
|
||||
|
||||
### Phase 3: Task JSON & IMPL_PLAN.md Generation
|
||||
|
||||
@@ -247,13 +257,14 @@ Generate IMPL_PLAN.md with 8-section structure:
|
||||
---
|
||||
identifier: WFS-{session-id}
|
||||
source: "User requirements" | "File: path"
|
||||
analysis: .workflow/{session-id}/.process/ANALYSIS_RESULTS.md
|
||||
conflict_resolution: .workflow/{session-id}/.process/CONFLICT_RESOLUTION.md # if exists
|
||||
context_package: .workflow/{session-id}/.process/context-package.json
|
||||
test_context: .workflow/{session-id}/.process/test-context-package.json # if exists
|
||||
workflow_type: "tdd"
|
||||
verification_history:
|
||||
concept_verify: "passed | skipped | pending"
|
||||
conflict_resolution: "executed | skipped" # based on conflict_risk
|
||||
action_plan_verify: "pending"
|
||||
phase_progression: "brainstorm → context → test_context → analysis → concept_verify → tdd_planning"
|
||||
phase_progression: "brainstorm → context → test_context → conflict_resolution → tdd_planning"
|
||||
feature_count: N
|
||||
task_count: N # ≤10 total
|
||||
task_breakdown:
|
||||
@@ -283,10 +294,10 @@ tdd_workflow: true
|
||||
|
||||
## 3. Brainstorming Artifacts Reference
|
||||
- Artifact Usage Strategy
|
||||
- CONFLICT_RESOLUTION.md (if exists - selected resolution strategies)
|
||||
- role analysis documents (primary reference)
|
||||
- test-context-package.json (test patterns)
|
||||
- context-package.json (smart context)
|
||||
- ANALYSIS_RESULTS.md (technical analysis)
|
||||
- Artifact Priority in Development
|
||||
|
||||
## 4. Implementation Strategy
|
||||
@@ -397,7 +408,7 @@ Update workflow-session.json with TDD metadata:
|
||||
│ ├── IMPL-3.2.json # Complex feature subtask (if needed)
|
||||
│ └── ...
|
||||
└── .process/
|
||||
├── ANALYSIS_RESULTS.md # Enhanced with TDD breakdown from concept-enhanced
|
||||
├── CONFLICT_RESOLUTION.md # Conflict resolution strategies (if conflict_risk ≥ medium)
|
||||
├── test-context-package.json # Test coverage analysis
|
||||
├── context-package.json # Input from context-gather
|
||||
└── green-fix-iteration-*.md # Fix logs from Green phase test-fix cycles
|
||||
@@ -438,7 +449,7 @@ Update workflow-session.json with TDD metadata:
|
||||
| Error | Cause | Resolution |
|
||||
|-------|-------|------------|
|
||||
| Session not found | Invalid session ID | Verify session exists |
|
||||
| Analysis missing | Incomplete planning | Run concept-enhanced first |
|
||||
| Context missing | Incomplete planning | Run context-gather first |
|
||||
|
||||
### TDD Generation Errors
|
||||
| Error | Cause | Resolution |
|
||||
|
||||
@@ -784,7 +784,7 @@ When using `--cli-execute`, each step in `implementation_approach` includes a `c
|
||||
| Error | Cause | Resolution |
|
||||
|-------|-------|------------|
|
||||
| Session not found | Invalid session ID | Verify session exists |
|
||||
| Analysis missing | Incomplete planning | Run concept-enhanced first |
|
||||
| Context missing | Incomplete planning | Run context-gather first |
|
||||
| Invalid format | Corrupted results | Regenerate analysis |
|
||||
|
||||
### Task Generation Errors
|
||||
@@ -817,5 +817,5 @@ When using `--cli-execute`, each step in `implementation_approach` includes a `c
|
||||
- `/workflow:plan` - Orchestrates entire planning
|
||||
- `/workflow:plan --cli-execute` - Planning with CLI execution mode
|
||||
- `/workflow:tools:context-gather` - Provides context package
|
||||
- `/workflow:tools:concept-enhanced` - Provides analysis results
|
||||
- `/workflow:tools:conflict-resolution` - Provides conflict resolution strategies (optional)
|
||||
- `/workflow:execute` - Executes generated tasks
|
||||
|
||||
@@ -122,12 +122,77 @@ IF section not found:
|
||||
Edit(file_path="...", old_string="[end of document]", new_string="\n\n## UI/UX Guidelines\n\n[new design reference content]")
|
||||
```
|
||||
|
||||
### Phase 4: Update UI Designer Style Guide
|
||||
### Phase 4A: Update Relevant Role Analysis Documents
|
||||
|
||||
Create or update `.brainstorming/ui-designer/style-guide.md`:
|
||||
**Discovery**: Find role analysis.md files affected by design outputs
|
||||
|
||||
```bash
|
||||
# Always update ui-designer
|
||||
ui_designer_files = Glob(".workflow/WFS-{session}/.brainstorming/ui-designer/analysis*.md")
|
||||
|
||||
# Conditionally update other roles
|
||||
has_animations = exists({latest_design}/animation-extraction/animation-tokens.json)
|
||||
has_layouts = exists({latest_design}/layout-extraction/layout-templates.json)
|
||||
|
||||
IF has_animations: ux_expert_files = Glob(".workflow/WFS-{session}/.brainstorming/ux-expert/analysis*.md")
|
||||
IF has_layouts: architect_files = Glob(".workflow/WFS-{session}/.brainstorming/system-architect/analysis*.md")
|
||||
IF selected_list: pm_files = Glob(".workflow/WFS-{session}/.brainstorming/product-manager/analysis*.md")
|
||||
```
|
||||
|
||||
**Content Templates**:
|
||||
|
||||
**ui-designer/analysis.md** (append if not exists):
|
||||
```markdown
|
||||
## Design System Implementation Reference
|
||||
|
||||
**Design Tokens**: @../../design-{run_id}/{design_tokens_path}
|
||||
**Style Guide**: @../../design-{run_id}/{style_guide_path}
|
||||
**Prototypes**: {FOR each: @../../design-{run_id}/prototypes/{prototype}.html}
|
||||
|
||||
*Reference added by /workflow:ui-design:update*
|
||||
```
|
||||
|
||||
**ux-expert/analysis.md** (if animations):
|
||||
```markdown
|
||||
## Animation & Interaction Reference
|
||||
|
||||
**Animations**: @../../design-{run_id}/animation-extraction/animation-tokens.json
|
||||
**Prototypes**: {FOR each: @../../design-{run_id}/prototypes/{prototype}.html}
|
||||
|
||||
*Reference added by /workflow:ui-design:update*
|
||||
```
|
||||
|
||||
**system-architect/analysis.md** (if layouts):
|
||||
```markdown
|
||||
## Layout Structure Reference
|
||||
|
||||
**Layout Templates**: @../../design-{run_id}/layout-extraction/layout-templates.json
|
||||
|
||||
*Reference added by /workflow:ui-design:update*
|
||||
```
|
||||
|
||||
**product-manager/analysis.md** (if prototypes):
|
||||
```markdown
|
||||
## Prototype Validation Reference
|
||||
|
||||
**Prototypes**: {FOR each: @../../design-{run_id}/prototypes/{prototype}.html}
|
||||
|
||||
*Reference added by /workflow:ui-design:update*
|
||||
```
|
||||
|
||||
**Implementation**:
|
||||
```bash
|
||||
FOR file IN [ui_designer_files, ux_expert_files, architect_files, pm_files]:
|
||||
IF file exists AND section_not_exists(file):
|
||||
Edit(file, old_string="[end of document]", new_string="\n\n{role-specific section}")
|
||||
```
|
||||
|
||||
### Phase 4B: Create UI Designer Design System Reference
|
||||
|
||||
Create or update `.brainstorming/ui-designer/design-system-reference.md`:
|
||||
|
||||
```markdown
|
||||
# UI Designer Style Guide
|
||||
# UI Designer Design System Reference
|
||||
|
||||
## Design System Integration
|
||||
This style guide references the finalized design system from the design refinement phase.
|
||||
@@ -158,7 +223,7 @@ For complete token definitions and usage examples, see:
|
||||
|
||||
**Implementation**:
|
||||
```bash
|
||||
Write(file_path=".workflow/WFS-{session}/.brainstorming/ui-designer/style-guide.md",
|
||||
Write(file_path=".workflow/WFS-{session}/.brainstorming/ui-designer/design-system-reference.md",
|
||||
content="[generated content with @ references]")
|
||||
```
|
||||
|
||||
@@ -169,7 +234,8 @@ TodoWrite({todos: [
|
||||
{content: "Validate session and design system artifacts", status: "completed", activeForm: "Validating artifacts"},
|
||||
{content: "Load target brainstorming artifacts", status: "completed", activeForm: "Loading target files"},
|
||||
{content: "Update role analysis documents with design references", status: "completed", activeForm: "Updating synthesis spec"},
|
||||
{content: "Create/update ui-designer/style-guide.md", status: "completed", activeForm: "Updating UI designer guide"}
|
||||
{content: "Update relevant role analysis.md documents", status: "completed", activeForm: "Updating role analysis files"},
|
||||
{content: "Create/update ui-designer/design-system-reference.md", status: "completed", activeForm: "Creating design system reference"}
|
||||
]});
|
||||
```
|
||||
|
||||
@@ -179,7 +245,8 @@ TodoWrite({todos: [
|
||||
|
||||
Updated artifacts:
|
||||
✓ role analysis documents - UI/UX Guidelines section with @ references
|
||||
✓ ui-designer/style-guide.md - Design system reference guide
|
||||
✓ {role_count} role analysis.md files - Design system references
|
||||
✓ ui-designer/design-system-reference.md - Design system reference guide
|
||||
|
||||
Design system assets ready for /workflow:plan:
|
||||
- design-tokens.json | style-guide.md | {prototype_count} reference prototypes
|
||||
@@ -193,9 +260,13 @@ Next: /workflow:plan [--agent] "<task description>"
|
||||
**Updated Files**:
|
||||
```
|
||||
.workflow/WFS-{session}/.brainstorming/
|
||||
├── role analysis documents # Updated with UI/UX Guidelines section
|
||||
└── ui-designer/
|
||||
└── style-guide.md # New or updated design reference guide
|
||||
├── role analysis documents # Updated with UI/UX Guidelines section
|
||||
├── ui-designer/
|
||||
│ ├── analysis*.md # Updated with design system references
|
||||
│ └── design-system-reference.md # New or updated design reference guide
|
||||
├── ux-expert/analysis*.md # Updated if animations exist
|
||||
├── product-manager/analysis*.md # Updated if prototypes exist
|
||||
└── system-architect/analysis*.md # Updated if layouts exist
|
||||
```
|
||||
|
||||
**@ Reference Format** (role analysis documents):
|
||||
@@ -205,13 +276,21 @@ Next: /workflow:plan [--agent] "<task description>"
|
||||
@../design-{run_id}/prototypes/{prototype}.html
|
||||
```
|
||||
|
||||
**@ Reference Format** (ui-designer/style-guide.md):
|
||||
**@ Reference Format** (ui-designer/design-system-reference.md):
|
||||
```
|
||||
@../../design-{run_id}/style-extraction/style-1/design-tokens.json
|
||||
@../../design-{run_id}/style-extraction/style-1/style-guide.md
|
||||
@../../design-{run_id}/prototypes/{prototype}.html
|
||||
```
|
||||
|
||||
**@ Reference Format** (role analysis.md files):
|
||||
```
|
||||
@../../design-{run_id}/style-extraction/style-1/design-tokens.json
|
||||
@../../design-{run_id}/animation-extraction/animation-tokens.json
|
||||
@../../design-{run_id}/layout-extraction/layout-templates.json
|
||||
@../../design-{run_id}/prototypes/{prototype}.html
|
||||
```
|
||||
|
||||
## Integration with /workflow:plan
|
||||
|
||||
After this update, `/workflow:plan` will discover design assets through:
|
||||
@@ -249,7 +328,9 @@ After this update, `/workflow:plan` will discover design assets through:
|
||||
After update, verify:
|
||||
- [ ] role analysis documents contains UI/UX Guidelines section
|
||||
- [ ] UI/UX Guidelines include @ references (not content duplication)
|
||||
- [ ] ui-designer/style-guide.md created or updated
|
||||
- [ ] ui-designer/analysis*.md updated with design system references
|
||||
- [ ] ui-designer/design-system-reference.md created or updated
|
||||
- [ ] Relevant role analysis.md files updated (ux-expert, product-manager, system-architect)
|
||||
- [ ] All @ referenced files exist and are accessible
|
||||
- [ ] @ reference paths are relative and correct
|
||||
|
||||
@@ -264,7 +345,7 @@ After update, verify:
|
||||
## Integration Points
|
||||
|
||||
- **Input**: Design system artifacts from `/workflow:ui-design:style-extract` and `/workflow:ui-design:generate`
|
||||
- **Output**: Updated role analysis documents, ui-designer/style-guide.md with @ references
|
||||
- **Output**: Updated role analysis documents, role analysis.md files, ui-designer/design-system-reference.md with @ references
|
||||
- **Next Phase**: `/workflow:plan` discovers and utilizes design system through @ references
|
||||
- **Auto Integration**: Automatically triggered by `/workflow:ui-design:auto` workflow
|
||||
|
||||
|
||||
Reference in New Issue
Block a user