@magic-ingredients/tiny-brain-local 0.13.1 → 0.14.10

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 (258) hide show
  1. package/dist/agents/formatters/claude-code-formatter.js +0 -1
  2. package/dist/agents/formatters/formatter-factory.js +0 -1
  3. package/dist/agents/types.js +0 -1
  4. package/dist/core/console-logger.js +0 -1
  5. package/dist/core/file-logger.js +0 -1
  6. package/dist/core/mcp-server.js +0 -1
  7. package/dist/index.d.ts +22 -8
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +20 -151
  10. package/dist/prompts/index.js +0 -1
  11. package/dist/prompts/persona/persona.prompt.js +0 -1
  12. package/dist/prompts/planning/planning.prompt.js +0 -1
  13. package/dist/prompts/prompt-registry.js +0 -1
  14. package/dist/prompts/rules/rules.prompt.js +0 -1
  15. package/dist/prompts/thinking/thinking.prompt.js +0 -1
  16. package/dist/services/UpdateService.js +0 -1
  17. package/dist/services/agent-installation-service.js +0 -1
  18. package/dist/services/agent-manager.js +0 -1
  19. package/dist/services/agent-service.js +0 -1
  20. package/dist/services/analyse-service.d.ts +52 -8
  21. package/dist/services/analyse-service.d.ts.map +1 -1
  22. package/dist/services/analyse-service.js +325 -66
  23. package/dist/services/credential-storage.service.js +0 -1
  24. package/dist/services/dashboard-launcher.service.js +0 -1
  25. package/dist/services/persona-enhancer.js +0 -1
  26. package/dist/services/persona-service.js +0 -1
  27. package/dist/services/remote/auth-token-service.js +0 -1
  28. package/dist/services/remote/persona-sync-service.js +0 -1
  29. package/dist/services/remote/system-persona-service.js +0 -1
  30. package/dist/services/repo-service.d.ts.map +1 -1
  31. package/dist/services/repo-service.js +31 -25
  32. package/dist/services/versioning-service.js +0 -1
  33. package/dist/storage/local-filesystem-adapter.js +0 -1
  34. package/dist/storage/platform-config-adapter.js +0 -1
  35. package/dist/storage/platform-path-builder.js +0 -1
  36. package/dist/storage/storage-path-builder.js +0 -1
  37. package/dist/tools/analyse-request/analyse-request.tool.js +0 -1
  38. package/dist/tools/analyse.tool.d.ts +4 -0
  39. package/dist/tools/analyse.tool.d.ts.map +1 -1
  40. package/dist/tools/analyse.tool.js +34 -3
  41. package/dist/tools/config/config.tool.d.ts +3 -0
  42. package/dist/tools/config/config.tool.d.ts.map +1 -1
  43. package/dist/tools/config/config.tool.js +139 -70
  44. package/dist/tools/config/index.js +0 -1
  45. package/dist/tools/index.d.ts +4 -4
  46. package/dist/tools/index.js +0 -1
  47. package/dist/tools/persona/as.tool.js +0 -1
  48. package/dist/tools/persona/persona.tool.js +0 -1
  49. package/dist/tools/plan/plan.tool.d.ts +4 -0
  50. package/dist/tools/plan/plan.tool.d.ts.map +1 -1
  51. package/dist/tools/plan/plan.tool.js +144 -32
  52. package/dist/tools/rules/rules.tool.js +0 -1
  53. package/dist/tools/strategy/strategy.tool.js +0 -1
  54. package/dist/tools/thinking/thinking.tool.js +0 -1
  55. package/dist/tools/tool-registry.js +0 -1
  56. package/dist/tools/update/update.tool.js +0 -1
  57. package/dist/tools/validate-response/validate-response.tool.js +0 -1
  58. package/dist/types/local-context.js +0 -1
  59. package/dist/types/request-context.d.ts +1 -1
  60. package/dist/types/request-context.d.ts.map +1 -1
  61. package/dist/types/request-context.js +0 -1
  62. package/dist/utils/package-version.js +0 -1
  63. package/dist/utils/repo-utils.js +0 -1
  64. package/package.json +8 -32
  65. package/LICENSE +0 -21
  66. package/README.md +0 -260
  67. package/dist/agents/formatters/claude-code-formatter.js.map +0 -1
  68. package/dist/agents/formatters/formatter-factory.js.map +0 -1
  69. package/dist/agents/types.js.map +0 -1
  70. package/dist/analyser/analyzers/script-analyzer.d.ts +0 -10
  71. package/dist/analyser/analyzers/script-analyzer.d.ts.map +0 -1
  72. package/dist/analyser/analyzers/script-analyzer.js +0 -205
  73. package/dist/analyser/analyzers/script-analyzer.js.map +0 -1
  74. package/dist/analyser/detectors/base-detector.d.ts +0 -12
  75. package/dist/analyser/detectors/base-detector.d.ts.map +0 -1
  76. package/dist/analyser/detectors/base-detector.js +0 -50
  77. package/dist/analyser/detectors/base-detector.js.map +0 -1
  78. package/dist/analyser/detectors/javascript-detector.d.ts +0 -19
  79. package/dist/analyser/detectors/javascript-detector.d.ts.map +0 -1
  80. package/dist/analyser/detectors/javascript-detector.js +0 -347
  81. package/dist/analyser/detectors/javascript-detector.js.map +0 -1
  82. package/dist/analyser/index.d.ts +0 -5
  83. package/dist/analyser/index.d.ts.map +0 -1
  84. package/dist/analyser/index.js +0 -315
  85. package/dist/analyser/index.js.map +0 -1
  86. package/dist/analyser/types.d.ts +0 -2
  87. package/dist/analyser/types.d.ts.map +0 -1
  88. package/dist/analyser/types.js +0 -2
  89. package/dist/analyser/types.js.map +0 -1
  90. package/dist/analyser/utils.d.ts +0 -5
  91. package/dist/analyser/utils.d.ts.map +0 -1
  92. package/dist/analyser/utils.js +0 -24
  93. package/dist/analyser/utils.js.map +0 -1
  94. package/dist/cli/cli-factory.d.ts +0 -3
  95. package/dist/cli/cli-factory.d.ts.map +0 -1
  96. package/dist/cli/cli-factory.js +0 -235
  97. package/dist/cli/cli-factory.js.map +0 -1
  98. package/dist/cli/commands/analyse.command.d.ts +0 -18
  99. package/dist/cli/commands/analyse.command.d.ts.map +0 -1
  100. package/dist/cli/commands/analyse.command.js +0 -161
  101. package/dist/cli/commands/analyse.command.js.map +0 -1
  102. package/dist/cli/commands/config.command.d.ts +0 -25
  103. package/dist/cli/commands/config.command.d.ts.map +0 -1
  104. package/dist/cli/commands/config.command.js +0 -285
  105. package/dist/cli/commands/config.command.js.map +0 -1
  106. package/dist/cli/commands/install.command.d.ts +0 -23
  107. package/dist/cli/commands/install.command.d.ts.map +0 -1
  108. package/dist/cli/commands/install.command.js +0 -189
  109. package/dist/cli/commands/install.command.js.map +0 -1
  110. package/dist/cli/commands/list.command.d.ts +0 -15
  111. package/dist/cli/commands/list.command.d.ts.map +0 -1
  112. package/dist/cli/commands/list.command.js +0 -90
  113. package/dist/cli/commands/list.command.js.map +0 -1
  114. package/dist/cli/commands/status.command.d.ts +0 -25
  115. package/dist/cli/commands/status.command.d.ts.map +0 -1
  116. package/dist/cli/commands/status.command.js +0 -367
  117. package/dist/cli/commands/status.command.js.map +0 -1
  118. package/dist/cli/commands/track-commit.command.d.ts +0 -52
  119. package/dist/cli/commands/track-commit.command.d.ts.map +0 -1
  120. package/dist/cli/commands/track-commit.command.js +0 -239
  121. package/dist/cli/commands/track-commit.command.js.map +0 -1
  122. package/dist/cli/commands/uninstall.command.d.ts +0 -23
  123. package/dist/cli/commands/uninstall.command.d.ts.map +0 -1
  124. package/dist/cli/commands/uninstall.command.js +0 -176
  125. package/dist/cli/commands/uninstall.command.js.map +0 -1
  126. package/dist/cli/commands/validate-commit-message.command.d.ts +0 -47
  127. package/dist/cli/commands/validate-commit-message.command.d.ts.map +0 -1
  128. package/dist/cli/commands/validate-commit-message.command.js +0 -223
  129. package/dist/cli/commands/validate-commit-message.command.js.map +0 -1
  130. package/dist/cli/installers/base-installer.d.ts +0 -20
  131. package/dist/cli/installers/base-installer.d.ts.map +0 -1
  132. package/dist/cli/installers/base-installer.js +0 -3
  133. package/dist/cli/installers/base-installer.js.map +0 -1
  134. package/dist/cli/installers/chatgpt-installer.d.ts +0 -18
  135. package/dist/cli/installers/chatgpt-installer.d.ts.map +0 -1
  136. package/dist/cli/installers/chatgpt-installer.js +0 -45
  137. package/dist/cli/installers/chatgpt-installer.js.map +0 -1
  138. package/dist/cli/installers/claude-code-installer.d.ts +0 -23
  139. package/dist/cli/installers/claude-code-installer.d.ts.map +0 -1
  140. package/dist/cli/installers/claude-code-installer.js +0 -127
  141. package/dist/cli/installers/claude-code-installer.js.map +0 -1
  142. package/dist/cli/installers/claude-desktop-installer.d.ts +0 -18
  143. package/dist/cli/installers/claude-desktop-installer.d.ts.map +0 -1
  144. package/dist/cli/installers/claude-desktop-installer.js +0 -48
  145. package/dist/cli/installers/claude-desktop-installer.js.map +0 -1
  146. package/dist/cli/installers/cursor-installer.d.ts +0 -18
  147. package/dist/cli/installers/cursor-installer.d.ts.map +0 -1
  148. package/dist/cli/installers/cursor-installer.js +0 -45
  149. package/dist/cli/installers/cursor-installer.js.map +0 -1
  150. package/dist/cli/installers/installer-factory.d.ts +0 -30
  151. package/dist/cli/installers/installer-factory.d.ts.map +0 -1
  152. package/dist/cli/installers/installer-factory.js +0 -90
  153. package/dist/cli/installers/installer-factory.js.map +0 -1
  154. package/dist/cli/utils/node-resolver.d.ts +0 -53
  155. package/dist/cli/utils/node-resolver.d.ts.map +0 -1
  156. package/dist/cli/utils/node-resolver.js +0 -200
  157. package/dist/cli/utils/node-resolver.js.map +0 -1
  158. package/dist/cli/utils/package-locator.d.ts +0 -9
  159. package/dist/cli/utils/package-locator.d.ts.map +0 -1
  160. package/dist/cli/utils/package-locator.js +0 -81
  161. package/dist/cli/utils/package-locator.js.map +0 -1
  162. package/dist/cli/utils/system-info.d.ts +0 -20
  163. package/dist/cli/utils/system-info.d.ts.map +0 -1
  164. package/dist/cli/utils/system-info.js +0 -90
  165. package/dist/cli/utils/system-info.js.map +0 -1
  166. package/dist/cli.d.ts +0 -3
  167. package/dist/cli.d.ts.map +0 -1
  168. package/dist/cli.js +0 -27
  169. package/dist/cli.js.map +0 -1
  170. package/dist/core/console-logger.js.map +0 -1
  171. package/dist/core/file-logger.js.map +0 -1
  172. package/dist/core/mcp-server.js.map +0 -1
  173. package/dist/index.js.map +0 -1
  174. package/dist/prompts/index.js.map +0 -1
  175. package/dist/prompts/persona/persona.prompt.js.map +0 -1
  176. package/dist/prompts/planning/planning.prompt.js.map +0 -1
  177. package/dist/prompts/prompt-registry.js.map +0 -1
  178. package/dist/prompts/rules/rules.prompt.js.map +0 -1
  179. package/dist/prompts/thinking/thinking.prompt.js.map +0 -1
  180. package/dist/services/UpdateService.js.map +0 -1
  181. package/dist/services/adr-service.d.ts +0 -70
  182. package/dist/services/adr-service.d.ts.map +0 -1
  183. package/dist/services/adr-service.js +0 -242
  184. package/dist/services/adr-service.js.map +0 -1
  185. package/dist/services/agent-installation-service.js.map +0 -1
  186. package/dist/services/agent-manager.js.map +0 -1
  187. package/dist/services/agent-service.js.map +0 -1
  188. package/dist/services/analyse-service.js.map +0 -1
  189. package/dist/services/credential-storage.service.js.map +0 -1
  190. package/dist/services/dashboard-launcher.service.js.map +0 -1
  191. package/dist/services/persona-enhancer.js.map +0 -1
  192. package/dist/services/persona-grouper.d.ts +0 -29
  193. package/dist/services/persona-grouper.d.ts.map +0 -1
  194. package/dist/services/persona-grouper.js +0 -111
  195. package/dist/services/persona-grouper.js.map +0 -1
  196. package/dist/services/persona-service.js.map +0 -1
  197. package/dist/services/remote/auth-token-service.js.map +0 -1
  198. package/dist/services/remote/persona-sync-service.js.map +0 -1
  199. package/dist/services/remote/system-persona-service.js.map +0 -1
  200. package/dist/services/repo-service.js.map +0 -1
  201. package/dist/services/types/persona-types.d.ts +0 -84
  202. package/dist/services/types/persona-types.d.ts.map +0 -1
  203. package/dist/services/types/persona-types.js +0 -5
  204. package/dist/services/types/persona-types.js.map +0 -1
  205. package/dist/services/versioning-service.js.map +0 -1
  206. package/dist/storage/local-filesystem-adapter.js.map +0 -1
  207. package/dist/storage/platform-config-adapter.js.map +0 -1
  208. package/dist/storage/platform-path-builder.js.map +0 -1
  209. package/dist/storage/storage-path-builder.js.map +0 -1
  210. package/dist/test-setup.d.ts +0 -2
  211. package/dist/test-setup.d.ts.map +0 -1
  212. package/dist/test-setup.js +0 -12
  213. package/dist/test-setup.js.map +0 -1
  214. package/dist/tools/analyse-request/analyse-request.tool.js.map +0 -1
  215. package/dist/tools/analyse.tool.js.map +0 -1
  216. package/dist/tools/config/config.tool.js.map +0 -1
  217. package/dist/tools/config/index.js.map +0 -1
  218. package/dist/tools/index.js.map +0 -1
  219. package/dist/tools/persona/as.tool.js.map +0 -1
  220. package/dist/tools/persona/persona.tool.js.map +0 -1
  221. package/dist/tools/plan/plan.tool.js.map +0 -1
  222. package/dist/tools/rules/rules.tool.js.map +0 -1
  223. package/dist/tools/strategy/strategy.tool.js.map +0 -1
  224. package/dist/tools/thinking/thinking.tool.js.map +0 -1
  225. package/dist/tools/tool-registry.js.map +0 -1
  226. package/dist/tools/update/update.tool.js.map +0 -1
  227. package/dist/tools/validate-response/validate-response.tool.js.map +0 -1
  228. package/dist/types/local-context.js.map +0 -1
  229. package/dist/types/request-context.js.map +0 -1
  230. package/dist/utils/adr-pattern-detector.d.ts +0 -38
  231. package/dist/utils/adr-pattern-detector.d.ts.map +0 -1
  232. package/dist/utils/adr-pattern-detector.js +0 -158
  233. package/dist/utils/adr-pattern-detector.js.map +0 -1
  234. package/dist/utils/adr-suggestion-generator.d.ts +0 -50
  235. package/dist/utils/adr-suggestion-generator.d.ts.map +0 -1
  236. package/dist/utils/adr-suggestion-generator.js +0 -63
  237. package/dist/utils/adr-suggestion-generator.js.map +0 -1
  238. package/dist/utils/commit-parser.d.ts +0 -25
  239. package/dist/utils/commit-parser.d.ts.map +0 -1
  240. package/dist/utils/commit-parser.js +0 -46
  241. package/dist/utils/commit-parser.js.map +0 -1
  242. package/dist/utils/package-version.js.map +0 -1
  243. package/dist/utils/repo-utils.js.map +0 -1
  244. package/templates/adr/README.md +0 -243
  245. package/templates/adr/_template/0001-record-architecture-decisions.md +0 -223
  246. package/templates/adr/_template/ADR_CREATION_INSTRUCTIONS.md +0 -234
  247. package/templates/adr/_template/adr-schema.json +0 -74
  248. package/templates/adr/_template/adr-template.md +0 -136
  249. package/templates/prd/PRD_CREATION_INSTRUCTIONS.md +0 -268
  250. package/templates/prd/README.md +0 -252
  251. package/templates/prd/_template/feature-template.md +0 -105
  252. package/templates/prd/_template/prd-template.md +0 -126
  253. package/templates/prd/example-task-management/features/task-collaboration.md +0 -84
  254. package/templates/prd/example-task-management/features/task-crud.md +0 -222
  255. package/templates/prd/example-task-management/features/task-workflow.md +0 -62
  256. package/templates/prd/example-task-management/prd.md +0 -177
  257. package/templates/prd/feature-schema.json +0 -54
  258. package/templates/prd/prd-schema.json +0 -60
