@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,436 +1,436 @@
1
- # ADR Superseding Example
2
-
3
- This example demonstrates how to properly supersede an Architecture Decision Record (ADR) when a previous decision needs to be replaced with a new one.
4
-
5
- ## Overview
6
-
7
- This example shows:
8
- - **ADR-0023**: "Use MongoDB for Primary Database" (original decision)
9
- - **ADR-0067**: "Migrate to PostgreSQL" (superseding decision)
10
-
11
- The superseding workflow includes proper linking, status updates, and coordination manifest updates.
12
-
13
- ---
14
-
15
- ## Step 1: Original ADR (Active)
16
-
17
- **File:** `adr/0023-use-mongodb.md`
18
-
19
- ```markdown
20
- # ADR-0023: Use MongoDB for Primary Database
21
-
22
- **Status:** Implemented
23
-
24
- **Date:** 2025-06-15
25
-
26
- **Deciders:** Tech Lead, Database Architect, Backend Team
27
-
28
- **Technical Story:** Related to OpenSpec spec: database/schema
29
-
30
- ---
31
-
32
- ## Context
33
-
34
- We need a database solution for our new application with the following requirements:
35
- - Flexible schema for rapid iteration
36
- - Horizontal scalability
37
- - JSON-like document storage
38
- - Strong community support
39
-
40
- ### Forces
41
-
42
- - Development speed is critical (6-month deadline)
43
- - Schema may evolve frequently during MVP phase
44
- - Team has MongoDB experience
45
- - Uncertain about final data model
46
-
47
- ---
48
-
49
- ## Decision
50
-
51
- We will use MongoDB as our primary database.
52
-
53
- ### Rationale
54
-
55
- 1. **Flexible Schema**: Document model allows rapid iteration
56
- 2. **Team Experience**: Team has 2+ years MongoDB experience
57
- 3. **Development Speed**: Faster prototyping with dynamic schema
58
- 4. **Scalability**: Built-in sharding for horizontal scaling
59
-
60
- ---
61
-
62
- ## Consequences
63
-
64
- ### Positive
65
-
66
- - Faster initial development
67
- - Easy schema evolution
68
- - Good developer experience
69
- - Strong ecosystem and tooling
70
-
71
- ### Negative
72
-
73
- - Limited transaction support (at time of decision)
74
- - Eventual consistency challenges
75
- - Complex aggregation queries
76
- - Higher memory usage
77
-
78
- ### Neutral
79
-
80
- - Need to learn MongoDB-specific patterns
81
- - Different backup/restore procedures
82
-
83
- ---
84
-
85
- ## Related Decisions
86
-
87
- - Related to: [ADR-0022](0022-microservices-architecture.md)
88
-
89
- ---
90
-
91
- ## Notes
92
-
93
- ### Implementation Notes
94
-
95
- - MongoDB 4.2 selected for multi-document transactions
96
- - Replica set with 3 nodes for high availability
97
- - Mongoose ODM for Node.js integration
98
- ```
99
-
100
- ---
101
-
102
- ## Step 2: Identifying Need for Change
103
-
104
- **Trigger:** After 18 months of production use, several issues emerged:
105
-
106
- 1. **Transaction Complexity**: Multi-collection transactions causing performance issues
107
- 2. **Query Performance**: Complex joins requiring multiple queries
108
- 3. **Data Integrity**: Lack of foreign key constraints causing data inconsistencies
109
- 4. **Operational Costs**: Higher memory and storage costs than anticipated
110
- 5. **Team Growth**: New team members prefer relational databases
111
-
112
- **Decision Point:** Team decides to migrate to PostgreSQL.
113
-
114
- ---
115
-
116
- ## Step 3: Create Superseding ADR
117
-
118
- **File:** `adr/0067-migrate-to-postgresql.md`
119
-
120
- ```markdown
121
- # ADR-0067: Migrate to PostgreSQL
122
-
123
- **Status:** Approved
124
-
125
- **Date:** 2026-12-01
126
-
127
- **Deciders:** Tech Lead, Database Architect, Backend Team, DevOps Lead
128
-
129
- **Technical Story:** Related to OpenSpec change: postgresql-migration
130
-
131
- ---
132
-
133
- ## Context
134
-
135
- After 18 months using MongoDB (ADR-0023), we've encountered several challenges:
136
-
137
- 1. **Transaction Complexity**: Multi-collection transactions causing 200ms+ latency
138
- 2. **Query Performance**: Complex aggregations requiring multiple round-trips
139
- 3. **Data Integrity**: 47 data inconsistency incidents due to lack of foreign keys
140
- 4. **Operational Costs**: 40% higher than projected ($12k/month vs $8.5k/month)
141
- 5. **Team Expertise**: 5 new hires with strong PostgreSQL background
142
-
143
- ### Forces
144
-
145
- - Production system with 50k active users
146
- - Cannot afford extended downtime
147
- - Need to maintain feature velocity during migration
148
- - Must preserve all existing data
149
- - Team capacity: 2 backend engineers for migration
150
-
151
- ---
152
-
153
- ## Decision
154
-
155
- We will migrate from MongoDB to PostgreSQL as our primary database.
156
-
157
- ### Rationale
158
-
159
- 1. **ACID Transactions**: Native support for complex multi-table transactions
160
- 2. **Query Performance**: Relational model better fits our evolved data structure
161
- 3. **Data Integrity**: Foreign key constraints prevent inconsistencies
162
- 4. **Cost Efficiency**: Projected 35% cost reduction
163
- 5. **Team Expertise**: Better alignment with current team skills
164
- 6. **JSON Support**: PostgreSQL JSONB provides flexibility where needed
165
-
166
- ---
167
-
168
- ## Consequences
169
-
170
- ### Positive
171
-
172
- - Improved data integrity with foreign key constraints
173
- - Better query performance for complex joins
174
- - Lower operational costs
175
- - Stronger ACID guarantees
176
- - Better tooling and monitoring
177
-
178
- ### Negative
179
-
180
- - 3-4 month migration effort
181
- - Temporary dual-database complexity
182
- - Need to rewrite aggregation queries
183
- - Learning curve for PostgreSQL-specific features
184
-
185
- ### Neutral
186
-
187
- - Different backup/restore procedures
188
- - Schema migrations become more structured
189
- - Need to adopt new ORM (Sequelize or TypeORM)
190
-
191
- ---
192
-
193
- ## Related Decisions
194
-
195
- - **Supersedes**: [ADR-0023](0023-use-mongodb.md) - Use MongoDB for Primary Database
196
- - Related to: [ADR-0022](0022-microservices-architecture.md)
197
-
198
- ---
199
-
200
- ## Notes
201
-
202
- ### Migration Strategy
203
-
204
- 1. **Phase 1**: Set up PostgreSQL infrastructure (2 weeks)
205
- 2. **Phase 2**: Dual-write to both databases (4 weeks)
206
- 3. **Phase 3**: Migrate historical data (2 weeks)
207
- 4. **Phase 4**: Switch reads to PostgreSQL (2 weeks)
208
- 5. **Phase 5**: Decommission MongoDB (2 weeks)
209
-
210
- ### Implementation Notes
211
-
212
- - PostgreSQL 15 selected for improved JSON performance
213
- - Primary-replica setup with 2 read replicas
214
- - Sequelize ORM for Node.js integration
215
- - Automated schema migration with db-migrate
216
-
217
- ### References
218
-
219
- - [Migration Plan](../openspec/changes/postgresql-migration/proposal.md)
220
- - [Performance Benchmarks](../docs/postgresql-benchmarks.md)
221
- ```
222
-
223
- ---
224
-
225
- ## Step 4: Update Original ADR Status
226
-
227
- Update `adr/0023-use-mongodb.md` to mark it as superseded:
228
-
229
- ```diff
230
- - **Status:** Implemented
231
- + **Status:** Superseded
232
-
233
- + **Superseded By:** [ADR-0067](0067-migrate-to-postgresql.md)
234
- + **Superseded Date:** 2026-12-01
235
- ```
236
-
237
- Add superseded reason to the end of the file:
238
-
239
- ```markdown
240
- ---
241
-
242
- ## Superseded
243
-
244
- **Date:** 2026-12-01
245
-
246
- **Superseded By:** [ADR-0067](0067-migrate-to-postgresql.md) - Migrate to PostgreSQL
247
-
248
- **Reason:** After 18 months in production, we encountered transaction complexity, query performance issues, data integrity challenges, and higher operational costs than anticipated. PostgreSQL better aligns with our evolved data model and team expertise.
249
-
250
- **Historical Context:** This decision was appropriate for our MVP phase when schema flexibility and development speed were critical. As the application matured, the need for strong data integrity and complex transactions became more important.
251
- ```
252
-
253
- ---
254
-
255
- ## Step 5: Update Coordination Manifest
256
-
257
- Update `.augment/coordination.json` to reflect the superseding relationship:
258
-
259
- ```json
260
- {
261
- "adrs": {
262
- "adr-0023": {
263
- "file": "adr/0023-use-mongodb.md",
264
- "title": "Use MongoDB for Primary Database",
265
- "status": "superseded",
266
- "supersededBy": "adr-0067",
267
- "supersededDate": "2026-12-01",
268
- "relatedSpecs": ["database/schema"],
269
- "relatedTasks": ["bd-db01", "bd-db02", "bd-db03"]
270
- },
271
- "adr-0067": {
272
- "file": "adr/0067-migrate-to-postgresql.md",
273
- "title": "Migrate to PostgreSQL",
274
- "status": "approved",
275
- "supersedes": ["adr-0023"],
276
- "relatedSpecs": ["database/postgresql-schema"],
277
- "relatedChanges": ["postgresql-migration"],
278
- "relatedTasks": ["bd-pg01", "bd-pg02", "bd-pg03", "bd-pg04", "bd-pg05"]
279
- }
280
- },
281
- "specs": {
282
- "database/schema": {
283
- "file": "openspec/specs/database/schema.md",
284
- "status": "superseded",
285
- "relatedADRs": ["adr-0023"],
286
- "supersededBy": "database/postgresql-schema"
287
- },
288
- "database/postgresql-schema": {
289
- "file": "openspec/specs/database/postgresql-schema.md",
290
- "status": "active",
291
- "relatedADRs": ["adr-0067"],
292
- "supersedes": "database/schema"
293
- }
294
- },
295
- "tasks": {
296
- "bd-pg01": {
297
- "title": "Set up PostgreSQL infrastructure",
298
- "status": "in_progress",
299
- "relatedADRs": ["adr-0067"],
300
- "relatedSpecs": ["database/postgresql-schema"]
301
- },
302
- "bd-pg02": {
303
- "title": "Implement dual-write layer",
304
- "status": "open",
305
- "relatedADRs": ["adr-0067"]
306
- },
307
- "bd-pg03": {
308
- "title": "Migrate historical data",
309
- "status": "open",
310
- "relatedADRs": ["adr-0067"]
311
- },
312
- "bd-pg04": {
313
- "title": "Switch reads to PostgreSQL",
314
- "status": "open",
315
- "relatedADRs": ["adr-0067"]
316
- },
317
- "bd-pg05": {
318
- "title": "Decommission MongoDB",
319
- "status": "open",
320
- "relatedADRs": ["adr-0067"],
321
- "blockedBy": ["bd-pg04"]
322
- }
323
- }
324
- }
325
- ```
326
-
327
- ---
328
-
329
- ## Step 6: Create Beads Tasks
330
-
331
- Create implementation tasks for the migration:
332
-
333
- ```bash
334
- # Create epic for migration
335
- bd create "Migrate from MongoDB to PostgreSQL" \
336
- --type epic \
337
- --priority 1 \
338
- --labels "adr-0067,database,migration"
339
-
340
- # Create subtasks
341
- bd create "Set up PostgreSQL infrastructure" \
342
- --parent bd-pg00 \
343
- --priority 1 \
344
- --labels "adr-0067,infrastructure"
345
-
346
- bd create "Implement dual-write layer" \
347
- --parent bd-pg00 \
348
- --priority 1 \
349
- --labels "adr-0067,implementation" \
350
- --blocks bd-pg03
351
-
352
- bd create "Migrate historical data" \
353
- --parent bd-pg00 \
354
- --priority 1 \
355
- --labels "adr-0067,migration" \
356
- --blocks bd-pg04
357
-
358
- bd create "Switch reads to PostgreSQL" \
359
- --parent bd-pg00 \
360
- --priority 1 \
361
- --labels "adr-0067,cutover" \
362
- --blocks bd-pg05
363
-
364
- bd create "Decommission MongoDB" \
365
- --parent bd-pg00 \
366
- --priority 2 \
367
- --labels "adr-0067,cleanup"
368
-
369
- # Link epic to ADR
370
- bd comment bd-pg00 "Implementing ADR-0067: Migrate to PostgreSQL (adr/0067-migrate-to-postgresql.md)"
371
- ```
372
-
373
- ---
374
-
375
- ## Step 7: Update OpenSpec
376
-
377
- Create OpenSpec change for the migration:
378
-
379
- **File:** `openspec/changes/postgresql-migration/proposal.md`
380
-
381
- ```markdown
382
- # PostgreSQL Migration
383
-
384
- ## Related ADR
385
-
386
- - [ADR-0067: Migrate to PostgreSQL](../../../adr/0067-migrate-to-postgresql.md)
387
- - Supersedes: [ADR-0023: Use MongoDB](../../../adr/0023-use-mongodb.md)
388
-
389
- ## Overview
390
-
391
- Migrate from MongoDB to PostgreSQL based on architectural decision ADR-0067.
392
-
393
- ## Motivation
394
-
395
- See ADR-0067 for detailed context and rationale.
396
-
397
- ## Proposed Changes
398
-
399
- [Migration details...]
400
- ```
401
-
402
- ---
403
-
404
- ## Workflow Summary
405
-
406
- ### Superseding Checklist
407
-
408
- - [x] **Create new ADR** with superseding decision
409
- - [x] **Link to original ADR** in "Supersedes" section
410
- - [x] **Update original ADR** status to "Superseded"
411
- - [x] **Add superseded metadata** to original ADR
412
- - [x] **Update coordination manifest** with both ADRs
413
- - [x] **Create implementation tasks** in Beads
414
- - [x] **Link OpenSpec changes** to new ADR
415
- - [x] **Document migration strategy** in new ADR
416
- - [x] **Preserve historical context** in original ADR
417
-
418
- ### Key Principles
419
-
420
- 1. **Never delete superseded ADRs** - They provide historical context
421
- 2. **Always link bidirectionally** - Both ADRs should reference each other
422
- 3. **Document the reason** - Explain why the decision changed
423
- 4. **Preserve context** - Original ADR shows why it made sense at the time
424
- 5. **Update all references** - Coordination manifest, specs, tasks
425
-
426
- ---
427
-
428
- ## See Also
429
-
430
- - [Complete Lifecycle Example](./complete-lifecycle-example.md)
431
- - [Integration Example](./integration-example.md)
432
- - [Lifecycle Management Rules](../rules/lifecycle-management.md)
433
- - [OpenSpec Integration](../rules/openspec-integration.md)
434
- - [Beads Integration](../rules/beads-integration.md)
435
-
436
-
1
+ # ADR Superseding Example
2
+
3
+ This example demonstrates how to properly supersede an Architecture Decision Record (ADR) when a previous decision needs to be replaced with a new one.
4
+
5
+ ## Overview
6
+
7
+ This example shows:
8
+ - **ADR-0023**: "Use MongoDB for Primary Database" (original decision)
9
+ - **ADR-0067**: "Migrate to PostgreSQL" (superseding decision)
10
+
11
+ The superseding workflow includes proper linking, status updates, and coordination manifest updates.
12
+
13
+ ---
14
+
15
+ ## Step 1: Original ADR (Active)
16
+
17
+ **File:** `adr/0023-use-mongodb.md`
18
+
19
+ ```markdown
20
+ # ADR-0023: Use MongoDB for Primary Database
21
+
22
+ **Status:** Implemented
23
+
24
+ **Date:** 2025-06-15
25
+
26
+ **Deciders:** Tech Lead, Database Architect, Backend Team
27
+
28
+ **Technical Story:** Related to OpenSpec spec: database/schema
29
+
30
+ ---
31
+
32
+ ## Context
33
+
34
+ We need a database solution for our new application with the following requirements:
35
+ - Flexible schema for rapid iteration
36
+ - Horizontal scalability
37
+ - JSON-like document storage
38
+ - Strong community support
39
+
40
+ ### Forces
41
+
42
+ - Development speed is critical (6-month deadline)
43
+ - Schema may evolve frequently during MVP phase
44
+ - Team has MongoDB experience
45
+ - Uncertain about final data model
46
+
47
+ ---
48
+
49
+ ## Decision
50
+
51
+ We will use MongoDB as our primary database.
52
+
53
+ ### Rationale
54
+
55
+ 1. **Flexible Schema**: Document model allows rapid iteration
56
+ 2. **Team Experience**: Team has 2+ years MongoDB experience
57
+ 3. **Development Speed**: Faster prototyping with dynamic schema
58
+ 4. **Scalability**: Built-in sharding for horizontal scaling
59
+
60
+ ---
61
+
62
+ ## Consequences
63
+
64
+ ### Positive
65
+
66
+ - Faster initial development
67
+ - Easy schema evolution
68
+ - Good developer experience
69
+ - Strong ecosystem and tooling
70
+
71
+ ### Negative
72
+
73
+ - Limited transaction support (at time of decision)
74
+ - Eventual consistency challenges
75
+ - Complex aggregation queries
76
+ - Higher memory usage
77
+
78
+ ### Neutral
79
+
80
+ - Need to learn MongoDB-specific patterns
81
+ - Different backup/restore procedures
82
+
83
+ ---
84
+
85
+ ## Related Decisions
86
+
87
+ - Related to: [ADR-0022](0022-microservices-architecture.md)
88
+
89
+ ---
90
+
91
+ ## Notes
92
+
93
+ ### Implementation Notes
94
+
95
+ - MongoDB 4.2 selected for multi-document transactions
96
+ - Replica set with 3 nodes for high availability
97
+ - Mongoose ODM for Node.js integration
98
+ ```
99
+
100
+ ---
101
+
102
+ ## Step 2: Identifying Need for Change
103
+
104
+ **Trigger:** After 18 months of production use, several issues emerged:
105
+
106
+ 1. **Transaction Complexity**: Multi-collection transactions causing performance issues
107
+ 2. **Query Performance**: Complex joins requiring multiple queries
108
+ 3. **Data Integrity**: Lack of foreign key constraints causing data inconsistencies
109
+ 4. **Operational Costs**: Higher memory and storage costs than anticipated
110
+ 5. **Team Growth**: New team members prefer relational databases
111
+
112
+ **Decision Point:** Team decides to migrate to PostgreSQL.
113
+
114
+ ---
115
+
116
+ ## Step 3: Create Superseding ADR
117
+
118
+ **File:** `adr/0067-migrate-to-postgresql.md`
119
+
120
+ ```markdown
121
+ # ADR-0067: Migrate to PostgreSQL
122
+
123
+ **Status:** Approved
124
+
125
+ **Date:** 2026-12-01
126
+
127
+ **Deciders:** Tech Lead, Database Architect, Backend Team, DevOps Lead
128
+
129
+ **Technical Story:** Related to OpenSpec change: postgresql-migration
130
+
131
+ ---
132
+
133
+ ## Context
134
+
135
+ After 18 months using MongoDB (ADR-0023), we've encountered several challenges:
136
+
137
+ 1. **Transaction Complexity**: Multi-collection transactions causing 200ms+ latency
138
+ 2. **Query Performance**: Complex aggregations requiring multiple round-trips
139
+ 3. **Data Integrity**: 47 data inconsistency incidents due to lack of foreign keys
140
+ 4. **Operational Costs**: 40% higher than projected ($12k/month vs $8.5k/month)
141
+ 5. **Team Expertise**: 5 new hires with strong PostgreSQL background
142
+
143
+ ### Forces
144
+
145
+ - Production system with 50k active users
146
+ - Cannot afford extended downtime
147
+ - Need to maintain feature velocity during migration
148
+ - Must preserve all existing data
149
+ - Team capacity: 2 backend engineers for migration
150
+
151
+ ---
152
+
153
+ ## Decision
154
+
155
+ We will migrate from MongoDB to PostgreSQL as our primary database.
156
+
157
+ ### Rationale
158
+
159
+ 1. **ACID Transactions**: Native support for complex multi-table transactions
160
+ 2. **Query Performance**: Relational model better fits our evolved data structure
161
+ 3. **Data Integrity**: Foreign key constraints prevent inconsistencies
162
+ 4. **Cost Efficiency**: Projected 35% cost reduction
163
+ 5. **Team Expertise**: Better alignment with current team skills
164
+ 6. **JSON Support**: PostgreSQL JSONB provides flexibility where needed
165
+
166
+ ---
167
+
168
+ ## Consequences
169
+
170
+ ### Positive
171
+
172
+ - Improved data integrity with foreign key constraints
173
+ - Better query performance for complex joins
174
+ - Lower operational costs
175
+ - Stronger ACID guarantees
176
+ - Better tooling and monitoring
177
+
178
+ ### Negative
179
+
180
+ - 3-4 month migration effort
181
+ - Temporary dual-database complexity
182
+ - Need to rewrite aggregation queries
183
+ - Learning curve for PostgreSQL-specific features
184
+
185
+ ### Neutral
186
+
187
+ - Different backup/restore procedures
188
+ - Schema migrations become more structured
189
+ - Need to adopt new ORM (Sequelize or TypeORM)
190
+
191
+ ---
192
+
193
+ ## Related Decisions
194
+
195
+ - **Supersedes**: [ADR-0023](0023-use-mongodb.md) - Use MongoDB for Primary Database
196
+ - Related to: [ADR-0022](0022-microservices-architecture.md)
197
+
198
+ ---
199
+
200
+ ## Notes
201
+
202
+ ### Migration Strategy
203
+
204
+ 1. **Phase 1**: Set up PostgreSQL infrastructure (2 weeks)
205
+ 2. **Phase 2**: Dual-write to both databases (4 weeks)
206
+ 3. **Phase 3**: Migrate historical data (2 weeks)
207
+ 4. **Phase 4**: Switch reads to PostgreSQL (2 weeks)
208
+ 5. **Phase 5**: Decommission MongoDB (2 weeks)
209
+
210
+ ### Implementation Notes
211
+
212
+ - PostgreSQL 15 selected for improved JSON performance
213
+ - Primary-replica setup with 2 read replicas
214
+ - Sequelize ORM for Node.js integration
215
+ - Automated schema migration with db-migrate
216
+
217
+ ### References
218
+
219
+ - [Migration Plan](../openspec/changes/postgresql-migration/proposal.md)
220
+ - [Performance Benchmarks](../docs/postgresql-benchmarks.md)
221
+ ```
222
+
223
+ ---
224
+
225
+ ## Step 4: Update Original ADR Status
226
+
227
+ Update `adr/0023-use-mongodb.md` to mark it as superseded:
228
+
229
+ ```diff
230
+ - **Status:** Implemented
231
+ + **Status:** Superseded
232
+
233
+ + **Superseded By:** [ADR-0067](0067-migrate-to-postgresql.md)
234
+ + **Superseded Date:** 2026-12-01
235
+ ```
236
+
237
+ Add superseded reason to the end of the file:
238
+
239
+ ```markdown
240
+ ---
241
+
242
+ ## Superseded
243
+
244
+ **Date:** 2026-12-01
245
+
246
+ **Superseded By:** [ADR-0067](0067-migrate-to-postgresql.md) - Migrate to PostgreSQL
247
+
248
+ **Reason:** After 18 months in production, we encountered transaction complexity, query performance issues, data integrity challenges, and higher operational costs than anticipated. PostgreSQL better aligns with our evolved data model and team expertise.
249
+
250
+ **Historical Context:** This decision was appropriate for our MVP phase when schema flexibility and development speed were critical. As the application matured, the need for strong data integrity and complex transactions became more important.
251
+ ```
252
+
253
+ ---
254
+
255
+ ## Step 5: Update Coordination Manifest
256
+
257
+ Update `.augment/coordination.json` to reflect the superseding relationship:
258
+
259
+ ```json
260
+ {
261
+ "adrs": {
262
+ "adr-0023": {
263
+ "file": "adr/0023-use-mongodb.md",
264
+ "title": "Use MongoDB for Primary Database",
265
+ "status": "superseded",
266
+ "supersededBy": "adr-0067",
267
+ "supersededDate": "2026-12-01",
268
+ "relatedSpecs": ["database/schema"],
269
+ "relatedTasks": ["bd-db01", "bd-db02", "bd-db03"]
270
+ },
271
+ "adr-0067": {
272
+ "file": "adr/0067-migrate-to-postgresql.md",
273
+ "title": "Migrate to PostgreSQL",
274
+ "status": "approved",
275
+ "supersedes": ["adr-0023"],
276
+ "relatedSpecs": ["database/postgresql-schema"],
277
+ "relatedChanges": ["postgresql-migration"],
278
+ "relatedTasks": ["bd-pg01", "bd-pg02", "bd-pg03", "bd-pg04", "bd-pg05"]
279
+ }
280
+ },
281
+ "specs": {
282
+ "database/schema": {
283
+ "file": "openspec/specs/database/schema.md",
284
+ "status": "superseded",
285
+ "relatedADRs": ["adr-0023"],
286
+ "supersededBy": "database/postgresql-schema"
287
+ },
288
+ "database/postgresql-schema": {
289
+ "file": "openspec/specs/database/postgresql-schema.md",
290
+ "status": "active",
291
+ "relatedADRs": ["adr-0067"],
292
+ "supersedes": "database/schema"
293
+ }
294
+ },
295
+ "tasks": {
296
+ "bd-pg01": {
297
+ "title": "Set up PostgreSQL infrastructure",
298
+ "status": "in_progress",
299
+ "relatedADRs": ["adr-0067"],
300
+ "relatedSpecs": ["database/postgresql-schema"]
301
+ },
302
+ "bd-pg02": {
303
+ "title": "Implement dual-write layer",
304
+ "status": "open",
305
+ "relatedADRs": ["adr-0067"]
306
+ },
307
+ "bd-pg03": {
308
+ "title": "Migrate historical data",
309
+ "status": "open",
310
+ "relatedADRs": ["adr-0067"]
311
+ },
312
+ "bd-pg04": {
313
+ "title": "Switch reads to PostgreSQL",
314
+ "status": "open",
315
+ "relatedADRs": ["adr-0067"]
316
+ },
317
+ "bd-pg05": {
318
+ "title": "Decommission MongoDB",
319
+ "status": "open",
320
+ "relatedADRs": ["adr-0067"],
321
+ "blockedBy": ["bd-pg04"]
322
+ }
323
+ }
324
+ }
325
+ ```
326
+
327
+ ---
328
+
329
+ ## Step 6: Create Beads Tasks
330
+
331
+ Create implementation tasks for the migration:
332
+
333
+ ```bash
334
+ # Create epic for migration
335
+ bd create "Migrate from MongoDB to PostgreSQL" \
336
+ --type epic \
337
+ --priority 1 \
338
+ --labels "adr-0067,database,migration"
339
+
340
+ # Create subtasks
341
+ bd create "Set up PostgreSQL infrastructure" \
342
+ --parent bd-pg00 \
343
+ --priority 1 \
344
+ --labels "adr-0067,infrastructure"
345
+
346
+ bd create "Implement dual-write layer" \
347
+ --parent bd-pg00 \
348
+ --priority 1 \
349
+ --labels "adr-0067,implementation" \
350
+ --blocks bd-pg03
351
+
352
+ bd create "Migrate historical data" \
353
+ --parent bd-pg00 \
354
+ --priority 1 \
355
+ --labels "adr-0067,migration" \
356
+ --blocks bd-pg04
357
+
358
+ bd create "Switch reads to PostgreSQL" \
359
+ --parent bd-pg00 \
360
+ --priority 1 \
361
+ --labels "adr-0067,cutover" \
362
+ --blocks bd-pg05
363
+
364
+ bd create "Decommission MongoDB" \
365
+ --parent bd-pg00 \
366
+ --priority 2 \
367
+ --labels "adr-0067,cleanup"
368
+
369
+ # Link epic to ADR
370
+ bd comment bd-pg00 "Implementing ADR-0067: Migrate to PostgreSQL (adr/0067-migrate-to-postgresql.md)"
371
+ ```
372
+
373
+ ---
374
+
375
+ ## Step 7: Update OpenSpec
376
+
377
+ Create OpenSpec change for the migration:
378
+
379
+ **File:** `openspec/changes/postgresql-migration/proposal.md`
380
+
381
+ ```markdown
382
+ # PostgreSQL Migration
383
+
384
+ ## Related ADR
385
+
386
+ - [ADR-0067: Migrate to PostgreSQL](../../../adr/0067-migrate-to-postgresql.md)
387
+ - Supersedes: [ADR-0023: Use MongoDB](../../../adr/0023-use-mongodb.md)
388
+
389
+ ## Overview
390
+
391
+ Migrate from MongoDB to PostgreSQL based on architectural decision ADR-0067.
392
+
393
+ ## Motivation
394
+
395
+ See ADR-0067 for detailed context and rationale.
396
+
397
+ ## Proposed Changes
398
+
399
+ [Migration details...]
400
+ ```
401
+
402
+ ---
403
+
404
+ ## Workflow Summary
405
+
406
+ ### Superseding Checklist
407
+
408
+ - [x] **Create new ADR** with superseding decision
409
+ - [x] **Link to original ADR** in "Supersedes" section
410
+ - [x] **Update original ADR** status to "Superseded"
411
+ - [x] **Add superseded metadata** to original ADR
412
+ - [x] **Update coordination manifest** with both ADRs
413
+ - [x] **Create implementation tasks** in Beads
414
+ - [x] **Link OpenSpec changes** to new ADR
415
+ - [x] **Document migration strategy** in new ADR
416
+ - [x] **Preserve historical context** in original ADR
417
+
418
+ ### Key Principles
419
+
420
+ 1. **Never delete superseded ADRs** - They provide historical context
421
+ 2. **Always link bidirectionally** - Both ADRs should reference each other
422
+ 3. **Document the reason** - Explain why the decision changed
423
+ 4. **Preserve context** - Original ADR shows why it made sense at the time
424
+ 5. **Update all references** - Coordination manifest, specs, tasks
425
+
426
+ ---
427
+
428
+ ## See Also
429
+
430
+ - [Complete Lifecycle Example](./complete-lifecycle-example.md)
431
+ - [Integration Example](./integration-example.md)
432
+ - [Lifecycle Management Rules](../rules/lifecycle-management.md)
433
+ - [OpenSpec Integration](../rules/openspec-integration.md)
434
+ - [Beads Integration](../rules/beads-integration.md)
435
+
436
+