appiq-solution 1.6.4 → 1.6.5
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/bmad-core/core-config-extended.yaml +39 -0
- package/bmad-core/core-config-smart.yaml +184 -0
- 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/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,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! 🧠✨
|
@@ -0,0 +1,322 @@
|
|
1
|
+
# Validate Mandatory Development Rules Task
|
2
|
+
|
3
|
+
## Purpose
|
4
|
+
Automatically validate that ALL mandatory development rules are being followed during development. This task MUST be run before any code is considered complete.
|
5
|
+
|
6
|
+
## Usage
|
7
|
+
```bash
|
8
|
+
@dev validate-mandatory-rules
|
9
|
+
@qa validate-mandatory-rules
|
10
|
+
```
|
11
|
+
|
12
|
+
## MANDATORY Validation Checklist
|
13
|
+
|
14
|
+
### 🚨 CRITICAL: Standard Workflow Validation
|
15
|
+
- [ ] **Plan Created**: `tasks/todo.md` exists with detailed, checkable items
|
16
|
+
- [ ] **Plan Verified**: User has approved the plan before coding started
|
17
|
+
- [ ] **Existing Code Checked**: Similar functionality was analyzed FIRST
|
18
|
+
- [ ] **Todo Items Tracked**: Items are being marked complete as work progresses
|
19
|
+
- [ ] **Explanations Provided**: High-level explanations given at each step
|
20
|
+
- [ ] **Simple Changes**: Minimal code impact - no massive refactors
|
21
|
+
- [ ] **Review Section Added**: Summary of changes in `todo.md`
|
22
|
+
- [ ] **Git Commits Made**: Proper commits after each completed task
|
23
|
+
|
24
|
+
### 🎯 MANDATORY: Quality Gates Validation (ALL 5 MUST PASS!)
|
25
|
+
|
26
|
+
#### 1. 🧹 DRY (Don't Repeat Yourself)
|
27
|
+
```bash
|
28
|
+
# Check for code duplication
|
29
|
+
find lib/ -name "*.dart" -exec grep -l "similar_pattern" {} \;
|
30
|
+
|
31
|
+
# Validate no duplicate widgets
|
32
|
+
find lib/shared/widgets/ -name "*.dart"
|
33
|
+
find lib/features/*/presentation/widgets/ -name "*similar*"
|
34
|
+
|
35
|
+
# Check for duplicate services
|
36
|
+
find lib/shared/services/ -name "*.dart"
|
37
|
+
find lib/features/*/data/datasources/ -name "*similar*"
|
38
|
+
```
|
39
|
+
|
40
|
+
**Validation Rules:**
|
41
|
+
- [ ] **No duplicate widgets** when shared widget exists
|
42
|
+
- [ ] **No duplicate services** when shared service exists
|
43
|
+
- [ ] **No duplicate utilities** when shared utility exists
|
44
|
+
- [ ] **No duplicate business logic** across features
|
45
|
+
- [ ] **Common functionality extracted** to shared components
|
46
|
+
|
47
|
+
#### 2. 📖 Readable
|
48
|
+
```bash
|
49
|
+
# Check for clear naming
|
50
|
+
grep -r "data\|info\|manager\|handler" lib/ --include="*.dart"
|
51
|
+
|
52
|
+
# Check method length (max 20 lines)
|
53
|
+
find lib/ -name "*.dart" -exec awk '/^[[:space:]]*[a-zA-Z].*{/{flag=1; count=0} flag{count++} /^[[:space:]]*}$/{if(flag && count>20) print FILENAME":"NR-count+1"-"NR; flag=0}' {} \;
|
54
|
+
|
55
|
+
# Check for comments explaining WHY
|
56
|
+
grep -r "// TODO\|// FIXME\|// HACK" lib/ --include="*.dart"
|
57
|
+
```
|
58
|
+
|
59
|
+
**Validation Rules:**
|
60
|
+
- [ ] **Method names** are descriptive and clear
|
61
|
+
- [ ] **Class names** follow single responsibility principle
|
62
|
+
- [ ] **Variable names** are self-documenting
|
63
|
+
- [ ] **Methods are small** (max 20 lines)
|
64
|
+
- [ ] **Comments explain WHY**, not WHAT
|
65
|
+
|
66
|
+
#### 3. 🔧 Maintainable
|
67
|
+
```bash
|
68
|
+
# Check Clean Architecture compliance
|
69
|
+
find lib/features/ -type d -name "data"
|
70
|
+
find lib/features/ -type d -name "domain"
|
71
|
+
find lib/features/ -type d -name "presentation"
|
72
|
+
|
73
|
+
# Check dependency injection usage
|
74
|
+
grep -r "@injectable\|GetIt" lib/ --include="*.dart"
|
75
|
+
|
76
|
+
# Check proper imports (no cross-layer dependencies)
|
77
|
+
grep -r "import.*data.*" lib/features/*/domain/ --include="*.dart"
|
78
|
+
grep -r "import.*presentation.*" lib/features/*/domain/ --include="*.dart"
|
79
|
+
```
|
80
|
+
|
81
|
+
**Validation Rules:**
|
82
|
+
- [ ] **Clean Architecture layers** properly separated
|
83
|
+
- [ ] **No cross-layer dependencies** (domain doesn't import data/presentation)
|
84
|
+
- [ ] **Dependency injection** used consistently
|
85
|
+
- [ ] **Modular design** with clear boundaries
|
86
|
+
- [ ] **Single responsibility** principle followed
|
87
|
+
|
88
|
+
#### 4. ⚡ Performant
|
89
|
+
```bash
|
90
|
+
# Check for redundant API calls
|
91
|
+
grep -r "http\|api" lib/ --include="*.dart" | grep -v "test"
|
92
|
+
|
93
|
+
# Check for proper const constructors
|
94
|
+
grep -r "const.*(" lib/features/*/presentation/widgets/ --include="*.dart"
|
95
|
+
|
96
|
+
# Check for efficient list operations
|
97
|
+
grep -r "\.map(\|\.where(\|\.forEach(" lib/ --include="*.dart"
|
98
|
+
```
|
99
|
+
|
100
|
+
**Validation Rules:**
|
101
|
+
- [ ] **No redundant API calls** in repositories
|
102
|
+
- [ ] **Const constructors** used in widgets
|
103
|
+
- [ ] **Efficient algorithms** implemented
|
104
|
+
- [ ] **Proper caching** strategies used
|
105
|
+
- [ ] **Resource optimization** applied
|
106
|
+
|
107
|
+
#### 5. 🧪 Testable
|
108
|
+
```bash
|
109
|
+
# Check for unit tests
|
110
|
+
find test/ -name "*_test.dart" | wc -l
|
111
|
+
find lib/features/*/domain/usecases/ -name "*.dart" | wc -l
|
112
|
+
|
113
|
+
# Check for widget tests
|
114
|
+
find test/ -name "*_widget_test.dart" | wc -l
|
115
|
+
find lib/features/*/presentation/widgets/ -name "*.dart" | wc -l
|
116
|
+
|
117
|
+
# Check test coverage
|
118
|
+
flutter test --coverage
|
119
|
+
```
|
120
|
+
|
121
|
+
**Validation Rules:**
|
122
|
+
- [ ] **Unit tests** exist for all use cases
|
123
|
+
- [ ] **Widget tests** exist for all custom widgets
|
124
|
+
- [ ] **Repository tests** with proper mocking
|
125
|
+
- [ ] **Cubit tests** for all state management
|
126
|
+
- [ ] **Test coverage** meets minimum requirements (80%+)
|
127
|
+
|
128
|
+
### 📱 MANDATORY: Flutter-Specific Validation
|
129
|
+
|
130
|
+
#### Clean Architecture Compliance
|
131
|
+
```bash
|
132
|
+
# Validate folder structure
|
133
|
+
ls -la lib/features/*/data/datasources/
|
134
|
+
ls -la lib/features/*/data/models/
|
135
|
+
ls -la lib/features/*/data/repositories/
|
136
|
+
ls -la lib/features/*/domain/entities/
|
137
|
+
ls -la lib/features/*/domain/repositories/
|
138
|
+
ls -la lib/features/*/domain/usecases/
|
139
|
+
ls -la lib/features/*/presentation/cubit/
|
140
|
+
ls -la lib/features/*/presentation/pages/
|
141
|
+
ls -la lib/features/*/presentation/widgets/
|
142
|
+
```
|
143
|
+
|
144
|
+
**Validation Rules:**
|
145
|
+
- [ ] **Proper folder structure** following Clean Architecture
|
146
|
+
- [ ] **Entity classes** in domain layer
|
147
|
+
- [ ] **Model classes** in data layer with JSON serialization
|
148
|
+
- [ ] **Repository interfaces** in domain, implementations in data
|
149
|
+
- [ ] **Use cases** contain business logic
|
150
|
+
- [ ] **Cubits** handle state management
|
151
|
+
- [ ] **Pages and widgets** in presentation layer
|
152
|
+
|
153
|
+
#### Localization Compliance
|
154
|
+
```bash
|
155
|
+
# Check for static text (INSTANT FAILURE!)
|
156
|
+
grep -r "Text(\|text:\|title:\|label:" lib/features/ --include="*.dart" | grep -v "AppLocalizations\|context.l10n\|S.of"
|
157
|
+
|
158
|
+
# Check for localization usage
|
159
|
+
grep -r "AppLocalizations.of\|context.l10n\|S.of" lib/ --include="*.dart"
|
160
|
+
|
161
|
+
# Validate ARB files
|
162
|
+
find lib/l10n/ -name "*.arb"
|
163
|
+
```
|
164
|
+
|
165
|
+
**Validation Rules:**
|
166
|
+
- [ ] **NO static text** in any widget (INSTANT FAILURE if found!)
|
167
|
+
- [ ] **All text uses AppLocalizations** or equivalent
|
168
|
+
- [ ] **ARB files** contain all required keys
|
169
|
+
- [ ] **Localization keys** are descriptive and hierarchical
|
170
|
+
- [ ] **Placeholders** used for dynamic content
|
171
|
+
|
172
|
+
#### State Management Compliance
|
173
|
+
```bash
|
174
|
+
# Check Cubit usage
|
175
|
+
find lib/features/*/presentation/cubit/ -name "*_cubit.dart"
|
176
|
+
find lib/features/*/presentation/cubit/ -name "*_state.dart"
|
177
|
+
|
178
|
+
# Check for proper state classes
|
179
|
+
grep -r "extends Equatable" lib/features/*/presentation/cubit/ --include="*.dart"
|
180
|
+
grep -r "copyWith" lib/features/*/presentation/cubit/ --include="*.dart"
|
181
|
+
```
|
182
|
+
|
183
|
+
**Validation Rules:**
|
184
|
+
- [ ] **Cubit pattern** used for state management
|
185
|
+
- [ ] **State classes** extend Equatable
|
186
|
+
- [ ] **CopyWith methods** implemented
|
187
|
+
- [ ] **Proper state transitions** defined
|
188
|
+
- [ ] **Error handling** in state management
|
189
|
+
|
190
|
+
### 🔍 MANDATORY: Code Integration Validation
|
191
|
+
|
192
|
+
#### Existing Component Check
|
193
|
+
```bash
|
194
|
+
# Before creating new widgets
|
195
|
+
echo "Checking existing widgets..."
|
196
|
+
find lib/shared/widgets/ -name "*.dart" | sort
|
197
|
+
|
198
|
+
# Before creating new services
|
199
|
+
echo "Checking existing services..."
|
200
|
+
find lib/shared/services/ -name "*.dart" | sort
|
201
|
+
|
202
|
+
# Before creating new utilities
|
203
|
+
echo "Checking existing utilities..."
|
204
|
+
find lib/shared/utils/ -name "*.dart" | sort
|
205
|
+
```
|
206
|
+
|
207
|
+
**Validation Rules:**
|
208
|
+
- [ ] **Existing widgets checked** before creating new ones
|
209
|
+
- [ ] **Existing services checked** before creating new ones
|
210
|
+
- [ ] **Existing utilities checked** before creating new ones
|
211
|
+
- [ ] **Similar features analyzed** for reusable patterns
|
212
|
+
- [ ] **Integration points identified** and utilized
|
213
|
+
|
214
|
+
#### Pattern Consistency Check
|
215
|
+
```bash
|
216
|
+
# Check naming conventions
|
217
|
+
find lib/ -name "*.dart" | grep -v "snake_case"
|
218
|
+
find lib/ -name "*.dart" -exec basename {} \; | grep -E "[A-Z]"
|
219
|
+
|
220
|
+
# Check class naming
|
221
|
+
grep -r "^class [a-z]" lib/ --include="*.dart"
|
222
|
+
grep -r "^class.*[_-]" lib/ --include="*.dart"
|
223
|
+
```
|
224
|
+
|
225
|
+
**Validation Rules:**
|
226
|
+
- [ ] **File names** use snake_case
|
227
|
+
- [ ] **Class names** use PascalCase
|
228
|
+
- [ ] **Method names** use camelCase
|
229
|
+
- [ ] **Variable names** use camelCase
|
230
|
+
- [ ] **Constants** use SCREAMING_SNAKE_CASE
|
231
|
+
|
232
|
+
### 🚨 FAILURE CONDITIONS (INSTANT FAILURE!)
|
233
|
+
|
234
|
+
#### Critical Failures (Development STOPS immediately!)
|
235
|
+
```bash
|
236
|
+
# Check for static text (INSTANT FAILURE!)
|
237
|
+
if grep -r "Text('\|Text(\"\|title: '\|title: \"" lib/features/ --include="*.dart" | grep -v "AppLocalizations\|context.l10n\|S.of"; then
|
238
|
+
echo "❌ INSTANT FAILURE: Static text found in UI!"
|
239
|
+
exit 1
|
240
|
+
fi
|
241
|
+
|
242
|
+
# Check for code duplication (INSTANT FAILURE!)
|
243
|
+
if find lib/features/ -name "*.dart" -exec grep -l "duplicate_pattern" {} \; 2>/dev/null; then
|
244
|
+
echo "❌ INSTANT FAILURE: Code duplication detected!"
|
245
|
+
exit 1
|
246
|
+
fi
|
247
|
+
|
248
|
+
# Check for architecture violations (INSTANT FAILURE!)
|
249
|
+
if grep -r "import.*data.*" lib/features/*/domain/ --include="*.dart" 2>/dev/null; then
|
250
|
+
echo "❌ INSTANT FAILURE: Domain layer importing data layer!"
|
251
|
+
exit 1
|
252
|
+
fi
|
253
|
+
|
254
|
+
# Check for missing tests (INSTANT FAILURE!)
|
255
|
+
if [ $(find test/ -name "*_test.dart" | wc -l) -eq 0 ]; then
|
256
|
+
echo "❌ INSTANT FAILURE: No tests found!"
|
257
|
+
exit 1
|
258
|
+
fi
|
259
|
+
```
|
260
|
+
|
261
|
+
## Validation Report Generation
|
262
|
+
|
263
|
+
### Success Report
|
264
|
+
```markdown
|
265
|
+
✅ MANDATORY RULES VALIDATION PASSED!
|
266
|
+
|
267
|
+
Standard Workflow: ✅ PASSED
|
268
|
+
- Plan created and verified
|
269
|
+
- Existing code checked first
|
270
|
+
- Simple changes implemented
|
271
|
+
- Review section completed
|
272
|
+
|
273
|
+
Quality Gates: ✅ ALL 5 PASSED
|
274
|
+
- 🧹 DRY: No code duplication
|
275
|
+
- 📖 Readable: Clear, self-documenting code
|
276
|
+
- 🔧 Maintainable: Clean Architecture followed
|
277
|
+
- ⚡ Performant: Optimized implementation
|
278
|
+
- 🧪 Testable: Comprehensive test coverage
|
279
|
+
|
280
|
+
Flutter Compliance: ✅ PASSED
|
281
|
+
- Clean Architecture structure
|
282
|
+
- No static text found
|
283
|
+
- Proper Cubit state management
|
284
|
+
- Localization fully implemented
|
285
|
+
|
286
|
+
Code Integration: ✅ PASSED
|
287
|
+
- Existing components reused
|
288
|
+
- Patterns followed consistently
|
289
|
+
- No unnecessary duplication
|
290
|
+
|
291
|
+
🎉 READY FOR PRODUCTION!
|
292
|
+
```
|
293
|
+
|
294
|
+
### Failure Report
|
295
|
+
```markdown
|
296
|
+
❌ MANDATORY RULES VALIDATION FAILED!
|
297
|
+
|
298
|
+
Critical Failures:
|
299
|
+
❌ Static text found in lib/features/livestream/presentation/pages/stream_page.dart:45
|
300
|
+
❌ Code duplication detected in lib/features/livestream/presentation/widgets/
|
301
|
+
❌ Missing tests for StreamUseCase
|
302
|
+
|
303
|
+
DEVELOPMENT MUST STOP UNTIL FIXED!
|
304
|
+
|
305
|
+
Required Actions:
|
306
|
+
1. Replace all static text with AppLocalizations
|
307
|
+
2. Remove duplicate code and reuse existing components
|
308
|
+
3. Add comprehensive unit tests
|
309
|
+
4. Re-run validation
|
310
|
+
|
311
|
+
DO NOT PROCEED UNTIL ALL FAILURES ARE RESOLVED!
|
312
|
+
```
|
313
|
+
|
314
|
+
## Integration with Development Workflow
|
315
|
+
|
316
|
+
This validation MUST be run:
|
317
|
+
- [ ] **Before any code review**
|
318
|
+
- [ ] **Before any git commit**
|
319
|
+
- [ ] **Before marking any story as complete**
|
320
|
+
- [ ] **Before any deployment**
|
321
|
+
|
322
|
+
**NO EXCEPTIONS! NO SHORTCUTS! NO COMPROMISES!**
|