olympus-ai 4.0.2 → 4.0.4

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.
Files changed (50) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/dist/features/workflow-engine/artifacts.d.ts.map +1 -1
  3. package/dist/features/workflow-engine/artifacts.js +13 -9
  4. package/dist/features/workflow-engine/artifacts.js.map +1 -1
  5. package/dist/features/workflow-engine/construction/nfr-requirements.js +1 -1
  6. package/dist/features/workflow-engine/construction/nfr-requirements.js.map +1 -1
  7. package/dist/features/workflow-engine/engine.d.ts +1 -1
  8. package/dist/features/workflow-engine/engine.js +2 -2
  9. package/dist/features/workflow-engine/engine.js.map +1 -1
  10. package/dist/features/workflow-engine/inception/stages/units-generation.d.ts.map +1 -1
  11. package/dist/features/workflow-engine/inception/stages/units-generation.js +7 -6
  12. package/dist/features/workflow-engine/inception/stages/units-generation.js.map +1 -1
  13. package/dist/features/workflow-engine/inception/stages/user-stories.d.ts.map +1 -1
  14. package/dist/features/workflow-engine/inception/stages/user-stories.js +5 -3
  15. package/dist/features/workflow-engine/inception/stages/user-stories.js.map +1 -1
  16. package/dist/features/workflow-engine/question-manager.d.ts.map +1 -1
  17. package/dist/features/workflow-engine/question-manager.js +5 -1
  18. package/dist/features/workflow-engine/question-manager.js.map +1 -1
  19. package/dist/features/workflow-engine/state-file.d.ts.map +1 -1
  20. package/dist/features/workflow-engine/state-file.js +4 -2
  21. package/dist/features/workflow-engine/state-file.js.map +1 -1
  22. package/dist/hooks/olympus-hooks.cjs +10 -10
  23. package/dist/installer/index.d.ts +1 -1
  24. package/dist/installer/index.js +1 -1
  25. package/dist/learning/__tests__/project-resolver.test.d.ts +2 -0
  26. package/dist/learning/__tests__/project-resolver.test.d.ts.map +1 -0
  27. package/dist/learning/__tests__/project-resolver.test.js +216 -0
  28. package/dist/learning/__tests__/project-resolver.test.js.map +1 -0
  29. package/dist/learning/hooks/success-detector.d.ts.map +1 -1
  30. package/dist/learning/hooks/success-detector.js +4 -26
  31. package/dist/learning/hooks/success-detector.js.map +1 -1
  32. package/dist/learning/pattern-extractor.js +1 -1
  33. package/dist/learning/pattern-extractor.js.map +1 -1
  34. package/dist/learning/project-resolver.d.ts +6 -0
  35. package/dist/learning/project-resolver.d.ts.map +1 -0
  36. package/dist/learning/project-resolver.js +65 -0
  37. package/dist/learning/project-resolver.js.map +1 -0
  38. package/dist/learning/storage.d.ts.map +1 -1
  39. package/dist/learning/storage.js +2 -1
  40. package/dist/learning/storage.js.map +1 -1
  41. package/package.json +1 -1
  42. package/resources/agents/frontend-engineer-high.md +112 -10
  43. package/resources/agents/frontend-engineer.md +136 -73
  44. package/resources/rules/common/depth-levels.md +73 -73
  45. package/resources/rules/common/question-format-guide.md +375 -375
  46. package/resources/rules/common/session-continuity.md +47 -47
  47. package/resources/rules/inception/requirements-analysis.md +247 -215
  48. package/resources/rules/inception/workflow-planning.md +487 -487
  49. package/resources/skills/continue/SKILL.md +3 -3
  50. package/resources/skills/plan/SKILL.md +35 -25
