@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,372 +1,372 @@
1
- # ADR Creation Guidelines
2
-
3
- ## Overview
4
-
5
- This document defines the process for creating Architecture Decision Records (ADRs), including automation, metadata generation, context extraction, and file creation workflow.
6
-
7
- ## Creation Workflow
8
-
9
- ### Step 1: Initiate ADR Creation
10
-
11
- ADRs can be created through:
12
-
13
- 1. **Automatic Detection** - AI agent detects decision and prompts user
14
- 2. **Manual Request** - User explicitly requests ADR creation
15
- 3. **Workflow Integration** - Created as part of OpenSpec/Beads workflow
16
-
17
- ### Step 2: Gather Decision Information
18
-
19
- Collect the following information:
20
-
21
- #### Required Information
22
- - **Title**: Brief, descriptive decision title
23
- - **Status**: Initial status (usually "draft" or "proposed")
24
- - **Decision**: What are we doing?
25
- - **Context**: Why are we making this decision?
26
-
27
- #### Optional Information
28
- - **Alternatives Considered**: What other options were evaluated?
29
- - **Consequences**: What are the expected outcomes?
30
- - **Related Decisions**: Links to other ADRs
31
- - **Related Specs**: Links to OpenSpec documents
32
- - **Related Tasks**: Links to Beads tasks
33
-
34
- ### Step 3: Select Template
35
-
36
- Choose appropriate template based on decision type:
37
-
38
- | Decision Type | Template | Use When |
39
- |--------------|----------|----------|
40
- | Simple, straightforward | Nygard | Quick decisions, clear context |
41
- | Standard decision | MADR Simple | Most common use case |
42
- | Complex with options | MADR Elaborate | Multiple alternatives evaluated |
43
- | Cost/ROI focused | Business Case | Financial implications important |
44
-
45
- See [Template Selection Rules](./template-selection.md) for detailed guidance.
46
-
47
- ### Step 4: Generate Metadata
48
-
49
- Create frontmatter with required and optional fields:
50
-
51
- ```yaml
52
- ---
53
- # Required fields
54
- id: adr-NNNN
55
- title: "Use PostgreSQL for Primary Database"
56
- status: proposed
57
- date: 2026-02-05
58
- deciders: ["kyle@mytech.today", "team-lead"]
59
-
60
- # Optional fields
61
- tags: ["database", "infrastructure", "postgresql"]
62
- supersedes: []
63
- superseded_by: null
64
- related_decisions: []
65
- related_specs: ["openspec/specs/database/schema.md"]
66
- related_tasks: ["bd-db01", "bd-db02"]
67
- ---
68
- ```
69
-
70
- #### Metadata Field Definitions
71
-
72
- **Required Fields:**
73
- - `id`: Unique identifier (format: `adr-NNNN` where NNNN is zero-padded number)
74
- - `title`: Descriptive title (50-80 characters)
75
- - `status`: Current status (see [Lifecycle Management](./lifecycle-management.md))
76
- - `date`: Creation date (ISO 8601 format: YYYY-MM-DD)
77
- - `deciders`: Array of people who made/approved the decision
78
-
79
- **Optional Fields:**
80
- - `tags`: Array of relevant tags for categorization
81
- - `supersedes`: Array of ADR IDs this decision replaces
82
- - `superseded_by`: ADR ID that replaces this decision (null if active)
83
- - `related_decisions`: Array of related ADR IDs
84
- - `related_specs`: Array of OpenSpec file paths
85
- - `related_tasks`: Array of Beads task IDs
86
-
87
- ### Step 5: Extract Context
88
-
89
- Automatically extract context from:
90
-
91
- #### Code Context
92
- ```typescript
93
- // Example: Detecting database decision from code
94
- const codeContext = {
95
- trigger: "New dependency: @prisma/client",
96
- files: ["package.json", "src/db/client.ts"],
97
- changes: "Added Prisma ORM for database access"
98
- };
99
- ```
100
-
101
- #### Conversation Context
102
- ```typescript
103
- // Example: Extracting from conversation
104
- const conversationContext = {
105
- problem: "Need type-safe database queries",
106
- alternatives: ["Prisma", "TypeORM", "Sequelize"],
107
- criteria: ["Type safety", "Performance", "Developer experience"]
108
- };
109
- ```
110
-
111
- #### Workflow Context
112
- ```typescript
113
- // Example: From OpenSpec change
114
- const workflowContext = {
115
- spec: "openspec/specs/database/schema.md",
116
- change: "openspec/changes/add-user-sessions/",
117
- tasks: ["bd-db01", "bd-db02"]
118
- };
119
- ```
120
-
121
- ### Step 6: Create ADR File
122
-
123
- #### File Naming Convention
124
-
125
- ```
126
- adr/NNNN-brief-title.md
127
- ```
128
-
129
- **Rules:**
130
- - `NNNN`: Zero-padded sequential number (0001, 0002, etc.)
131
- - `brief-title`: Lowercase, hyphen-separated, descriptive
132
- - Maximum 50 characters for filename
133
-
134
- **Examples:**
135
- - `adr/0001-use-postgresql-database.md`
136
- - `adr/0015-migrate-to-microservices.md`
137
- - `adr/0042-implement-api-versioning.md`
138
-
139
- #### File Location
140
-
141
- ADRs are stored in the `adr/` directory at the repository root:
142
-
143
- ```
144
- repository-root/
145
- ├── adr/
146
- │ ├── 0001-use-postgresql-database.md
147
- │ ├── 0002-implement-jwt-authentication.md
148
- │ └── 0003-adopt-microservices-architecture.md
149
- ├── openspec/
150
- ├── .beads/
151
- └── .augment/
152
- ```
153
-
154
- ### Step 7: Populate Template
155
-
156
- Fill in the selected template with gathered information:
157
-
158
- **Example (Nygard Template):**
159
- ```markdown
160
- ---
161
- id: adr-0001
162
- title: "Use PostgreSQL for Primary Database"
163
- status: proposed
164
- date: 2026-02-05
165
- deciders: ["kyle@mytech.today"]
166
- tags: ["database", "infrastructure"]
167
- ---
168
-
169
- # Use PostgreSQL for Primary Database
170
-
171
- ## Status
172
-
173
- Proposed
174
-
175
- ## Context
176
-
177
- We need to select a primary database for our application. Requirements:
178
- - ACID compliance for financial transactions
179
- - JSON support for flexible data structures
180
- - Strong community and ecosystem
181
- - Proven scalability
182
-
183
- Current situation: Using SQLite for development, need production database.
184
-
185
- ## Decision
186
-
187
- We will use PostgreSQL as our primary database.
188
-
189
- ## Consequences
190
-
191
- ### Positive
192
- - ACID compliance ensures data integrity
193
- - JSONB support provides flexibility
194
- - Excellent performance for our scale
195
- - Strong TypeScript integration via Prisma
196
-
197
- ### Negative
198
- - Requires PostgreSQL hosting (cost)
199
- - Team needs to learn PostgreSQL-specific features
200
- - More complex than SQLite for local development
201
-
202
- ### Neutral
203
- - Need to set up connection pooling
204
- - Requires migration from SQLite
205
- ```
206
-
207
- ## Automation Guidelines
208
-
209
- ### AI Agent Responsibilities
210
-
211
- When creating ADRs, AI agents should:
212
-
213
- 1. **Auto-generate ID**
214
- - Find highest existing ADR number
215
- - Increment by 1
216
- - Zero-pad to 4 digits
217
-
218
- 2. **Auto-populate Metadata**
219
- - Set creation date to current date
220
- - Extract deciders from conversation/commits
221
- - Generate tags from decision context
222
- - Link related specs/tasks automatically
223
-
224
- 3. **Extract Context Automatically**
225
- - Parse code changes for technical context
226
- - Extract problem statement from conversation
227
- - Identify alternatives from discussion
228
- - Capture evaluation criteria
229
-
230
- 4. **Suggest Template**
231
- - Analyze decision complexity
232
- - Recommend appropriate template
233
- - Allow user override
234
-
235
- 5. **Validate Completeness**
236
- - Check required fields present
237
- - Verify context is clear
238
- - Ensure decision is stated
239
- - Validate consequences documented
240
-
241
- ### User Interaction
242
-
243
- Provide clear prompts and options:
244
-
245
- **Creation Prompt:**
246
- ```
247
- I'll create an ADR for this decision. Let me gather some information:
248
-
249
- 1. Title: "Use PostgreSQL for Primary Database"
250
- [Edit] [Accept]
251
-
252
- 2. Template: MADR Simple (recommended for this decision)
253
- [Change] [Accept]
254
-
255
- 3. Context detected:
256
- - Problem: Need production database
257
- - Alternatives: PostgreSQL, MySQL, MongoDB
258
- - Criteria: ACID, JSON support, scalability
259
- [Edit] [Accept]
260
-
261
- 4. Related items:
262
- - Spec: openspec/specs/database/schema.md
263
- - Tasks: bd-db01, bd-db02
264
- [Edit] [Accept]
265
-
266
- [Create ADR] [Cancel]
267
- ```
268
-
269
- ## Integration with Workflows
270
-
271
- ### OpenSpec Integration
272
-
273
- When creating ADR from OpenSpec change:
274
-
275
- 1. Extract context from proposal.md
276
- 2. Link to spec files in change
277
- 3. Reference in coordination manifest
278
- 4. Update proposal with ADR link
279
-
280
- **Example:**
281
- ```json
282
- // .augment/coordination.json
283
- {
284
- "adrs": {
285
- "adr-0001": {
286
- "file": "adr/0001-use-postgresql-database.md",
287
- "status": "proposed",
288
- "relatedSpecs": ["database/schema"],
289
- "relatedTasks": ["bd-db01", "bd-db02"]
290
- }
291
- }
292
- }
293
- ```
294
-
295
- ### Beads Integration
296
-
297
- When creating ADR from Beads task:
298
-
299
- 1. Extract context from task description
300
- 2. Link to related tasks
301
- 3. Add ADR reference to task comments
302
- 4. Update coordination manifest
303
-
304
- **Example:**
305
- ```bash
306
- # Add comment to task
307
- bd comment bd-db01 "Documented in ADR-0001: Use PostgreSQL for Primary Database (adr/0001-use-postgresql-database.md)"
308
- ```
309
-
310
- ## Validation Rules
311
-
312
- Before creating ADR file, validate:
313
-
314
- ### Required Validations
315
- - [ ] Unique ID (no duplicates)
316
- - [ ] Valid status value
317
- - [ ] Title is descriptive (not generic)
318
- - [ ] Date is valid ISO 8601
319
- - [ ] At least one decider listed
320
-
321
- ### Content Validations
322
- - [ ] Context section explains "why"
323
- - [ ] Decision section states "what"
324
- - [ ] Consequences section covers positive/negative
325
- - [ ] No placeholder text (e.g., "TODO", "TBD")
326
-
327
- ### Reference Validations
328
- - [ ] Related specs exist
329
- - [ ] Related tasks exist
330
- - [ ] Superseded ADRs exist and are valid
331
-
332
- ## Best Practices
333
-
334
- 1. **Create Early**
335
- - Document decisions when made, not later
336
- - Capture context while fresh
337
- - Don't wait for "perfect" documentation
338
-
339
- 2. **Be Concise**
340
- - Focus on "why" not "how"
341
- - Avoid implementation details
342
- - Keep it readable (< 500 words for simple decisions)
343
-
344
- 3. **Link Generously**
345
- - Connect to related ADRs
346
- - Link to specs and tasks
347
- - Reference external resources
348
-
349
- 4. **Update Status**
350
- - Keep status current
351
- - Document when implemented
352
- - Mark as superseded when replaced
353
-
354
- 5. **Review Regularly**
355
- - Revisit ADRs during retrospectives
356
- - Update consequences with actual outcomes
357
- - Archive obsolete decisions
358
-
359
- ## Examples
360
-
361
- See [examples/](../examples/) directory for complete examples:
362
- - [Simple Decision Example](../examples/simple-decision-example.md)
363
- - [Complete Lifecycle Example](../examples/complete-lifecycle-example.md)
364
- - [Integration Example](../examples/integration-example.md)
365
-
366
- ## See Also
367
-
368
- - [Decision Detection Rules](./decision-detection.md)
369
- - [Template Selection Rules](./template-selection.md)
370
- - [Lifecycle Management](./lifecycle-management.md)
371
- - [Validation Rules](./validation-rules.md)
372
-
1
+ # ADR Creation Guidelines
2
+
3
+ ## Overview
4
+
5
+ This document defines the process for creating Architecture Decision Records (ADRs), including automation, metadata generation, context extraction, and file creation workflow.
6
+
7
+ ## Creation Workflow
8
+
9
+ ### Step 1: Initiate ADR Creation
10
+
11
+ ADRs can be created through:
12
+
13
+ 1. **Automatic Detection** - AI agent detects decision and prompts user
14
+ 2. **Manual Request** - User explicitly requests ADR creation
15
+ 3. **Workflow Integration** - Created as part of OpenSpec/Beads workflow
16
+
17
+ ### Step 2: Gather Decision Information
18
+
19
+ Collect the following information:
20
+
21
+ #### Required Information
22
+ - **Title**: Brief, descriptive decision title
23
+ - **Status**: Initial status (usually "draft" or "proposed")
24
+ - **Decision**: What are we doing?
25
+ - **Context**: Why are we making this decision?
26
+
27
+ #### Optional Information
28
+ - **Alternatives Considered**: What other options were evaluated?
29
+ - **Consequences**: What are the expected outcomes?
30
+ - **Related Decisions**: Links to other ADRs
31
+ - **Related Specs**: Links to OpenSpec documents
32
+ - **Related Tasks**: Links to Beads tasks
33
+
34
+ ### Step 3: Select Template
35
+
36
+ Choose appropriate template based on decision type:
37
+
38
+ | Decision Type | Template | Use When |
39
+ |--------------|----------|----------|
40
+ | Simple, straightforward | Nygard | Quick decisions, clear context |
41
+ | Standard decision | MADR Simple | Most common use case |
42
+ | Complex with options | MADR Elaborate | Multiple alternatives evaluated |
43
+ | Cost/ROI focused | Business Case | Financial implications important |
44
+
45
+ See [Template Selection Rules](./template-selection.md) for detailed guidance.
46
+
47
+ ### Step 4: Generate Metadata
48
+
49
+ Create frontmatter with required and optional fields:
50
+
51
+ ```yaml
52
+ ---
53
+ # Required fields
54
+ id: adr-NNNN
55
+ title: "Use PostgreSQL for Primary Database"
56
+ status: proposed
57
+ date: 2026-02-05
58
+ deciders: ["kyle@mytech.today", "team-lead"]
59
+
60
+ # Optional fields
61
+ tags: ["database", "infrastructure", "postgresql"]
62
+ supersedes: []
63
+ superseded_by: null
64
+ related_decisions: []
65
+ related_specs: ["openspec/specs/database/schema.md"]
66
+ related_tasks: ["bd-db01", "bd-db02"]
67
+ ---
68
+ ```
69
+
70
+ #### Metadata Field Definitions
71
+
72
+ **Required Fields:**
73
+ - `id`: Unique identifier (format: `adr-NNNN` where NNNN is zero-padded number)
74
+ - `title`: Descriptive title (50-80 characters)
75
+ - `status`: Current status (see [Lifecycle Management](./lifecycle-management.md))
76
+ - `date`: Creation date (ISO 8601 format: YYYY-MM-DD)
77
+ - `deciders`: Array of people who made/approved the decision
78
+
79
+ **Optional Fields:**
80
+ - `tags`: Array of relevant tags for categorization
81
+ - `supersedes`: Array of ADR IDs this decision replaces
82
+ - `superseded_by`: ADR ID that replaces this decision (null if active)
83
+ - `related_decisions`: Array of related ADR IDs
84
+ - `related_specs`: Array of OpenSpec file paths
85
+ - `related_tasks`: Array of Beads task IDs
86
+
87
+ ### Step 5: Extract Context
88
+
89
+ Automatically extract context from:
90
+
91
+ #### Code Context
92
+ ```typescript
93
+ // Example: Detecting database decision from code
94
+ const codeContext = {
95
+ trigger: "New dependency: @prisma/client",
96
+ files: ["package.json", "src/db/client.ts"],
97
+ changes: "Added Prisma ORM for database access"
98
+ };
99
+ ```
100
+
101
+ #### Conversation Context
102
+ ```typescript
103
+ // Example: Extracting from conversation
104
+ const conversationContext = {
105
+ problem: "Need type-safe database queries",
106
+ alternatives: ["Prisma", "TypeORM", "Sequelize"],
107
+ criteria: ["Type safety", "Performance", "Developer experience"]
108
+ };
109
+ ```
110
+
111
+ #### Workflow Context
112
+ ```typescript
113
+ // Example: From OpenSpec change
114
+ const workflowContext = {
115
+ spec: "openspec/specs/database/schema.md",
116
+ change: "openspec/changes/add-user-sessions/",
117
+ tasks: ["bd-db01", "bd-db02"]
118
+ };
119
+ ```
120
+
121
+ ### Step 6: Create ADR File
122
+
123
+ #### File Naming Convention
124
+
125
+ ```
126
+ adr/NNNN-brief-title.md
127
+ ```
128
+
129
+ **Rules:**
130
+ - `NNNN`: Zero-padded sequential number (0001, 0002, etc.)
131
+ - `brief-title`: Lowercase, hyphen-separated, descriptive
132
+ - Maximum 50 characters for filename
133
+
134
+ **Examples:**
135
+ - `adr/0001-use-postgresql-database.md`
136
+ - `adr/0015-migrate-to-microservices.md`
137
+ - `adr/0042-implement-api-versioning.md`
138
+
139
+ #### File Location
140
+
141
+ ADRs are stored in the `adr/` directory at the repository root:
142
+
143
+ ```
144
+ repository-root/
145
+ ├── adr/
146
+ │ ├── 0001-use-postgresql-database.md
147
+ │ ├── 0002-implement-jwt-authentication.md
148
+ │ └── 0003-adopt-microservices-architecture.md
149
+ ├── openspec/
150
+ ├── .beads/
151
+ └── .augment/
152
+ ```
153
+
154
+ ### Step 7: Populate Template
155
+
156
+ Fill in the selected template with gathered information:
157
+
158
+ **Example (Nygard Template):**
159
+ ```markdown
160
+ ---
161
+ id: adr-0001
162
+ title: "Use PostgreSQL for Primary Database"
163
+ status: proposed
164
+ date: 2026-02-05
165
+ deciders: ["kyle@mytech.today"]
166
+ tags: ["database", "infrastructure"]
167
+ ---
168
+
169
+ # Use PostgreSQL for Primary Database
170
+
171
+ ## Status
172
+
173
+ Proposed
174
+
175
+ ## Context
176
+
177
+ We need to select a primary database for our application. Requirements:
178
+ - ACID compliance for financial transactions
179
+ - JSON support for flexible data structures
180
+ - Strong community and ecosystem
181
+ - Proven scalability
182
+
183
+ Current situation: Using SQLite for development, need production database.
184
+
185
+ ## Decision
186
+
187
+ We will use PostgreSQL as our primary database.
188
+
189
+ ## Consequences
190
+
191
+ ### Positive
192
+ - ACID compliance ensures data integrity
193
+ - JSONB support provides flexibility
194
+ - Excellent performance for our scale
195
+ - Strong TypeScript integration via Prisma
196
+
197
+ ### Negative
198
+ - Requires PostgreSQL hosting (cost)
199
+ - Team needs to learn PostgreSQL-specific features
200
+ - More complex than SQLite for local development
201
+
202
+ ### Neutral
203
+ - Need to set up connection pooling
204
+ - Requires migration from SQLite
205
+ ```
206
+
207
+ ## Automation Guidelines
208
+
209
+ ### AI Agent Responsibilities
210
+
211
+ When creating ADRs, AI agents should:
212
+
213
+ 1. **Auto-generate ID**
214
+ - Find highest existing ADR number
215
+ - Increment by 1
216
+ - Zero-pad to 4 digits
217
+
218
+ 2. **Auto-populate Metadata**
219
+ - Set creation date to current date
220
+ - Extract deciders from conversation/commits
221
+ - Generate tags from decision context
222
+ - Link related specs/tasks automatically
223
+
224
+ 3. **Extract Context Automatically**
225
+ - Parse code changes for technical context
226
+ - Extract problem statement from conversation
227
+ - Identify alternatives from discussion
228
+ - Capture evaluation criteria
229
+
230
+ 4. **Suggest Template**
231
+ - Analyze decision complexity
232
+ - Recommend appropriate template
233
+ - Allow user override
234
+
235
+ 5. **Validate Completeness**
236
+ - Check required fields present
237
+ - Verify context is clear
238
+ - Ensure decision is stated
239
+ - Validate consequences documented
240
+
241
+ ### User Interaction
242
+
243
+ Provide clear prompts and options:
244
+
245
+ **Creation Prompt:**
246
+ ```
247
+ I'll create an ADR for this decision. Let me gather some information:
248
+
249
+ 1. Title: "Use PostgreSQL for Primary Database"
250
+ [Edit] [Accept]
251
+
252
+ 2. Template: MADR Simple (recommended for this decision)
253
+ [Change] [Accept]
254
+
255
+ 3. Context detected:
256
+ - Problem: Need production database
257
+ - Alternatives: PostgreSQL, MySQL, MongoDB
258
+ - Criteria: ACID, JSON support, scalability
259
+ [Edit] [Accept]
260
+
261
+ 4. Related items:
262
+ - Spec: openspec/specs/database/schema.md
263
+ - Tasks: bd-db01, bd-db02
264
+ [Edit] [Accept]
265
+
266
+ [Create ADR] [Cancel]
267
+ ```
268
+
269
+ ## Integration with Workflows
270
+
271
+ ### OpenSpec Integration
272
+
273
+ When creating ADR from OpenSpec change:
274
+
275
+ 1. Extract context from proposal.md
276
+ 2. Link to spec files in change
277
+ 3. Reference in coordination manifest
278
+ 4. Update proposal with ADR link
279
+
280
+ **Example:**
281
+ ```json
282
+ // .augment/coordination.json
283
+ {
284
+ "adrs": {
285
+ "adr-0001": {
286
+ "file": "adr/0001-use-postgresql-database.md",
287
+ "status": "proposed",
288
+ "relatedSpecs": ["database/schema"],
289
+ "relatedTasks": ["bd-db01", "bd-db02"]
290
+ }
291
+ }
292
+ }
293
+ ```
294
+
295
+ ### Beads Integration
296
+
297
+ When creating ADR from Beads task:
298
+
299
+ 1. Extract context from task description
300
+ 2. Link to related tasks
301
+ 3. Add ADR reference to task comments
302
+ 4. Update coordination manifest
303
+
304
+ **Example:**
305
+ ```bash
306
+ # Add comment to task
307
+ bd comment bd-db01 "Documented in ADR-0001: Use PostgreSQL for Primary Database (adr/0001-use-postgresql-database.md)"
308
+ ```
309
+
310
+ ## Validation Rules
311
+
312
+ Before creating ADR file, validate:
313
+
314
+ ### Required Validations
315
+ - [ ] Unique ID (no duplicates)
316
+ - [ ] Valid status value
317
+ - [ ] Title is descriptive (not generic)
318
+ - [ ] Date is valid ISO 8601
319
+ - [ ] At least one decider listed
320
+
321
+ ### Content Validations
322
+ - [ ] Context section explains "why"
323
+ - [ ] Decision section states "what"
324
+ - [ ] Consequences section covers positive/negative
325
+ - [ ] No placeholder text (e.g., "TODO", "TBD")
326
+
327
+ ### Reference Validations
328
+ - [ ] Related specs exist
329
+ - [ ] Related tasks exist
330
+ - [ ] Superseded ADRs exist and are valid
331
+
332
+ ## Best Practices
333
+
334
+ 1. **Create Early**
335
+ - Document decisions when made, not later
336
+ - Capture context while fresh
337
+ - Don't wait for "perfect" documentation
338
+
339
+ 2. **Be Concise**
340
+ - Focus on "why" not "how"
341
+ - Avoid implementation details
342
+ - Keep it readable (< 500 words for simple decisions)
343
+
344
+ 3. **Link Generously**
345
+ - Connect to related ADRs
346
+ - Link to specs and tasks
347
+ - Reference external resources
348
+
349
+ 4. **Update Status**
350
+ - Keep status current
351
+ - Document when implemented
352
+ - Mark as superseded when replaced
353
+
354
+ 5. **Review Regularly**
355
+ - Revisit ADRs during retrospectives
356
+ - Update consequences with actual outcomes
357
+ - Archive obsolete decisions
358
+
359
+ ## Examples
360
+
361
+ See [examples/](../examples/) directory for complete examples:
362
+ - [Simple Decision Example](../examples/simple-decision-example.md)
363
+ - [Complete Lifecycle Example](../examples/complete-lifecycle-example.md)
364
+ - [Integration Example](../examples/integration-example.md)
365
+
366
+ ## See Also
367
+
368
+ - [Decision Detection Rules](./decision-detection.md)
369
+ - [Template Selection Rules](./template-selection.md)
370
+ - [Lifecycle Management](./lifecycle-management.md)
371
+ - [Validation Rules](./validation-rules.md)
372
+