appiq-solution 1.6.4 โ 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +62 -0
- package/README.md +109 -63
- package/bmad-core/core-config-extended.yaml +39 -0
- package/bmad-core/core-config-smart.yaml +184 -0
- package/bmad-core/core-config.yaml +165 -1
- package/bmad-core/data/mandatory-development-rules.md +170 -0
- package/bmad-core/tasks/auto-detect-prds.md +162 -0
- package/bmad-core/tasks/smart-auto-detect-prds.md +299 -0
- package/bmad-core/tasks/validate-mandatory-rules.md +322 -0
- package/docs/enhanced_prd_template.md +202 -0
- package/docs/livestream_prd_example.md +93 -0
- package/docs/livestream_prd_smart.md +278 -0
- package/docs/onboarding_prd.md +93 -0
- package/expansion-packs/appiq-flutter-mobile-dev/agents/flutter-ui-agent.md +34 -8
- package/expansion-packs/appiq-flutter-mobile-dev/config.yaml +1 -1
- package/expansion-packs/appiq-flutter-mobile-dev/data/flutter-development-guidelines.md +66 -0
- package/package.json +1 -1
@@ -0,0 +1,170 @@
|
|
1
|
+
# MANDATORY DEVELOPMENT RULES
|
2
|
+
## THESE RULES MUST ALWAYS BE FOLLOWED - NO EXCEPTIONS!
|
3
|
+
|
4
|
+
This file provides mandatory guidance that MUST be followed by ALL agents when working with code in ANY repository.
|
5
|
+
|
6
|
+
## ๐จ CRITICAL: Standard Workflow (ALWAYS FOLLOW!)
|
7
|
+
|
8
|
+
### MANDATORY 8-Step Process:
|
9
|
+
1. **THINK**: First think through the problem, read the codebase for relevant files
|
10
|
+
2. **PLAN**: Write a detailed plan to `tasks/todo.md` with checkable items
|
11
|
+
3. **VERIFY**: Check in with user - get plan approval before starting
|
12
|
+
4. **WORK**: Work on todo items, marking them complete as you go
|
13
|
+
5. **EXPLAIN**: Give high-level explanation of changes at every step
|
14
|
+
6. **SIMPLE**: Make every change as simple as possible - impact minimal code
|
15
|
+
7. **REVIEW**: Add review section to `todo.md` with summary of changes
|
16
|
+
8. **COMMIT**: After every fully finished task - make git commit with proper message
|
17
|
+
|
18
|
+
### MANDATORY Workflow Rules:
|
19
|
+
- โ
**NEVER start coding without a verified plan**
|
20
|
+
- โ
**ALWAYS check existing code before creating new code**
|
21
|
+
- โ
**ALWAYS extend existing code instead of duplicating**
|
22
|
+
- โ
**ALWAYS use existing patterns and folder structure**
|
23
|
+
- โ
**ALWAYS check if functionality already exists**
|
24
|
+
- โ
**ALWAYS make git commits after completed tasks**
|
25
|
+
|
26
|
+
## ๐ฏ MANDATORY Quality Criteria (ALL 5 MUST PASS!)
|
27
|
+
|
28
|
+
### 1. ๐งน DRY (Don't Repeat Yourself)
|
29
|
+
- โ
**NO code duplication allowed**
|
30
|
+
- โ
**ALWAYS reuse existing functions/classes/components**
|
31
|
+
- โ
**ALWAYS extract common functionality into shared utilities**
|
32
|
+
- โ
**ALWAYS check if similar code exists before writing new code**
|
33
|
+
|
34
|
+
### 2. ๐ Readable
|
35
|
+
- โ
**Code MUST be self-documenting with clear naming**
|
36
|
+
- โ
**Methods MUST be small and focused (max 20 lines)**
|
37
|
+
- โ
**Classes MUST have single responsibility**
|
38
|
+
- โ
**Comments MUST explain WHY, not WHAT**
|
39
|
+
|
40
|
+
### 3. ๐ง Maintainable
|
41
|
+
- โ
**MUST follow Clean Architecture with proper layer separation**
|
42
|
+
- โ
**MUST use dependency injection**
|
43
|
+
- โ
**MUST have modular design**
|
44
|
+
- โ
**MUST follow existing folder/file structure**
|
45
|
+
|
46
|
+
### 4. โก Performant
|
47
|
+
- โ
**MUST avoid redundant API calls**
|
48
|
+
- โ
**MUST use efficient algorithms**
|
49
|
+
- โ
**MUST optimize resource usage**
|
50
|
+
- โ
**MUST follow existing performance patterns**
|
51
|
+
|
52
|
+
### 5. ๐งช Testable
|
53
|
+
- โ
**ALL business logic MUST be unit tested**
|
54
|
+
- โ
**ALL UI components MUST be widget tested**
|
55
|
+
- โ
**MUST use dependency injection for testability**
|
56
|
+
- โ
**MUST follow existing testing patterns**
|
57
|
+
|
58
|
+
## ๐ฑ MANDATORY Flutter-Specific Rules
|
59
|
+
|
60
|
+
### Architecture Compliance (ALWAYS!)
|
61
|
+
- โ
**MUST follow Clean Architecture (Presentation โ Domain โ Data)**
|
62
|
+
- โ
**MUST use Cubit for state management**
|
63
|
+
- โ
**MUST implement Repository pattern**
|
64
|
+
- โ
**MUST use GetIt for dependency injection**
|
65
|
+
|
66
|
+
### Localization (ALWAYS!)
|
67
|
+
- โ
**NO static text allowed - EVER!**
|
68
|
+
- โ
**ALL user-facing text MUST use AppLocalizations**
|
69
|
+
- โ
**ALL localization keys MUST be descriptive**
|
70
|
+
- โ
**MUST add keys to ALL supported ARB files**
|
71
|
+
|
72
|
+
### Code Structure (ALWAYS!)
|
73
|
+
- โ
**MUST follow existing folder structure**
|
74
|
+
- โ
**MUST use snake_case for files**
|
75
|
+
- โ
**MUST use PascalCase for classes**
|
76
|
+
- โ
**MUST use camelCase for methods/variables**
|
77
|
+
|
78
|
+
### Integration Rules (ALWAYS!)
|
79
|
+
- โ
**BEFORE creating new files**: Check if similar exists
|
80
|
+
- โ
**BEFORE new widgets**: Review `lib/shared/widgets/`
|
81
|
+
- โ
**BEFORE new services**: Check `lib/shared/services/`
|
82
|
+
- โ
**BEFORE new utilities**: Review `lib/shared/utils/`
|
83
|
+
|
84
|
+
## ๐ ๏ธ MANDATORY MCP Tool Usage
|
85
|
+
|
86
|
+
### When to Use MCPs (ALWAYS check these!):
|
87
|
+
- โ
**sequential-thinking**: For complex problem analysis
|
88
|
+
- โ
**context7**: For up-to-date library documentation
|
89
|
+
- โ
**memory**: For storing important decisions/patterns
|
90
|
+
- โ
**puppeteer**: For web scraping/testing needs
|
91
|
+
- โ
**fetcher**: For external API data retrieval
|
92
|
+
|
93
|
+
## ๐ MANDATORY Pre-Development Checklist
|
94
|
+
|
95
|
+
### Before ANY coding (ALWAYS!):
|
96
|
+
- [ ] **Read existing codebase** for similar functionality
|
97
|
+
- [ ] **Check shared components** for reusable parts
|
98
|
+
- [ ] **Review existing patterns** in similar features
|
99
|
+
- [ ] **Verify architecture compliance** with existing structure
|
100
|
+
- [ ] **Plan minimal impact changes** - avoid massive refactors
|
101
|
+
- [ ] **Ensure localization keys** are planned
|
102
|
+
- [ ] **Identify testing requirements** early
|
103
|
+
|
104
|
+
### During Development (ALWAYS!):
|
105
|
+
- [ ] **Follow existing naming conventions** exactly
|
106
|
+
- [ ] **Use existing error handling patterns**
|
107
|
+
- [ ] **Reuse existing validation logic**
|
108
|
+
- [ ] **Follow existing state management patterns**
|
109
|
+
- [ ] **Use existing navigation patterns**
|
110
|
+
- [ ] **Follow existing styling/theming**
|
111
|
+
|
112
|
+
### After Development (ALWAYS!):
|
113
|
+
- [ ] **Run all tests** and ensure they pass
|
114
|
+
- [ ] **Check code coverage** meets minimum requirements
|
115
|
+
- [ ] **Verify localization** works for all languages
|
116
|
+
- [ ] **Test on different screen sizes**
|
117
|
+
- [ ] **Review code** against all 5 quality criteria
|
118
|
+
- [ ] **Make proper git commit** with descriptive message
|
119
|
+
|
120
|
+
## ๐จ CRITICAL VALIDATION RULES
|
121
|
+
|
122
|
+
### Code Review Criteria (ALL MUST PASS!):
|
123
|
+
1. โ
**Architecture**: Follows Clean Architecture with proper layer separation
|
124
|
+
2. โ
**Localization**: All text supports multi-language
|
125
|
+
3. โ
**Quality**: Passes all 5 quality criteria (DRY, Readable, Maintainable, Performant, Testable)
|
126
|
+
4. โ
**Documentation**: Code is properly documented with examples
|
127
|
+
5. โ
**Consistency**: Code style matches existing patterns
|
128
|
+
|
129
|
+
### Failure Conditions (NEVER ALLOWED!):
|
130
|
+
- โ **Static text in UI** - Immediate failure
|
131
|
+
- โ **Code duplication** - Immediate failure
|
132
|
+
- โ **Breaking existing patterns** - Immediate failure
|
133
|
+
- โ **Missing tests** - Immediate failure
|
134
|
+
- โ **Poor performance** - Immediate failure
|
135
|
+
|
136
|
+
## ๐ MANDATORY Commit Message Format
|
137
|
+
|
138
|
+
```
|
139
|
+
type(scope): brief description
|
140
|
+
|
141
|
+
- Detailed explanation of changes
|
142
|
+
- Why the changes were made
|
143
|
+
- What patterns were followed
|
144
|
+
- What tests were added
|
145
|
+
|
146
|
+
Quality Checklist:
|
147
|
+
โ
DRY: No code duplication
|
148
|
+
โ
Readable: Clear naming and structure
|
149
|
+
โ
Maintainable: Modular design
|
150
|
+
โ
Performant: Optimized implementation
|
151
|
+
โ
Testable: Comprehensive test coverage
|
152
|
+
```
|
153
|
+
|
154
|
+
## ๐ฏ REMEMBER: Consistency is King!
|
155
|
+
|
156
|
+
> **When in doubt, ALWAYS follow existing patterns in the codebase.**
|
157
|
+
> **NEVER create new patterns without explicit approval.**
|
158
|
+
> **ALWAYS prefer extending existing code over creating new code.**
|
159
|
+
|
160
|
+
---
|
161
|
+
|
162
|
+
## โ ๏ธ ENFORCEMENT NOTICE
|
163
|
+
|
164
|
+
**These rules are MANDATORY and MUST be followed by:**
|
165
|
+
- โ
All BMAD agents (dev, flutter-ui-agent, flutter-cubit-agent, etc.)
|
166
|
+
- โ
All development workflows
|
167
|
+
- โ
All IDE integrations (Cursor, Claude Code, etc.)
|
168
|
+
- โ
All automated processes
|
169
|
+
|
170
|
+
**NO EXCEPTIONS! NO SHORTCUTS! NO COMPROMISES!**
|
@@ -0,0 +1,162 @@
|
|
1
|
+
# Auto-Detect PRDs Task
|
2
|
+
|
3
|
+
## Purpose
|
4
|
+
Automatically detect PRD files based on pattern matching and trigger the complete BMAD workflow without manual Planning Phase.
|
5
|
+
|
6
|
+
## Usage
|
7
|
+
```bash
|
8
|
+
@po auto-detect-prds
|
9
|
+
```
|
10
|
+
|
11
|
+
## Process
|
12
|
+
|
13
|
+
### Step 1: Scan for PRD Files
|
14
|
+
1. **Scan configured directories** from core-config.yaml `autoWorkflow.scanDirectories`
|
15
|
+
2. **Look for files matching patterns**:
|
16
|
+
- `*_prd.md` (e.g., `livestream_prd.md`, `payment_prd.md`)
|
17
|
+
- `*_requirements.md`
|
18
|
+
- `*_feature.md`
|
19
|
+
3. **List found files** and ask user for confirmation
|
20
|
+
|
21
|
+
### Step 2: Process Each PRD File
|
22
|
+
For each detected PRD file:
|
23
|
+
|
24
|
+
1. **Validate PRD Structure**:
|
25
|
+
- Check for required sections (Features, Acceptance Criteria, etc.)
|
26
|
+
- Ensure proper markdown formatting
|
27
|
+
- Validate completeness
|
28
|
+
|
29
|
+
2. **Auto-Shard Document**:
|
30
|
+
```bash
|
31
|
+
md-tree explode {prd_file} docs/prd/{feature_name}
|
32
|
+
```
|
33
|
+
|
34
|
+
3. **Create Feature Directory Structure**:
|
35
|
+
```
|
36
|
+
docs/
|
37
|
+
โโโ prd/
|
38
|
+
โ โโโ {feature_name}/
|
39
|
+
โ โโโ overview.md
|
40
|
+
โ โโโ features.md
|
41
|
+
โ โโโ acceptance-criteria.md
|
42
|
+
โ โโโ technical-requirements.md
|
43
|
+
โโโ stories/
|
44
|
+
โโโ {feature_name}/
|
45
|
+
```
|
46
|
+
|
47
|
+
### Step 3: Auto-Generate Stories
|
48
|
+
1. **Extract Epics** from sharded PRD sections
|
49
|
+
2. **Generate User Stories** from each epic
|
50
|
+
3. **Create Story Files** in `docs/stories/{feature_name}/`
|
51
|
+
4. **Apply Flutter-specific patterns** if Flutter extension detected
|
52
|
+
|
53
|
+
### Step 4: Trigger Development Workflow
|
54
|
+
1. **Notify SM** that stories are ready
|
55
|
+
2. **Auto-start Flutter UI-First Workflow** if configured
|
56
|
+
3. **Create initial todo.md** for development tracking
|
57
|
+
|
58
|
+
## Example Workflow
|
59
|
+
|
60
|
+
### Input Files:
|
61
|
+
```
|
62
|
+
docs/
|
63
|
+
โโโ livestream_prd.md
|
64
|
+
โโโ payment_prd.md
|
65
|
+
โโโ user_profile_prd.md
|
66
|
+
```
|
67
|
+
|
68
|
+
### Command:
|
69
|
+
```bash
|
70
|
+
@po auto-detect-prds
|
71
|
+
```
|
72
|
+
|
73
|
+
### Output:
|
74
|
+
```
|
75
|
+
Found 3 PRD files:
|
76
|
+
1. livestream_prd.md โ Livestream Feature
|
77
|
+
2. payment_prd.md โ Payment Integration
|
78
|
+
3. user_profile_prd.md โ User Profile Management
|
79
|
+
|
80
|
+
Processing livestream_prd.md...
|
81
|
+
โ
Sharded to docs/prd/livestream/
|
82
|
+
โ
Generated 4 stories in docs/stories/livestream/
|
83
|
+
โ
Ready for development
|
84
|
+
|
85
|
+
Processing payment_prd.md...
|
86
|
+
โ
Sharded to docs/prd/payment/
|
87
|
+
โ
Generated 6 stories in docs/stories/payment/
|
88
|
+
โ
Ready for development
|
89
|
+
|
90
|
+
Processing user_profile_prd.md...
|
91
|
+
โ
Sharded to docs/prd/user_profile/
|
92
|
+
โ
Generated 3 stories in docs/stories/user_profile/
|
93
|
+
โ
Ready for development
|
94
|
+
|
95
|
+
๐ All PRDs processed! Ready to start development with:
|
96
|
+
@sm start-next-story
|
97
|
+
```
|
98
|
+
|
99
|
+
## PRD File Requirements
|
100
|
+
|
101
|
+
Your `*_prd.md` files should contain:
|
102
|
+
|
103
|
+
```markdown
|
104
|
+
# Feature Name PRD
|
105
|
+
|
106
|
+
## Overview
|
107
|
+
Brief description of the feature
|
108
|
+
|
109
|
+
## Features
|
110
|
+
- Feature 1: Description
|
111
|
+
- Feature 2: Description
|
112
|
+
- Feature 3: Description
|
113
|
+
|
114
|
+
## Acceptance Criteria
|
115
|
+
### Feature 1
|
116
|
+
- [ ] Criteria 1
|
117
|
+
- [ ] Criteria 2
|
118
|
+
|
119
|
+
### Feature 2
|
120
|
+
- [ ] Criteria 1
|
121
|
+
- [ ] Criteria 2
|
122
|
+
|
123
|
+
## Technical Requirements
|
124
|
+
- Flutter Clean Architecture
|
125
|
+
- Cubit State Management
|
126
|
+
- Repository Pattern
|
127
|
+
- Unit Tests Required
|
128
|
+
|
129
|
+
## User Stories
|
130
|
+
### Epic: Feature Implementation
|
131
|
+
- As a user I want to... so that...
|
132
|
+
- As a user I want to... so that...
|
133
|
+
|
134
|
+
## Dependencies
|
135
|
+
- Backend API endpoints
|
136
|
+
- Third-party integrations
|
137
|
+
- Design assets
|
138
|
+
```
|
139
|
+
|
140
|
+
## Configuration
|
141
|
+
|
142
|
+
Enable in `core-config.yaml`:
|
143
|
+
```yaml
|
144
|
+
autoWorkflow:
|
145
|
+
enabled: true
|
146
|
+
scanDirectories:
|
147
|
+
- "docs/"
|
148
|
+
- "features/"
|
149
|
+
triggerPatterns:
|
150
|
+
- "*_prd.md"
|
151
|
+
- "*_requirements.md"
|
152
|
+
```
|
153
|
+
|
154
|
+
## Flutter-Specific Integration
|
155
|
+
|
156
|
+
When Flutter extension is detected, automatically:
|
157
|
+
1. **Apply Flutter story templates**
|
158
|
+
2. **Set up UI-First workflow**
|
159
|
+
3. **Configure Clean Architecture patterns**
|
160
|
+
4. **Prepare Cubit state management structure**
|
161
|
+
|
162
|
+
This task bridges the gap between existing documentation and BMAD's development workflow, perfect for Brownfield projects!
|
@@ -0,0 +1,299 @@
|
|
1
|
+
# Smart Auto-Detect PRDs Task
|
2
|
+
|
3
|
+
## Purpose
|
4
|
+
Intelligently detect PRD files, analyze existing codebase, and determine optimal implementation paths while maximizing code reuse.
|
5
|
+
|
6
|
+
## Usage
|
7
|
+
```bash
|
8
|
+
@po smart-auto-detect-prds
|
9
|
+
```
|
10
|
+
|
11
|
+
## Enhanced Process
|
12
|
+
|
13
|
+
### Step 1: PRD Discovery & Analysis
|
14
|
+
1. **Scan for PRD Files** matching patterns:
|
15
|
+
- `*_prd.md`
|
16
|
+
- `*_requirements.md`
|
17
|
+
- `*_feature.md`
|
18
|
+
|
19
|
+
2. **Parse PRD Content**:
|
20
|
+
- Extract feature name
|
21
|
+
- Parse implementation paths (if specified)
|
22
|
+
- Identify UI reference assets
|
23
|
+
- Extract integration points
|
24
|
+
- Parse code reuse requirements
|
25
|
+
|
26
|
+
### Step 2: Codebase Analysis
|
27
|
+
For each detected PRD:
|
28
|
+
|
29
|
+
#### A. Existing Code Scan
|
30
|
+
```bash
|
31
|
+
# 1. Find similar features
|
32
|
+
find lib/features/ -type d -name "*{feature_keyword}*"
|
33
|
+
|
34
|
+
# 2. Scan shared components
|
35
|
+
find lib/shared/ -name "*.dart" | xargs grep -l "{relevant_keywords}"
|
36
|
+
|
37
|
+
# 3. Check existing services
|
38
|
+
find lib/shared/services/ lib/core/services/ -name "*.dart"
|
39
|
+
|
40
|
+
# 4. Analyze existing patterns
|
41
|
+
find lib/features/ -name "*_cubit.dart" -o -name "*_repository.dart" -o -name "*_usecase.dart"
|
42
|
+
```
|
43
|
+
|
44
|
+
#### B. Dependency Analysis
|
45
|
+
```bash
|
46
|
+
# Check pubspec.yaml for existing packages
|
47
|
+
grep -E "(http|dio|cached_network_image|shared_preferences)" pubspec.yaml
|
48
|
+
|
49
|
+
# Analyze DI container
|
50
|
+
grep -n "registerLazySingleton\|registerFactory" lib/core/di/injection_container.dart
|
51
|
+
|
52
|
+
# Check existing API endpoints
|
53
|
+
find lib/features/*/data/datasources/ -name "*_remote_datasource.dart" -exec grep -l "http" {} \;
|
54
|
+
```
|
55
|
+
|
56
|
+
#### C. UI Component Analysis
|
57
|
+
```bash
|
58
|
+
# Find reusable widgets
|
59
|
+
find lib/shared/widgets/ -name "*.dart" | sort
|
60
|
+
|
61
|
+
# Check existing page structures
|
62
|
+
find lib/features/*/presentation/pages/ -name "*.dart"
|
63
|
+
|
64
|
+
# Analyze existing themes and styles
|
65
|
+
find lib/shared/theme/ lib/core/theme/ -name "*.dart"
|
66
|
+
```
|
67
|
+
|
68
|
+
### Step 3: Smart Path Resolution
|
69
|
+
|
70
|
+
#### If Implementation Paths Specified in PRD:
|
71
|
+
1. **Validate Specified Paths**:
|
72
|
+
- Check if directories exist
|
73
|
+
- Verify no conflicts with existing files
|
74
|
+
- Ensure paths follow project conventions
|
75
|
+
|
76
|
+
2. **Integration Point Validation**:
|
77
|
+
- Verify specified existing files exist
|
78
|
+
- Check if integration points are compatible
|
79
|
+
- Validate shared component references
|
80
|
+
|
81
|
+
#### If No Paths Specified - Architect Mode:
|
82
|
+
1. **Feature Complexity Analysis**:
|
83
|
+
```markdown
|
84
|
+
Analyzing feature: {feature_name}
|
85
|
+
|
86
|
+
Complexity Factors:
|
87
|
+
- [ ] Number of screens: {count}
|
88
|
+
- [ ] External dependencies: {list}
|
89
|
+
- [ ] Database changes needed: {yes/no}
|
90
|
+
- [ ] New API endpoints: {count}
|
91
|
+
- [ ] Shared state requirements: {yes/no}
|
92
|
+
|
93
|
+
Recommendation: {simple_integration|new_feature|shared_component}
|
94
|
+
```
|
95
|
+
|
96
|
+
2. **Automatic Path Generation**:
|
97
|
+
```bash
|
98
|
+
# For new features
|
99
|
+
mkdir -p lib/features/{feature_name}/{data,domain,presentation}
|
100
|
+
|
101
|
+
# For simple integrations
|
102
|
+
# Add to existing feature folder
|
103
|
+
|
104
|
+
# For shared components
|
105
|
+
mkdir -p lib/shared/{widgets,services,utils}/{feature_name}
|
106
|
+
```
|
107
|
+
|
108
|
+
### Step 4: Code Reuse Optimization
|
109
|
+
|
110
|
+
#### Existing Component Mapping:
|
111
|
+
```markdown
|
112
|
+
Found Reusable Components for {feature_name}:
|
113
|
+
|
114
|
+
UI Components:
|
115
|
+
โ
lib/shared/widgets/custom_button.dart - Can be used for {action_buttons}
|
116
|
+
โ
lib/shared/widgets/loading_widget.dart - For loading states
|
117
|
+
โ Need new: {specific_widget} - No existing equivalent found
|
118
|
+
|
119
|
+
Services:
|
120
|
+
โ
lib/shared/services/api_service.dart - Can be extended for {api_calls}
|
121
|
+
โ
lib/shared/services/navigation_service.dart - For navigation
|
122
|
+
โ Need new: {specific_service} - No existing equivalent found
|
123
|
+
|
124
|
+
Utilities:
|
125
|
+
โ
lib/shared/utils/validators.dart - For input validation
|
126
|
+
โ
lib/shared/utils/formatters.dart - For data formatting
|
127
|
+
โ Need new: {specific_utility} - No existing equivalent found
|
128
|
+
```
|
129
|
+
|
130
|
+
#### Integration Strategy:
|
131
|
+
```markdown
|
132
|
+
Integration Plan for {feature_name}:
|
133
|
+
|
134
|
+
1. Extend Existing:
|
135
|
+
- {existing_cubit} โ Add {new_states}
|
136
|
+
- {existing_repository} โ Add {new_methods}
|
137
|
+
- {existing_service} โ Add {new_functionality}
|
138
|
+
|
139
|
+
2. Create New:
|
140
|
+
- {new_entity} โ lib/features/{feature}/domain/entities/
|
141
|
+
- {new_usecase} โ lib/features/{feature}/domain/usecases/
|
142
|
+
- {new_widget} โ lib/features/{feature}/presentation/widgets/
|
143
|
+
|
144
|
+
3. Shared Enhancements:
|
145
|
+
- Add {new_shared_widget} โ lib/shared/widgets/
|
146
|
+
- Extend {existing_theme} โ lib/shared/theme/
|
147
|
+
```
|
148
|
+
|
149
|
+
### Step 5: UI Reference Processing
|
150
|
+
|
151
|
+
#### Asset Organization:
|
152
|
+
```bash
|
153
|
+
# Create asset directories if specified
|
154
|
+
mkdir -p assets/images/{feature_name}
|
155
|
+
mkdir -p assets/icons/{feature_name}
|
156
|
+
|
157
|
+
# Validate referenced assets exist
|
158
|
+
for asset in {ui_reference_assets}; do
|
159
|
+
if [[ -f "$asset" ]]; then
|
160
|
+
echo "โ
Found: $asset"
|
161
|
+
else
|
162
|
+
echo "โ Missing: $asset - Please add this asset"
|
163
|
+
fi
|
164
|
+
done
|
165
|
+
```
|
166
|
+
|
167
|
+
#### UI Pattern Analysis:
|
168
|
+
```markdown
|
169
|
+
UI Pattern Analysis for {feature_name}:
|
170
|
+
|
171
|
+
Similar Existing Patterns:
|
172
|
+
โ
{existing_feature}/presentation/pages/{page}.dart - Similar layout structure
|
173
|
+
โ
{existing_feature}/presentation/widgets/{widget}.dart - Similar component pattern
|
174
|
+
|
175
|
+
Recommended UI Approach:
|
176
|
+
- Base Layout: Extend {existing_scaffold_pattern}
|
177
|
+
- Components: Reuse {existing_widget_pattern}
|
178
|
+
- Styling: Follow {existing_theme_pattern}
|
179
|
+
- Navigation: Use {existing_navigation_pattern}
|
180
|
+
```
|
181
|
+
|
182
|
+
### Step 6: Enhanced Story Generation
|
183
|
+
|
184
|
+
#### Context-Aware Stories:
|
185
|
+
```markdown
|
186
|
+
Generated Stories for {feature_name}:
|
187
|
+
|
188
|
+
Story 1: Setup Infrastructure
|
189
|
+
- Extend {existing_repository} with {new_methods}
|
190
|
+
- Add {new_entity} following {existing_pattern}
|
191
|
+
- Register dependencies in {existing_di_container}
|
192
|
+
|
193
|
+
Story 2: UI Implementation
|
194
|
+
- Create {new_page} extending {existing_base_page}
|
195
|
+
- Reuse {existing_shared_widgets}
|
196
|
+
- Follow {existing_theme_patterns}
|
197
|
+
|
198
|
+
Story 3: Integration
|
199
|
+
- Connect to {existing_navigation}
|
200
|
+
- Integrate with {existing_services}
|
201
|
+
- Add to {existing_routing}
|
202
|
+
```
|
203
|
+
|
204
|
+
### Step 7: Architect Consultation
|
205
|
+
|
206
|
+
#### When Architect Input Needed:
|
207
|
+
```bash
|
208
|
+
@architect analyze-implementation-strategy {feature_name}
|
209
|
+
```
|
210
|
+
|
211
|
+
**Triggers for Architect Consultation**:
|
212
|
+
- Complex cross-feature dependencies detected
|
213
|
+
- No clear existing patterns found
|
214
|
+
- Conflicting implementation approaches possible
|
215
|
+
- Major architectural changes suggested
|
216
|
+
|
217
|
+
#### Architect Analysis Output:
|
218
|
+
```markdown
|
219
|
+
Architect Analysis for {feature_name}:
|
220
|
+
|
221
|
+
Current Architecture Assessment:
|
222
|
+
- Existing patterns: {list}
|
223
|
+
- Architectural constraints: {list}
|
224
|
+
- Integration challenges: {list}
|
225
|
+
|
226
|
+
Recommended Approach:
|
227
|
+
1. Implementation Strategy: {detailed_strategy}
|
228
|
+
2. File Structure: {recommended_structure}
|
229
|
+
3. Integration Points: {specific_integration_points}
|
230
|
+
4. Risk Mitigation: {potential_issues_and_solutions}
|
231
|
+
|
232
|
+
Code Reuse Opportunities:
|
233
|
+
- {existing_component} can be extended for {new_functionality}
|
234
|
+
- {existing_pattern} should be followed for consistency
|
235
|
+
- {existing_service} can be enhanced with {new_methods}
|
236
|
+
```
|
237
|
+
|
238
|
+
## Example Enhanced Workflow
|
239
|
+
|
240
|
+
### Input: `livestream_prd.md` with Implementation Paths
|
241
|
+
```markdown
|
242
|
+
## Implementation Paths
|
243
|
+
### Suggested File Structure
|
244
|
+
lib/features/livestream/...
|
245
|
+
|
246
|
+
### Integration Points
|
247
|
+
- Existing Pages: lib/features/home/presentation/pages/home_page.dart
|
248
|
+
- Shared Services: lib/shared/services/api_service.dart
|
249
|
+
|
250
|
+
### UI References
|
251
|
+
assets/images/livestream/mockup_main_screen.png
|
252
|
+
```
|
253
|
+
|
254
|
+
### Auto-Analysis Output:
|
255
|
+
```markdown
|
256
|
+
๐ Analyzing livestream_prd.md...
|
257
|
+
|
258
|
+
๐ Path Analysis:
|
259
|
+
โ
lib/features/livestream/ - Path available
|
260
|
+
โ
Integration with home_page.dart - Compatible
|
261
|
+
โ
api_service.dart - Can be extended
|
262
|
+
|
263
|
+
๐ Codebase Scan Results:
|
264
|
+
Found Similar Features:
|
265
|
+
- lib/features/video_player/ - 67% similarity
|
266
|
+
- lib/features/chat/ - 45% similarity
|
267
|
+
|
268
|
+
Reusable Components:
|
269
|
+
โ
lib/shared/widgets/video_controller.dart - Perfect for stream controls
|
270
|
+
โ
lib/shared/services/websocket_service.dart - Can handle chat
|
271
|
+
โ Need new: Stream management service
|
272
|
+
|
273
|
+
๐ฑ UI Analysis:
|
274
|
+
โ
Found: assets/images/livestream/mockup_main_screen.png
|
275
|
+
โ
Existing video player patterns can be extended
|
276
|
+
โ
Chat UI patterns exist in lib/features/chat/
|
277
|
+
|
278
|
+
๐ Generated Implementation Plan:
|
279
|
+
1. Extend existing video_player patterns
|
280
|
+
2. Reuse chat UI components
|
281
|
+
3. Create new stream management service
|
282
|
+
4. Integrate with existing navigation
|
283
|
+
|
284
|
+
Ready for development!
|
285
|
+
```
|
286
|
+
|
287
|
+
## Configuration
|
288
|
+
|
289
|
+
Enable in `core-config.yaml`:
|
290
|
+
```yaml
|
291
|
+
smartAnalysis:
|
292
|
+
enabled: true
|
293
|
+
codebaseAnalysis: true
|
294
|
+
architectConsultation: true
|
295
|
+
uiReferenceProcessing: true
|
296
|
+
reuseOptimization: true
|
297
|
+
```
|
298
|
+
|
299
|
+
This creates an intelligent system that maximizes code reuse and ensures optimal implementation paths! ๐ง โจ
|