@@ -1,487 +1,487 @@
1
- # Workflow Planning
2
-
3
- **Purpose**: Determine which phases to execute and create comprehensive execution plan
4
-
5
- **Always Execute**: This phase always runs after understanding requirements and scope
6
-
7
- ## Execution Model
8
-
9
- **Orchestrator-only stage** — no agent delegation. Workflow Planning is meta-planning: the orchestrator synthesizes all prior context (requirements, stories, reverse engineering) to determine which stages to execute and at what depth. Delegating this work would be circular, as the output of this stage drives all subsequent delegation decisions. The orchestrator executes all steps directly.
10
-
11
- ## Step 1: Load All Prior Context
12
-
13
- ### 1.1 Load Reverse Engineering Artifacts (if brownfield)
14
- - architecture.md
15
- - component-inventory.md
16
- - technology-stack.md
17
- - dependencies.md
18
-
19
- ### 1.2 Load Requirements Analysis
20
- - requirements.md (includes intent analysis)
21
- - requirement-verification-questions.md (with answers)
22
-
23
- ### 1.3 Load User Stories (if executed)
24
- - stories.md
25
- - personas.md
26
-
27
- ## Step 2: Detailed Scope and Impact Analysis
28
-
29
- **Now that we have complete context (requirements + stories), perform detailed analysis:**
30
-
31
- ### 2.1 Transformation Scope Detection (Brownfield Only)
32
-
33
- **IF brownfield project**, analyze transformation scope:
34
-
35
- #### Architectural Transformation
36
- - **Single component change** vs **architectural transformation**
37
- - **Infrastructure changes** vs **application changes**
38
- - **Deployment model changes** (Lambda→Container, EC2→Serverless, etc.)
39
-
40
- #### Related Component Identification
41
- For transformations, identify:
42
- - **Infrastructure code** that needs updates
43
- - **CDK stacks** requiring changes
44
- - **API Gateway** configurations
45
- - **Load balancer** requirements
46
- - **Networking** changes needed
47
- - **Monitoring/logging** adaptations
48
-
49
- #### Cross-Package Impact
50
- - **CDK infrastructure** packages requiring updates
51
- - **Shared models** needing version updates
52
- - **Client libraries** requiring endpoint changes
53
- - **Test packages** needing new test scenarios
54
-
55
- ### 2.2 Change Impact Assessment
56
-
57
- #### Impact Areas
58
- 1. **User-facing changes**: Does this affect user experience?
59
- 2. **Structural changes**: Does this change system architecture?
60
- 3. **Data model changes**: Does this affect database schemas or data structures?
61
- 4. **API changes**: Does this affect interfaces or contracts?
62
- 5. **NFR impact**: Does this affect performance, security, or scalability?
63
-
64
- #### Application Layer Impact (if applicable)
65
- - **Code changes**: New entry points, adapters, configurations
66
- - **Dependencies**: New libraries, framework changes
67
- - **Configuration**: Environment variables, config files
68
- - **Testing**: Unit tests, integration tests
69
-
70
- #### Infrastructure Layer Impact (if applicable)
71
- - **Deployment model**: Lambda→ECS, EC2→Fargate, etc.
72
- - **Networking**: VPC, security groups, load balancers
73
- - **Storage**: Persistent volumes, shared storage
74
- - **Scaling**: Auto-scaling policies, capacity planning
75
-
76
- #### Operations Layer Impact (if applicable)
77
- - **Monitoring**: CloudWatch, custom metrics, dashboards
78
- - **Logging**: Log aggregation, structured logging
79
- - **Alerting**: Alarm configurations, notification channels
80
- - **Deployment**: CI/CD pipeline changes, rollback strategies
81
-
82
- ### 2.3 Component Relationship Mapping (Brownfield Only)
83
-
84
- **IF brownfield project**, create component dependency graph:
85
-
86
- ```markdown
87
- ## Component Relationships
88
- - **Primary Component**: [Package being changed]
89
- - **Infrastructure Components**: [CDK/Terraform packages]
90
- - **Shared Components**: [Models, utilities, clients]
91
- - **Dependent Components**: [Services that call this component]
92
- - **Supporting Components**: [Monitoring, logging, deployment]
93
- ```
94
-
95
- For each related component:
96
- - **Change Type**: Major, Minor, Configuration-only
97
- - **Change Reason**: Direct dependency, deployment model, networking
98
- - **Change Priority**: Critical, Important, Optional
99
-
100
- ### 2.4 Risk Assessment
101
-
102
- Evaluate risk level:
103
- 1. **Low**: Isolated change, easy rollback, well-understood
104
- 2. **Medium**: Multiple components, moderate rollback, some unknowns
105
- 3. **High**: System-wide impact, complex rollback, significant unknowns
106
- 4. **Critical**: Production-critical, difficult rollback, high uncertainty
107
-
108
- ## Step 3: Phase Determination
109
-
110
- ### 3.1 User Stories - Already Executed or Skip?
111
- **Already executed**: Move to next determination
112
- **Not executed - Execute IF**:
113
- - Multiple user personas
114
- - User experience impact
115
- - Acceptance criteria needed
116
- - Team collaboration required
117
-
118
- **Skip IF**:
119
- - Internal refactoring
120
- - Bug fix with clear reproduction
121
- - Technical debt reduction
122
- - Infrastructure changes
123
-
124
- ### 3.2 Application Design - Execute IF:
125
- - New components or services needed
126
- - Component methods and business rules need definition
127
- - Service layer design required
128
- - Component dependencies need clarification
129
-
130
- **Skip IF**:
131
- - Changes within existing component boundaries
132
- - No new components or methods
133
- - Pure implementation changes
134
-
135
- ### 3.3 Design (Units Planning/Generation) - Execute IF:
136
- - New data models or schemas
137
- - API changes or new endpoints
138
- - Complex algorithms or business logic
139
- - State management changes
140
- - Multiple packages require changes
141
- - Infrastructure-as-code updates needed
142
-
143
- **Skip IF**:
144
- - Simple logic changes
145
- - UI-only changes
146
- - Configuration updates
147
- - Straightforward implementations
148
-
149
- ### 3.4 NFR Implementation - Execute IF:
150
- - Performance requirements
151
- - Security considerations
152
- - Scalability concerns
153
- - Monitoring/observability needed
154
-
155
- **Skip IF**:
156
- - Existing NFR setup sufficient
157
- - No new NFR requirements
158
- - Simple changes with no NFR impact
159
-
160
- ## Step 4: Note Adaptive Detail
161
-
162
- **See [depth-levels.md](../common/depth-levels.md) for adaptive depth explanation**
163
-
164
- For each stage that will execute:
165
- - All defined artifacts will be created
166
- - Detail level within artifacts adapts to problem complexity
167
- - Model determines appropriate detail based on problem characteristics
168
-
169
- ## Step 5: Multi-Module Coordination Analysis (Brownfield Only)
170
-
171
- **IF brownfield with multiple modules/packages**, analyze dependencies and determine optimal update strategy:
172
-
173
- ### 5.1 Analyze Module Dependencies
174
- - Examine build system dependencies and dependency manifests
175
- - Identify build-time vs runtime dependencies
176
- - Map API contracts and shared interfaces between modules
177
-
178
- ### 5.2 Determine Update Strategy
179
- Based on dependency analysis, decide:
180
- - **Update sequence**: Which modules must be updated first due to dependencies
181
- - **Parallelization opportunities**: Which modules can be updated simultaneously
182
- - **Coordination requirements**: Version compatibility, API contracts, deployment order
183
- - **Testing strategy**: Per-module vs integrated testing approach
184
- - **Rollback strategy**: Recovery plan if mid-sequence failures occur
185
-
186
- ### 5.3 Document Coordination Plan
187
- ```markdown
188
- ## Module Update Strategy
189
- - **Update Approach**: [Sequential/Parallel/Hybrid]
190
- - **Critical Path**: [Modules that block other updates]
191
- - **Coordination Points**: [Shared APIs, infrastructure, data contracts]
192
- - **Testing Checkpoints**: [When to validate integration]
193
- ```
194
-
195
- Identify for each affected module:
196
- - **Update priority**: Must-update-first vs can-update-later
197
- - **Dependency constraints**: What it depends on, what depends on it
198
- - **Change scope**: Major (breaking), Minor (compatible), Patch (fixes)
199
-
200
- ## Step 6: Generate Workflow Visualization
201
-
202
- Create Mermaid flowchart showing:
203
- - All phases in sequence
204
- - EXECUTE or SKIP decision for each conditional phase
205
- - Proper styling for each phase state
206
-
207
- **Styling rules** (add after flowchart):
208
- ```
209
- style WD fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
210
- style CP fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
211
- style CG fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
212
- style BT fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
213
- style US fill:#BDBDBD,stroke:#424242,stroke-width:2px,stroke-dasharray: 5 5,color:#000
214
- style Start fill:#CE93D8,stroke:#6A1B9A,stroke-width:3px,color:#000
215
- style End fill:#CE93D8,stroke:#6A1B9A,stroke-width:3px,color:#000
216
-
217
- linkStyle default stroke:#333,stroke-width:2px
218
- ```
219
-
220
- **Style Guidelines**:
221
- - Completed/Always execute: `fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff` (Material Green with white text)
222
- - Conditional EXECUTE: `fill:#FFA726,stroke:#E65100,stroke-width:3px,stroke-dasharray: 5 5,color:#000` (Material Orange with black text)
223
- - Conditional SKIP: `fill:#BDBDBD,stroke:#424242,stroke-width:2px,stroke-dasharray: 5 5,color:#000` (Material Gray with black text)
224
- - Start/End: `fill:#CE93D8,stroke:#6A1B9A,stroke-width:3px,color:#000` (Material Purple with black text)
225
- - Phase containers: Use lighter Material colors (INCEPTION: #BBDEFB, CONSTRUCTION: #C8E6C9, OPERATIONS: #FFF59D)
226
-
227
- ## Step 7: Create Execution Plan Document
228
-
229
- Create `aidlc-docs/inception/plans/execution-plan.md`:
230
-
231
- ```markdown
232
- # Execution Plan
233
-
234
- ## Detailed Analysis Summary
235
-
236
- ### Transformation Scope (Brownfield Only)
237
- - **Transformation Type**: [Single component/Architectural/Infrastructure]
238
- - **Primary Changes**: [Description]
239
- - **Related Components**: [List]
240
-
241
- ### Change Impact Assessment
242
- - **User-facing changes**: [Yes/No - Description]
243
- - **Structural changes**: [Yes/No - Description]
244
- - **Data model changes**: [Yes/No - Description]
245
- - **API changes**: [Yes/No - Description]
246
- - **NFR impact**: [Yes/No - Description]
247
-
248
- ### Component Relationships (Brownfield Only)
249
- [Component dependency graph]
250
-
251
- ### Risk Assessment
252
- - **Risk Level**: [Low/Medium/High/Critical]
253
- - **Rollback Complexity**: [Easy/Moderate/Difficult]
254
- - **Testing Complexity**: [Simple/Moderate/Complex]
255
-
256
- ## Workflow Visualization
257
-
258
- ```mermaid
259
- flowchart TD
260
- Start(["User Request"])
261
-
262
- subgraph INCEPTION["🔵 INCEPTION PHASE"]
263
- WD["Workspace Detection<br/><b>STATUS</b>"]
264
- RE["Reverse Engineering<br/><b>STATUS</b>"]
265
- RA["Requirements Analysis<br/><b>STATUS</b>"]
266
- US["User Stories<br/><b>STATUS</b>"]
267
- WP["Workflow Planning<br/><b>STATUS</b>"]
268
- AD["Application Design<br/><b>STATUS</b>"]
269
- UP["Units Planning<br/><b>STATUS</b>"]
270
- UG["Units Generation<br/><b>STATUS</b>"]
271
- end
272
-
273
- subgraph CONSTRUCTION["🟢 CONSTRUCTION PHASE"]
274
- FD["Functional Design<br/><b>STATUS</b>"]
275
- NFRA["NFR Requirements<br/><b>STATUS</b>"]
276
- NFRD["NFR Design<br/><b>STATUS</b>"]
277
- ID["Infrastructure Design<br/><b>STATUS</b>"]
278
- CP["Code Planning<br/><b>EXECUTE</b>"]
279
- CG["Code Generation<br/><b>EXECUTE</b>"]
280
- BT["Build and Test<br/><b>EXECUTE</b>"]
281
- end
282
-
283
- subgraph OPERATIONS["🟡 OPERATIONS PHASE"]
284
- OPS["Operations<br/><b>PLACEHOLDER</b>"]
285
- end
286
-
287
- Start --> WD
288
- WD --> RA
289
- RA --> WP
290
- WP --> CP
291
- CP --> CG
292
- CG --> BT
293
- BT --> End(["Complete"])
294
-
295
- %% Replace STATUS with COMPLETED, SKIP, EXECUTE as appropriate
296
- %% Apply styling based on status
297
- ```
298
-
299
- **Note**: Replace STATUS placeholders with actual phase status (COMPLETED/SKIP/EXECUTE) and apply appropriate styling
300
-
301
- ## Phases to Execute
302
-
303
- ### 🔵 INCEPTION PHASE
304
- - [x] Workspace Detection (COMPLETED)
305
- - [x] Reverse Engineering (COMPLETED/SKIPPED)
306
- - [x] Requirements Elaboration (COMPLETED)
307
- - [x] User Stories (COMPLETED/SKIPPED)
308
- - [x] Execution Plan (IN PROGRESS)
309
- - [ ] Application Design - [EXECUTE/SKIP]
310
- - **Rationale**: [Why executing or skipping]
311
- - [ ] Units Planning - [EXECUTE/SKIP]
312
- - **Rationale**: [Why executing or skipping]
313
- - [ ] Units Generation - [EXECUTE/SKIP]
314
- - **Rationale**: [Why executing or skipping]
315
-
316
- ### 🟢 CONSTRUCTION PHASE
317
- - [ ] Functional Design - [EXECUTE/SKIP]
318
- - **Rationale**: [Why executing or skipping]
319
- - [ ] NFR Requirements - [EXECUTE/SKIP]
320
- - **Rationale**: [Why executing or skipping]
321
- - [ ] NFR Design - [EXECUTE/SKIP]
322
- - **Rationale**: [Why executing or skipping]
323
- - [ ] Infrastructure Design - [EXECUTE/SKIP]
324
- - **Rationale**: [Why executing or skipping]
325
- - [ ] Code Planning - EXECUTE (ALWAYS)
326
- - **Rationale**: Implementation approach needed
327
- - [ ] Code Generation - EXECUTE (ALWAYS)
328
- - **Rationale**: Code implementation needed
329
- - [ ] Build and Test - EXECUTE (ALWAYS)
330
- - **Rationale**: Build, test, and verification needed
331
-
332
- ### 🟡 OPERATIONS PHASE
333
- - [ ] Operations - PLACEHOLDER
334
- - **Rationale**: Future deployment and monitoring workflows
335
-
336
- ## Package Change Sequence (Brownfield Only)
337
- [If applicable, list package update sequence with dependencies]
338
-
339
- ## Estimated Timeline
340
- - **Total Phases**: [Number]
341
- - **Estimated Duration**: [Time estimate]
342
-
343
- ## Success Criteria
344
- - **Primary Goal**: [Main objective]
345
- - **Key Deliverables**: [List]
346
- - **Quality Gates**: [List]
347
-
348
- [IF brownfield]
349
- - **Integration Testing**: All components working together
350
- - **Operational Readiness**: Monitoring, logging, alerting working
351
- ```
352
-
353
- ## Step 8: MANDATORY: Initialize State Tracking
354
-
355
- **MANDATORY**: Update BOTH state files in the SAME interaction:
356
- 1. Update `aidlc-docs/{workflow-id}/aidlc-state.md`:
357
-
358
- ```markdown
359
- # AI-DLC State Tracking
360
-
361
- ## Project Information
362
- - **Project Type**: [Greenfield/Brownfield]
363
- - **Start Date**: [ISO timestamp]
364
- - **Current Stage**: INCEPTION - Workflow Planning
365
-
366
- ## Execution Plan Summary
367
- - **Total Stages**: [Number]
368
- - **Stages to Execute**: [List]
369
- - **Stages to Skip**: [List with reasons]
370
-
371
- ## Stage Progress
372
-
373
- ### 🔵 INCEPTION PHASE
374
- - [x] Workspace Detection
375
- - [x] Reverse Engineering (if applicable)
376
- - [x] Requirements Analysis
377
- - [x] User Stories (if applicable)
378
- - [x] Workflow Planning
379
- - [ ] Application Design - [EXECUTE/SKIP]
380
- - [ ] Units Planning - [EXECUTE/SKIP]
381
- - [ ] Units Generation - [EXECUTE/SKIP]
382
-
383
- ### 🟢 CONSTRUCTION PHASE
384
- - [ ] Functional Design - [EXECUTE/SKIP]
385
- - [ ] NFR Requirements - [EXECUTE/SKIP]
386
- - [ ] NFR Design - [EXECUTE/SKIP]
387
- - [ ] Infrastructure Design - [EXECUTE/SKIP]
388
- - [ ] Code Planning - EXECUTE
389
- - [ ] Code Generation - EXECUTE
390
- - [ ] Build and Test - EXECUTE
391
-
392
- ### 🟡 OPERATIONS PHASE
393
- - [ ] Operations - PLACEHOLDER
394
-
395
- ## Current Status
396
- - **Lifecycle Phase**: INCEPTION
397
- - **Current Stage**: Workflow Planning Complete
398
- - **Next Stage**: [Next stage to execute]
399
- - **Status**: Ready to proceed
400
- ```
401
-
402
- 2. Update `aidlc-docs/{workflow-id}/checkpoint.json` — initialize workflow state with all stage statuses, current_inception_stage set to next stage after Workflow Planning
403
- - **Do NOT proceed to the next stage without completing this step**
404
-
405
- ## Step 9: Present Plan to User
406
-
407
- ```markdown
408
- # 📋 Workflow Planning Complete
409
-
410
- I've created a comprehensive execution plan based on:
411
- - Your request: [Summary]
412
- - Existing system: [Summary if brownfield]
413
- - Requirements: [Summary if executed]
414
- - User stories: [Summary if executed]
415
-
416
- **Detailed Analysis**:
417
- - Risk level: [Level]
418
- - Impact: [Summary of key impacts]
419
- - Components affected: [List]
420
-
421
- **Recommended Execution Plan**:
422
-
423
- I recommend executing [X] stages:
424
-
425
- 🔵 **INCEPTION PHASE:**
426
- 1. [Stage name] - *Rationale:* [Why executing]
427
- 2. [Stage name] - *Rationale:* [Why executing]
428
- ...
429
-
430
- 🟢 **CONSTRUCTION PHASE:**
431
- 3. [Stage name] - *Rationale:* [Why executing]
432
- 4. [Stage name] - *Rationale:* [Why executing]
433
- ...
434
-
435
- I recommend skipping [Y] stages:
436
-
437
- 🔵 **INCEPTION PHASE:**
438
- 1. [Stage name] - *Rationale:* [Why skipping]
439
- 2. [Stage name] - *Rationale:* [Why skipping]
440
- ...
441
-
442
- 🟢 **CONSTRUCTION PHASE:**
443
- 3. [Stage name] - *Rationale:* [Why skipping]
444
- 4. [Stage name] - *Rationale:* [Why skipping]
445
- ...
446
-
447
- [IF brownfield with multiple packages]
448
- **Recommended Package Update Sequence**:
449
- 1. [Package] - [Reason]
450
- 2. [Package] - [Reason]
451
- ...
452
-
453
- **Estimated Timeline**: [Duration]
454
-
455
- > **📋 <u>**REVIEW REQUIRED:**</u>**
456
- > Please examine the execution plan at: `aidlc-docs/inception/plans/execution-plan.md`
457
-
458
- > **🚀 <u>**WHAT'S NEXT?**</u>**
459
- >
460
- > **You may:**
461
- >
462
- > 🔧 **Request Changes** - Ask for modifications to the execution plan if required
463
- > [IF any stages are skipped:]
464
- > 📝 **Add Skipped Stages** - Choose to include stages currently marked as SKIP
465
- > ✅ **Approve & Continue** - Approve plan and proceed to **[Next Stage Name]**
466
- ```
467
-
468
- ## Step 10: Handle User Response
469
-
470
- - **If approved**: Proceed to next stage in execution plan
471
- - **If changes requested**: Update execution plan and re-confirm
472
- - **If user wants to force include/exclude stages**: Update plan accordingly
473
-
474
- ## Step 11: Log Interaction
475
-
476
- Log in `aidlc-docs/audit.md`:
477
-
478
- ```markdown
479
- ## Workflow Planning - Approval
480
- **Timestamp**: [ISO timestamp]
481
- **AI Prompt**: "Ready to proceed with this plan?"
482
- **User Response**: "[User's COMPLETE RAW response]"
483
- **Status**: [Approved/Changes Requested]
484
- **Context**: Workflow plan created with [X] stages to execute
485
-
486
- ---
487
- ```
1
+ # Workflow Planning
2
+
3
+ **Purpose**: Determine which phases to execute and create comprehensive execution plan
4
+
5
+ **Always Execute**: This phase always runs after understanding requirements and scope
6
+
7
+ ## Execution Model
8
+
9
+ **Orchestrator-only stage** — no agent delegation. Workflow Planning is meta-planning: the orchestrator synthesizes all prior context (requirements, stories, reverse engineering) to determine which stages to execute and at what depth. Delegating this work would be circular, as the output of this stage drives all subsequent delegation decisions. The orchestrator executes all steps directly.
10
+
11
+ ## Step 1: Load All Prior Context
12
+
13
+ ### 1.1 Load Reverse Engineering Artifacts (if brownfield)
14
+ - architecture.md
15
+ - component-inventory.md
16
+ - technology-stack.md
17
+ - dependencies.md
18
+
19
+ ### 1.2 Load Requirements Analysis
20
+ - requirements.md (includes intent analysis)
21
+ - requirements-analysis-questions.md (with answers)
22
+
23
+ ### 1.3 Load User Stories (if executed)
24
+ - stories.md
25
+ - personas.md
26
+
27
+ ## Step 2: Detailed Scope and Impact Analysis
28
+
29
+ **Now that we have complete context (requirements + stories), perform detailed analysis:**
30
+
31
+ ### 2.1 Transformation Scope Detection (Brownfield Only)
32
+
33
+ **IF brownfield project**, analyze transformation scope:
34
+
35
+ #### Architectural Transformation
36
+ - **Single component change** vs **architectural transformation**
37
+ - **Infrastructure changes** vs **application changes**
38
+ - **Deployment model changes** (Lambda→Container, EC2→Serverless, etc.)
39
+
40
+ #### Related Component Identification
41
+ For transformations, identify:
42
+ - **Infrastructure code** that needs updates
43
+ - **CDK stacks** requiring changes
44
+ - **API Gateway** configurations
45
+ - **Load balancer** requirements
46
+ - **Networking** changes needed
47
+ - **Monitoring/logging** adaptations
48
+
49
+ #### Cross-Package Impact
50
+ - **CDK infrastructure** packages requiring updates
51
+ - **Shared models** needing version updates
52
+ - **Client libraries** requiring endpoint changes
53
+ - **Test packages** needing new test scenarios
54
+
55
+ ### 2.2 Change Impact Assessment
56
+
57
+ #### Impact Areas
58
+ 1. **User-facing changes**: Does this affect user experience?
59
+ 2. **Structural changes**: Does this change system architecture?
60
+ 3. **Data model changes**: Does this affect database schemas or data structures?
61
+ 4. **API changes**: Does this affect interfaces or contracts?
62
+ 5. **NFR impact**: Does this affect performance, security, or scalability?
63
+
64
+ #### Application Layer Impact (if applicable)
65
+ - **Code changes**: New entry points, adapters, configurations
66
+ - **Dependencies**: New libraries, framework changes
67
+ - **Configuration**: Environment variables, config files
68
+ - **Testing**: Unit tests, integration tests
69
+
70
+ #### Infrastructure Layer Impact (if applicable)
71
+ - **Deployment model**: Lambda→ECS, EC2→Fargate, etc.
72
+ - **Networking**: VPC, security groups, load balancers
73
+ - **Storage**: Persistent volumes, shared storage
74
+ - **Scaling**: Auto-scaling policies, capacity planning
75
+
76
+ #### Operations Layer Impact (if applicable)
77
+ - **Monitoring**: CloudWatch, custom metrics, dashboards
78
+ - **Logging**: Log aggregation, structured logging
79
+ - **Alerting**: Alarm configurations, notification channels
80
+ - **Deployment**: CI/CD pipeline changes, rollback strategies
81
+
82
+ ### 2.3 Component Relationship Mapping (Brownfield Only)
83
+
84
+ **IF brownfield project**, create component dependency graph:
85
+
86
+ ```markdown
87
+ ## Component Relationships
88
+ - **Primary Component**: [Package being changed]
89
+ - **Infrastructure Components**: [CDK/Terraform packages]
90
+ - **Shared Components**: [Models, utilities, clients]
91
+ - **Dependent Components**: [Services that call this component]
92
+ - **Supporting Components**: [Monitoring, logging, deployment]
93
+ ```
94
+
95
+ For each related component:
96
+ - **Change Type**: Major, Minor, Configuration-only
97
+ - **Change Reason**: Direct dependency, deployment model, networking
98
+ - **Change Priority**: Critical, Important, Optional
99
+
100
+ ### 2.4 Risk Assessment
101
+
102
+ Evaluate risk level:
103
+ 1. **Low**: Isolated change, easy rollback, well-understood
104
+ 2. **Medium**: Multiple components, moderate rollback, some unknowns
105
+ 3. **High**: System-wide impact, complex rollback, significant unknowns
106
+ 4. **Critical**: Production-critical, difficult rollback, high uncertainty
107
+
108
+ ## Step 3: Phase Determination
109
+
110
+ ### 3.1 User Stories - Already Executed or Skip?
111
+ **Already executed**: Move to next determination
112
+ **Not executed - Execute IF**:
113
+ - Multiple user personas
114
+ - User experience impact
115
+ - Acceptance criteria needed
116
+ - Team collaboration required
117
+
118
+ **Skip IF**:
119
+ - Internal refactoring
120
+ - Bug fix with clear reproduction
121
+ - Technical debt reduction
122
+ - Infrastructure changes
123
+
124
+ ### 3.2 Application Design - Execute IF:
125
+ - New components or services needed
126
+ - Component methods and business rules need definition
127
+ - Service layer design required
128
+ - Component dependencies need clarification
129
+
130
+ **Skip IF**:
131
+ - Changes within existing component boundaries
132
+ - No new components or methods
133
+ - Pure implementation changes
134
+
135
+ ### 3.3 Design (Units Planning/Generation) - Execute IF:
136
+ - New data models or schemas
137
+ - API changes or new endpoints
138
+ - Complex algorithms or business logic
139
+ - State management changes
140
+ - Multiple packages require changes
141
+ - Infrastructure-as-code updates needed
142
+
143
+ **Skip IF**:
144
+ - Simple logic changes
145
+ - UI-only changes
146
+ - Configuration updates
147
+ - Straightforward implementations
148
+
149
+ ### 3.4 NFR Implementation - Execute IF:
150
+ - Performance requirements
151
+ - Security considerations
152
+ - Scalability concerns
153
+ - Monitoring/observability needed
154
+
155
+ **Skip IF**:
156
+ - Existing NFR setup sufficient
157
+ - No new NFR requirements
158
+ - Simple changes with no NFR impact
159
+
160
+ ## Step 4: Note Adaptive Detail
161
+
162
+ **See [depth-levels.md](../common/depth-levels.md) for adaptive depth explanation**
163
+
164
+ For each stage that will execute:
165
+ - All defined artifacts will be created
166
+ - Detail level within artifacts adapts to problem complexity
167
+ - Model determines appropriate detail based on problem characteristics
168
+
169
+ ## Step 5: Multi-Module Coordination Analysis (Brownfield Only)
170
+
171
+ **IF brownfield with multiple modules/packages**, analyze dependencies and determine optimal update strategy:
172
+
173
+ ### 5.1 Analyze Module Dependencies
174
+ - Examine build system dependencies and dependency manifests
175
+ - Identify build-time vs runtime dependencies
176
+ - Map API contracts and shared interfaces between modules
177
+
178
+ ### 5.2 Determine Update Strategy
179
+ Based on dependency analysis, decide:
180
+ - **Update sequence**: Which modules must be updated first due to dependencies
181
+ - **Parallelization opportunities**: Which modules can be updated simultaneously
182
+ - **Coordination requirements**: Version compatibility, API contracts, deployment order
183
+ - **Testing strategy**: Per-module vs integrated testing approach
184
+ - **Rollback strategy**: Recovery plan if mid-sequence failures occur
185
+
186
+ ### 5.3 Document Coordination Plan
187
+ ```markdown
188
+ ## Module Update Strategy
189
+ - **Update Approach**: [Sequential/Parallel/Hybrid]
190
+ - **Critical Path**: [Modules that block other updates]
191
+ - **Coordination Points**: [Shared APIs, infrastructure, data contracts]
192
+ - **Testing Checkpoints**: [When to validate integration]
193
+ ```
194
+
195
+ Identify for each affected module:
196
+ - **Update priority**: Must-update-first vs can-update-later
197
+ - **Dependency constraints**: What it depends on, what depends on it
198
+ - **Change scope**: Major (breaking), Minor (compatible), Patch (fixes)
199
+
200
+ ## Step 6: Generate Workflow Visualization
201
+
202
+ Create Mermaid flowchart showing:
203
+ - All phases in sequence
204
+ - EXECUTE or SKIP decision for each conditional phase
205
+ - Proper styling for each phase state
206
+
207
+ **Styling rules** (add after flowchart):
208
+ ```
209
+ style WD fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
210
+ style CP fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
211
+ style CG fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
212
+ style BT fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
213
+ style US fill:#BDBDBD,stroke:#424242,stroke-width:2px,stroke-dasharray: 5 5,color:#000
214
+ style Start fill:#CE93D8,stroke:#6A1B9A,stroke-width:3px,color:#000
215
+ style End fill:#CE93D8,stroke:#6A1B9A,stroke-width:3px,color:#000
216
+
217
+ linkStyle default stroke:#333,stroke-width:2px
218
+ ```
219
+
220
+ **Style Guidelines**:
221
+ - Completed/Always execute: `fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff` (Material Green with white text)
222
+ - Conditional EXECUTE: `fill:#FFA726,stroke:#E65100,stroke-width:3px,stroke-dasharray: 5 5,color:#000` (Material Orange with black text)
223
+ - Conditional SKIP: `fill:#BDBDBD,stroke:#424242,stroke-width:2px,stroke-dasharray: 5 5,color:#000` (Material Gray with black text)
224
+ - Start/End: `fill:#CE93D8,stroke:#6A1B9A,stroke-width:3px,color:#000` (Material Purple with black text)
225
+ - Phase containers: Use lighter Material colors (INCEPTION: #BBDEFB, CONSTRUCTION: #C8E6C9, OPERATIONS: #FFF59D)
226
+
227
+ ## Step 7: Create Execution Plan Document
228
+
229
+ Create `aidlc-docs/inception/plans/execution-plan.md`:
230
+
231
+ ```markdown
232
+ # Execution Plan
233
+
234
+ ## Detailed Analysis Summary
235
+
236
+ ### Transformation Scope (Brownfield Only)
237
+ - **Transformation Type**: [Single component/Architectural/Infrastructure]
238
+ - **Primary Changes**: [Description]
239
+ - **Related Components**: [List]
240
+
241
+ ### Change Impact Assessment
242
+ - **User-facing changes**: [Yes/No - Description]
243
+ - **Structural changes**: [Yes/No - Description]
244
+ - **Data model changes**: [Yes/No - Description]
245
+ - **API changes**: [Yes/No - Description]
246
+ - **NFR impact**: [Yes/No - Description]
247
+
248
+ ### Component Relationships (Brownfield Only)
249
+ [Component dependency graph]
250
+
251
+ ### Risk Assessment
252
+ - **Risk Level**: [Low/Medium/High/Critical]
253
+ - **Rollback Complexity**: [Easy/Moderate/Difficult]
254
+ - **Testing Complexity**: [Simple/Moderate/Complex]
255
+
256
+ ## Workflow Visualization
257
+
258
+ ```mermaid
259
+ flowchart TD
260
+ Start(["User Request"])
261
+
262
+ subgraph INCEPTION["🔵 INCEPTION PHASE"]
263
+ WD["Workspace Detection<br/><b>STATUS</b>"]
264
+ RE["Reverse Engineering<br/><b>STATUS</b>"]
265
+ RA["Requirements Analysis<br/><b>STATUS</b>"]
266
+ US["User Stories<br/><b>STATUS</b>"]
267
+ WP["Workflow Planning<br/><b>STATUS</b>"]
268
+ AD["Application Design<br/><b>STATUS</b>"]
269
+ UP["Units Planning<br/><b>STATUS</b>"]
270
+ UG["Units Generation<br/><b>STATUS</b>"]
271
+ end
272
+
273
+ subgraph CONSTRUCTION["🟢 CONSTRUCTION PHASE"]
274
+ FD["Functional Design<br/><b>STATUS</b>"]
275
+ NFRA["NFR Requirements<br/><b>STATUS</b>"]
276
+ NFRD["NFR Design<br/><b>STATUS</b>"]
277
+ ID["Infrastructure Design<br/><b>STATUS</b>"]
278
+ CP["Code Planning<br/><b>EXECUTE</b>"]
279
+ CG["Code Generation<br/><b>EXECUTE</b>"]
280
+ BT["Build and Test<br/><b>EXECUTE</b>"]
281
+ end
282
+
283
+ subgraph OPERATIONS["🟡 OPERATIONS PHASE"]
284
+ OPS["Operations<br/><b>PLACEHOLDER</b>"]
285
+ end
286
+
287
+ Start --> WD
288
+ WD --> RA
289
+ RA --> WP
290
+ WP --> CP
291
+ CP --> CG
292
+ CG --> BT
293
+ BT --> End(["Complete"])
294
+
295
+ %% Replace STATUS with COMPLETED, SKIP, EXECUTE as appropriate
296
+ %% Apply styling based on status
297
+ ```
298
+
299
+ **Note**: Replace STATUS placeholders with actual phase status (COMPLETED/SKIP/EXECUTE) and apply appropriate styling
300
+
301
+ ## Phases to Execute
302
+
303
+ ### 🔵 INCEPTION PHASE
304
+ - [x] Workspace Detection (COMPLETED)
305
+ - [x] Reverse Engineering (COMPLETED/SKIPPED)
306
+ - [x] Requirements Elaboration (COMPLETED)
307
+ - [x] User Stories (COMPLETED/SKIPPED)
308
+ - [x] Execution Plan (IN PROGRESS)
309
+ - [ ] Application Design - [EXECUTE/SKIP]
310
+ - **Rationale**: [Why executing or skipping]
311
+ - [ ] Units Planning - [EXECUTE/SKIP]
312
+ - **Rationale**: [Why executing or skipping]
313
+ - [ ] Units Generation - [EXECUTE/SKIP]
314
+ - **Rationale**: [Why executing or skipping]
315
+
316
+ ### 🟢 CONSTRUCTION PHASE
317
+ - [ ] Functional Design - [EXECUTE/SKIP]
318
+ - **Rationale**: [Why executing or skipping]
319
+ - [ ] NFR Requirements - [EXECUTE/SKIP]
320
+ - **Rationale**: [Why executing or skipping]
321
+ - [ ] NFR Design - [EXECUTE/SKIP]
322
+ - **Rationale**: [Why executing or skipping]
323
+ - [ ] Infrastructure Design - [EXECUTE/SKIP]
324
+ - **Rationale**: [Why executing or skipping]
325
+ - [ ] Code Planning - EXECUTE (ALWAYS)
326
+ - **Rationale**: Implementation approach needed
327
+ - [ ] Code Generation - EXECUTE (ALWAYS)
328
+ - **Rationale**: Code implementation needed
329
+ - [ ] Build and Test - EXECUTE (ALWAYS)
330
+ - **Rationale**: Build, test, and verification needed
331
+
332
+ ### 🟡 OPERATIONS PHASE
333
+ - [ ] Operations - PLACEHOLDER
334
+ - **Rationale**: Future deployment and monitoring workflows
335
+
336
+ ## Package Change Sequence (Brownfield Only)
337
+ [If applicable, list package update sequence with dependencies]
338
+
339
+ ## Estimated Timeline
340
+ - **Total Phases**: [Number]
341
+ - **Estimated Duration**: [Time estimate]
342
+
343
+ ## Success Criteria
344
+ - **Primary Goal**: [Main objective]
345
+ - **Key Deliverables**: [List]
346
+ - **Quality Gates**: [List]
347
+
348
+ [IF brownfield]
349
+ - **Integration Testing**: All components working together
350
+ - **Operational Readiness**: Monitoring, logging, alerting working
351
+ ```
352
+
353
+ ## Step 8: MANDATORY: Initialize State Tracking
354
+
355
+ **MANDATORY**: Update BOTH state files in the SAME interaction:
356
+ 1. Update `aidlc-docs/{workflow-id}/aidlc-state.md`:
357
+
358
+ ```markdown
359
+ # AI-DLC State Tracking
360
+
361
+ ## Project Information
362
+ - **Project Type**: [Greenfield/Brownfield]
363
+ - **Start Date**: [ISO timestamp]
364
+ - **Current Stage**: INCEPTION - Workflow Planning
365
+
366
+ ## Execution Plan Summary
367
+ - **Total Stages**: [Number]
368
+ - **Stages to Execute**: [List]
369
+ - **Stages to Skip**: [List with reasons]
370
+
371
+ ## Stage Progress
372
+
373
+ ### 🔵 INCEPTION PHASE
374
+ - [x] Workspace Detection
375
+ - [x] Reverse Engineering (if applicable)
376
+ - [x] Requirements Analysis
377
+ - [x] User Stories (if applicable)
378
+ - [x] Workflow Planning
379
+ - [ ] Application Design - [EXECUTE/SKIP]
380
+ - [ ] Units Planning - [EXECUTE/SKIP]
381
+ - [ ] Units Generation - [EXECUTE/SKIP]
382
+
383
+ ### 🟢 CONSTRUCTION PHASE
384
+ - [ ] Functional Design - [EXECUTE/SKIP]
385
+ - [ ] NFR Requirements - [EXECUTE/SKIP]
386
+ - [ ] NFR Design - [EXECUTE/SKIP]
387
+ - [ ] Infrastructure Design - [EXECUTE/SKIP]
388
+ - [ ] Code Planning - EXECUTE
389
+ - [ ] Code Generation - EXECUTE
390
+ - [ ] Build and Test - EXECUTE
391
+
392
+ ### 🟡 OPERATIONS PHASE
393
+ - [ ] Operations - PLACEHOLDER
394
+
395
+ ## Current Status
396
+ - **Lifecycle Phase**: INCEPTION
397
+ - **Current Stage**: Workflow Planning Complete
398
+ - **Next Stage**: [Next stage to execute]
399
+ - **Status**: Ready to proceed
400
+ ```
401
+
402
+ 2. Update `aidlc-docs/{workflow-id}/checkpoint.json` — initialize workflow state with all stage statuses, current_inception_stage set to next stage after Workflow Planning
403
+ - **Do NOT proceed to the next stage without completing this step**
404
+
405
+ ## Step 9: Present Plan to User
406
+
407
+ ```markdown
408
+ # 📋 Workflow Planning Complete
409
+
410
+ I've created a comprehensive execution plan based on:
411
+ - Your request: [Summary]
412
+ - Existing system: [Summary if brownfield]
413
+ - Requirements: [Summary if executed]
414
+ - User stories: [Summary if executed]
415
+
416
+ **Detailed Analysis**:
417
+ - Risk level: [Level]
418
+ - Impact: [Summary of key impacts]
419
+ - Components affected: [List]
420
+
421
+ **Recommended Execution Plan**:
422
+
423
+ I recommend executing [X] stages:
424
+
425
+ 🔵 **INCEPTION PHASE:**
426
+ 1. [Stage name] - *Rationale:* [Why executing]
427
+ 2. [Stage name] - *Rationale:* [Why executing]
428
+ ...
429
+
430
+ 🟢 **CONSTRUCTION PHASE:**
431
+ 3. [Stage name] - *Rationale:* [Why executing]
432
+ 4. [Stage name] - *Rationale:* [Why executing]
433
+ ...
434
+
435
+ I recommend skipping [Y] stages:
436
+
437
+ 🔵 **INCEPTION PHASE:**
438
+ 1. [Stage name] - *Rationale:* [Why skipping]
439
+ 2. [Stage name] - *Rationale:* [Why skipping]
440
+ ...
441
+
442
+ 🟢 **CONSTRUCTION PHASE:**
443
+ 3. [Stage name] - *Rationale:* [Why skipping]
444
+ 4. [Stage name] - *Rationale:* [Why skipping]
445
+ ...
446
+
447
+ [IF brownfield with multiple packages]
448
+ **Recommended Package Update Sequence**:
449
+ 1. [Package] - [Reason]
450
+ 2. [Package] - [Reason]
451
+ ...
452
+
453
+ **Estimated Timeline**: [Duration]
454
+
455
+ > **📋 <u>**REVIEW REQUIRED:**</u>**
456
+ > Please examine the execution plan at: `aidlc-docs/inception/plans/execution-plan.md`
457
+
458
+ > **🚀 <u>**WHAT'S NEXT?**</u>**
459
+ >
460
+ > **You may:**
461
+ >
462
+ > 🔧 **Request Changes** - Ask for modifications to the execution plan if required
463
+ > [IF any stages are skipped:]
464
+ > 📝 **Add Skipped Stages** - Choose to include stages currently marked as SKIP
465
+ > ✅ **Approve & Continue** - Approve plan and proceed to **[Next Stage Name]**
466
+ ```
467
+
468
+ ## Step 10: Handle User Response
469
+
470
+ - **If approved**: Proceed to next stage in execution plan
471
+ - **If changes requested**: Update execution plan and re-confirm
472
+ - **If user wants to force include/exclude stages**: Update plan accordingly
473
+
474
+ ## Step 11: Log Interaction
475
+
476
+ Log in `aidlc-docs/audit.md`:
477
+
478
+ ```markdown
479
+ ## Workflow Planning - Approval
480
+ **Timestamp**: [ISO timestamp]
481
+ **AI Prompt**: "Ready to proceed with this plan?"
482
+ **User Response**: "[User's COMPLETE RAW response]"
483
+ **Status**: [Approved/Changes Requested]
484
+ **Context**: Workflow plan created with [X] stages to execute
485
+
486
+ ---
487
+ ```