mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-05 01:50:27 +08:00
refactor: optimize TodoWrite format with hierarchical display across workflow commands
Adopt consistent hierarchical TodoWrite format for better visual clarity: - Phase-level tasks: "Phase N: Description" - Sub-tasks: " → Sub-task description" (indented with arrow) - Clear parent-child relationships through visual hierarchy - Task attachment/collapse pattern visualization Updated commands: - lite-plan.md (Phase 1-4 examples) - auto-parallel.md (Phase 0-3 examples) - tdd-plan.md (Phase 3-5 examples) - test-fix-gen.md (TodoWrite Pattern with examples) - explore-auto.md (TodoWrite Pattern) - imitate-auto.md (TodoWrite Pattern) - review-session-cycle.md - review-module-cycle.md Benefits: - Visual hierarchy shows task relationships - Expanded view shows detailed progress - Collapsed view maintains clean orchestrator-level summary - Consistent format across all multi-phase workflows
This commit is contained in:
@@ -90,14 +90,15 @@ This workflow runs **fully autonomously** once triggered. Phase 1 (artifacts) ha
|
||||
**TodoWrite Update (Phase 1 SlashCommand invoked - tasks attached)**:
|
||||
```json
|
||||
[
|
||||
{"content": "Parse --count parameter from user input", "status": "completed", "activeForm": "Parsing count parameter"},
|
||||
{"content": "Phase 1.1: Topic analysis and question generation (artifacts)", "status": "in_progress", "activeForm": "Analyzing topic"},
|
||||
{"content": "Phase 1.2: Role selection and user confirmation (artifacts)", "status": "pending", "activeForm": "Selecting roles"},
|
||||
{"content": "Phase 1.3: Role questions and user decisions (artifacts)", "status": "pending", "activeForm": "Collecting role questions"},
|
||||
{"content": "Phase 1.4: Conflict detection and resolution (artifacts)", "status": "pending", "activeForm": "Resolving conflicts"},
|
||||
{"content": "Phase 1.5: Guidance specification generation (artifacts)", "status": "pending", "activeForm": "Generating guidance"},
|
||||
{"content": "Execute parallel role analysis", "status": "pending", "activeForm": "Executing parallel role analysis"},
|
||||
{"content": "Execute synthesis integration", "status": "pending", "activeForm": "Executing synthesis integration"}
|
||||
{"content": "Phase 0: Parameter Parsing", "status": "completed", "activeForm": "Parsing count parameter"},
|
||||
{"content": "Phase 1: Interactive Framework Generation", "status": "in_progress", "activeForm": "Executing artifacts interactive framework"},
|
||||
{"content": " → Topic analysis and question generation", "status": "in_progress", "activeForm": "Analyzing topic"},
|
||||
{"content": " → Role selection and user confirmation", "status": "pending", "activeForm": "Selecting roles"},
|
||||
{"content": " → Role questions and user decisions", "status": "pending", "activeForm": "Collecting role questions"},
|
||||
{"content": " → Conflict detection and resolution", "status": "pending", "activeForm": "Resolving conflicts"},
|
||||
{"content": " → Guidance specification generation", "status": "pending", "activeForm": "Generating guidance"},
|
||||
{"content": "Phase 2: Parallel Role Analysis", "status": "pending", "activeForm": "Executing parallel role analysis"},
|
||||
{"content": "Phase 3: Synthesis Integration", "status": "pending", "activeForm": "Executing synthesis integration"}
|
||||
]
|
||||
```
|
||||
|
||||
@@ -108,10 +109,10 @@ This workflow runs **fully autonomously** once triggered. Phase 1 (artifacts) ha
|
||||
**TodoWrite Update (Phase 1 completed - tasks collapsed)**:
|
||||
```json
|
||||
[
|
||||
{"content": "Parse --count parameter from user input", "status": "completed", "activeForm": "Parsing count parameter"},
|
||||
{"content": "Execute artifacts interactive framework generation", "status": "completed", "activeForm": "Executing artifacts interactive framework"},
|
||||
{"content": "Execute parallel role analysis", "status": "pending", "activeForm": "Executing parallel role analysis"},
|
||||
{"content": "Execute synthesis integration", "status": "pending", "activeForm": "Executing synthesis integration"}
|
||||
{"content": "Phase 0: Parameter Parsing", "status": "completed", "activeForm": "Parsing count parameter"},
|
||||
{"content": "Phase 1: Interactive Framework Generation", "status": "completed", "activeForm": "Executing artifacts interactive framework"},
|
||||
{"content": "Phase 2: Parallel Role Analysis", "status": "pending", "activeForm": "Executing parallel role analysis"},
|
||||
{"content": "Phase 3: Synthesis Integration", "status": "pending", "activeForm": "Executing synthesis integration"}
|
||||
]
|
||||
```
|
||||
|
||||
@@ -203,12 +204,13 @@ TOPIC: {user-provided-topic}
|
||||
**TodoWrite Update (Phase 2 agents invoked - tasks attached in parallel)**:
|
||||
```json
|
||||
[
|
||||
{"content": "Parse --count parameter from user input", "status": "completed", "activeForm": "Parsing count parameter"},
|
||||
{"content": "Execute artifacts interactive framework generation", "status": "completed", "activeForm": "Executing artifacts interactive framework"},
|
||||
{"content": "Phase 2.1: Execute system-architect analysis [conceptual-planning-agent]", "status": "in_progress", "activeForm": "Executing system-architect analysis"},
|
||||
{"content": "Phase 2.2: Execute ui-designer analysis [conceptual-planning-agent]", "status": "in_progress", "activeForm": "Executing ui-designer analysis"},
|
||||
{"content": "Phase 2.3: Execute product-manager analysis [conceptual-planning-agent]", "status": "in_progress", "activeForm": "Executing product-manager analysis"},
|
||||
{"content": "Execute synthesis integration", "status": "pending", "activeForm": "Executing synthesis integration"}
|
||||
{"content": "Phase 0: Parameter Parsing", "status": "completed", "activeForm": "Parsing count parameter"},
|
||||
{"content": "Phase 1: Interactive Framework Generation", "status": "completed", "activeForm": "Executing artifacts interactive framework"},
|
||||
{"content": "Phase 2: Parallel Role Analysis", "status": "in_progress", "activeForm": "Executing parallel role analysis"},
|
||||
{"content": " → Execute system-architect analysis", "status": "in_progress", "activeForm": "Executing system-architect analysis"},
|
||||
{"content": " → Execute ui-designer analysis", "status": "in_progress", "activeForm": "Executing ui-designer analysis"},
|
||||
{"content": " → Execute product-manager analysis", "status": "in_progress", "activeForm": "Executing product-manager analysis"},
|
||||
{"content": "Phase 3: Synthesis Integration", "status": "pending", "activeForm": "Executing synthesis integration"}
|
||||
]
|
||||
```
|
||||
|
||||
@@ -219,10 +221,10 @@ TOPIC: {user-provided-topic}
|
||||
**TodoWrite Update (Phase 2 completed - tasks collapsed)**:
|
||||
```json
|
||||
[
|
||||
{"content": "Parse --count parameter from user input", "status": "completed", "activeForm": "Parsing count parameter"},
|
||||
{"content": "Execute artifacts interactive framework generation", "status": "completed", "activeForm": "Executing artifacts interactive framework"},
|
||||
{"content": "Execute parallel role analysis", "status": "completed", "activeForm": "Executing parallel role analysis"},
|
||||
{"content": "Execute synthesis integration", "status": "pending", "activeForm": "Executing synthesis integration"}
|
||||
{"content": "Phase 0: Parameter Parsing", "status": "completed", "activeForm": "Parsing count parameter"},
|
||||
{"content": "Phase 1: Interactive Framework Generation", "status": "completed", "activeForm": "Executing artifacts interactive framework"},
|
||||
{"content": "Phase 2: Parallel Role Analysis", "status": "completed", "activeForm": "Executing parallel role analysis"},
|
||||
{"content": "Phase 3: Synthesis Integration", "status": "pending", "activeForm": "Executing synthesis integration"}
|
||||
]
|
||||
```
|
||||
|
||||
@@ -251,12 +253,13 @@ TOPIC: {user-provided-topic}
|
||||
**TodoWrite Update (Phase 3 SlashCommand invoked - tasks attached)**:
|
||||
```json
|
||||
[
|
||||
{"content": "Parse --count parameter from user input", "status": "completed", "activeForm": "Parsing count parameter"},
|
||||
{"content": "Execute artifacts interactive framework generation", "status": "completed", "activeForm": "Executing artifacts interactive framework"},
|
||||
{"content": "Execute parallel role analysis", "status": "completed", "activeForm": "Executing parallel role analysis"},
|
||||
{"content": "Phase 3.1: Load role analysis files (synthesis)", "status": "in_progress", "activeForm": "Loading role analyses"},
|
||||
{"content": "Phase 3.2: Integrate insights across roles (synthesis)", "status": "pending", "activeForm": "Integrating insights"},
|
||||
{"content": "Phase 3.3: Generate synthesis specification (synthesis)", "status": "pending", "activeForm": "Generating synthesis"}
|
||||
{"content": "Phase 0: Parameter Parsing", "status": "completed", "activeForm": "Parsing count parameter"},
|
||||
{"content": "Phase 1: Interactive Framework Generation", "status": "completed", "activeForm": "Executing artifacts interactive framework"},
|
||||
{"content": "Phase 2: Parallel Role Analysis", "status": "completed", "activeForm": "Executing parallel role analysis"},
|
||||
{"content": "Phase 3: Synthesis Integration", "status": "in_progress", "activeForm": "Executing synthesis integration"},
|
||||
{"content": " → Load role analysis files", "status": "in_progress", "activeForm": "Loading role analyses"},
|
||||
{"content": " → Integrate insights across roles", "status": "pending", "activeForm": "Integrating insights"},
|
||||
{"content": " → Generate synthesis specification", "status": "pending", "activeForm": "Generating synthesis"}
|
||||
]
|
||||
```
|
||||
|
||||
@@ -267,10 +270,10 @@ TOPIC: {user-provided-topic}
|
||||
**TodoWrite Update (Phase 3 completed - tasks collapsed)**:
|
||||
```json
|
||||
[
|
||||
{"content": "Parse --count parameter from user input", "status": "completed", "activeForm": "Parsing count parameter"},
|
||||
{"content": "Execute artifacts interactive framework generation", "status": "completed", "activeForm": "Executing artifacts interactive framework"},
|
||||
{"content": "Execute parallel role analysis", "status": "completed", "activeForm": "Executing parallel role analysis"},
|
||||
{"content": "Execute synthesis integration", "status": "completed", "activeForm": "Executing synthesis integration"}
|
||||
{"content": "Phase 0: Parameter Parsing", "status": "completed", "activeForm": "Parsing count parameter"},
|
||||
{"content": "Phase 1: Interactive Framework Generation", "status": "completed", "activeForm": "Executing artifacts interactive framework"},
|
||||
{"content": "Phase 2: Parallel Role Analysis", "status": "completed", "activeForm": "Executing parallel role analysis"},
|
||||
{"content": "Phase 3: Synthesis Integration", "status": "completed", "activeForm": "Executing synthesis integration"}
|
||||
]
|
||||
```
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ User Input → Task Analysis & Exploration Decision (Phase 1)
|
||||
|
||||
## Implementation
|
||||
|
||||
### Phase 1: Task Analysis & Exploration Decision
|
||||
### Phase 1: Intelligent Multi-Angle Exploration
|
||||
|
||||
**Session Setup**:
|
||||
```javascript
|
||||
@@ -60,7 +60,7 @@ const sessionFolder = `.workflow/.lite-plan/${sessionId}`
|
||||
bash(`mkdir -p ${sessionFolder}`)
|
||||
```
|
||||
|
||||
**Decision Logic**:
|
||||
**Exploration Decision Logic**:
|
||||
```javascript
|
||||
needsExploration = (
|
||||
flags.includes('--explore') || flags.includes('-e') ||
|
||||
@@ -69,16 +69,66 @@ needsExploration = (
|
||||
task.needs_architecture_understanding ||
|
||||
task.modifies_existing_code
|
||||
)
|
||||
|
||||
if (!needsExploration) {
|
||||
// Skip to Phase 2 (Clarification) or Phase 3 (Planning)
|
||||
proceed_to_next_phase()
|
||||
}
|
||||
```
|
||||
|
||||
**If exploration needed** - Invoke cli-explore-agent:
|
||||
**Complexity Assessment & Exploration Count**:
|
||||
```javascript
|
||||
// Estimate task complexity based on description
|
||||
function estimateComplexity(taskDescription) {
|
||||
const wordCount = taskDescription.split(/\s+/).length
|
||||
const text = taskDescription.toLowerCase()
|
||||
|
||||
const indicators = {
|
||||
high: ['refactor', 'migrate', 'redesign', 'architecture', 'system'],
|
||||
medium: ['implement', 'add feature', 'integrate', 'modify module'],
|
||||
low: ['fix', 'update', 'adjust', 'tweak']
|
||||
}
|
||||
|
||||
let score = 0
|
||||
if (wordCount > 50) score += 2
|
||||
else if (wordCount > 20) score += 1
|
||||
|
||||
if (indicators.high.some(w => text.includes(w))) score += 3
|
||||
else if (indicators.medium.some(w => text.includes(w))) score += 2
|
||||
else if (indicators.low.some(w => text.includes(w))) score += 1
|
||||
|
||||
// 0-2: Low, 3-4: Medium, 5+: High
|
||||
if (score >= 5) return 'High'
|
||||
if (score >= 3) return 'Medium'
|
||||
return 'Low'
|
||||
}
|
||||
|
||||
const complexity = estimateComplexity(task_description)
|
||||
const explorationCount = complexity === 'High' ? 4 : (complexity === 'Medium' ? 3 : 1)
|
||||
|
||||
console.log(`
|
||||
## Exploration Plan
|
||||
|
||||
Task Complexity: ${complexity}
|
||||
Exploration Count: ${explorationCount} angle(s)
|
||||
|
||||
Starting intelligent multi-angle exploration...
|
||||
`)
|
||||
```
|
||||
|
||||
**Launch Parallel Explorations** - Each agent chooses its own angle:
|
||||
|
||||
```javascript
|
||||
Task(
|
||||
subagent_type="cli-explore-agent",
|
||||
description="Analyze codebase for task context",
|
||||
prompt=`
|
||||
Analyze codebase for task context and generate exploration.json.
|
||||
// Launch multiple cli-explore-agent tasks in parallel
|
||||
const explorationTasks = []
|
||||
|
||||
for (let i = 1; i <= explorationCount; i++) {
|
||||
explorationTasks.push(
|
||||
Task(
|
||||
subagent_type="cli-explore-agent",
|
||||
description=`Explore angle ${i}/${explorationCount}`,
|
||||
prompt=`
|
||||
**以解决任务为目标的智能探索** - 从不同角度分析代码库,为任务规划提供上下文。
|
||||
|
||||
## Output Schema Reference
|
||||
~/.claude/workflows/cli-templates/schemas/explore-json-schema.json
|
||||
@@ -86,45 +136,155 @@ Analyze codebase for task context and generate exploration.json.
|
||||
## Task Description
|
||||
${task_description}
|
||||
|
||||
## Requirements
|
||||
Generate exploration.json with:
|
||||
- project_structure: Architecture and module organization
|
||||
- relevant_files: File paths to be affected
|
||||
- patterns: Code patterns, conventions, styles
|
||||
- dependencies: External/internal module dependencies
|
||||
- integration_points: Task connections with existing code
|
||||
- constraints: Technical limitations/requirements
|
||||
- clarification_needs: Ambiguities requiring user input
|
||||
- _metadata: timestamp, task_description, source
|
||||
## Your Mission
|
||||
You are exploration ${i} of ${explorationCount} parallel explorations.
|
||||
|
||||
## Execution
|
||||
1. Structural scan: get_modules_by_depth.sh, find, rg
|
||||
2. Semantic analysis: Gemini for patterns/architecture
|
||||
3. Write JSON: Write('${sessionFolder}/exploration.json', jsonContent)
|
||||
4. Return brief completion summary
|
||||
**Choose ONE unique angle** most relevant to solving this task:
|
||||
- Choose different angles from what other explorations might cover
|
||||
- Focus on aspects critical for task success
|
||||
- Examples: architecture, security, dataflow, patterns, performance, dependencies, testing, error-handling, state-management, etc.
|
||||
- Be creative and task-driven - not limited to examples above
|
||||
|
||||
## Output File Naming
|
||||
Choose a descriptive angle name (lowercase, no spaces, hyphen-separated if needed)
|
||||
Examples: "architecture", "security", "dataflow", "auth-patterns", "error-handling"
|
||||
|
||||
Generate file: exploration-{your-chosen-angle}.json
|
||||
|
||||
Example angles based on task type:
|
||||
- Architecture refactoring → "architecture", "modularity", "dependencies"
|
||||
- Security feature → "security", "auth-patterns", "dataflow"
|
||||
- Performance fix → "performance", "bottlenecks", "caching"
|
||||
- Bug fix → "error-handling", "dataflow", "state-management"
|
||||
|
||||
## Requirements
|
||||
Generate exploration-{angle}.json with:
|
||||
- project_structure: Architecture and module organization relevant to your angle
|
||||
- relevant_files: File paths to be affected
|
||||
- patterns: Code patterns relevant to your angle
|
||||
- dependencies: Dependencies relevant to your angle
|
||||
- integration_points: Integration points from your angle's viewpoint
|
||||
- constraints: Constraints related to your angle
|
||||
- clarification_needs: Ambiguities requiring user input
|
||||
- _metadata:
|
||||
- timestamp: ISO 8601 timestamp
|
||||
- task_description: Original task description
|
||||
- source: "cli-explore-agent"
|
||||
- exploration_angle: "your-chosen-angle"
|
||||
- exploration_index: ${i}
|
||||
- total_explorations: ${explorationCount}
|
||||
|
||||
## Execution Steps
|
||||
1. Decide your unique exploration angle based on task needs
|
||||
2. Structural scan: get_modules_by_depth.sh, find, rg (focused on your angle)
|
||||
3. Semantic analysis: Use Gemini for patterns/architecture specific to your angle
|
||||
4. Write JSON: Write('${sessionFolder}/exploration-{your-angle}.json', jsonContent)
|
||||
5. Return: Brief summary stating your chosen angle and key findings
|
||||
|
||||
Time Limit: 60 seconds
|
||||
|
||||
**Remember**: Choose a unique, task-relevant angle. Don't duplicate other explorations' focus.
|
||||
`
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
// Execute all exploration tasks in parallel (single message, multiple tool calls)
|
||||
console.log(`Launching ${explorationCount} parallel explorations...`)
|
||||
```
|
||||
|
||||
**Output**: `${sessionFolder}/exploration.json` (if exploration performed)
|
||||
**Auto-discover Generated Exploration Files**:
|
||||
```javascript
|
||||
// After explorations complete, auto-discover all exploration-*.json files
|
||||
const explorationFiles = bash(`find ${sessionFolder} -name "exploration-*.json" -type f`)
|
||||
.split('\n')
|
||||
.filter(f => f.trim())
|
||||
|
||||
// Read metadata to build manifest
|
||||
const explorationManifest = {
|
||||
session_id: sessionId,
|
||||
task_description: task_description,
|
||||
timestamp: new Date().toISOString(),
|
||||
complexity: complexity,
|
||||
exploration_count: explorationCount,
|
||||
explorations: explorationFiles.map(file => {
|
||||
const data = JSON.parse(Read(file))
|
||||
const filename = path.basename(file)
|
||||
return {
|
||||
angle: data._metadata.exploration_angle,
|
||||
file: filename,
|
||||
path: file,
|
||||
index: data._metadata.exploration_index
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Write(`${sessionFolder}/explorations-manifest.json`, JSON.stringify(explorationManifest, null, 2))
|
||||
|
||||
console.log(`
|
||||
## Exploration Complete
|
||||
|
||||
Generated exploration files in ${sessionFolder}:
|
||||
${explorationManifest.explorations.map(e => `- exploration-${e.angle}.json (angle: ${e.angle})`).join('\n')}
|
||||
|
||||
Manifest: explorations-manifest.json
|
||||
Angles explored: ${explorationManifest.explorations.map(e => e.angle).join(', ')}
|
||||
`)
|
||||
```
|
||||
|
||||
**Output**:
|
||||
- `${sessionFolder}/exploration-{angle1}.json`
|
||||
- `${sessionFolder}/exploration-{angle2}.json`
|
||||
- ... (1-4 files based on complexity)
|
||||
- `${sessionFolder}/explorations-manifest.json`
|
||||
|
||||
---
|
||||
|
||||
### Phase 2: Clarification (Optional)
|
||||
|
||||
**Skip if**: No exploration or `clarification_needs` is empty
|
||||
**Skip if**: No exploration or `clarification_needs` is empty across all explorations
|
||||
|
||||
**If clarification needed**:
|
||||
**Aggregate clarification needs from all exploration angles**:
|
||||
```javascript
|
||||
const exploration = JSON.parse(Read(`${sessionFolder}/exploration.json`))
|
||||
// Load manifest and all exploration files
|
||||
const manifest = JSON.parse(Read(`${sessionFolder}/explorations-manifest.json`))
|
||||
const explorations = manifest.explorations.map(exp => ({
|
||||
angle: exp.angle,
|
||||
data: JSON.parse(Read(exp.path))
|
||||
}))
|
||||
|
||||
if (exploration.clarification_needs?.length > 0) {
|
||||
// Aggregate clarification needs from all explorations
|
||||
const allClarifications = []
|
||||
explorations.forEach(exp => {
|
||||
if (exp.data.clarification_needs?.length > 0) {
|
||||
exp.data.clarification_needs.forEach(need => {
|
||||
allClarifications.push({
|
||||
...need,
|
||||
source_angle: exp.angle
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
// Deduplicate by question similarity
|
||||
function deduplicateClarifications(clarifications) {
|
||||
const unique = []
|
||||
clarifications.forEach(c => {
|
||||
const isDuplicate = unique.some(u =>
|
||||
u.question.toLowerCase() === c.question.toLowerCase()
|
||||
)
|
||||
if (!isDuplicate) unique.push(c)
|
||||
})
|
||||
return unique
|
||||
}
|
||||
|
||||
const uniqueClarifications = deduplicateClarifications(allClarifications)
|
||||
|
||||
if (uniqueClarifications.length > 0) {
|
||||
AskUserQuestion({
|
||||
questions: exploration.clarification_needs.map(need => ({
|
||||
question: `${need.context}\n\n${need.question}`,
|
||||
header: "Clarification",
|
||||
questions: uniqueClarifications.map(need => ({
|
||||
question: `[${need.source_angle}] ${need.question}\n\nContext: ${need.context}`,
|
||||
header: need.source_angle,
|
||||
multiSelect: false,
|
||||
options: need.options.map(opt => ({
|
||||
label: opt,
|
||||
@@ -172,8 +332,17 @@ Generate implementation plan and write plan.json.
|
||||
## Task Description
|
||||
${task_description}
|
||||
|
||||
## Exploration Context
|
||||
${sessionFolder}/exploration.json (if exists)
|
||||
## Multi-Angle Exploration Context
|
||||
|
||||
${manifest.explorations.map(exp => `### Exploration: ${exp.angle} (${exp.file})
|
||||
Path: ${exp.path}
|
||||
|
||||
Read this file for detailed ${exp.angle} analysis.`).join('\n\n')}
|
||||
|
||||
Total explorations: ${manifest.exploration_count}
|
||||
Angles covered: ${manifest.explorations.map(e => e.angle).join(', ')}
|
||||
|
||||
Manifest: ${sessionFolder}/explorations-manifest.json
|
||||
|
||||
## User Clarifications
|
||||
${JSON.stringify(clarificationContext) || "None"}
|
||||
@@ -184,19 +353,23 @@ ${complexity}
|
||||
## Requirements
|
||||
Generate plan.json with:
|
||||
- summary: 2-3 sentence overview
|
||||
- approach: High-level implementation strategy
|
||||
- approach: High-level implementation strategy (incorporating insights from all exploration angles)
|
||||
- tasks: 3-10 structured tasks with:
|
||||
- title, file, action, description
|
||||
- implementation (3-7 steps)
|
||||
- reference (pattern, files, examples)
|
||||
- acceptance (2-4 criteria)
|
||||
- estimated_time, recommended_execution, complexity
|
||||
- _metadata: timestamp, source, planning_mode
|
||||
- _metadata:
|
||||
- timestamp, source, planning_mode
|
||||
- exploration_angles: ${JSON.stringify(manifest.explorations.map(e => e.angle))}
|
||||
|
||||
## Execution
|
||||
1. Execute CLI planning using Gemini (Qwen fallback)
|
||||
2. Parse output and structure plan
|
||||
3. Write JSON: Write('${sessionFolder}/plan.json', jsonContent)
|
||||
1. Read ALL exploration files for comprehensive context
|
||||
2. Execute CLI planning using Gemini (Qwen fallback)
|
||||
3. Synthesize findings from multiple exploration angles
|
||||
4. Parse output and structure plan
|
||||
5. Write JSON: Write('${sessionFolder}/plan.json', jsonContent)
|
||||
4. Return brief completion summary
|
||||
`
|
||||
)
|
||||
@@ -273,9 +446,17 @@ AskUserQuestion({
|
||||
|
||||
```javascript
|
||||
const taskId = `LP-${shortTimestamp}`
|
||||
const exploration = file_exists(`${sessionFolder}/exploration.json`)
|
||||
? JSON.parse(Read(`${sessionFolder}/exploration.json`))
|
||||
: null
|
||||
|
||||
// Load manifest and all exploration files
|
||||
const manifest = JSON.parse(Read(`${sessionFolder}/explorations-manifest.json`))
|
||||
const explorations = {}
|
||||
|
||||
manifest.explorations.forEach(exp => {
|
||||
if (file_exists(exp.path)) {
|
||||
explorations[exp.angle] = JSON.parse(Read(exp.path))
|
||||
}
|
||||
})
|
||||
|
||||
const plan = JSON.parse(Read(`${sessionFolder}/plan.json`))
|
||||
|
||||
const taskJson = {
|
||||
@@ -291,7 +472,9 @@ const taskJson = {
|
||||
recommended_execution: plan.recommended_execution,
|
||||
workflow: "lite-plan",
|
||||
session_id: sessionId,
|
||||
session_folder: sessionFolder
|
||||
session_folder: sessionFolder,
|
||||
exploration_count: manifest.exploration_count,
|
||||
exploration_angles: manifest.explorations.map(e => e.angle)
|
||||
},
|
||||
|
||||
context: {
|
||||
@@ -301,9 +484,25 @@ const taskJson = {
|
||||
approach: plan.approach,
|
||||
tasks: plan.tasks
|
||||
},
|
||||
exploration: exploration,
|
||||
|
||||
// Multi-angle exploration structure
|
||||
explorations: explorations,
|
||||
|
||||
// Exploration files for reference
|
||||
exploration_files: manifest.explorations.map(exp => ({
|
||||
angle: exp.angle,
|
||||
file: exp.file,
|
||||
path: exp.path,
|
||||
index: exp.index
|
||||
})),
|
||||
|
||||
clarifications: clarificationContext || null,
|
||||
focus_paths: exploration?.relevant_files || [],
|
||||
|
||||
// Aggregate relevant files from all exploration angles
|
||||
focus_paths: Array.from(new Set(
|
||||
Object.values(explorations).flatMap(exp => exp.relevant_files || [])
|
||||
)),
|
||||
|
||||
acceptance: plan.tasks.flatMap(t => t.acceptance)
|
||||
}
|
||||
}
|
||||
@@ -316,7 +515,9 @@ Write(`${sessionFolder}/task.json`, JSON.stringify(taskJson, null, 2))
|
||||
```javascript
|
||||
executionContext = {
|
||||
planObject: plan,
|
||||
explorationContext: exploration,
|
||||
explorationsContext: explorations, // Multiple explorations
|
||||
explorationAngles: manifest.explorations.map(e => e.angle),
|
||||
explorationManifest: manifest,
|
||||
clarificationContext: clarificationContext || null,
|
||||
executionMethod: userSelection.execution_method,
|
||||
codeReviewTool: userSelection.code_review_tool,
|
||||
@@ -325,7 +526,11 @@ executionContext = {
|
||||
id: sessionId,
|
||||
folder: sessionFolder,
|
||||
artifacts: {
|
||||
exploration: exploration ? `${sessionFolder}/exploration.json` : null,
|
||||
explorations: manifest.explorations.map(exp => ({
|
||||
angle: exp.angle,
|
||||
path: exp.path
|
||||
})),
|
||||
explorations_manifest: `${sessionFolder}/explorations-manifest.json`,
|
||||
plan: `${sessionFolder}/plan.json`,
|
||||
task: `${sessionFolder}/task.json`
|
||||
}
|
||||
@@ -343,9 +548,24 @@ SlashCommand(command="/workflow:lite-execute --in-memory")
|
||||
|
||||
```
|
||||
.workflow/.lite-plan/{task-slug}-{timestamp}/
|
||||
├── exploration.json # If exploration performed (by cli-explore-agent)
|
||||
├── plan.json # Always created (by agent or direct planning)
|
||||
└── task.json # Always created (by command)
|
||||
├── exploration-{angle1}.json # Exploration angle 1 (agent-decided)
|
||||
├── exploration-{angle2}.json # Exploration angle 2 (agent-decided)
|
||||
├── exploration-{angle3}.json # Exploration angle 3 (if applicable)
|
||||
├── exploration-{angle4}.json # Exploration angle 4 (if applicable)
|
||||
├── explorations-manifest.json # Exploration index
|
||||
├── plan.json # Implementation plan
|
||||
└── task.json # Task definition with multi-exploration refs
|
||||
```
|
||||
|
||||
**Example** (angles decided by agents):
|
||||
```
|
||||
.workflow/.lite-plan/implement-jwt-refresh-2025-11-25-14-30-25/
|
||||
├── exploration-architecture.json
|
||||
├── exploration-auth-patterns.json
|
||||
├── exploration-security.json
|
||||
├── explorations-manifest.json
|
||||
├── plan.json
|
||||
└── task.json
|
||||
```
|
||||
|
||||
## Error Handling
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
name: review-module-cycle
|
||||
description: Independent multi-dimensional code review for specified modules/files. Analyzes specific code paths across 7 dimensions with hybrid parallel-iterative execution, independent of workflow sessions.
|
||||
argument-hint: "<path-pattern> [--dimensions=security,architecture,...] [--max-iterations=N] [--output-dir=path] [--resume]"
|
||||
argument-hint: "<path-pattern> [--dimensions=security,architecture,...] [--max-iterations=N] [--resume]"
|
||||
allowed-tools: SlashCommand(*), TodoWrite(*), Read(*), Bash(*), Task(*)
|
||||
---
|
||||
|
||||
@@ -22,14 +22,12 @@ allowed-tools: SlashCommand(*), TodoWrite(*), Read(*), Bash(*), Task(*)
|
||||
# Review specific files
|
||||
/workflow:review-module-cycle src/payment/processor.ts,src/payment/validator.ts
|
||||
|
||||
# Custom output directory
|
||||
/workflow:review-module-cycle src/auth/** --output-dir=.workflow/.scratchpad/reviews/auth-review
|
||||
|
||||
# Resume interrupted review
|
||||
/workflow:review-module-cycle --resume
|
||||
```
|
||||
|
||||
**Review Scope**: Specified modules/files only (independent of git history or sessions)
|
||||
**Output Directory**: `.workflow/.reviews/module-{pattern-hash}/` (fixed location)
|
||||
**Default Dimensions**: Security, Architecture, Quality, Action-Items, Performance, Maintainability, Best-Practices
|
||||
**Max Iterations**: 3 (default, adjustable)
|
||||
**CLI Tools**: Gemini → Qwen → Codex (fallback chain)
|
||||
@@ -179,8 +177,9 @@ const CATEGORIES = {
|
||||
**Phase 1: Discovery & Initialization**
|
||||
- Path resolution: Parse and expand file patterns (glob support)
|
||||
- Validation: Ensure all specified files exist and are readable
|
||||
- Output directory: Set to `.workflow/.reviews/module-{pattern-hash}/` (fixed location, hash based on target pattern)
|
||||
- State initialization: Create review-state.json with dimensions, max_iterations, resolved_files
|
||||
- Directory structure: Create output-dir/{dimensions,iterations,reports}/
|
||||
- Directory structure: Create {dimensions,iterations,reports}/ subdirectories
|
||||
- Dashboard generation: Generate dashboard.html from template (see Dashboard Generation below)
|
||||
- TodoWrite initialization: Set up progress tracking
|
||||
|
||||
@@ -300,15 +299,6 @@ Dashboard uses **static HTML + JSON polling**: reads template from `~/.claude/te
|
||||
🔄 Monitor progress in real-time (auto-refresh every 5s)
|
||||
```
|
||||
|
||||
### Features Summary
|
||||
|
||||
- **Real-time Progress**: Phase indicator, progress bar, agent status (auto-refresh 5s)
|
||||
- **Interactive Findings**: Severity/dimension filtering, search, sort, detail drawer
|
||||
- **Export**: Generate markdown report
|
||||
- **Dark Mode**: Toggle with localStorage persistence
|
||||
|
||||
**Usage Details**: See `~/.claude/workflows/DASHBOARD-QUICKSTART.md`
|
||||
|
||||
## Reference
|
||||
|
||||
### CLI Tool Configuration
|
||||
@@ -325,7 +315,7 @@ Dashboard uses **static HTML + JSON polling**: reads template from `~/.claude/te
|
||||
### Output File Structure
|
||||
|
||||
```
|
||||
{output-dir}/
|
||||
.workflow/.reviews/module-{pattern-hash}/
|
||||
├── review-state.json # Orchestrator state machine
|
||||
├── review-progress.json # Real-time progress for dashboard
|
||||
├── dimensions/ # Per-dimension results
|
||||
@@ -797,3 +787,30 @@ TodoWrite({
|
||||
```bash
|
||||
/workflow:review-module-cycle src/payment/processor.ts,src/auth/validator.ts --max-iterations=5
|
||||
```
|
||||
|
||||
## Related Commands
|
||||
|
||||
### Automated Fix Workflow
|
||||
After completing a module review, use the dashboard to select findings and export them for automated fixing:
|
||||
|
||||
```bash
|
||||
# Step 1: Complete review (this command)
|
||||
/workflow:review-module-cycle src/auth/**
|
||||
|
||||
# Step 2: Open dashboard, select findings, and export
|
||||
# Dashboard generates: fix-export-{timestamp}.json
|
||||
|
||||
# Step 3: Run automated fixes
|
||||
/workflow:review-fix .workflow/.reviews/module-{hash}/fix-export-{timestamp}.json
|
||||
```
|
||||
|
||||
See `/workflow:review-fix` for automated fixing with smart grouping, parallel execution, and test verification.
|
||||
|
||||
### Session-Based Review
|
||||
For reviewing all changes in a workflow session:
|
||||
|
||||
```bash
|
||||
/workflow:review-session-cycle
|
||||
```
|
||||
|
||||
This command analyzes all git-tracked changes in the active workflow session across all 7 dimensions.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
name: review-session-cycle
|
||||
description: Session-based comprehensive multi-dimensional code review. Analyzes git changes from workflow session across 7 dimensions with hybrid parallel-iterative execution, aggregates findings, and performs focused deep-dives on critical issues until quality gates met.
|
||||
argument-hint: "[session-id] [--dimensions=security,architecture,...] [--max-iterations=N] [--output-dir=path] [--resume]"
|
||||
argument-hint: "[session-id] [--dimensions=security,architecture,...] [--max-iterations=N] [--resume]"
|
||||
allowed-tools: SlashCommand(*), TodoWrite(*), Read(*), Bash(*), Task(*)
|
||||
---
|
||||
|
||||
@@ -21,12 +21,10 @@ allowed-tools: SlashCommand(*), TodoWrite(*), Read(*), Bash(*), Task(*)
|
||||
|
||||
# Specify session and iteration limit
|
||||
/workflow:review-session-cycle WFS-payment-integration --max-iterations=5
|
||||
|
||||
# Custom output directory
|
||||
/workflow:review-session-cycle --output-dir=.workflow/active/WFS-session/.review-cycle
|
||||
```
|
||||
|
||||
**Review Scope**: Git changes from session creation to present (via `git log --since`)
|
||||
**Output Directory**: `.workflow/.reviews/session-{session-id}/` (fixed location)
|
||||
**Default Dimensions**: Security, Architecture, Quality, Action-Items, Performance, Maintainability, Best-Practices
|
||||
**Max Iterations**: 3 (default, adjustable)
|
||||
**CLI Tools**: Gemini → Qwen → Codex (fallback chain)
|
||||
@@ -160,8 +158,9 @@ const CATEGORIES = {
|
||||
**Phase 1: Discovery & Initialization**
|
||||
- Session discovery: Auto-detect active session if not specified
|
||||
- Validation: Ensure session has completed implementation (check .summaries/)
|
||||
- Output directory: Set to `.workflow/.reviews/session-{session-id}/` (fixed location)
|
||||
- State initialization: Create review-state.json with dimensions, max_iterations
|
||||
- Directory structure: Create .review-cycle/{dimensions,iterations,reports}/
|
||||
- Directory structure: Create {dimensions,iterations,reports}/ subdirectories
|
||||
- Dashboard generation: Generate dashboard.html from template (see Dashboard Generation below)
|
||||
- TodoWrite initialization: Set up progress tracking
|
||||
|
||||
@@ -305,7 +304,7 @@ Dashboard uses **static HTML + JSON polling**: reads template from `~/.claude/te
|
||||
### Session File Structure
|
||||
|
||||
```
|
||||
.workflow/active/WFS-{session}/.review-cycle/
|
||||
.workflow/.reviews/session-{session-id}/
|
||||
├── review-state.json # Orchestrator state machine
|
||||
├── review-progress.json # Real-time progress for dashboard
|
||||
├── dimensions/ # Per-dimension results
|
||||
@@ -821,3 +820,30 @@ TodoWrite({
|
||||
5. **Dashboard Polling**: Refresh every 5 seconds for real-time updates
|
||||
6. **Resume Support**: Interrupted reviews can resume from last checkpoint
|
||||
7. **Export Results**: Use dashboard export for external tracking tools
|
||||
|
||||
## Related Commands
|
||||
|
||||
### Automated Fix Workflow
|
||||
After completing a review, use the dashboard to select findings and export them for automated fixing:
|
||||
|
||||
```bash
|
||||
# Step 1: Complete review (this command)
|
||||
/workflow:review-session-cycle
|
||||
|
||||
# Step 2: Open dashboard, select findings, and export
|
||||
# Dashboard generates: fix-export-{timestamp}.json
|
||||
|
||||
# Step 3: Run automated fixes
|
||||
/workflow:review-fix .workflow/.reviews/session-{session-id}/fix-export-{timestamp}.json
|
||||
```
|
||||
|
||||
See `/workflow:review-fix` for automated fixing with smart grouping, parallel execution, and test verification.
|
||||
|
||||
### Independent Module Review
|
||||
For reviewing specific modules without a workflow session:
|
||||
|
||||
```bash
|
||||
/workflow:review-module-cycle <path-pattern>
|
||||
```
|
||||
|
||||
This command provides the same 7-dimension analysis but targets specific files or directories.
|
||||
|
||||
@@ -100,13 +100,14 @@ TEST_FOCUS: [Test scenarios]
|
||||
**TodoWrite Update (Phase 3 SlashCommand invoked - tasks attached)**:
|
||||
```json
|
||||
[
|
||||
{"content": "Execute session discovery", "status": "completed", "activeForm": "Executing session discovery"},
|
||||
{"content": "Execute context gathering", "status": "completed", "activeForm": "Executing context gathering"},
|
||||
{"content": "Phase 3.1: Detect test framework and conventions (test-context-gather)", "status": "in_progress", "activeForm": "Detecting test framework"},
|
||||
{"content": "Phase 3.2: Analyze existing test coverage (test-context-gather)", "status": "pending", "activeForm": "Analyzing test coverage"},
|
||||
{"content": "Phase 3.3: Identify coverage gaps (test-context-gather)", "status": "pending", "activeForm": "Identifying coverage gaps"},
|
||||
{"content": "Execute TDD task generation", "status": "pending", "activeForm": "Executing TDD task generation"},
|
||||
{"content": "Validate TDD structure", "status": "pending", "activeForm": "Validating TDD structure"}
|
||||
{"content": "Phase 1: Session Discovery", "status": "completed", "activeForm": "Executing session discovery"},
|
||||
{"content": "Phase 2: Context Gathering", "status": "completed", "activeForm": "Executing context gathering"},
|
||||
{"content": "Phase 3: Test Coverage Analysis", "status": "in_progress", "activeForm": "Executing test coverage analysis"},
|
||||
{"content": " → Detect test framework and conventions", "status": "in_progress", "activeForm": "Detecting test framework"},
|
||||
{"content": " → Analyze existing test coverage", "status": "pending", "activeForm": "Analyzing test coverage"},
|
||||
{"content": " → Identify coverage gaps", "status": "pending", "activeForm": "Identifying coverage gaps"},
|
||||
{"content": "Phase 5: TDD Task Generation", "status": "pending", "activeForm": "Executing TDD task generation"},
|
||||
{"content": "Phase 6: TDD Structure Validation", "status": "pending", "activeForm": "Validating TDD structure"}
|
||||
]
|
||||
```
|
||||
|
||||
@@ -119,11 +120,11 @@ TEST_FOCUS: [Test scenarios]
|
||||
**TodoWrite Update (Phase 3 completed - tasks collapsed)**:
|
||||
```json
|
||||
[
|
||||
{"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": "pending", "activeForm": "Executing TDD task generation"},
|
||||
{"content": "Validate TDD structure", "status": "pending", "activeForm": "Validating TDD structure"}
|
||||
{"content": "Phase 1: Session Discovery", "status": "completed", "activeForm": "Executing session discovery"},
|
||||
{"content": "Phase 2: Context Gathering", "status": "completed", "activeForm": "Executing context gathering"},
|
||||
{"content": "Phase 3: Test Coverage Analysis", "status": "completed", "activeForm": "Executing test coverage analysis"},
|
||||
{"content": "Phase 5: TDD Task Generation", "status": "pending", "activeForm": "Executing TDD task generation"},
|
||||
{"content": "Phase 6: TDD Structure Validation", "status": "pending", "activeForm": "Validating TDD structure"}
|
||||
]
|
||||
```
|
||||
|
||||
@@ -160,14 +161,15 @@ TEST_FOCUS: [Test scenarios]
|
||||
**TodoWrite Update (Phase 4 SlashCommand invoked - tasks attached, if conflict_risk ≥ medium)**:
|
||||
```json
|
||||
[
|
||||
{"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": "Phase 4.1: Detect conflicts with CLI analysis (conflict-resolution)", "status": "in_progress", "activeForm": "Detecting conflicts"},
|
||||
{"content": "Phase 4.2: Present conflicts to user (conflict-resolution)", "status": "pending", "activeForm": "Presenting conflicts"},
|
||||
{"content": "Phase 4.3: Apply resolution strategies (conflict-resolution)", "status": "pending", "activeForm": "Applying resolution strategies"},
|
||||
{"content": "Execute TDD task generation", "status": "pending", "activeForm": "Executing TDD task generation"},
|
||||
{"content": "Validate TDD structure", "status": "pending", "activeForm": "Validating TDD structure"}
|
||||
{"content": "Phase 1: Session Discovery", "status": "completed", "activeForm": "Executing session discovery"},
|
||||
{"content": "Phase 2: Context Gathering", "status": "completed", "activeForm": "Executing context gathering"},
|
||||
{"content": "Phase 3: Test Coverage Analysis", "status": "completed", "activeForm": "Executing test coverage analysis"},
|
||||
{"content": "Phase 4: Conflict Resolution", "status": "in_progress", "activeForm": "Executing conflict resolution"},
|
||||
{"content": " → Detect conflicts with CLI analysis", "status": "in_progress", "activeForm": "Detecting conflicts"},
|
||||
{"content": " → Present conflicts to user", "status": "pending", "activeForm": "Presenting conflicts"},
|
||||
{"content": " → Apply resolution strategies", "status": "pending", "activeForm": "Applying resolution strategies"},
|
||||
{"content": "Phase 5: TDD Task Generation", "status": "pending", "activeForm": "Executing TDD task generation"},
|
||||
{"content": "Phase 6: TDD Structure Validation", "status": "pending", "activeForm": "Validating TDD structure"}
|
||||
]
|
||||
```
|
||||
|
||||
@@ -180,12 +182,12 @@ TEST_FOCUS: [Test scenarios]
|
||||
**TodoWrite Update (Phase 4 completed - tasks collapsed)**:
|
||||
```json
|
||||
[
|
||||
{"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": "pending", "activeForm": "Executing TDD task generation"},
|
||||
{"content": "Validate TDD structure", "status": "pending", "activeForm": "Validating TDD structure"}
|
||||
{"content": "Phase 1: Session Discovery", "status": "completed", "activeForm": "Executing session discovery"},
|
||||
{"content": "Phase 2: Context Gathering", "status": "completed", "activeForm": "Executing context gathering"},
|
||||
{"content": "Phase 3: Test Coverage Analysis", "status": "completed", "activeForm": "Executing test coverage analysis"},
|
||||
{"content": "Phase 4: Conflict Resolution", "status": "completed", "activeForm": "Executing conflict resolution"},
|
||||
{"content": "Phase 5: TDD Task Generation", "status": "pending", "activeForm": "Executing TDD task generation"},
|
||||
{"content": "Phase 6: TDD Structure Validation", "status": "pending", "activeForm": "Validating TDD structure"}
|
||||
]
|
||||
```
|
||||
|
||||
@@ -226,13 +228,14 @@ TEST_FOCUS: [Test scenarios]
|
||||
**TodoWrite Update (Phase 5 SlashCommand invoked - tasks attached)**:
|
||||
```json
|
||||
[
|
||||
{"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": "Phase 5.1: Discovery - analyze TDD requirements (task-generate-tdd)", "status": "in_progress", "activeForm": "Analyzing TDD requirements"},
|
||||
{"content": "Phase 5.2: Planning - design Red-Green-Refactor cycles (task-generate-tdd)", "status": "pending", "activeForm": "Designing TDD cycles"},
|
||||
{"content": "Phase 5.3: Output - generate IMPL tasks with internal TDD phases (task-generate-tdd)", "status": "pending", "activeForm": "Generating TDD tasks"},
|
||||
{"content": "Validate TDD structure", "status": "pending", "activeForm": "Validating TDD structure"}
|
||||
{"content": "Phase 1: Session Discovery", "status": "completed", "activeForm": "Executing session discovery"},
|
||||
{"content": "Phase 2: Context Gathering", "status": "completed", "activeForm": "Executing context gathering"},
|
||||
{"content": "Phase 3: Test Coverage Analysis", "status": "completed", "activeForm": "Executing test coverage analysis"},
|
||||
{"content": "Phase 5: TDD Task Generation", "status": "in_progress", "activeForm": "Executing TDD task generation"},
|
||||
{"content": " → Discovery - analyze TDD requirements", "status": "in_progress", "activeForm": "Analyzing TDD requirements"},
|
||||
{"content": " → Planning - design Red-Green-Refactor cycles", "status": "pending", "activeForm": "Designing TDD cycles"},
|
||||
{"content": " → Output - generate IMPL tasks with internal TDD phases", "status": "pending", "activeForm": "Generating TDD tasks"},
|
||||
{"content": "Phase 6: TDD Structure Validation", "status": "pending", "activeForm": "Validating TDD structure"}
|
||||
]
|
||||
```
|
||||
|
||||
@@ -245,11 +248,11 @@ TEST_FOCUS: [Test scenarios]
|
||||
**TodoWrite Update (Phase 5 completed - tasks collapsed)**:
|
||||
```json
|
||||
[
|
||||
{"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": "completed", "activeForm": "Executing TDD task generation"},
|
||||
{"content": "Validate TDD structure", "status": "in_progress", "activeForm": "Validating TDD structure"}
|
||||
{"content": "Phase 1: Session Discovery", "status": "completed", "activeForm": "Executing session discovery"},
|
||||
{"content": "Phase 2: Context Gathering", "status": "completed", "activeForm": "Executing context gathering"},
|
||||
{"content": "Phase 3: Test Coverage Analysis", "status": "completed", "activeForm": "Executing test coverage analysis"},
|
||||
{"content": "Phase 5: TDD Task Generation", "status": "completed", "activeForm": "Executing TDD task generation"},
|
||||
{"content": "Phase 6: TDD Structure Validation", "status": "in_progress", "activeForm": "Validating TDD structure"}
|
||||
]
|
||||
```
|
||||
|
||||
|
||||
@@ -343,19 +343,49 @@ CRITICAL - Next Steps:
|
||||
|
||||
**Core Concept**: Dynamic task attachment and collapse for test-fix-gen workflow with dual-mode support (Session Mode and Prompt Mode).
|
||||
|
||||
#### Initial TodoWrite Structure
|
||||
|
||||
```json
|
||||
[
|
||||
{"content": "Phase 1: Create Test Session", "status": "in_progress", "activeForm": "Creating test session"},
|
||||
{"content": "Phase 2: Gather Test Context", "status": "pending", "activeForm": "Gathering test context"},
|
||||
{"content": "Phase 3: Test Generation Analysis", "status": "pending", "activeForm": "Analyzing test generation"},
|
||||
{"content": "Phase 4: Generate Test Tasks", "status": "pending", "activeForm": "Generating test tasks"},
|
||||
{"content": "Phase 5: Return Summary", "status": "pending", "activeForm": "Completing"}
|
||||
]
|
||||
```
|
||||
|
||||
#### Key Principles
|
||||
|
||||
1. **Task Attachment** (when SlashCommand invoked):
|
||||
- Sub-command's internal tasks are **attached** to orchestrator's TodoWrite
|
||||
- Example: `/workflow:tools:test-context-gather` (Session Mode) or `/workflow:tools:context-gather` (Prompt Mode) attaches 3 sub-tasks (Phase 2.1, 2.2, 2.3)
|
||||
- First attached task marked as `in_progress`, others as `pending`
|
||||
- Orchestrator **executes** these attached tasks sequentially
|
||||
- Example - Phase 2 with sub-tasks:
|
||||
```json
|
||||
[
|
||||
{"content": "Phase 1: Create Test Session", "status": "completed", "activeForm": "Creating test session"},
|
||||
{"content": "Phase 2: Gather Test Context", "status": "in_progress", "activeForm": "Gathering test context"},
|
||||
{"content": " → Load context and analyze coverage", "status": "in_progress", "activeForm": "Loading context"},
|
||||
{"content": " → Detect test framework and conventions", "status": "pending", "activeForm": "Detecting framework"},
|
||||
{"content": " → Generate context package", "status": "pending", "activeForm": "Generating context"},
|
||||
{"content": "Phase 3: Test Generation Analysis", "status": "pending", "activeForm": "Analyzing test generation"},
|
||||
{"content": "Phase 4: Generate Test Tasks", "status": "pending", "activeForm": "Generating test tasks"},
|
||||
{"content": "Phase 5: Return Summary", "status": "pending", "activeForm": "Completing"}
|
||||
]
|
||||
```
|
||||
|
||||
2. **Task Collapse** (after sub-tasks complete):
|
||||
- Remove detailed sub-tasks from TodoWrite
|
||||
- **Collapse** to high-level phase summary
|
||||
- Example: Phase 2.1-2.3 collapse to "Gather test coverage context: completed"
|
||||
- Maintains clean orchestrator-level view
|
||||
- Example - Phase 2 completed:
|
||||
```json
|
||||
[
|
||||
{"content": "Phase 1: Create Test Session", "status": "completed", "activeForm": "Creating test session"},
|
||||
{"content": "Phase 2: Gather Test Context", "status": "completed", "activeForm": "Gathering test context"},
|
||||
{"content": "Phase 3: Test Generation Analysis", "status": "in_progress", "activeForm": "Analyzing test generation"},
|
||||
{"content": "Phase 4: Generate Test Tasks", "status": "pending", "activeForm": "Generating test tasks"},
|
||||
{"content": "Phase 5: Return Summary", "status": "pending", "activeForm": "Completing"}
|
||||
]
|
||||
```
|
||||
|
||||
3. **Continuous Execution**:
|
||||
- After collapse, automatically proceed to next pending phase
|
||||
|
||||
@@ -528,10 +528,10 @@ SlashCommand(command)
|
||||
```javascript
|
||||
// Initialize IMMEDIATELY after Phase 5 user confirmation to track multi-phase execution (4 orchestrator-level tasks)
|
||||
TodoWrite({todos: [
|
||||
{"content": "Execute style extraction", "status": "in_progress", "activeForm": "Executing style extraction"},
|
||||
{"content": "Execute animation extraction", "status": "pending", "activeForm": "Executing animation extraction"},
|
||||
{"content": "Execute layout extraction", "status": "pending", "activeForm": "Executing layout extraction"},
|
||||
{"content": "Execute UI assembly", "status": "pending", "activeForm": "Executing UI assembly"}
|
||||
{"content": "Phase 7: Style Extraction", "status": "in_progress", "activeForm": "Executing style extraction"},
|
||||
{"content": "Phase 8: Animation Extraction", "status": "pending", "activeForm": "Executing animation extraction"},
|
||||
{"content": "Phase 9: Layout Extraction", "status": "pending", "activeForm": "Executing layout extraction"},
|
||||
{"content": "Phase 10: UI Assembly", "status": "pending", "activeForm": "Executing UI assembly"}
|
||||
]})
|
||||
|
||||
// ⚠️ CRITICAL: Dynamic TodoWrite task attachment strategy:
|
||||
@@ -539,14 +539,23 @@ TodoWrite({todos: [
|
||||
// **Key Concept**: SlashCommand invocation ATTACHES tasks to current workflow.
|
||||
// Orchestrator EXECUTES these attached tasks itself, not waiting for external completion.
|
||||
//
|
||||
// Phase 7-10 SlashCommand Invocation Pattern:
|
||||
// 1. SlashCommand invocation ATTACHES sub-command tasks to TodoWrite
|
||||
// 2. TodoWrite expands to include attached tasks
|
||||
// 3. Orchestrator EXECUTES attached tasks sequentially
|
||||
// 4. After all attached tasks complete, COLLAPSE them into phase summary
|
||||
// 5. Update next phase to in_progress
|
||||
// 6. IMMEDIATELY execute next phase (auto-continue)
|
||||
// 7. After Phase 10 completes, workflow finishes (generate command handles preview files)
|
||||
// Phase 7-10 SlashCommand Invocation Pattern (when tasks are attached):
|
||||
// Example - Phase 7 with sub-tasks:
|
||||
// [
|
||||
// {"content": "Phase 7: Style Extraction", "status": "in_progress", "activeForm": "Executing style extraction"},
|
||||
// {"content": " → Analyze style references", "status": "in_progress", "activeForm": "Analyzing style references"},
|
||||
// {"content": " → Generate style variants", "status": "pending", "activeForm": "Generating style variants"},
|
||||
// {"content": " → Create design tokens", "status": "pending", "activeForm": "Creating design tokens"},
|
||||
// {"content": "Phase 8: Animation Extraction", "status": "pending", "activeForm": "Executing animation extraction"},
|
||||
// ...
|
||||
// ]
|
||||
//
|
||||
// After sub-tasks complete, COLLAPSE back to:
|
||||
// [
|
||||
// {"content": "Phase 7: Style Extraction", "status": "completed", "activeForm": "Executing style extraction"},
|
||||
// {"content": "Phase 8: Animation Extraction", "status": "in_progress", "activeForm": "Executing animation extraction"},
|
||||
// ...
|
||||
// ]
|
||||
//
|
||||
```
|
||||
|
||||
|
||||
@@ -570,12 +570,12 @@ ELSE:
|
||||
```javascript
|
||||
// Initialize IMMEDIATELY at start of Phase 0 to track multi-phase execution (6 orchestrator-level tasks)
|
||||
TodoWrite({todos: [
|
||||
{content: "Initialize and detect design source", status: "in_progress", activeForm: "Initializing"},
|
||||
{content: "Extract style (complete design systems)", status: "pending", activeForm: "Extracting style"},
|
||||
{content: "Extract animation (CSS auto mode)", status: "pending", activeForm: "Extracting animation"},
|
||||
{content: "Extract layout (structure templates)", status: "pending", activeForm: "Extracting layout"},
|
||||
{content: "Assemble UI prototypes", status: "pending", activeForm: "Assembling UI"},
|
||||
{content: "Integrate design system", status: "pending", activeForm: "Integrating"}
|
||||
{content: "Phase 0: Initialize and Detect Design Source", status: "in_progress", activeForm: "Initializing"},
|
||||
{content: "Phase 2: Style Extraction", status: "pending", activeForm: "Extracting style"},
|
||||
{content: "Phase 2.3: Animation Extraction", status: "pending", activeForm: "Extracting animation"},
|
||||
{content: "Phase 2.5: Layout Extraction", status: "pending", activeForm: "Extracting layout"},
|
||||
{content: "Phase 3: UI Assembly", status: "pending", activeForm: "Assembling UI"},
|
||||
{content: "Phase 4: Design System Integration", status: "pending", activeForm: "Integrating"}
|
||||
]})
|
||||
|
||||
// ⚠️ CRITICAL: Dynamic TodoWrite task attachment strategy:
|
||||
@@ -583,13 +583,25 @@ TodoWrite({todos: [
|
||||
// **Key Concept**: SlashCommand invocation ATTACHES tasks to current workflow.
|
||||
// Orchestrator EXECUTES these attached tasks itself, not waiting for external completion.
|
||||
//
|
||||
// Phase 2-4 SlashCommand Invocation Pattern:
|
||||
// 1. SlashCommand invocation ATTACHES sub-command tasks to TodoWrite
|
||||
// 2. TodoWrite expands to include attached tasks
|
||||
// 3. Orchestrator EXECUTES attached tasks sequentially
|
||||
// 4. After all attached tasks complete, COLLAPSE them into phase summary
|
||||
// 5. Update next phase to in_progress
|
||||
// 6. IMMEDIATELY execute next phase SlashCommand (auto-continue)
|
||||
// Phase 2-4 SlashCommand Invocation Pattern (when tasks are attached):
|
||||
// Example - Phase 2 with sub-tasks:
|
||||
// [
|
||||
// {"content": "Phase 0: Initialize and Detect Design Source", "status": "completed", "activeForm": "Initializing"},
|
||||
// {"content": "Phase 2: Style Extraction", "status": "in_progress", "activeForm": "Extracting style"},
|
||||
// {"content": " → Analyze design references", "status": "in_progress", "activeForm": "Analyzing references"},
|
||||
// {"content": " → Generate design tokens", "status": "pending", "activeForm": "Generating tokens"},
|
||||
// {"content": " → Create style guide", "status": "pending", "activeForm": "Creating guide"},
|
||||
// {"content": "Phase 2.3: Animation Extraction", "status": "pending", "activeForm": "Extracting animation"},
|
||||
// ...
|
||||
// ]
|
||||
//
|
||||
// After sub-tasks complete, COLLAPSE back to:
|
||||
// [
|
||||
// {"content": "Phase 0: Initialize and Detect Design Source", "status": "completed", "activeForm": "Initializing"},
|
||||
// {"content": "Phase 2: Style Extraction", "status": "completed", "activeForm": "Extracting style"},
|
||||
// {"content": "Phase 2.3: Animation Extraction", "status": "in_progress", "activeForm": "Extracting animation"},
|
||||
// ...
|
||||
// ]
|
||||
//
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user