@@ -1,243 +0,0 @@
1
- # Architecture Decision Records (ADRs)
2
-
3
- This repository uses Architecture Decision Records (ADRs) to document significant architectural and technical decisions.
4
-
5
- ## What is an ADR?
6
-
7
- An Architecture Decision Record captures important architectural decisions along with their context and consequences. ADRs help teams:
8
- - Understand why decisions were made
9
- - Onboard new team members quickly
10
- - Avoid revisiting settled decisions
11
- - Track the evolution of the system architecture
12
-
13
- ## Directory Structure
14
-
15
- ```
16
- docs/adr/
17
- ├── README.md # This file
18
- ├── adr-template.md # Template for new ADRs
19
- ├── 0001-record-architecture-decisions.md
20
- ├── 0002-use-postgresql-for-data-storage.md
21
- └── 0003-implement-event-sourcing.md
22
- ```
23
-
24
- ## File Naming Convention
25
-
26
- ADR files follow this naming pattern:
27
- ```
28
- NNNN-decision-title-in-kebab-case.md
29
- ```
30
-
31
- Where:
32
- - `NNNN` is a 4-digit sequential number (e.g., 0001, 0002, 0123)
33
- - Title uses kebab-case (lowercase, hyphens between words)
34
- - Keep titles concise but descriptive
35
-
36
- Examples:
37
- - `0001-record-architecture-decisions.md`
38
- - `0042-adopt-microservices-architecture.md`
39
- - `0123-migrate-from-mysql-to-postgresql.md`
40
-
41
- ## ADR Status Lifecycle
42
-
43
- ADRs go through the following statuses:
44
-
45
- 1. **proposed** - Decision is under consideration
46
- 2. **accepted** - Decision has been approved and is active
47
- 3. **deprecated** - Decision is no longer recommended but may still be in use
48
- 4. **superseded** - Decision has been replaced by a newer ADR
49
-
50
- When superseding an ADR:
51
- - Update the old ADR's status to "superseded"
52
- - Set the `superseded_by` field to the new ADR number
53
- - Set the new ADR's `supersedes` field to the old ADR number
54
- - Link between the two documents
55
-
56
- ## ADR Structure
57
-
58
- Each ADR uses Markdown with YAML frontmatter and contains:
59
-
60
- ### YAML Frontmatter (Metadata)
61
- ```yaml
62
- ---
63
- adr_number: 1
64
- title: "Brief Decision Title"
65
- date: 2025-01-15
66
- status: accepted
67
- supersedes: null
68
- superseded_by: null
69
- tags: [infrastructure, database]
70
- decision_makers: [Alice, Bob]
71
- ---
72
- ```
73
-
74
- ### Content Sections
75
-
76
- 1. **Status** - Current state of the decision
77
- 2. **Context** - The issue, constraints, and background
78
- 3. **Decision** - What was decided (clear and specific)
79
- 4. **Consequences** - Positive, negative, and neutral outcomes
80
- 5. **Alternatives Considered** - Options evaluated and why they were rejected
81
- 6. **Validation** - How the decision was tested/validated
82
- 7. **References** - Links to code, docs, discussions
83
- 8. **Notes** - Additional information and future considerations
84
-
85
- ## Creating a New ADR
86
-
87
- ### Manual Process
88
-
89
- 1. Copy `adr-template.md`
90
- 2. Determine the next sequential number
91
- 3. Name the file: `NNNN-your-decision-title.md`
92
- 4. Fill out all sections
93
- 5. Update YAML frontmatter
94
- 6. Commit and open PR for review
95
-
96
- ### Using Claude Code
97
-
98
- Claude Code is configured to automatically create ADRs when making significant technical decisions. Simply ask Claude Code to:
99
-
100
- ```bash
101
- # Claude will automatically:
102
- # - Determine the next ADR number
103
- # - Fill out the template
104
- # - Save to docs/adr/
105
- # - Follow all conventions
106
-
107
- "Document this decision as an ADR"
108
- "Create an ADR for choosing React over Vue"
109
- ```
110
-
111
- ## Guidelines for Writing Good ADRs
112
-
113
- ### Do:
114
- ✅ Write in clear, concise language
115
- ✅ Focus on the decision, not the implementation details
116
- ✅ Explain the "why" behind the decision
117
- ✅ Document alternatives considered
118
- ✅ Include validation and testing results
119
- ✅ Link to relevant resources and code
120
- ✅ Keep it objective and factual
121
-
122
- ### Don't:
123
- ❌ Include implementation code (link to it instead)
124
- ❌ Make it too long (aim for 1-3 pages)
125
- ❌ Use jargon without explanation
126
- ❌ Skip the consequences section
127
- ❌ Forget to update status when circumstances change
128
-
129
- ## When to Create an ADR
130
-
131
- Create an ADR for decisions that:
132
- - Affect the system's structure or architecture
133
- - Are difficult or expensive to reverse
134
- - Impact multiple teams or components
135
- - Involve significant trade-offs
136
- - Set precedents for future decisions
137
- - Are likely to be questioned later
138
-
139
- Examples:
140
- - Choosing a database technology
141
- - Selecting a framework or library
142
- - Deciding on deployment strategy
143
- - Establishing coding standards
144
- - Picking authentication approach
145
- - Choosing between microservices vs monolith
146
-
147
- ## When NOT to Create an ADR
148
-
149
- Skip ADRs for:
150
- - Routine bug fixes
151
- - Minor refactoring
152
- - Temporary workarounds
153
- - Individual code styling choices
154
- - Decisions easily reversed
155
- - Obvious, uncontroversial choices
156
-
157
- ## ADR Review Process
158
-
159
- 1. **Draft** - Create ADR with status "proposed"
160
- 2. **Discussion** - Share with team for feedback
161
- 3. **Decision** - Team makes final call
162
- 4. **Accept** - Update status to "accepted"
163
- 5. **Implement** - Build based on the decision
164
- 6. **Review** - Periodically review active ADRs
165
-
166
- ## Tips for Claude Code Integration
167
-
168
- ### Automatic ADR Creation
169
-
170
- Claude Code will create ADRs automatically when it detects significant decisions. To optimize this:
171
-
172
- **Be explicit when making architectural decisions:**
173
- ```
174
- "Let's use PostgreSQL for this. Can you create an ADR documenting this decision?"
175
- "We're choosing Terraform over CloudFormation. Document this as ADR."
176
- ```
177
-
178
- **Claude will:**
179
- 1. Analyze the decision context from the conversation
180
- 2. Identify alternatives discussed
181
- 3. Extract pros/cons from the discussion
182
- 4. Determine appropriate metadata (tags, etc.)
183
- 5. Generate a complete ADR
184
- 6. Save it with the correct naming convention
185
-
186
- **Review the generated ADR:**
187
- - Claude's ADRs are comprehensive but review them
188
- - Add any missing context or validation
189
- - Verify the consequences are accurate
190
- - Ensure references are complete
191
-
192
- ### Claude Code Instructions
193
-
194
- When working with ADRs, Claude Code follows these rules:
195
-
196
- 1. **Numbering**: Always check existing ADRs to get the next sequential number
197
- 2. **Naming**: Use kebab-case for file names
198
- 3. **Completeness**: Fill out all sections (no TODOs or placeholders)
199
- 4. **Context**: Include relevant conversation history in the Context section
200
- 5. **Alternatives**: Document all options discussed, not just the winner
201
- 6. **Validation**: Include actual test results or metrics when available
202
- 7. **References**: Link to actual code changes, PRs, or commits
203
- 8. **Status**: New ADRs start as "proposed" unless explicitly accepted
204
-
205
- ## Maintaining ADRs
206
-
207
- ### Regular Review
208
- - Review ADRs quarterly
209
- - Mark outdated decisions as deprecated
210
- - Update superseded ADRs
211
- - Remove truly obsolete ADRs (rare)
212
-
213
- ### Updating Existing ADRs
214
- - Small clarifications: Edit directly
215
- - Significant changes: Create new superseding ADR
216
- - Add notes section for minor updates
217
- - Keep historical context intact
218
-
219
- ### Linking ADRs
220
- - Reference related ADRs in the content
221
- - Use the "Related ADRs" section
222
- - Update both directions when linking
223
- - Consider creating decision trees for complex relationships
224
-
225
- ## Example ADR
226
-
227
- See `0001-record-architecture-decisions.md` for a meta-ADR that documents the decision to use ADRs.
228
-
229
- ## Resources
230
-
231
- - [ADR GitHub Organization](https://adr.github.io/)
232
- - [Markdown Guide](https://www.markdownguide.org/)
233
- - [YAML Specification](https://yaml.org/spec/)
234
- - [Architectural Decision Records (Martin Fowler)](https://martinfowler.com/articles/scaling-architecture-conversationally.html)
235
-
236
- ## Questions?
237
-
238
- If you have questions about ADRs or need help creating one, reach out to the architecture team or ask Claude Code for assistance.
239
-
240
- ---
241
-
242
- **Last Updated:** 2025-01-15
243
- **Maintained By:** Architecture Team
@@ -1,223 +0,0 @@
1
- ---
2
- adr_number: 1
3
- title: "Record Architecture Decisions"
4
- date: 2025-01-15
5
- status: accepted
6
- supersedes: null
7
- superseded_by: null
8
- tags: [documentation, process, governance]
9
- decision_makers: [Architecture Team]
10
- ---
11
-
12
- # ADR-0001: Record Architecture Decisions
13
-
14
- ## Status
15
-
16
- **accepted** (Date: 2025-01-15)
17
-
18
- ## Context
19
-
20
- As our system grows in complexity, we need a way to capture important architectural decisions along with their context and consequences. Currently, decisions are scattered across:
21
- - Slack conversations that are difficult to search
22
- - Meeting notes in various formats
23
- - Tribal knowledge in team members' heads
24
- - Code comments that lack context
25
-
26
- This creates several problems:
27
- - New team members struggle to understand why systems are designed the way they are
28
- - Decisions get revisited repeatedly because rationale is lost
29
- - Context behind trade-offs is not preserved
30
- - Impact of changing decisions is unclear
31
-
32
- ### Background
33
-
34
- The Architecture Decision Record (ADR) approach, popularized by Michael Nygard in 2011, provides a lightweight way to document architectural decisions. ADRs are:
35
- - Short documents (1-2 pages)
36
- - Stored in version control with the code
37
- - Immutable once accepted (new decisions supersede old ones)
38
- - Focused on significant decisions that affect structure, non-functional properties, dependencies, interfaces, or construction techniques
39
-
40
- ### Constraints
41
-
42
- - Must integrate with existing development workflow
43
- - Should not add significant overhead to decision-making process
44
- - Needs to be searchable and maintainable
45
- - Must work well with version control
46
- - Should be accessible to both technical and non-technical stakeholders
47
-
48
- ## Decision
49
-
50
- We will use Architecture Decision Records (ADRs) to capture significant architectural decisions. Specifically:
51
-
52
- - **Format**: Markdown files with YAML frontmatter
53
- - **Location**: `docs/adr/` directory in the main repository
54
- - **Naming**: Sequential numbering with kebab-case titles (e.g., `0001-record-architecture-decisions.md`)
55
- - **Template**: Standardized template covering context, decision, consequences, and alternatives
56
- - **Lifecycle**: Proposed → Accepted → (Deprecated or Superseded)
57
- - **Automation**: Claude Code integration for automatic ADR generation
58
-
59
- ### Implementation Details
60
-
61
- 1. Create `docs/adr/` directory structure
62
- 2. Establish ADR template and README documentation
63
- 3. Configure Claude Code with ADR creation instructions
64
- 4. Begin documenting all significant new decisions
65
- 5. Gradually backfill critical historical decisions
66
-
67
- ## Consequences
68
-
69
- ### Positive Consequences
70
-
71
- - **Knowledge preservation**: Decisions and rationale are permanently recorded
72
- - **Onboarding efficiency**: New team members can quickly understand system evolution
73
- - **Decision quality**: Forcing documentation encourages thorough consideration of alternatives
74
- - **Searchability**: Text files in git are easily searchable
75
- - **Historical context**: Clear record of when and why decisions were made
76
- - **Reduced decision revisiting**: Clear documentation reduces redundant discussions
77
- - **AI-friendly**: Claude Code can automatically create and reference ADRs
78
-
79
- ### Negative Consequences
80
-
81
- - **Initial overhead**: Creating first ADRs and establishing process takes time
82
- - **Discipline required**: Team must commit to writing ADRs for significant decisions
83
- - **Maintenance burden**: ADRs need periodic review and updates
84
- - **Process learning curve**: Team needs to learn when and how to write ADRs
85
- - **Risk of over-documentation**: May be tempted to document trivial decisions
86
-
87
- ### Neutral Consequences
88
-
89
- - **Cultural shift**: Changes team behavior around decision-making
90
- - **Review process**: ADRs should be reviewed like code changes
91
- - **Template evolution**: Template and process will likely evolve over time
92
- - **Tooling needs**: May eventually want better tooling for ADR visualization
93
-
94
- ## Alternatives Considered
95
-
96
- ### Alternative 1: Wiki Documentation
97
-
98
- **Description:** Use Confluence or similar wiki to document architectural decisions
99
-
100
- **Pros:**
101
- - Rich formatting options
102
- - Easy to link between documents
103
- - Built-in search functionality
104
- - Familiar to most teams
105
-
106
- **Cons:**
107
- - Separate from code repository
108
- - Not version controlled with code changes
109
- - Can become outdated easily
110
- - Requires additional tool/license
111
- - Less structured format
112
-
113
- **Rejection Reason:** ADRs in git are closer to the code, version controlled together, and don't require additional tools. The structured format encourages better decision documentation.
114
-
115
- ---
116
-
117
- ### Alternative 2: Code Comments Only
118
-
119
- **Description:** Document architectural decisions in code comments or README files
120
-
121
- **Pros:**
122
- - No separate documentation to maintain
123
- - Close to implementation
124
- - No new process needed
125
- - Developers already write comments
126
-
127
- **Cons:**
128
- - Lacks structure and searchability
129
- - Gets lost in code noise
130
- - Not suitable for cross-cutting decisions
131
- - Difficult to find historical context
132
- - No clear lifecycle management
133
-
134
- **Rejection Reason:** Code comments are good for implementation details but poor for capturing architectural rationale, alternatives considered, and consequences. A separate, structured approach is needed.
135
-
136
- ---
137
-
138
- ### Alternative 3: Design Documents in Google Docs
139
-
140
- **Description:** Write detailed design documents for each major decision
141
-
142
- **Pros:**
143
- - Rich formatting and diagrams
144
- - Real-time collaboration
145
- - Comment threads for discussions
146
- - Familiar tool for most teams
147
-
148
- **Cons:**
149
- - Not version controlled with code
150
- - Becomes outdated quickly
151
- - Access control complexity
152
- - Not searchable from codebase
153
- - Too heavyweight for many decisions
154
- - Separate from development workflow
155
-
156
- **Rejection Reason:** While design docs are valuable for complex features, ADRs provide a lighter-weight, version-controlled approach for capturing decisions. They complement, rather than replace, design docs.
157
-
158
- ---
159
-
160
- ## Validation
161
-
162
- ### Tests Performed
163
-
164
- - Reviewed ADR examples from multiple successful open-source projects
165
- - Prototyped ADR structure with markdown + YAML frontmatter
166
- - Tested integration with Claude Code for automatic generation
167
- - Verified searchability in GitHub and local development
168
-
169
- ### Metrics Collected
170
-
171
- - Time to create ADR from template: ~15-30 minutes for detailed decisions
172
- - Time for Claude Code to generate ADR: ~2-3 minutes
173
- - Markdown file size: Typically 2-5KB per ADR
174
- - Readability score: High (markdown renders well on GitHub)
175
-
176
- ### Success Criteria
177
-
178
- - [x] Template is clear and comprehensive
179
- - [x] Process integrates with git workflow
180
- - [x] Documents are easily searchable
181
- - [x] Format is both human and AI-friendly
182
- - [x] Can be automatically generated by Claude Code
183
- - [x] Minimal overhead for decision-makers
184
-
185
- ## References
186
-
187
- - [Original ADR article by Michael Nygard](https://cognitect.com/blog/2011/11/15/documenting-architecture-decisions)
188
- - [ADR GitHub Organization](https://adr.github.io/)
189
- - [Markdown Guide](https://www.markdownguide.org/)
190
- - [YAML Frontmatter Specification](https://jekyllrb.com/docs/front-matter/)
191
- - [GitHub's Markdown Rendering](https://docs.github.com/en/get-started/writing-on-github)
192
-
193
- ## Notes
194
-
195
- ### Future Considerations
196
-
197
- - May want to build visualization tools to show ADR relationships
198
- - Consider adding ADR linting to CI/CD pipeline
199
- - Could generate ADR index/table of contents automatically
200
- - Might want to track ADR metrics (count by status, age, etc.)
201
-
202
- ### Open Questions
203
-
204
- - Should we require ADRs for all decisions or only significant ones? (Answer: Only significant)
205
- - How often should we review ADRs? (Recommendation: Quarterly)
206
- - Who approves ADRs? (Answer: Architecture team or tech leads)
207
-
208
- ### Follow-up Items
209
-
210
- - [ ] Train team on ADR process (completed: 2025-01-15)
211
- - [ ] Document 5-10 historical architectural decisions
212
- - [ ] Add ADR checklist to project onboarding
213
- - [ ] Schedule quarterly ADR review sessions
214
-
215
- ---
216
-
217
- **Related ADRs:**
218
-
219
- This is the foundational ADR. Future ADRs will reference this one as the basis for the documentation practice.
220
-
221
- ---
222
-
223
- *This ADR serves as both documentation of our ADR process and a template/example for future ADRs.*
@@ -1,234 +0,0 @@
1
- # ADR Creation Instructions for Claude Code
2
-
3
- ## When to Create an ADR
4
-
5
- Create an ADR automatically when you make decisions about:
6
- - Architecture patterns (microservices, event-driven, etc.)
7
- - Technology selection (databases, frameworks, libraries)
8
- - Infrastructure choices (cloud providers, IaC tools, CI/CD)
9
- - Security approaches (authentication, authorization)
10
- - Testing strategies (unit, integration, e2e frameworks)
11
- - API design (REST vs GraphQL, versioning)
12
- - Data storage/modeling decisions
13
- - Deployment strategies
14
- - Development workflows
15
-
16
- ## ADR Creation Process
17
-
18
- ### Step 1: Determine ADR Number
19
- ```bash
20
- # List existing ADRs and get the highest number
21
- ls docs/adr/*.md | grep -E '[0-9]{4}' | sort | tail -1
22
- # Increment by 1 for new ADR number
23
- ```
24
-
25
- ### Step 2: Gather Information from Context
26
-
27
- Extract from conversation:
28
- - **Decision**: What was decided
29
- - **Context**: Why we're making this decision
30
- - **Constraints**: Technical, time, budget, team limitations
31
- - **Alternatives**: All options discussed (including rejected ones)
32
- - **Pros/Cons**: Benefits and drawbacks of each option
33
- - **Validation**: Any tests, prototypes, or benchmarks mentioned
34
- - **References**: Code, docs, or external resources mentioned
35
-
36
- ### Step 3: Fill Out Template
37
-
38
- Use `docs/adr/adr-template.md` and populate:
39
-
40
- **YAML Frontmatter:**
41
- ```yaml
42
- adr_number: [next sequential number]
43
- title: "[concise, descriptive title]"
44
- date: [YYYY-MM-DD - today's date]
45
- status: proposed # or accepted if explicitly approved
46
- supersedes: null # only if replacing an old ADR
47
- superseded_by: null
48
- tags: [relevant, technology, tags]
49
- decision_makers: [names if mentioned in conversation]
50
- ```
51
-
52
- **Content Sections:**
53
-
54
- 1. **Status**: Use current date and status from frontmatter
55
-
56
- 2. **Context**:
57
- - Summarize the problem/need
58
- - List constraints discovered
59
- - Include background from conversation
60
-
61
- 3. **Decision**:
62
- - State clearly what was chosen
63
- - Include implementation approach
64
- - Be specific and actionable
65
-
66
- 4. **Consequences**:
67
- - Positive: All benefits mentioned
68
- - Negative: All trade-offs/limitations discussed
69
- - Neutral: Workflow changes, dependencies, future work
70
-
71
- 5. **Alternatives Considered**:
72
- - List ALL options discussed (minimum 2-3)
73
- - Include pros/cons for each
74
- - State specific rejection reasons
75
-
76
- 6. **Validation**:
77
- - List any prototypes built
78
- - Include benchmark results
79
- - Note success criteria met
80
- - Reference test code if created
81
-
82
- 7. **References**:
83
- - Link to relevant code files
84
- - Link to documentation
85
- - Link to external resources mentioned
86
- - Link to related ADRs
87
-
88
- 8. **Notes**:
89
- - Future considerations discussed
90
- - Open questions
91
- - Follow-up items
92
-
93
- ### Step 4: File Naming
94
-
95
- Format: `NNNN-decision-title-in-kebab-case.md`
96
-
97
- Example conversions:
98
- - "Use PostgreSQL" → `0042-use-postgresql-for-data-storage.md`
99
- - "Migrate to Kubernetes" → `0043-migrate-to-kubernetes-from-docker-swarm.md`
100
- - "Implement Event Sourcing" → `0044-implement-event-sourcing-pattern.md`
101
-
102
- ### Step 5: Save and Confirm
103
-
104
- 1. Save to `docs/adr/NNNN-title.md`
105
- 2. Tell user: "I've created ADR-NNNN: [title] and saved it to docs/adr/"
106
- 3. Offer to make adjustments if needed
107
-
108
- ## Quality Checklist
109
-
110
- Before finalizing an ADR, verify:
111
-
112
- - [ ] All YAML frontmatter fields are filled
113
- - [ ] Status is appropriate (proposed vs accepted)
114
- - [ ] Context explains WHY this decision is needed
115
- - [ ] Decision is clear and specific
116
- - [ ] At least 2-3 alternatives are documented
117
- - [ ] Each alternative has pros, cons, and rejection reason
118
- - [ ] All three consequence types are considered
119
- - [ ] Validation section has concrete data (not generic)
120
- - [ ] References are actual links (not placeholders)
121
- - [ ] No TODO or FIXME comments remain
122
- - [ ] Markdown formatting is correct
123
- - [ ] File name matches convention
124
- - [ ] ADR number is sequential
125
-
126
- ## Example Workflows
127
-
128
- ### Workflow 1: Database Selection
129
- ```
130
- User: "Should we use PostgreSQL or MongoDB?"
131
- [Discussion of requirements, trade-offs]
132
- User: "Let's go with PostgreSQL"
133
-
134
- Claude:
135
- 1. Recognize this as a database selection decision
136
- 2. Extract all discussed points
137
- 3. Create ADR-NNNN with:
138
- - Context: Data requirements, team skills
139
- - Decision: PostgreSQL chosen
140
- - Alternatives: MongoDB (rejected), MySQL (not discussed but include)
141
- - Validation: Any performance tests mentioned
142
- 4. Save and confirm
143
- ```
144
-
145
- ### Workflow 2: Framework Migration
146
- ```
147
- User: "We need to migrate from Vue to React"
148
- [Discussion of reasons, timeline, risks]
149
-
150
- Claude:
151
- 1. Recognize this as a framework decision + migration
152
- 2. Note this might supersede an old ADR
153
- 3. Create ADR-NNNN with:
154
- - Context: Why migration is needed
155
- - Decision: Migrate to React
156
- - Alternatives: Stay with Vue, try Svelte
157
- - Consequences: Migration cost, team training, etc.
158
- 4. Check if previous Vue ADR exists
159
- 5. Update old ADR status if found
160
- 6. Save and confirm
161
- ```
162
-
163
- ### Workflow 3: New Architecture Pattern
164
- ```
165
- User: "Let's implement event sourcing for audit logs"
166
-
167
- Claude:
168
- 1. Recognize this as an architecture pattern decision
169
- 2. Create ADR-NNNN with:
170
- - Context: Audit requirements, compliance needs
171
- - Decision: Implement event sourcing
172
- - Alternatives: Traditional logging, database triggers
173
- - Implementation: High-level approach
174
- 3. Include in Validation: Need to build proof of concept
175
- 4. Save and confirm
176
- ```
177
-
178
- ## Common Pitfalls to Avoid
179
-
180
- ❌ **Don't**: Leave sections empty or with "TODO"
181
- ✅ **Do**: Fill all sections or write "N/A - [reason]"
182
-
183
- ❌ **Don't**: Write vague decisions like "Use a database"
184
- ✅ **Do**: Be specific "Use PostgreSQL 15+ for transactional data storage"
185
-
186
- ❌ **Don't**: Only list the chosen alternative
187
- ✅ **Do**: Document all options discussed, even if briefly
188
-
189
- ❌ **Don't**: Generic consequences like "Better performance"
190
- ✅ **Do**: Specific consequences "Reduces query time by 40% based on benchmark"
191
-
192
- ❌ **Don't**: Forget to update old ADRs when superseding
193
- ✅ **Do**: Update both old and new ADRs with cross-references
194
-
195
- ❌ **Don't**: Use present tense ("We are deciding...")
196
- ✅ **Do**: Use past/declarative tense ("We decided..." or "We will use...")
197
-
198
- ## Template Shortcuts
199
-
200
- For common decision types, use these patterns:
201
-
202
- ### Technology Selection
203
- ```
204
- Context: Need for [capability], evaluated based on [criteria]
205
- Decision: Selected [technology] for [use case]
206
- Alternatives: [Tech A] (rejected: reason), [Tech B] (rejected: reason)
207
- Validation: [Prototype/benchmark results]
208
- ```
209
-
210
- ### Migration Decision
211
- ```
212
- Context: Current [old tech] limitations: [list]
213
- Decision: Migrate from [old] to [new] over [timeframe]
214
- Alternatives: Stay with current (rejected: why), [other option]
215
- Consequences: Migration cost [X], training [Y], benefits [Z]
216
- ```
217
-
218
- ### Architecture Pattern
219
- ```
220
- Context: System requirements: [list], current problems: [list]
221
- Decision: Implement [pattern] for [components]
222
- Alternatives: [Pattern A] (rejected: why), continue current (rejected: why)
223
- Validation: Proof of concept in [location]
224
- ```
225
-
226
- ## Final Notes
227
-
228
- - **Trust the conversation**: All the information needed is usually in the discussion
229
- - **Be comprehensive**: Better to over-document than under-document
230
- - **Stay objective**: Present facts, not opinions
231
- - **Be helpful**: Offer to create ADR even if not explicitly requested
232
- - **Update history**: Keep track of superseded ADRs
233
-
234
- When in doubt, ask the user: "Would you like me to create an ADR to document this decision?"