olympus-ai 4.5.13 → 4.5.14

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 (49) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/dist/cli/index.js +63 -27
  3. package/dist/cli/index.js.map +1 -1
  4. package/dist/hooks/olympus-hooks.cjs +257 -257
  5. package/dist/installer/hooks.d.ts +47 -14
  6. package/dist/installer/hooks.d.ts.map +1 -1
  7. package/dist/installer/hooks.js +45 -77
  8. package/dist/installer/hooks.js.map +1 -1
  9. package/dist/installer/index.d.ts +8 -7
  10. package/dist/installer/index.d.ts.map +1 -1
  11. package/dist/installer/index.js +49 -46
  12. package/dist/installer/index.js.map +1 -1
  13. package/package.json +1 -1
  14. package/resources/config/risk-keywords.json +5 -5
  15. package/resources/rules/common/ascii-diagram-standards.md +115 -115
  16. package/resources/rules/common/content-validation.md +131 -131
  17. package/resources/rules/common/error-handling.md +430 -430
  18. package/resources/rules/common/markdown-formatting.md +170 -170
  19. package/resources/rules/common/overconfidence-prevention.md +100 -100
  20. package/resources/rules/common/pathway-behaviors.json +60 -60
  21. package/resources/rules/common/pathway-behaviors.md +100 -100
  22. package/resources/rules/common/process-overview.md +157 -157
  23. package/resources/rules/common/terminal-formatting.md +161 -161
  24. package/resources/rules/common/terminology.md +189 -189
  25. package/resources/rules/common/welcome-message.md +118 -118
  26. package/resources/rules/common/workflow-changes.md +285 -285
  27. package/resources/rules/construction/bolt-planning.md +153 -153
  28. package/resources/rules/construction/bolt-review.md +143 -143
  29. package/resources/rules/construction/build-and-test.md +527 -527
  30. package/resources/rules/construction/code-generation.md +414 -414
  31. package/resources/rules/construction/documentation.md +201 -201
  32. package/resources/rules/construction/functional-design.md +135 -135
  33. package/resources/rules/construction/infrastructure-design.md +110 -110
  34. package/resources/rules/construction/nfr-design.md +106 -106
  35. package/resources/rules/construction/nfr-requirements.md +118 -118
  36. package/resources/rules/construction/test-generation.md +112 -112
  37. package/resources/rules/core-workflow.md +196 -196
  38. package/resources/rules/inception/application-design.md +195 -195
  39. package/resources/rules/inception/bolt-planning.md +588 -588
  40. package/resources/rules/inception/reverse-engineering.md +354 -354
  41. package/resources/rules/inception/units-generation.md +505 -505
  42. package/resources/rules/inception/user-stories.md +527 -527
  43. package/resources/rules/inception/workspace-detection.md +82 -82
  44. package/resources/rules/operations/operations.md +19 -19
  45. package/resources/skills/brief/templates/ai-dlc-intent-brief-template.md +149 -149
  46. package/resources/skills/getting-started/SKILL.md +79 -79
  47. package/resources/templates/construction/bolt-spec-template.md +270 -270
  48. package/resources/templates/inception/unit-brief-template.md +188 -188
  49. package/resources/templates/inception/units-template.md +99 -99
