@mytechtoday/augment-extensions 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (232) hide show
  1. package/LICENSE +22 -22
  2. package/README.md +105 -6
  3. package/augment-extensions/domain-rules/software-architecture/README.md +143 -143
  4. package/augment-extensions/domain-rules/software-architecture/examples/banking-layered.md +961 -961
  5. package/augment-extensions/domain-rules/software-architecture/examples/ecommerce-microservices.md +990 -990
  6. package/augment-extensions/domain-rules/software-architecture/examples/iot-eventdriven.md +882 -882
  7. package/augment-extensions/domain-rules/software-architecture/examples/monolith-to-microservices-migration.md +703 -703
  8. package/augment-extensions/domain-rules/software-architecture/examples/serverless-imageprocessing.md +957 -957
  9. package/augment-extensions/domain-rules/software-architecture/examples/trading-eventdriven.md +747 -747
  10. package/augment-extensions/domain-rules/software-architecture/module.json +119 -119
  11. package/augment-extensions/domain-rules/software-architecture/rules/challenges-solutions.md +763 -763
  12. package/augment-extensions/domain-rules/software-architecture/rules/definitions-terminology.md +409 -409
  13. package/augment-extensions/domain-rules/software-architecture/rules/design-principles.md +684 -684
  14. package/augment-extensions/domain-rules/software-architecture/rules/evaluation-testing.md +1381 -1381
  15. package/augment-extensions/domain-rules/software-architecture/rules/event-driven-architecture.md +616 -616
  16. package/augment-extensions/domain-rules/software-architecture/rules/fundamentals.md +306 -306
  17. package/augment-extensions/domain-rules/software-architecture/rules/industry-architectures.md +554 -554
  18. package/augment-extensions/domain-rules/software-architecture/rules/layered-architecture.md +776 -776
  19. package/augment-extensions/domain-rules/software-architecture/rules/microservices-architecture.md +503 -503
  20. package/augment-extensions/domain-rules/software-architecture/rules/modeling-documentation.md +1199 -1199
  21. package/augment-extensions/domain-rules/software-architecture/rules/monolithic-architecture.md +351 -351
  22. package/augment-extensions/domain-rules/software-architecture/rules/principles.md +556 -556
  23. package/augment-extensions/domain-rules/software-architecture/rules/quality-attributes.md +797 -797
  24. package/augment-extensions/domain-rules/software-architecture/rules/scalability-performance.md +1345 -1345
  25. package/augment-extensions/domain-rules/software-architecture/rules/security-architecture.md +1039 -1039
  26. package/augment-extensions/domain-rules/software-architecture/rules/serverless-architecture.md +711 -711
  27. package/augment-extensions/domain-rules/software-architecture/rules/skills-development.md +568 -568
  28. package/augment-extensions/domain-rules/software-architecture/rules/tools-methodologies.md +961 -961
  29. package/augment-extensions/visual-design/CHANGELOG.md +132 -132
  30. package/augment-extensions/visual-design/README.md +255 -255
  31. package/augment-extensions/visual-design/__tests__/README.md +119 -119
  32. package/augment-extensions/visual-design/__tests__/style-selector.test.ts +172 -172
  33. package/augment-extensions/visual-design/__tests__/vendor-styles.test.ts +214 -214
  34. package/augment-extensions/visual-design/domains/other/ai-prompt-helper.ts +157 -157
  35. package/augment-extensions/visual-design/domains/other/dotnet-application.ts +156 -156
  36. package/augment-extensions/visual-design/domains/other/linux-platform.ts +156 -156
  37. package/augment-extensions/visual-design/domains/other/mobile-application.ts +157 -157
  38. package/augment-extensions/visual-design/domains/other/motion-picture.ts +156 -156
  39. package/augment-extensions/visual-design/domains/other/os-application.ts +156 -156
  40. package/augment-extensions/visual-design/domains/other/print-campaigns.ts +158 -158
  41. package/augment-extensions/visual-design/domains/other/web-app.ts +157 -157
  42. package/augment-extensions/visual-design/domains/other/website.ts +161 -161
  43. package/augment-extensions/visual-design/domains/other/windows-platform.ts +156 -156
  44. package/augment-extensions/visual-design/domains/web-page-styles/amazon-cloudscape.ts +506 -506
  45. package/augment-extensions/visual-design/domains/web-page-styles/google-modern.ts +615 -615
  46. package/augment-extensions/visual-design/domains/web-page-styles/microsoft-fluent.ts +531 -531
  47. package/augment-extensions/visual-design/examples/README.md +97 -97
  48. package/augment-extensions/visual-design/examples/ai-prompt-generation.md +233 -233
  49. package/augment-extensions/visual-design/examples/basic-usage.md +216 -216
  50. package/augment-extensions/visual-design/examples/domain-workflows.md +257 -257
  51. package/augment-extensions/visual-design/examples/vendor-comparison.md +247 -247
  52. package/augment-extensions/visual-design/module.json +78 -78
  53. package/augment-extensions/visual-design/style-selector.ts +177 -177
  54. package/augment-extensions/visual-design/types.ts +302 -302
  55. package/augment-extensions/visual-design/visual-design-core.ts +469 -469
  56. package/augment-extensions/workflows/adr-support/README.md +227 -227
  57. package/augment-extensions/workflows/adr-support/__tests__/adr-validator.test.ts +203 -203
  58. package/augment-extensions/workflows/adr-support/adr-validator.ts +162 -162
  59. package/augment-extensions/workflows/adr-support/examples/complete-lifecycle-example.md +449 -449
  60. package/augment-extensions/workflows/adr-support/examples/integration-example.md +580 -580
  61. package/augment-extensions/workflows/adr-support/examples/superseding-example.md +436 -436
  62. package/augment-extensions/workflows/adr-support/module.json +112 -112
  63. package/augment-extensions/workflows/adr-support/rules/adr-creation.md +372 -372
  64. package/augment-extensions/workflows/adr-support/rules/beads-integration.md +443 -443
  65. package/augment-extensions/workflows/adr-support/rules/conflict-detection.md +486 -486
  66. package/augment-extensions/workflows/adr-support/rules/decision-detection.md +362 -362
  67. package/augment-extensions/workflows/adr-support/rules/lifecycle-management.md +427 -427
  68. package/augment-extensions/workflows/adr-support/rules/openspec-integration.md +465 -465
  69. package/augment-extensions/workflows/adr-support/rules/template-selection.md +405 -405
  70. package/augment-extensions/workflows/adr-support/rules/validation-rules.md +543 -543
  71. package/augment-extensions/workflows/adr-support/schemas/adr-config.json +191 -191
  72. package/augment-extensions/workflows/adr-support/schemas/adr-metadata.json +172 -172
  73. package/augment-extensions/workflows/adr-support/templates/business-case.md +235 -235
  74. package/augment-extensions/workflows/adr-support/templates/madr-elaborate.md +197 -197
  75. package/augment-extensions/workflows/adr-support/templates/madr-simple.md +68 -68
  76. package/augment-extensions/workflows/adr-support/templates/nygard.md +84 -84
  77. package/augment-extensions/writing-standards/screenplay/rules/file-organization.md +213 -213
  78. package/augment-extensions/writing-standards/screenplay/utils/__tests__/file-organization.test.ts +169 -169
  79. package/augment-extensions/writing-standards/screenplay/utils/file-organization.ts +165 -165
  80. package/cli/dist/commands/agent.d.ts +37 -0
  81. package/cli/dist/commands/agent.d.ts.map +1 -0
  82. package/cli/dist/commands/agent.js +222 -0
  83. package/cli/dist/commands/agent.js.map +1 -0
  84. package/cli/dist/commands/beads.d.ts +64 -0
  85. package/cli/dist/commands/beads.d.ts.map +1 -0
  86. package/cli/dist/commands/beads.js +377 -0
  87. package/cli/dist/commands/beads.js.map +1 -0
  88. package/cli/dist/commands/change.d.ts +54 -0
  89. package/cli/dist/commands/change.d.ts.map +1 -0
  90. package/cli/dist/commands/change.js +243 -0
  91. package/cli/dist/commands/change.js.map +1 -0
  92. package/cli/dist/commands/clean.d.ts +15 -0
  93. package/cli/dist/commands/clean.d.ts.map +1 -0
  94. package/cli/dist/commands/clean.js +63 -0
  95. package/cli/dist/commands/clean.js.map +1 -0
  96. package/cli/dist/commands/clone.d.ts +15 -0
  97. package/cli/dist/commands/clone.d.ts.map +1 -0
  98. package/cli/dist/commands/clone.js +49 -0
  99. package/cli/dist/commands/clone.js.map +1 -0
  100. package/cli/dist/commands/config.d.ts +33 -0
  101. package/cli/dist/commands/config.d.ts.map +1 -0
  102. package/cli/dist/commands/config.js +166 -0
  103. package/cli/dist/commands/config.js.map +1 -0
  104. package/cli/dist/commands/context.d.ts +38 -0
  105. package/cli/dist/commands/context.d.ts.map +1 -0
  106. package/cli/dist/commands/context.js +205 -0
  107. package/cli/dist/commands/context.js.map +1 -0
  108. package/cli/dist/commands/create.d.ts +18 -0
  109. package/cli/dist/commands/create.d.ts.map +1 -0
  110. package/cli/dist/commands/create.js +178 -0
  111. package/cli/dist/commands/create.js.map +1 -0
  112. package/cli/dist/commands/diff.d.ts +19 -0
  113. package/cli/dist/commands/diff.d.ts.map +1 -0
  114. package/cli/dist/commands/diff.js +104 -0
  115. package/cli/dist/commands/diff.js.map +1 -0
  116. package/cli/dist/commands/doctor.d.ts +14 -0
  117. package/cli/dist/commands/doctor.d.ts.map +1 -0
  118. package/cli/dist/commands/doctor.js +62 -0
  119. package/cli/dist/commands/doctor.js.map +1 -0
  120. package/cli/dist/commands/export.d.ts +28 -0
  121. package/cli/dist/commands/export.d.ts.map +1 -0
  122. package/cli/dist/commands/export.js +135 -0
  123. package/cli/dist/commands/export.js.map +1 -0
  124. package/cli/dist/commands/import.d.ts +23 -0
  125. package/cli/dist/commands/import.d.ts.map +1 -0
  126. package/cli/dist/commands/import.js +118 -0
  127. package/cli/dist/commands/import.js.map +1 -0
  128. package/cli/dist/commands/prompt.d.ts +45 -0
  129. package/cli/dist/commands/prompt.d.ts.map +1 -0
  130. package/cli/dist/commands/prompt.js +223 -0
  131. package/cli/dist/commands/prompt.js.map +1 -0
  132. package/cli/dist/commands/spec.d.ts +57 -0
  133. package/cli/dist/commands/spec.d.ts.map +1 -0
  134. package/cli/dist/commands/spec.js +279 -0
  135. package/cli/dist/commands/spec.js.map +1 -0
  136. package/cli/dist/commands/stats.d.ts +18 -0
  137. package/cli/dist/commands/stats.d.ts.map +1 -0
  138. package/cli/dist/commands/stats.js +85 -0
  139. package/cli/dist/commands/stats.js.map +1 -0
  140. package/cli/dist/commands/task.d.ts +65 -0
  141. package/cli/dist/commands/task.d.ts.map +1 -0
  142. package/cli/dist/commands/task.js +282 -0
  143. package/cli/dist/commands/task.js.map +1 -0
  144. package/cli/dist/commands/template.d.ts +17 -0
  145. package/cli/dist/commands/template.d.ts.map +1 -0
  146. package/cli/dist/commands/template.js +55 -0
  147. package/cli/dist/commands/template.js.map +1 -0
  148. package/cli/dist/utils/agent-config.d.ts +129 -0
  149. package/cli/dist/utils/agent-config.d.ts.map +1 -0
  150. package/cli/dist/utils/agent-config.js +297 -0
  151. package/cli/dist/utils/agent-config.js.map +1 -0
  152. package/cli/dist/utils/auto-sync.js +19 -19
  153. package/cli/dist/utils/beads-graph.d.ts +17 -0
  154. package/cli/dist/utils/beads-graph.d.ts.map +1 -0
  155. package/cli/dist/utils/beads-graph.js +150 -0
  156. package/cli/dist/utils/beads-graph.js.map +1 -0
  157. package/cli/dist/utils/beads-integration.d.ts +112 -0
  158. package/cli/dist/utils/beads-integration.d.ts.map +1 -0
  159. package/cli/dist/utils/beads-integration.js +312 -0
  160. package/cli/dist/utils/beads-integration.js.map +1 -0
  161. package/cli/dist/utils/beads-reporter.d.ts +17 -0
  162. package/cli/dist/utils/beads-reporter.d.ts.map +1 -0
  163. package/cli/dist/utils/beads-reporter.js +160 -0
  164. package/cli/dist/utils/beads-reporter.js.map +1 -0
  165. package/cli/dist/utils/cache-manager.d.ts +55 -0
  166. package/cli/dist/utils/cache-manager.d.ts.map +1 -0
  167. package/cli/dist/utils/cache-manager.js +150 -0
  168. package/cli/dist/utils/cache-manager.js.map +1 -0
  169. package/cli/dist/utils/change-manager.d.ts +70 -0
  170. package/cli/dist/utils/change-manager.d.ts.map +1 -0
  171. package/cli/dist/utils/change-manager.js +412 -0
  172. package/cli/dist/utils/change-manager.js.map +1 -0
  173. package/cli/dist/utils/config-manager-enhanced.d.ts +66 -0
  174. package/cli/dist/utils/config-manager-enhanced.d.ts.map +1 -0
  175. package/cli/dist/utils/config-manager-enhanced.js +77 -0
  176. package/cli/dist/utils/config-manager-enhanced.js.map +1 -0
  177. package/cli/dist/utils/context-manager.d.ts +96 -0
  178. package/cli/dist/utils/context-manager.d.ts.map +1 -0
  179. package/cli/dist/utils/context-manager.js +258 -0
  180. package/cli/dist/utils/context-manager.js.map +1 -0
  181. package/cli/dist/utils/diff-engine.d.ts +78 -0
  182. package/cli/dist/utils/diff-engine.d.ts.map +1 -0
  183. package/cli/dist/utils/diff-engine.js +233 -0
  184. package/cli/dist/utils/diff-engine.js.map +1 -0
  185. package/cli/dist/utils/export-system.d.ts +101 -0
  186. package/cli/dist/utils/export-system.d.ts.map +1 -0
  187. package/cli/dist/utils/export-system.js +289 -0
  188. package/cli/dist/utils/export-system.js.map +1 -0
  189. package/cli/dist/utils/health-checker.d.ts +66 -0
  190. package/cli/dist/utils/health-checker.d.ts.map +1 -0
  191. package/cli/dist/utils/health-checker.js +285 -0
  192. package/cli/dist/utils/health-checker.js.map +1 -0
  193. package/cli/dist/utils/import-system.d.ts +74 -0
  194. package/cli/dist/utils/import-system.d.ts.map +1 -0
  195. package/cli/dist/utils/import-system.js +317 -0
  196. package/cli/dist/utils/import-system.js.map +1 -0
  197. package/cli/dist/utils/module-cloner.d.ts +40 -0
  198. package/cli/dist/utils/module-cloner.d.ts.map +1 -0
  199. package/cli/dist/utils/module-cloner.js +136 -0
  200. package/cli/dist/utils/module-cloner.js.map +1 -0
  201. package/cli/dist/utils/prompt-manager.d.ts +90 -0
  202. package/cli/dist/utils/prompt-manager.d.ts.map +1 -0
  203. package/cli/dist/utils/prompt-manager.js +302 -0
  204. package/cli/dist/utils/prompt-manager.js.map +1 -0
  205. package/cli/dist/utils/spec-manager.d.ts +65 -0
  206. package/cli/dist/utils/spec-manager.d.ts.map +1 -0
  207. package/cli/dist/utils/spec-manager.js +329 -0
  208. package/cli/dist/utils/spec-manager.js.map +1 -0
  209. package/cli/dist/utils/stats-collector.d.ts +74 -0
  210. package/cli/dist/utils/stats-collector.d.ts.map +1 -0
  211. package/cli/dist/utils/stats-collector.js +164 -0
  212. package/cli/dist/utils/stats-collector.js.map +1 -0
  213. package/cli/dist/utils/template-engine.d.ts +47 -0
  214. package/cli/dist/utils/template-engine.d.ts.map +1 -0
  215. package/cli/dist/utils/template-engine.js +204 -0
  216. package/cli/dist/utils/template-engine.js.map +1 -0
  217. package/package.json +12 -3
  218. package/augment-extensions/workflows/openspec/README.md +0 -96
  219. package/augment-extensions/workflows/openspec/examples/complete-change-example.md +0 -244
  220. package/augment-extensions/workflows/openspec/module.json +0 -54
  221. package/augment-extensions/workflows/openspec/rules/best-practices.md +0 -272
  222. package/augment-extensions/workflows/openspec/rules/manual-setup.md +0 -231
  223. package/augment-extensions/workflows/openspec/rules/spec-format.md +0 -236
  224. package/augment-extensions/workflows/openspec/rules/workflow.md +0 -214
  225. package/cli/dist/utils/__tests__/adr-validator.example.d.ts +0 -6
  226. package/cli/dist/utils/__tests__/adr-validator.example.d.ts.map +0 -1
  227. package/cli/dist/utils/__tests__/adr-validator.example.js +0 -148
  228. package/cli/dist/utils/__tests__/adr-validator.example.js.map +0 -1
  229. package/cli/dist/utils/adr-validator.d.ts +0 -65
  230. package/cli/dist/utils/adr-validator.d.ts.map +0 -1
  231. package/cli/dist/utils/adr-validator.js +0 -203
  232. package/cli/dist/utils/adr-validator.js.map +0 -1
