@magic-ingredients/tiny-brain-local 0.10.2 → 0.12.2
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.
- package/dist/cli/cli-factory.d.ts.map +1 -1
- package/dist/cli/cli-factory.js +49 -0
- package/dist/cli/cli-factory.js.map +1 -1
- package/dist/cli/commands/track-commit.command.d.ts +40 -0
- package/dist/cli/commands/track-commit.command.d.ts.map +1 -0
- package/dist/cli/commands/track-commit.command.js +144 -0
- package/dist/cli/commands/track-commit.command.js.map +1 -0
- package/dist/core/mcp-server.d.ts.map +1 -1
- package/dist/core/mcp-server.js +19 -4
- package/dist/core/mcp-server.js.map +1 -1
- package/dist/prompts/persona/persona.prompt.d.ts.map +1 -1
- package/dist/prompts/persona/persona.prompt.js +4 -5
- package/dist/prompts/persona/persona.prompt.js.map +1 -1
- package/dist/prompts/planning/planning.prompt.js +41 -41
- package/dist/prompts/planning/planning.prompt.js.map +1 -1
- package/dist/services/agent-manager.d.ts.map +1 -1
- package/dist/services/agent-manager.js +5 -2
- package/dist/services/agent-manager.js.map +1 -1
- package/dist/services/analyse-service.d.ts +30 -0
- package/dist/services/analyse-service.d.ts.map +1 -1
- package/dist/services/analyse-service.js +176 -3
- package/dist/services/analyse-service.js.map +1 -1
- package/dist/services/persona-service.d.ts.map +1 -1
- package/dist/services/persona-service.js +25 -18
- package/dist/services/persona-service.js.map +1 -1
- package/dist/services/remote/system-persona-service.d.ts.map +1 -1
- package/dist/services/remote/system-persona-service.js +19 -10
- package/dist/services/remote/system-persona-service.js.map +1 -1
- package/dist/services/repo-service.d.ts +26 -2
- package/dist/services/repo-service.d.ts.map +1 -1
- package/dist/services/repo-service.js +192 -8
- package/dist/services/repo-service.js.map +1 -1
- package/dist/storage/local-filesystem-adapter.d.ts +1 -0
- package/dist/storage/local-filesystem-adapter.d.ts.map +1 -1
- package/dist/storage/local-filesystem-adapter.js +2 -0
- package/dist/storage/local-filesystem-adapter.js.map +1 -1
- package/dist/tools/persona/as.tool.d.ts.map +1 -1
- package/dist/tools/persona/as.tool.js +27 -16
- package/dist/tools/persona/as.tool.js.map +1 -1
- package/dist/tools/persona/persona.tool.d.ts.map +1 -1
- package/dist/tools/persona/persona.tool.js +3 -5
- package/dist/tools/persona/persona.tool.js.map +1 -1
- package/dist/tools/plan/plan.tool.d.ts +2 -0
- package/dist/tools/plan/plan.tool.d.ts.map +1 -1
- package/dist/tools/plan/plan.tool.js +278 -71
- package/dist/tools/plan/plan.tool.js.map +1 -1
- package/dist/utils/package-version.d.ts +11 -0
- package/dist/utils/package-version.d.ts.map +1 -0
- package/dist/utils/package-version.js +26 -0
- package/dist/utils/package-version.js.map +1 -0
- package/package.json +4 -3
- package/templates/adr/0001-record-architecture-decisions.md +223 -0
- package/templates/adr/ADR_CREATION_INSTRUCTIONS.md +234 -0
- package/templates/adr/README.md +243 -0
- package/templates/adr/adr-schema.json +74 -0
- package/templates/adr/adr-template.md +136 -0
- package/templates/prd/PRD_CREATION_INSTRUCTIONS.md +268 -0
- package/templates/prd/README.md +252 -0
- package/templates/prd/_template/feature-template.md +105 -0
- package/templates/prd/_template/prd-template.md +126 -0
- package/templates/prd/example-task-management/features/task-collaboration.md +84 -0
- package/templates/prd/example-task-management/features/task-crud.md +222 -0
- package/templates/prd/example-task-management/features/task-workflow.md +62 -0
- package/templates/prd/example-task-management/prd.md +177 -0
- package/templates/prd/feature-schema.json +54 -0
- package/templates/prd/prd-schema.json +60 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Package Version Utility
|
|
3
|
+
*
|
|
4
|
+
* Provides access to the current package version from package.json
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Get the current package version from package.json
|
|
8
|
+
* @returns Semantic version string (e.g., "0.11.0")
|
|
9
|
+
*/
|
|
10
|
+
export declare function getPackageVersion(): string;
|
|
11
|
+
//# sourceMappingURL=package-version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-version.d.ts","sourceRoot":"","sources":["../../src/utils/package-version.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAa1C"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Package Version Utility
|
|
3
|
+
*
|
|
4
|
+
* Provides access to the current package version from package.json
|
|
5
|
+
*/
|
|
6
|
+
import { readFileSync } from 'fs';
|
|
7
|
+
import { join, dirname } from 'path';
|
|
8
|
+
import { fileURLToPath } from 'url';
|
|
9
|
+
/**
|
|
10
|
+
* Get the current package version from package.json
|
|
11
|
+
* @returns Semantic version string (e.g., "0.11.0")
|
|
12
|
+
*/
|
|
13
|
+
export function getPackageVersion() {
|
|
14
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
15
|
+
const __dirname = dirname(__filename);
|
|
16
|
+
// Navigate from dist/utils/ to package root
|
|
17
|
+
const packagePath = join(__dirname, '..', '..', 'package.json');
|
|
18
|
+
try {
|
|
19
|
+
const packageJson = JSON.parse(readFileSync(packagePath, 'utf-8'));
|
|
20
|
+
return packageJson.version;
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
throw new Error(`Failed to read package version: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=package-version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-version.js","sourceRoot":"","sources":["../../src/utils/package-version.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC;;;GAGG;AACH,MAAM,UAAU,iBAAiB;IAC/B,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAEtC,4CAA4C;IAC5C,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;IAEhE,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;QACnE,OAAO,WAAW,CAAC,OAAO,CAAC;IAC7B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,mCAAmC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC,CAAC;IACjH,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magic-ingredients/tiny-brain-local",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.2",
|
|
4
4
|
"description": "Local MCP server implementation for Tiny Brain AI assistant",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
19
19
|
"dist",
|
|
20
|
-
"README.md"
|
|
20
|
+
"README.md",
|
|
21
|
+
"templates"
|
|
21
22
|
],
|
|
22
23
|
"scripts": {
|
|
23
24
|
"build": "tsc",
|
|
@@ -40,7 +41,7 @@
|
|
|
40
41
|
"dxt:init": "cd dxt && dxt init"
|
|
41
42
|
},
|
|
42
43
|
"dependencies": {
|
|
43
|
-
"@magic-ingredients/tiny-brain-core": "^0.
|
|
44
|
+
"@magic-ingredients/tiny-brain-core": "^0.12.2",
|
|
44
45
|
"@magic-ingredients/tiny-brain-dashboard": "file:../tiny-brain-dashboard",
|
|
45
46
|
"@modelcontextprotocol/sdk": "^1.0.6",
|
|
46
47
|
"chalk": "^5.3.0",
|
|
@@ -0,0 +1,223 @@
|
|
|
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.*
|
|
@@ -0,0 +1,234 @@
|
|
|
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?"
|