78 lines
2.7 KiB
Python
78 lines
2.7 KiB
Python
#!/usr/bin/env python3
|
|
"""Workflow generator for TUI implementation."""
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
from typing import Dict, List
|
|
|
|
sys.path.insert(0, str(Path(__file__).parent))
|
|
|
|
from utils.helpers import estimate_complexity
|
|
from utils.validators import DesignValidator
|
|
|
|
|
|
def generate_implementation_workflow(architecture: Dict, patterns: Dict) -> Dict:
|
|
"""Generate step-by-step implementation workflow."""
|
|
comp_count = len(architecture.get('model_struct', '').split('\n')) // 2
|
|
examples = patterns.get('examples', [])
|
|
|
|
phases = [
|
|
{
|
|
'name': 'Phase 1: Setup',
|
|
'tasks': [
|
|
{'task': 'Initialize Go module', 'estimated_time': '2 minutes'},
|
|
{'task': 'Install Bubble Tea and dependencies', 'estimated_time': '3 minutes'},
|
|
{'task': 'Create main.go with basic structure', 'estimated_time': '5 minutes'}
|
|
],
|
|
'total_time': '10 minutes'
|
|
},
|
|
{
|
|
'name': 'Phase 2: Core Components',
|
|
'tasks': [
|
|
{'task': 'Implement model struct', 'estimated_time': '15 minutes'},
|
|
{'task': 'Add Init() function', 'estimated_time': '10 minutes'},
|
|
{'task': 'Implement basic Update() handler', 'estimated_time': '20 minutes'},
|
|
{'task': 'Create basic View()', 'estimated_time': '15 minutes'}
|
|
],
|
|
'total_time': '60 minutes'
|
|
},
|
|
{
|
|
'name': 'Phase 3: Integration',
|
|
'tasks': [
|
|
{'task': 'Connect components', 'estimated_time': '30 minutes'},
|
|
{'task': 'Add message passing', 'estimated_time': '20 minutes'},
|
|
{'task': 'Implement full keyboard handling', 'estimated_time': '20 minutes'}
|
|
],
|
|
'total_time': '70 minutes'
|
|
},
|
|
{
|
|
'name': 'Phase 4: Polish',
|
|
'tasks': [
|
|
{'task': 'Add Lipgloss styling', 'estimated_time': '30 minutes'},
|
|
{'task': 'Add help text', 'estimated_time': '15 minutes'},
|
|
{'task': 'Error handling', 'estimated_time': '15 minutes'}
|
|
],
|
|
'total_time': '60 minutes'
|
|
}
|
|
]
|
|
|
|
testing_checkpoints = [
|
|
'After Phase 1: go build succeeds',
|
|
'After Phase 2: Basic TUI renders',
|
|
'After Phase 3: All interactions work',
|
|
'After Phase 4: Production ready'
|
|
]
|
|
|
|
workflow = {
|
|
'phases': phases,
|
|
'testing_checkpoints': testing_checkpoints,
|
|
'total_estimated_time': estimate_complexity(comp_count)
|
|
}
|
|
|
|
# Validate
|
|
validator = DesignValidator()
|
|
validation = validator.validate_workflow_completeness(workflow)
|
|
workflow['validation'] = validation.to_dict()
|
|
|
|
return workflow
|