@@ -1,405 +1,405 @@
1
- # Template Selection Rules
2
-
3
- ## Overview
4
-
5
- This document defines how to select the appropriate ADR template based on decision type, complexity, and context. Choosing the right template ensures ADRs are appropriately detailed without being overly burdensome.
6
-
7
- ## Available Templates
8
-
9
- ### 1. Michael Nygard Template (Nygard)
10
-
11
- **File:** `templates/nygard.md`
12
-
13
- **Structure:**
14
- - Title
15
- - Status
16
- - Context
17
- - Decision
18
- - Consequences
19
-
20
- **Best For:**
21
- - Simple, straightforward decisions
22
- - Quick decisions with clear context
23
- - Decisions with obvious trade-offs
24
- - When brevity is important
25
-
26
- **Characteristics:**
27
- - Minimal structure
28
- - Fast to complete
29
- - Easy to read
30
- - Focuses on essentials
31
-
32
- **Example Use Cases:**
33
- - "Use PostgreSQL for primary database"
34
- - "Adopt ESLint for code linting"
35
- - "Use JWT for authentication tokens"
36
-
37
- ### 2. MADR Simple Template
38
-
39
- **File:** `templates/madr-simple.md`
40
-
41
- **Structure:**
42
- - Title and metadata
43
- - Context and Problem Statement
44
- - Decision Drivers
45
- - Considered Options
46
- - Decision Outcome
47
- - Consequences
48
-
49
- **Best For:**
50
- - Standard decisions (most common)
51
- - Decisions with 2-4 alternatives
52
- - When decision drivers are important
53
- - Balanced detail level
54
-
55
- **Characteristics:**
56
- - Structured but not overwhelming
57
- - Captures alternatives considered
58
- - Documents decision drivers
59
- - Good for team review
60
-
61
- **Example Use Cases:**
62
- - "Select state management library (Redux vs MobX vs Zustand)"
63
- - "Choose deployment platform (AWS vs Azure vs GCP)"
64
- - "Pick testing framework (Jest vs Vitest vs Mocha)"
65
-
66
- ### 3. MADR Elaborate Template
67
-
68
- **File:** `templates/madr-elaborate.md`
69
-
70
- **Structure:**
71
- - Title and metadata
72
- - Context and Problem Statement
73
- - Decision Drivers
74
- - Considered Options (with detailed pros/cons)
75
- - Decision Outcome
76
- - Validation
77
- - Consequences
78
- - Confirmation
79
-
80
- **Best For:**
81
- - Complex decisions with many alternatives
82
- - High-stakes decisions
83
- - Decisions requiring detailed analysis
84
- - When stakeholder buy-in is critical
85
-
86
- **Characteristics:**
87
- - Comprehensive structure
88
- - Detailed pros/cons for each option
89
- - Validation and confirmation sections
90
- - Takes more time to complete
91
-
92
- **Example Use Cases:**
93
- - "Migrate from monolith to microservices"
94
- - "Select enterprise database (PostgreSQL vs Oracle vs SQL Server)"
95
- - "Choose cloud provider for multi-year commitment"
96
-
97
- ### 4. Business Case Template
98
-
99
- **File:** `templates/business-case.md`
100
-
101
- **Structure:**
102
- - Executive Summary
103
- - Problem Statement
104
- - Proposed Solution
105
- - Cost Analysis
106
- - ROI Projection
107
- - Risk Assessment
108
- - Implementation Plan
109
- - Success Metrics
110
-
111
- **Best For:**
112
- - Decisions with significant cost implications
113
- - When ROI justification is needed
114
- - Vendor selection decisions
115
- - Budget approval required
116
-
117
- **Characteristics:**
118
- - Business-focused language
119
- - Financial analysis
120
- - Risk/benefit quantification
121
- - Executive-friendly format
122
-
123
- **Example Use Cases:**
124
- - "Purchase enterprise monitoring solution"
125
- - "Hire dedicated DevOps team"
126
- - "Migrate to cloud infrastructure"
127
-
128
- ## Selection Decision Tree
129
-
130
- ```
131
- Start
132
-
133
- Does decision have significant cost/ROI implications?
134
- ├─ Yes → Business Case Template
135
- └─ No → Continue
136
-
137
- How many alternatives are being seriously considered?
138
- ├─ 1-2 → Continue
139
- │ ↓
140
- │ Is decision straightforward with clear trade-offs?
141
- │ ├─ Yes → Nygard Template
142
- │ └─ No → MADR Simple Template
143
-
144
- └─ 3+ → Continue
145
-
146
- Is this a high-stakes decision requiring detailed analysis?
147
- ├─ Yes → MADR Elaborate Template
148
- └─ No → MADR Simple Template
149
- ```
150
-
151
- ## Selection Criteria
152
-
153
- ### Complexity Assessment
154
-
155
- **Low Complexity → Nygard**
156
- - Single clear option
157
- - Obvious trade-offs
158
- - Limited stakeholders
159
- - Low risk
160
-
161
- **Medium Complexity → MADR Simple**
162
- - 2-4 alternatives
163
- - Multiple decision drivers
164
- - Several stakeholders
165
- - Moderate risk
166
-
167
- **High Complexity → MADR Elaborate**
168
- - 5+ alternatives
169
- - Complex trade-offs
170
- - Many stakeholders
171
- - High risk/impact
172
-
173
- **Financial Focus → Business Case**
174
- - Significant cost
175
- - ROI justification needed
176
- - Budget approval required
177
- - Executive stakeholders
178
-
179
- ### Decision Type Mapping
180
-
181
- | Decision Type | Recommended Template | Rationale |
182
- |--------------|---------------------|-----------|
183
- | Technology selection (simple) | Nygard | Quick, clear choice |
184
- | Technology selection (complex) | MADR Simple | Multiple options to evaluate |
185
- | Architecture pattern | MADR Elaborate | High impact, needs analysis |
186
- | Tool/library selection | MADR Simple | Standard evaluation process |
187
- | Infrastructure change | MADR Simple or Elaborate | Depends on complexity |
188
- | Vendor selection | Business Case | Cost and ROI important |
189
- | Process change | Nygard or MADR Simple | Depends on impact |
190
- | Security decision | MADR Elaborate | High stakes, needs detail |
191
- | Performance optimization | Nygard or MADR Simple | Depends on scope |
192
- | Deprecation decision | MADR Simple | Need to document alternatives |
193
-
194
- ### Stakeholder Considerations
195
-
196
- **Few Stakeholders (1-3) → Nygard or MADR Simple**
197
- - Faster consensus
198
- - Less formal review needed
199
- - Can iterate quickly
200
-
201
- **Many Stakeholders (4+) → MADR Elaborate or Business Case**
202
- - Need comprehensive documentation
203
- - Formal review process
204
- - Multiple perspectives to capture
205
-
206
- ### Time Constraints
207
-
208
- **Urgent Decision → Nygard**
209
- - Need to document quickly
210
- - Can elaborate later if needed
211
- - Focus on essentials
212
-
213
- **Standard Timeline → MADR Simple**
214
- - Balanced approach
215
- - Adequate time for review
216
- - Good detail level
217
-
218
- **Extended Timeline → MADR Elaborate or Business Case**
219
- - Time for thorough analysis
220
- - Multiple review cycles
221
- - Comprehensive documentation
222
-
223
- ## AI Agent Selection Logic
224
-
225
- ### Automatic Template Recommendation
226
-
227
- ```typescript
228
- function recommendTemplate(decision: DecisionContext): Template {
229
- // Check for financial implications
230
- if (decision.hasCostImplications && decision.estimatedCost > threshold) {
231
- return Template.BusinessCase;
232
- }
233
-
234
- // Check complexity
235
- const complexity = assessComplexity(decision);
236
- const alternativesCount = decision.alternatives.length;
237
-
238
- if (complexity === 'low' && alternativesCount <= 2) {
239
- return Template.Nygard;
240
- }
241
-
242
- if (complexity === 'high' || alternativesCount >= 5) {
243
- return Template.MADRElaborate;
244
- }
245
-
246
- // Default to MADR Simple for most cases
247
- return Template.MADRSimple;
248
- }
249
-
250
- function assessComplexity(decision: DecisionContext): 'low' | 'medium' | 'high' {
251
- let score = 0;
252
-
253
- // Factor in various complexity indicators
254
- if (decision.stakeholders.length > 5) score += 2;
255
- if (decision.affectedSystems.length > 3) score += 2;
256
- if (decision.isReversible === false) score += 2;
257
- if (decision.riskLevel === 'high') score += 3;
258
- if (decision.alternatives.length > 4) score += 2;
259
-
260
- if (score <= 3) return 'low';
261
- if (score <= 7) return 'medium';
262
- return 'high';
263
- }
264
- ```
265
-
266
- ### User Prompt for Template Selection
267
-
268
- ```
269
- I recommend the MADR Simple template for this decision because:
270
- - You're evaluating 3 alternatives (PostgreSQL, MySQL, MongoDB)
271
- - Decision has moderate complexity
272
- - Multiple stakeholders involved
273
- - Standard evaluation process
274
-
275
- Would you like to:
276
- 1. Use MADR Simple (recommended)
277
- 2. Use Nygard (simpler, faster)
278
- 3. Use MADR Elaborate (more detailed)
279
- 4. Use Business Case (cost-focused)
280
-
281
- [1] [2] [3] [4]
282
- ```
283
-
284
- ## Template Switching
285
-
286
- ### When to Switch Templates
287
-
288
- **Upgrade to More Detailed Template:**
289
- - Decision becomes more complex than initially thought
290
- - Additional alternatives discovered
291
- - Stakeholder requests more detail
292
- - Risk level increases
293
-
294
- **Downgrade to Simpler Template:**
295
- - Decision simpler than expected
296
- - Time constraints require faster documentation
297
- - Stakeholders prefer brevity
298
- - Low-risk decision
299
-
300
- ### How to Switch Templates
301
-
302
- 1. **Copy existing content** to new template
303
- 2. **Map sections** from old to new template
304
- 3. **Fill in additional sections** if upgrading
305
- 4. **Preserve all context** and decisions
306
- 5. **Update metadata** to reflect template change
307
-
308
- ## Best Practices
309
-
310
- 1. **Start Simple, Elaborate if Needed**
311
- - Begin with Nygard or MADR Simple
312
- - Upgrade if complexity warrants
313
- - Don't over-engineer documentation
314
-
315
- 2. **Consider Your Audience**
316
- - Technical team → Nygard or MADR Simple
317
- - Executive stakeholders → Business Case
318
- - Mixed audience → MADR Elaborate
319
-
320
- 3. **Match Template to Decision Impact**
321
- - Low impact → Nygard
322
- - Medium impact → MADR Simple
323
- - High impact → MADR Elaborate or Business Case
324
-
325
- 4. **Respect Time Constraints**
326
- - Urgent → Nygard
327
- - Standard → MADR Simple
328
- - Extended → MADR Elaborate
329
-
330
- 5. **Allow Template Override**
331
- - AI recommendation is a suggestion
332
- - User knows context best
333
- - Support manual template selection
334
-
335
- ## Examples
336
-
337
- ### Example 1: Simple Decision → Nygard
338
-
339
- **Decision:** "Use Prettier for code formatting"
340
-
341
- **Why Nygard:**
342
- - Single clear option (Prettier)
343
- - Straightforward decision
344
- - Low complexity
345
- - Quick to document
346
-
347
- ### Example 2: Standard Decision → MADR Simple
348
-
349
- **Decision:** "Select state management library"
350
-
351
- **Why MADR Simple:**
352
- - 3 alternatives (Redux, MobX, Zustand)
353
- - Multiple decision drivers (learning curve, bundle size, DevTools)
354
- - Standard evaluation process
355
- - Moderate complexity
356
-
357
- ### Example 3: Complex Decision → MADR Elaborate
358
-
359
- **Decision:** "Migrate to microservices architecture"
360
-
361
- **Why MADR Elaborate:**
362
- - High-stakes decision
363
- - Multiple architectural patterns to consider
364
- - Many stakeholders (dev team, ops, management)
365
- - Significant consequences
366
- - Need detailed analysis
367
-
368
- ### Example 4: Financial Decision → Business Case
369
-
370
- **Decision:** "Purchase Datadog for monitoring"
371
-
372
- **Why Business Case:**
373
- - Significant annual cost ($50k+)
374
- - ROI justification needed
375
- - Budget approval required
376
- - Executive stakeholders
377
- - Need cost/benefit analysis
378
-
379
- ## Configuration
380
-
381
- Projects can configure template preferences in `.adr-config.json`:
382
-
383
- ```json
384
- {
385
- "templates": {
386
- "default": "madr-simple",
387
- "autoSelect": true,
388
- "allowOverride": true,
389
- "complexityThresholds": {
390
- "low": 3,
391
- "medium": 7
392
- },
393
- "costThreshold": 10000
394
- }
395
- }
396
- ```
397
-
398
- ## See Also
399
-
400
- - [ADR Creation Guidelines](./adr-creation.md)
401
- - [Nygard Template](../templates/nygard.md)
402
- - [MADR Simple Template](../templates/madr-simple.md)
403
- - [MADR Elaborate Template](../templates/madr-elaborate.md)
404
- - [Business Case Template](../templates/business-case.md)
405
-
1
+ # Template Selection Rules
2
+
3
+ ## Overview
4
+
5
+ This document defines how to select the appropriate ADR template based on decision type, complexity, and context. Choosing the right template ensures ADRs are appropriately detailed without being overly burdensome.
6
+
7
+ ## Available Templates
8
+
9
+ ### 1. Michael Nygard Template (Nygard)
10
+
11
+ **File:** `templates/nygard.md`
12
+
13
+ **Structure:**
14
+ - Title
15
+ - Status
16
+ - Context
17
+ - Decision
18
+ - Consequences
19
+
20
+ **Best For:**
21
+ - Simple, straightforward decisions
22
+ - Quick decisions with clear context
23
+ - Decisions with obvious trade-offs
24
+ - When brevity is important
25
+
26
+ **Characteristics:**
27
+ - Minimal structure
28
+ - Fast to complete
29
+ - Easy to read
30
+ - Focuses on essentials
31
+
32
+ **Example Use Cases:**
33
+ - "Use PostgreSQL for primary database"
34
+ - "Adopt ESLint for code linting"
35
+ - "Use JWT for authentication tokens"
36
+
37
+ ### 2. MADR Simple Template
38
+
39
+ **File:** `templates/madr-simple.md`
40
+
41
+ **Structure:**
42
+ - Title and metadata
43
+ - Context and Problem Statement
44
+ - Decision Drivers
45
+ - Considered Options
46
+ - Decision Outcome
47
+ - Consequences
48
+
49
+ **Best For:**
50
+ - Standard decisions (most common)
51
+ - Decisions with 2-4 alternatives
52
+ - When decision drivers are important
53
+ - Balanced detail level
54
+
55
+ **Characteristics:**
56
+ - Structured but not overwhelming
57
+ - Captures alternatives considered
58
+ - Documents decision drivers
59
+ - Good for team review
60
+
61
+ **Example Use Cases:**
62
+ - "Select state management library (Redux vs MobX vs Zustand)"
63
+ - "Choose deployment platform (AWS vs Azure vs GCP)"
64
+ - "Pick testing framework (Jest vs Vitest vs Mocha)"
65
+
66
+ ### 3. MADR Elaborate Template
67
+
68
+ **File:** `templates/madr-elaborate.md`
69
+
70
+ **Structure:**
71
+ - Title and metadata
72
+ - Context and Problem Statement
73
+ - Decision Drivers
74
+ - Considered Options (with detailed pros/cons)
75
+ - Decision Outcome
76
+ - Validation
77
+ - Consequences
78
+ - Confirmation
79
+
80
+ **Best For:**
81
+ - Complex decisions with many alternatives
82
+ - High-stakes decisions
83
+ - Decisions requiring detailed analysis
84
+ - When stakeholder buy-in is critical
85
+
86
+ **Characteristics:**
87
+ - Comprehensive structure
88
+ - Detailed pros/cons for each option
89
+ - Validation and confirmation sections
90
+ - Takes more time to complete
91
+
92
+ **Example Use Cases:**
93
+ - "Migrate from monolith to microservices"
94
+ - "Select enterprise database (PostgreSQL vs Oracle vs SQL Server)"
95
+ - "Choose cloud provider for multi-year commitment"
96
+
97
+ ### 4. Business Case Template
98
+
99
+ **File:** `templates/business-case.md`
100
+
101
+ **Structure:**
102
+ - Executive Summary
103
+ - Problem Statement
104
+ - Proposed Solution
105
+ - Cost Analysis
106
+ - ROI Projection
107
+ - Risk Assessment
108
+ - Implementation Plan
109
+ - Success Metrics
110
+
111
+ **Best For:**
112
+ - Decisions with significant cost implications
113
+ - When ROI justification is needed
114
+ - Vendor selection decisions
115
+ - Budget approval required
116
+
117
+ **Characteristics:**
118
+ - Business-focused language
119
+ - Financial analysis
120
+ - Risk/benefit quantification
121
+ - Executive-friendly format
122
+
123
+ **Example Use Cases:**
124
+ - "Purchase enterprise monitoring solution"
125
+ - "Hire dedicated DevOps team"
126
+ - "Migrate to cloud infrastructure"
127
+
128
+ ## Selection Decision Tree
129
+
130
+ ```
131
+ Start
132
+
133
+ Does decision have significant cost/ROI implications?
134
+ ├─ Yes → Business Case Template
135
+ └─ No → Continue
136
+
137
+ How many alternatives are being seriously considered?
138
+ ├─ 1-2 → Continue
139
+ │ ↓
140
+ │ Is decision straightforward with clear trade-offs?
141
+ │ ├─ Yes → Nygard Template
142
+ │ └─ No → MADR Simple Template
143
+
144
+ └─ 3+ → Continue
145
+
146
+ Is this a high-stakes decision requiring detailed analysis?
147
+ ├─ Yes → MADR Elaborate Template
148
+ └─ No → MADR Simple Template
149
+ ```
150
+
151
+ ## Selection Criteria
152
+
153
+ ### Complexity Assessment
154
+
155
+ **Low Complexity → Nygard**
156
+ - Single clear option
157
+ - Obvious trade-offs
158
+ - Limited stakeholders
159
+ - Low risk
160
+
161
+ **Medium Complexity → MADR Simple**
162
+ - 2-4 alternatives
163
+ - Multiple decision drivers
164
+ - Several stakeholders
165
+ - Moderate risk
166
+
167
+ **High Complexity → MADR Elaborate**
168
+ - 5+ alternatives
169
+ - Complex trade-offs
170
+ - Many stakeholders
171
+ - High risk/impact
172
+
173
+ **Financial Focus → Business Case**
174
+ - Significant cost
175
+ - ROI justification needed
176
+ - Budget approval required
177
+ - Executive stakeholders
178
+
179
+ ### Decision Type Mapping
180
+
181
+ | Decision Type | Recommended Template | Rationale |
182
+ |--------------|---------------------|-----------|
183
+ | Technology selection (simple) | Nygard | Quick, clear choice |
184
+ | Technology selection (complex) | MADR Simple | Multiple options to evaluate |
185
+ | Architecture pattern | MADR Elaborate | High impact, needs analysis |
186
+ | Tool/library selection | MADR Simple | Standard evaluation process |
187
+ | Infrastructure change | MADR Simple or Elaborate | Depends on complexity |
188
+ | Vendor selection | Business Case | Cost and ROI important |
189
+ | Process change | Nygard or MADR Simple | Depends on impact |
190
+ | Security decision | MADR Elaborate | High stakes, needs detail |
191
+ | Performance optimization | Nygard or MADR Simple | Depends on scope |
192
+ | Deprecation decision | MADR Simple | Need to document alternatives |
193
+
194
+ ### Stakeholder Considerations
195
+
196
+ **Few Stakeholders (1-3) → Nygard or MADR Simple**
197
+ - Faster consensus
198
+ - Less formal review needed
199
+ - Can iterate quickly
200
+
201
+ **Many Stakeholders (4+) → MADR Elaborate or Business Case**
202
+ - Need comprehensive documentation
203
+ - Formal review process
204
+ - Multiple perspectives to capture
205
+
206
+ ### Time Constraints
207
+
208
+ **Urgent Decision → Nygard**
209
+ - Need to document quickly
210
+ - Can elaborate later if needed
211
+ - Focus on essentials
212
+
213
+ **Standard Timeline → MADR Simple**
214
+ - Balanced approach
215
+ - Adequate time for review
216
+ - Good detail level
217
+
218
+ **Extended Timeline → MADR Elaborate or Business Case**
219
+ - Time for thorough analysis
220
+ - Multiple review cycles
221
+ - Comprehensive documentation
222
+
223
+ ## AI Agent Selection Logic
224
+
225
+ ### Automatic Template Recommendation
226
+
227
+ ```typescript
228
+ function recommendTemplate(decision: DecisionContext): Template {
229
+ // Check for financial implications
230
+ if (decision.hasCostImplications && decision.estimatedCost > threshold) {
231
+ return Template.BusinessCase;
232
+ }
233
+
234
+ // Check complexity
235
+ const complexity = assessComplexity(decision);
236
+ const alternativesCount = decision.alternatives.length;
237
+
238
+ if (complexity === 'low' && alternativesCount <= 2) {
239
+ return Template.Nygard;
240
+ }
241
+
242
+ if (complexity === 'high' || alternativesCount >= 5) {
243
+ return Template.MADRElaborate;
244
+ }
245
+
246
+ // Default to MADR Simple for most cases
247
+ return Template.MADRSimple;
248
+ }
249
+
250
+ function assessComplexity(decision: DecisionContext): 'low' | 'medium' | 'high' {
251
+ let score = 0;
252
+
253
+ // Factor in various complexity indicators
254
+ if (decision.stakeholders.length > 5) score += 2;
255
+ if (decision.affectedSystems.length > 3) score += 2;
256
+ if (decision.isReversible === false) score += 2;
257
+ if (decision.riskLevel === 'high') score += 3;
258
+ if (decision.alternatives.length > 4) score += 2;
259
+
260
+ if (score <= 3) return 'low';
261
+ if (score <= 7) return 'medium';
262
+ return 'high';
263
+ }
264
+ ```
265
+
266
+ ### User Prompt for Template Selection
267
+
268
+ ```
269
+ I recommend the MADR Simple template for this decision because:
270
+ - You're evaluating 3 alternatives (PostgreSQL, MySQL, MongoDB)
271
+ - Decision has moderate complexity
272
+ - Multiple stakeholders involved
273
+ - Standard evaluation process
274
+
275
+ Would you like to:
276
+ 1. Use MADR Simple (recommended)
277
+ 2. Use Nygard (simpler, faster)
278
+ 3. Use MADR Elaborate (more detailed)
279
+ 4. Use Business Case (cost-focused)
280
+
281
+ [1] [2] [3] [4]
282
+ ```
283
+
284
+ ## Template Switching
285
+
286
+ ### When to Switch Templates
287
+
288
+ **Upgrade to More Detailed Template:**
289
+ - Decision becomes more complex than initially thought
290
+ - Additional alternatives discovered
291
+ - Stakeholder requests more detail
292
+ - Risk level increases
293
+
294
+ **Downgrade to Simpler Template:**
295
+ - Decision simpler than expected
296
+ - Time constraints require faster documentation
297
+ - Stakeholders prefer brevity
298
+ - Low-risk decision
299
+
300
+ ### How to Switch Templates
301
+
302
+ 1. **Copy existing content** to new template
303
+ 2. **Map sections** from old to new template
304
+ 3. **Fill in additional sections** if upgrading
305
+ 4. **Preserve all context** and decisions
306
+ 5. **Update metadata** to reflect template change
307
+
308
+ ## Best Practices
309
+
310
+ 1. **Start Simple, Elaborate if Needed**
311
+ - Begin with Nygard or MADR Simple
312
+ - Upgrade if complexity warrants
313
+ - Don't over-engineer documentation
314
+
315
+ 2. **Consider Your Audience**
316
+ - Technical team → Nygard or MADR Simple
317
+ - Executive stakeholders → Business Case
318
+ - Mixed audience → MADR Elaborate
319
+
320
+ 3. **Match Template to Decision Impact**
321
+ - Low impact → Nygard
322
+ - Medium impact → MADR Simple
323
+ - High impact → MADR Elaborate or Business Case
324
+
325
+ 4. **Respect Time Constraints**
326
+ - Urgent → Nygard
327
+ - Standard → MADR Simple
328
+ - Extended → MADR Elaborate
329
+
330
+ 5. **Allow Template Override**
331
+ - AI recommendation is a suggestion
332
+ - User knows context best
333
+ - Support manual template selection
334
+
335
+ ## Examples
336
+
337
+ ### Example 1: Simple Decision → Nygard
338
+
339
+ **Decision:** "Use Prettier for code formatting"
340
+
341
+ **Why Nygard:**
342
+ - Single clear option (Prettier)
343
+ - Straightforward decision
344
+ - Low complexity
345
+ - Quick to document
346
+
347
+ ### Example 2: Standard Decision → MADR Simple
348
+
349
+ **Decision:** "Select state management library"
350
+
351
+ **Why MADR Simple:**
352
+ - 3 alternatives (Redux, MobX, Zustand)
353
+ - Multiple decision drivers (learning curve, bundle size, DevTools)
354
+ - Standard evaluation process
355
+ - Moderate complexity
356
+
357
+ ### Example 3: Complex Decision → MADR Elaborate
358
+
359
+ **Decision:** "Migrate to microservices architecture"
360
+
361
+ **Why MADR Elaborate:**
362
+ - High-stakes decision
363
+ - Multiple architectural patterns to consider
364
+ - Many stakeholders (dev team, ops, management)
365
+ - Significant consequences
366
+ - Need detailed analysis
367
+
368
+ ### Example 4: Financial Decision → Business Case
369
+
370
+ **Decision:** "Purchase Datadog for monitoring"
371
+
372
+ **Why Business Case:**
373
+ - Significant annual cost ($50k+)
374
+ - ROI justification needed
375
+ - Budget approval required
376
+ - Executive stakeholders
377
+ - Need cost/benefit analysis
378
+
379
+ ## Configuration
380
+
381
+ Projects can configure template preferences in `.adr-config.json`:
382
+
383
+ ```json
384
+ {
385
+ "templates": {
386
+ "default": "madr-simple",
387
+ "autoSelect": true,
388
+ "allowOverride": true,
389
+ "complexityThresholds": {
390
+ "low": 3,
391
+ "medium": 7
392
+ },
393
+ "costThreshold": 10000
394
+ }
395
+ }
396
+ ```
397
+
398
+ ## See Also
399
+
400
+ - [ADR Creation Guidelines](./adr-creation.md)
401
+ - [Nygard Template](../templates/nygard.md)
402
+ - [MADR Simple Template](../templates/madr-simple.md)
403
+ - [MADR Elaborate Template](../templates/madr-elaborate.md)
404
+ - [Business Case Template](../templates/business-case.md)
405
+