@@ -1,135 +1,135 @@
1
- # Functional Design
2
-
3
- ## Purpose
4
- **Detailed business logic design per unit**
5
-
6
- Functional Design focuses on:
7
- - Detailed business logic and algorithms for the unit
8
- - Domain models with entities and relationships
9
- - Detailed business rules, validation logic, and constraints
10
- - Technology-agnostic design (no infrastructure concerns)
11
-
12
- **Note**: This builds upon high-level component design from Application Design (INCEPTION phase)
13
-
14
- ## Prerequisites
15
- - Units Generation must be complete
16
- - Unit of work artifacts must be available
17
- - Application Design recommended (provides high-level component structure)
18
- - Execution plan must indicate Functional Design stage should execute
19
-
20
- ## Agent Delegation Strategy
21
-
22
- **MANDATORY**: Delegate functional design artifact generation (Step 6) to `oracle-medium`. Do NOT generate business logic models and domain entities directly.
23
-
24
- **Execution mode**: Foreground sequential — single coherent design reasoning task per unit.
25
-
26
- **Delegation scope**:
27
- - **Orchestrator retains**: Steps 1-5 (context analysis, plan creation, Q&A, answer collection) and Steps 7-9 (completion message, approval gate, state update).
28
- - **Delegated to `oracle-medium`**: Step 6 (Generate Functional Design Artifacts) — the agent analyzes the unit definition, user answers, and prior context to produce business-logic-model.md, business-rules.md, domain-entities.md, and frontend-components.md (if applicable).
29
-
30
- **If an agent task fails**: Follow the Agent Task Failure Recovery procedure in `error-handling.md` — retry the delegation, never silently do the work yourself.
31
-
32
- **After agent completes**: The orchestrator compiles the agent's output into the artifact files, presents the completion message, and manages the approval gate.
33
-
34
- ## Overview
35
- Design detailed business logic for the unit, technology-agnostic and focused purely on business functions.
36
-
37
- ## Steps to Execute
38
-
39
- ### Step 1: Analyze Unit Context
40
- - Read unit definition from `aidlc-docs/inception/units/unit-of-work.md`
41
- - Read assigned stories from `aidlc-docs/inception/units/unit-of-work-story-map.md`
42
- - Understand unit responsibilities and boundaries
43
-
44
- ### Step 2: Create Functional Design Plan
45
- - Generate plan with checkboxes [] for functional design
46
- - Focus on business logic, domain models, business rules
47
- - Each step should have a checkbox []
48
-
49
- ### Step 3: Generate Context-Appropriate Questions
50
- **DIRECTIVE**: Thoroughly analyze the unit definition and functional design artifacts to identify ALL areas where clarification would improve the functional design. Be proactive in asking questions to ensure comprehensive understanding.
51
-
52
- **CRITICAL**: Default to asking questions when there is ANY ambiguity or missing detail that could affect functional design quality. It's better to ask too many questions than to make incorrect assumptions.
53
-
54
- - EMBED questions using [Answer]: tag format
55
- - Focus on ANY ambiguities, missing information, or areas needing clarification
56
- - Generate questions wherever user input would improve functional design decisions
57
- - **When in doubt, ask the question** - overconfidence leads to poor designs
58
-
59
- **Question categories to consider** (evaluate ALL categories):
60
- - **Business Logic Modeling** - Ask about core entities, workflows, data transformations, and business processes
61
- - **Domain Model** - Ask about domain concepts, entity relationships, data structures, and business objects
62
- - **Business Rules** - Ask about decision rules, validation logic, constraints, and business policies
63
- - **Data Flow** - Ask about data inputs, outputs, transformations, and persistence requirements
64
- - **Integration Points** - Ask about external system interactions, APIs, and data exchange
65
- - **Error Handling** - Ask about error scenarios, validation failures, and exception handling
66
- - **Business Scenarios** - Ask about edge cases, alternative flows, and complex business situations
67
- - **Frontend Components** (if applicable) - Ask about UI component structure, user interactions, state management, and form handling
68
-
69
- ### Step 4: Store Plan
70
- - Save as `aidlc-docs/construction/plans/{unit-name}-functional-design-plan.md`
71
- - Include all [Answer]: tags for user input
72
-
73
- ### Step 5: Collect and Analyze Answers
74
- - Wait for user to complete all [Answer]: tags
75
- - **MANDATORY**: Carefully review ALL responses for vague or ambiguous answers
76
- - **CRITICAL**: Add follow-up questions for ANY unclear responses - do not proceed with ambiguity
77
- - Look for responses like "depends", "maybe", "not sure", "mix of", "somewhere between"
78
- - Create clarification questions file if ANY ambiguities are detected
79
- - **Do not proceed until ALL ambiguities are resolved**
80
-
81
- ### Step 6: Generate Functional Design Artifacts
82
- - Create `aidlc-docs/construction/{unit-name}/functional-design/business-logic-model.md`
83
- - Create `aidlc-docs/construction/{unit-name}/functional-design/business-rules.md`
84
- - Create `aidlc-docs/construction/{unit-name}/functional-design/domain-entities.md`
85
- - If unit includes frontend/UI: Create `aidlc-docs/construction/{unit-name}/functional-design/frontend-components.md`
86
- - Component hierarchy and structure
87
- - Props and state definitions for each component
88
- - User interaction flows
89
- - Form validation rules
90
- - API integration points (which backend endpoints each component uses)
91
-
92
- ### Step 7: Present Completion Message
93
- - Present completion message in this structure:
94
- 1. **Completion Announcement** (mandatory): Always start with this:
95
-
96
- ```markdown
97
- # 🔧 Functional Design Complete - [unit-name]
98
- ```
99
-
100
- 2. **AI Summary** (optional): Provide structured bullet-point summary of functional design
101
- - Format: "Functional design has created [description]:"
102
- - List key business logic models and entities (bullet points)
103
- - List business rules and validation logic defined
104
- - Mention domain model structure and relationships
105
- - DO NOT include workflow instructions ("please review", "let me know", "proceed to next phase", "before we proceed")
106
- - Keep factual and content-focused
107
- 3. **Formatted Workflow Message** (mandatory): Always end with this exact format:
108
-
109
- ```markdown
110
- ---
111
-
112
- ⚠️ **REVIEW REQUIRED**
113
-
114
- > Please examine the functional design artifacts at:
115
- > `aidlc-docs/{workflow-id}/construction/[unit-name]/functional-design/`
116
-
117
- **You may:**
118
- - 🔧 **Request Changes** — Ask for modifications to the functional design based on your review
119
- - ✅ **Continue to Next Stage** — Approve functional design and proceed to **[next-stage-name]**
120
-
121
- ---
122
- ```
123
-
124
- ### Step 8: Wait for Explicit Approval
125
- - Do not proceed until the user explicitly approves the functional design
126
- - Approval must be clear and unambiguous
127
- - If user requests changes, update the design and repeat the approval process
128
-
129
- ### Step 9: Record Approval and MANDATORY State Update
130
- - Log approval in audit.md with timestamp
131
- - Record the user's approval response with timestamp
132
- - **MANDATORY**: Update BOTH state files in the SAME interaction:
133
- 1. Mark Functional Design stage complete in `aidlc-docs/{workflow-id}/aidlc-state.md`
134
- 2. Update `aidlc-docs/{workflow-id}/checkpoint.json` — set functional-design status to "completed" with completed_at timestamp
135
- - **Do NOT proceed to the next stage without completing state updates**
1
+ # Functional Design
2
+
3
+ ## Purpose
4
+ **Detailed business logic design per unit**
5
+
6
+ Functional Design focuses on:
7
+ - Detailed business logic and algorithms for the unit
8
+ - Domain models with entities and relationships
9
+ - Detailed business rules, validation logic, and constraints
10
+ - Technology-agnostic design (no infrastructure concerns)
11
+
12
+ **Note**: This builds upon high-level component design from Application Design (INCEPTION phase)
13
+
14
+ ## Prerequisites
15
+ - Units Generation must be complete
16
+ - Unit of work artifacts must be available
17
+ - Application Design recommended (provides high-level component structure)
18
+ - Execution plan must indicate Functional Design stage should execute
19
+
20
+ ## Agent Delegation Strategy
21
+
22
+ **MANDATORY**: Delegate functional design artifact generation (Step 6) to `oracle-medium`. Do NOT generate business logic models and domain entities directly.
23
+
24
+ **Execution mode**: Foreground sequential — single coherent design reasoning task per unit.
25
+
26
+ **Delegation scope**:
27
+ - **Orchestrator retains**: Steps 1-5 (context analysis, plan creation, Q&A, answer collection) and Steps 7-9 (completion message, approval gate, state update).
28
+ - **Delegated to `oracle-medium`**: Step 6 (Generate Functional Design Artifacts) — the agent analyzes the unit definition, user answers, and prior context to produce business-logic-model.md, business-rules.md, domain-entities.md, and frontend-components.md (if applicable).
29
+
30
+ **If an agent task fails**: Follow the Agent Task Failure Recovery procedure in `error-handling.md` — retry the delegation, never silently do the work yourself.
31
+
32
+ **After agent completes**: The orchestrator compiles the agent's output into the artifact files, presents the completion message, and manages the approval gate.
33
+
34
+ ## Overview
35
+ Design detailed business logic for the unit, technology-agnostic and focused purely on business functions.
36
+
37
+ ## Steps to Execute
38
+
39
+ ### Step 1: Analyze Unit Context
40
+ - Read unit definition from `aidlc-docs/inception/units/unit-of-work.md`
41
+ - Read assigned stories from `aidlc-docs/inception/units/unit-of-work-story-map.md`
42
+ - Understand unit responsibilities and boundaries
43
+
44
+ ### Step 2: Create Functional Design Plan
45
+ - Generate plan with checkboxes [] for functional design
46
+ - Focus on business logic, domain models, business rules
47
+ - Each step should have a checkbox []
48
+
49
+ ### Step 3: Generate Context-Appropriate Questions
50
+ **DIRECTIVE**: Thoroughly analyze the unit definition and functional design artifacts to identify ALL areas where clarification would improve the functional design. Be proactive in asking questions to ensure comprehensive understanding.
51
+
52
+ **CRITICAL**: Default to asking questions when there is ANY ambiguity or missing detail that could affect functional design quality. It's better to ask too many questions than to make incorrect assumptions.
53
+
54
+ - EMBED questions using [Answer]: tag format
55
+ - Focus on ANY ambiguities, missing information, or areas needing clarification
56
+ - Generate questions wherever user input would improve functional design decisions
57
+ - **When in doubt, ask the question** - overconfidence leads to poor designs
58
+
59
+ **Question categories to consider** (evaluate ALL categories):
60
+ - **Business Logic Modeling** - Ask about core entities, workflows, data transformations, and business processes
61
+ - **Domain Model** - Ask about domain concepts, entity relationships, data structures, and business objects
62
+ - **Business Rules** - Ask about decision rules, validation logic, constraints, and business policies
63
+ - **Data Flow** - Ask about data inputs, outputs, transformations, and persistence requirements
64
+ - **Integration Points** - Ask about external system interactions, APIs, and data exchange
65
+ - **Error Handling** - Ask about error scenarios, validation failures, and exception handling
66
+ - **Business Scenarios** - Ask about edge cases, alternative flows, and complex business situations
67
+ - **Frontend Components** (if applicable) - Ask about UI component structure, user interactions, state management, and form handling
68
+
69
+ ### Step 4: Store Plan
70
+ - Save as `aidlc-docs/construction/plans/{unit-name}-functional-design-plan.md`
71
+ - Include all [Answer]: tags for user input
72
+
73
+ ### Step 5: Collect and Analyze Answers
74
+ - Wait for user to complete all [Answer]: tags
75
+ - **MANDATORY**: Carefully review ALL responses for vague or ambiguous answers
76
+ - **CRITICAL**: Add follow-up questions for ANY unclear responses - do not proceed with ambiguity
77
+ - Look for responses like "depends", "maybe", "not sure", "mix of", "somewhere between"
78
+ - Create clarification questions file if ANY ambiguities are detected
79
+ - **Do not proceed until ALL ambiguities are resolved**
80
+
81
+ ### Step 6: Generate Functional Design Artifacts
82
+ - Create `aidlc-docs/construction/{unit-name}/functional-design/business-logic-model.md`
83
+ - Create `aidlc-docs/construction/{unit-name}/functional-design/business-rules.md`
84
+ - Create `aidlc-docs/construction/{unit-name}/functional-design/domain-entities.md`
85
+ - If unit includes frontend/UI: Create `aidlc-docs/construction/{unit-name}/functional-design/frontend-components.md`
86
+ - Component hierarchy and structure
87
+ - Props and state definitions for each component
88
+ - User interaction flows
89
+ - Form validation rules
90
+ - API integration points (which backend endpoints each component uses)
91
+
92
+ ### Step 7: Present Completion Message
93
+ - Present completion message in this structure:
94
+ 1. **Completion Announcement** (mandatory): Always start with this:
95
+
96
+ ```markdown
97
+ # 🔧 Functional Design Complete - [unit-name]
98
+ ```
99
+
100
+ 2. **AI Summary** (optional): Provide structured bullet-point summary of functional design
101
+ - Format: "Functional design has created [description]:"
102
+ - List key business logic models and entities (bullet points)
103
+ - List business rules and validation logic defined
104
+ - Mention domain model structure and relationships
105
+ - DO NOT include workflow instructions ("please review", "let me know", "proceed to next phase", "before we proceed")
106
+ - Keep factual and content-focused
107
+ 3. **Formatted Workflow Message** (mandatory): Always end with this exact format:
108
+
109
+ ```markdown
110
+ ---
111
+
112
+ ⚠️ **REVIEW REQUIRED**
113
+
114
+ > Please examine the functional design artifacts at:
115
+ > `aidlc-docs/{workflow-id}/construction/[unit-name]/functional-design/`
116
+
117
+ **You may:**
118
+ - 🔧 **Request Changes** — Ask for modifications to the functional design based on your review
119
+ - ✅ **Continue to Next Stage** — Approve functional design and proceed to **[next-stage-name]**
120
+
121
+ ---
122
+ ```
123
+
124
+ ### Step 8: Wait for Explicit Approval
125
+ - Do not proceed until the user explicitly approves the functional design
126
+ - Approval must be clear and unambiguous
127
+ - If user requests changes, update the design and repeat the approval process
128
+
129
+ ### Step 9: Record Approval and MANDATORY State Update
130
+ - Log approval in audit.md with timestamp
131
+ - Record the user's approval response with timestamp
132
+ - **MANDATORY**: Update BOTH state files in the SAME interaction:
133
+ 1. Mark Functional Design stage complete in `aidlc-docs/{workflow-id}/aidlc-state.md`
134
+ 2. Update `aidlc-docs/{workflow-id}/checkpoint.json` — set functional-design status to "completed" with completed_at timestamp
135
+ - **Do NOT proceed to the next stage without completing state updates**
@@ -1,110 +1,110 @@
1
- # Infrastructure Design
2
-
3
- ## Prerequisites
4
- - Functional Design must be complete for the unit
5
- - NFR Design recommended (provides logical components to map)
6
- - Execution plan must indicate Infrastructure Design stage should execute
7
-
8
- ## Agent Delegation Strategy
9
-
10
- **MANDATORY**: Delegate infrastructure design artifact generation (Step 6) to `oracle-medium`. Do NOT generate infrastructure mappings and deployment architecture directly.
11
-
12
- **Execution mode**: Foreground sequential — single coherent infrastructure design task per unit.
13
-
14
- **Delegation scope**:
15
- - **Orchestrator retains**: Steps 1-5 (analyze design artifacts, plan creation, Q&A, answer collection) and Steps 7-9 (completion message, approval gate, state update).
16
- - **Delegated to `oracle-medium`**: Step 6 (Generate Infrastructure Design Artifacts) — the agent maps logical components to actual infrastructure services, producing infrastructure-design.md, deployment-architecture.md, and shared-infrastructure.md (if applicable).
17
-
18
- **If an agent task fails**: Follow the Agent Task Failure Recovery procedure in `error-handling.md` — retry the delegation, never silently do the work yourself.
19
-
20
- **After agent completes**: The orchestrator compiles the agent's output into the artifact files, presents the completion message, and manages the approval gate.
21
-
22
- ## Overview
23
- Map logical software components to actual infrastructure choices for deployment environments.
24
-
25
- ## Steps to Execute
26
-
27
- ### Step 1: Analyze Design Artifacts
28
- - Read functional design from `aidlc-docs/construction/{unit-name}/functional-design/`
29
- - Read NFR design from `aidlc-docs/construction/{unit-name}/nfr-design/` (if exists)
30
- - Identify logical components needing infrastructure
31
-
32
- ### Step 2: Create Infrastructure Design Plan
33
- - Generate plan with checkboxes [] for infrastructure design
34
- - Focus on mapping to actual services (AWS, Azure, GCP, on-premise)
35
- - Each step should have a checkbox []
36
-
37
- ### Step 3: Generate Context-Appropriate Questions
38
- **DIRECTIVE**: Analyze the functional and NFR design to generate ONLY questions relevant to THIS specific unit's infrastructure needs. Use the categories below as inspiration, NOT as a mandatory checklist. Skip entire categories if not applicable.
39
-
40
- - EMBED questions using [Answer]: tag format
41
- - Focus on ambiguities and missing information specific to this unit
42
- - Generate questions only where user input is needed for infrastructure decisions
43
-
44
- **Example question categories** (adapt as needed):
45
- - **Deployment Environment** - Only if cloud provider or environment setup is unclear
46
- - **Compute Infrastructure** - Only if compute service choice needs clarification
47
- - **Storage Infrastructure** - Only if database or storage selection is ambiguous
48
- - **Messaging Infrastructure** - Only if messaging/queuing services need specification
49
- - **Networking Infrastructure** - Only if load balancing or API gateway approach is unclear
50
- - **Monitoring Infrastructure** - Only if observability tooling needs clarification
51
- - **Shared Infrastructure** - Only if infrastructure sharing strategy is ambiguous
52
-
53
- ### Step 4: Store Plan
54
- - Save as `aidlc-docs/construction/plans/{unit-name}-infrastructure-design-plan.md`
55
- - Include all [Answer]: tags for user input
56
-
57
- ### Step 5: Collect and Analyze Answers
58
- - Wait for user to complete all [Answer]: tags
59
- - Review for vague or ambiguous responses
60
- - Add follow-up questions if needed
61
-
62
- ### Step 6: Generate Infrastructure Design Artifacts
63
- - Create `aidlc-docs/construction/{unit-name}/infrastructure-design/infrastructure-design.md`
64
- - Create `aidlc-docs/construction/{unit-name}/infrastructure-design/deployment-architecture.md`
65
- - If shared infrastructure: Create `aidlc-docs/construction/shared-infrastructure.md`
66
-
67
- ### Step 7: Present Completion Message
68
- - Present completion message in this structure:
69
- 1. **Completion Announcement** (mandatory): Always start with this:
70
-
71
- ```markdown
72
- # 🏢 Infrastructure Design Complete - [unit-name]
73
- ```
74
-
75
- 2. **AI Summary** (optional): Provide structured bullet-point summary of infrastructure design
76
- - Format: "Infrastructure design has mapped [description]:"
77
- - List key infrastructure services and components (bullet points)
78
- - List deployment architecture decisions and rationale
79
- - Mention cloud provider choices and service mappings
80
- - DO NOT include workflow instructions ("please review", "let me know", "proceed to next phase", "before we proceed")
81
- - Keep factual and content-focused
82
- 3. **Formatted Workflow Message** (mandatory): Always end with this exact format:
83
-
84
- ```markdown
85
- ---
86
-
87
- ⚠️ **REVIEW REQUIRED**
88
-
89
- > Please examine the infrastructure design at:
90
- > `aidlc-docs/{workflow-id}/construction/[unit-name]/infrastructure-design/`
91
-
92
- **You may:**
93
- - 🔧 **Request Changes** — Ask for modifications to the infrastructure design based on your review
94
- - ✅ **Continue to Next Stage** — Approve infrastructure design and proceed to **Code Generation**
95
-
96
- ---
97
- ```
98
-
99
- ### Step 8: Wait for Explicit Approval
100
- - Do not proceed until the user explicitly approves the infrastructure design
101
- - Approval must be clear and unambiguous
102
- - If user requests changes, update the design and repeat the approval process
103
-
104
- ### Step 9: Record Approval and MANDATORY State Update
105
- - Log approval in audit.md with timestamp
106
- - Record the user's approval response with timestamp
107
- - **MANDATORY**: Update BOTH state files in the SAME interaction:
108
- 1. Mark Infrastructure Design stage complete in `aidlc-docs/{workflow-id}/aidlc-state.md`
109
- 2. Update `aidlc-docs/{workflow-id}/checkpoint.json` — set infrastructure-design status to "completed" with completed_at timestamp
110
- - **Do NOT proceed to the next stage without completing state updates**
1
+ # Infrastructure Design
2
+
3
+ ## Prerequisites
4
+ - Functional Design must be complete for the unit
5
+ - NFR Design recommended (provides logical components to map)
6
+ - Execution plan must indicate Infrastructure Design stage should execute
7
+
8
+ ## Agent Delegation Strategy
9
+
10
+ **MANDATORY**: Delegate infrastructure design artifact generation (Step 6) to `oracle-medium`. Do NOT generate infrastructure mappings and deployment architecture directly.
11
+
12
+ **Execution mode**: Foreground sequential — single coherent infrastructure design task per unit.
13
+
14
+ **Delegation scope**:
15
+ - **Orchestrator retains**: Steps 1-5 (analyze design artifacts, plan creation, Q&A, answer collection) and Steps 7-9 (completion message, approval gate, state update).
16
+ - **Delegated to `oracle-medium`**: Step 6 (Generate Infrastructure Design Artifacts) — the agent maps logical components to actual infrastructure services, producing infrastructure-design.md, deployment-architecture.md, and shared-infrastructure.md (if applicable).
17
+
18
+ **If an agent task fails**: Follow the Agent Task Failure Recovery procedure in `error-handling.md` — retry the delegation, never silently do the work yourself.
19
+
20
+ **After agent completes**: The orchestrator compiles the agent's output into the artifact files, presents the completion message, and manages the approval gate.
21
+
22
+ ## Overview
23
+ Map logical software components to actual infrastructure choices for deployment environments.
24
+
25
+ ## Steps to Execute
26
+
27
+ ### Step 1: Analyze Design Artifacts
28
+ - Read functional design from `aidlc-docs/construction/{unit-name}/functional-design/`
29
+ - Read NFR design from `aidlc-docs/construction/{unit-name}/nfr-design/` (if exists)
30
+ - Identify logical components needing infrastructure
31
+
32
+ ### Step 2: Create Infrastructure Design Plan
33
+ - Generate plan with checkboxes [] for infrastructure design
34
+ - Focus on mapping to actual services (AWS, Azure, GCP, on-premise)
35
+ - Each step should have a checkbox []
36
+
37
+ ### Step 3: Generate Context-Appropriate Questions
38
+ **DIRECTIVE**: Analyze the functional and NFR design to generate ONLY questions relevant to THIS specific unit's infrastructure needs. Use the categories below as inspiration, NOT as a mandatory checklist. Skip entire categories if not applicable.
39
+
40
+ - EMBED questions using [Answer]: tag format
41
+ - Focus on ambiguities and missing information specific to this unit
42
+ - Generate questions only where user input is needed for infrastructure decisions
43
+
44
+ **Example question categories** (adapt as needed):
45
+ - **Deployment Environment** - Only if cloud provider or environment setup is unclear
46
+ - **Compute Infrastructure** - Only if compute service choice needs clarification
47
+ - **Storage Infrastructure** - Only if database or storage selection is ambiguous
48
+ - **Messaging Infrastructure** - Only if messaging/queuing services need specification
49
+ - **Networking Infrastructure** - Only if load balancing or API gateway approach is unclear
50
+ - **Monitoring Infrastructure** - Only if observability tooling needs clarification
51
+ - **Shared Infrastructure** - Only if infrastructure sharing strategy is ambiguous
52
+
53
+ ### Step 4: Store Plan
54
+ - Save as `aidlc-docs/construction/plans/{unit-name}-infrastructure-design-plan.md`
55
+ - Include all [Answer]: tags for user input
56
+
57
+ ### Step 5: Collect and Analyze Answers
58
+ - Wait for user to complete all [Answer]: tags
59
+ - Review for vague or ambiguous responses
60
+ - Add follow-up questions if needed
61
+
62
+ ### Step 6: Generate Infrastructure Design Artifacts
63
+ - Create `aidlc-docs/construction/{unit-name}/infrastructure-design/infrastructure-design.md`
64
+ - Create `aidlc-docs/construction/{unit-name}/infrastructure-design/deployment-architecture.md`
65
+ - If shared infrastructure: Create `aidlc-docs/construction/shared-infrastructure.md`
66
+
67
+ ### Step 7: Present Completion Message
68
+ - Present completion message in this structure:
69
+ 1. **Completion Announcement** (mandatory): Always start with this:
70
+
71
+ ```markdown
72
+ # 🏢 Infrastructure Design Complete - [unit-name]
73
+ ```
74
+
75
+ 2. **AI Summary** (optional): Provide structured bullet-point summary of infrastructure design
76
+ - Format: "Infrastructure design has mapped [description]:"
77
+ - List key infrastructure services and components (bullet points)
78
+ - List deployment architecture decisions and rationale
79
+ - Mention cloud provider choices and service mappings
80
+ - DO NOT include workflow instructions ("please review", "let me know", "proceed to next phase", "before we proceed")
81
+ - Keep factual and content-focused
82
+ 3. **Formatted Workflow Message** (mandatory): Always end with this exact format:
83
+
84
+ ```markdown
85
+ ---
86
+
87
+ ⚠️ **REVIEW REQUIRED**
88
+
89
+ > Please examine the infrastructure design at:
90
+ > `aidlc-docs/{workflow-id}/construction/[unit-name]/infrastructure-design/`
91
+
92
+ **You may:**
93
+ - 🔧 **Request Changes** — Ask for modifications to the infrastructure design based on your review
94
+ - ✅ **Continue to Next Stage** — Approve infrastructure design and proceed to **Code Generation**
95
+
96
+ ---
97
+ ```
98
+
99
+ ### Step 8: Wait for Explicit Approval
100
+ - Do not proceed until the user explicitly approves the infrastructure design
101
+ - Approval must be clear and unambiguous
102
+ - If user requests changes, update the design and repeat the approval process
103
+
104
+ ### Step 9: Record Approval and MANDATORY State Update
105
+ - Log approval in audit.md with timestamp
106
+ - Record the user's approval response with timestamp
107
+ - **MANDATORY**: Update BOTH state files in the SAME interaction:
108
+ 1. Mark Infrastructure Design stage complete in `aidlc-docs/{workflow-id}/aidlc-state.md`
109
+ 2. Update `aidlc-docs/{workflow-id}/checkpoint.json` — set infrastructure-design status to "completed" with completed_at timestamp
110
+ - **Do NOT proceed to the next stage without completing state updates**