@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.
Files changed (66) hide show
  1. package/dist/cli/cli-factory.d.ts.map +1 -1
  2. package/dist/cli/cli-factory.js +49 -0
  3. package/dist/cli/cli-factory.js.map +1 -1
  4. package/dist/cli/commands/track-commit.command.d.ts +40 -0
  5. package/dist/cli/commands/track-commit.command.d.ts.map +1 -0
  6. package/dist/cli/commands/track-commit.command.js +144 -0
  7. package/dist/cli/commands/track-commit.command.js.map +1 -0
  8. package/dist/core/mcp-server.d.ts.map +1 -1
  9. package/dist/core/mcp-server.js +19 -4
  10. package/dist/core/mcp-server.js.map +1 -1
  11. package/dist/prompts/persona/persona.prompt.d.ts.map +1 -1
  12. package/dist/prompts/persona/persona.prompt.js +4 -5
  13. package/dist/prompts/persona/persona.prompt.js.map +1 -1
  14. package/dist/prompts/planning/planning.prompt.js +41 -41
  15. package/dist/prompts/planning/planning.prompt.js.map +1 -1
  16. package/dist/services/agent-manager.d.ts.map +1 -1
  17. package/dist/services/agent-manager.js +5 -2
  18. package/dist/services/agent-manager.js.map +1 -1
  19. package/dist/services/analyse-service.d.ts +30 -0
  20. package/dist/services/analyse-service.d.ts.map +1 -1
  21. package/dist/services/analyse-service.js +176 -3
  22. package/dist/services/analyse-service.js.map +1 -1
  23. package/dist/services/persona-service.d.ts.map +1 -1
  24. package/dist/services/persona-service.js +25 -18
  25. package/dist/services/persona-service.js.map +1 -1
  26. package/dist/services/remote/system-persona-service.d.ts.map +1 -1
  27. package/dist/services/remote/system-persona-service.js +19 -10
  28. package/dist/services/remote/system-persona-service.js.map +1 -1
  29. package/dist/services/repo-service.d.ts +26 -2
  30. package/dist/services/repo-service.d.ts.map +1 -1
  31. package/dist/services/repo-service.js +192 -8
  32. package/dist/services/repo-service.js.map +1 -1
  33. package/dist/storage/local-filesystem-adapter.d.ts +1 -0
  34. package/dist/storage/local-filesystem-adapter.d.ts.map +1 -1
  35. package/dist/storage/local-filesystem-adapter.js +2 -0
  36. package/dist/storage/local-filesystem-adapter.js.map +1 -1
  37. package/dist/tools/persona/as.tool.d.ts.map +1 -1
  38. package/dist/tools/persona/as.tool.js +27 -16
  39. package/dist/tools/persona/as.tool.js.map +1 -1
  40. package/dist/tools/persona/persona.tool.d.ts.map +1 -1
  41. package/dist/tools/persona/persona.tool.js +3 -5
  42. package/dist/tools/persona/persona.tool.js.map +1 -1
  43. package/dist/tools/plan/plan.tool.d.ts +2 -0
  44. package/dist/tools/plan/plan.tool.d.ts.map +1 -1
  45. package/dist/tools/plan/plan.tool.js +278 -71
  46. package/dist/tools/plan/plan.tool.js.map +1 -1
  47. package/dist/utils/package-version.d.ts +11 -0
  48. package/dist/utils/package-version.d.ts.map +1 -0
  49. package/dist/utils/package-version.js +26 -0
  50. package/dist/utils/package-version.js.map +1 -0
  51. package/package.json +4 -3
  52. package/templates/adr/0001-record-architecture-decisions.md +223 -0
  53. package/templates/adr/ADR_CREATION_INSTRUCTIONS.md +234 -0
  54. package/templates/adr/README.md +243 -0
  55. package/templates/adr/adr-schema.json +74 -0
  56. package/templates/adr/adr-template.md +136 -0
  57. package/templates/prd/PRD_CREATION_INSTRUCTIONS.md +268 -0
  58. package/templates/prd/README.md +252 -0
  59. package/templates/prd/_template/feature-template.md +105 -0
  60. package/templates/prd/_template/prd-template.md +126 -0
  61. package/templates/prd/example-task-management/features/task-collaboration.md +84 -0
  62. package/templates/prd/example-task-management/features/task-crud.md +222 -0
  63. package/templates/prd/example-task-management/features/task-workflow.md +62 -0
  64. package/templates/prd/example-task-management/prd.md +177 -0
  65. package/templates/prd/feature-schema.json +54 -0
  66. package/templates/prd/prd-schema.json +60 -0
@@ -0,0 +1,243 @@
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
@@ -0,0 +1,74 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://example.com/adr-schema.json",
4
+ "title": "Architecture Decision Record",
5
+ "description": "Schema for validating ADR YAML frontmatter",
6
+ "type": "object",
7
+ "required": ["adr_number", "title", "date", "status"],
8
+ "properties": {
9
+ "adr_number": {
10
+ "type": "integer",
11
+ "minimum": 1,
12
+ "description": "Sequential ADR number"
13
+ },
14
+ "title": {
15
+ "type": "string",
16
+ "minLength": 5,
17
+ "maxLength": 100,
18
+ "description": "Brief, descriptive title of the decision"
19
+ },
20
+ "date": {
21
+ "type": "string",
22
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
23
+ "description": "Decision date in YYYY-MM-DD format"
24
+ },
25
+ "status": {
26
+ "type": "string",
27
+ "enum": ["proposed", "accepted", "deprecated", "superseded"],
28
+ "description": "Current status of the ADR"
29
+ },
30
+ "supersedes": {
31
+ "oneOf": [
32
+ { "type": "null" },
33
+ { "type": "integer", "minimum": 1 }
34
+ ],
35
+ "description": "ADR number this decision replaces (if any)"
36
+ },
37
+ "superseded_by": {
38
+ "oneOf": [
39
+ { "type": "null" },
40
+ { "type": "integer", "minimum": 1 }
41
+ ],
42
+ "description": "ADR number that replaces this decision (if any)"
43
+ },
44
+ "tags": {
45
+ "type": "array",
46
+ "items": {
47
+ "type": "string",
48
+ "pattern": "^[a-z0-9-]+$"
49
+ },
50
+ "uniqueItems": true,
51
+ "description": "Tags for categorizing the ADR"
52
+ },
53
+ "decision_makers": {
54
+ "type": "array",
55
+ "items": {
56
+ "type": "string"
57
+ },
58
+ "description": "People involved in making this decision"
59
+ }
60
+ },
61
+ "additionalProperties": false,
62
+ "examples": [
63
+ {
64
+ "adr_number": 42,
65
+ "title": "Use PostgreSQL for Data Storage",
66
+ "date": "2025-01-15",
67
+ "status": "accepted",
68
+ "supersedes": null,
69
+ "superseded_by": null,
70
+ "tags": ["database", "infrastructure"],
71
+ "decision_makers": ["Alice", "Bob", "Charlie"]
72
+ }
73
+ ]
74
+ }
@@ -0,0 +1,136 @@
1
+ ---
2
+ # ADR Metadata (YAML Frontmatter)
3
+ adr_number: 0
4
+ title: "Decision Title Here"
5
+ date: YYYY-MM-DD
6
+ status: proposed # proposed | accepted | deprecated | superseded
7
+ supersedes: null # ADR number if replacing another decision
8
+ superseded_by: null # ADR number if this decision was replaced
9
+ tags: [] # e.g., [infrastructure, testing, backend]
10
+ decision_makers: [] # People involved in the decision
11
+ ---
12
+
13
+ # ADR-{adr_number}: {title}
14
+
15
+ ## Status
16
+
17
+ **{status}** (Date: {date})
18
+
19
+ <!-- Status values: proposed | accepted | deprecated | superseded -->
20
+ <!-- If superseded, reference the new ADR: "Superseded by ADR-XXX" -->
21
+ <!-- If superseding, reference the old ADR: "Supersedes ADR-XXX" -->
22
+
23
+ ## Context
24
+
25
+ <!-- What is the issue we're facing? -->
26
+ <!-- What constraints exist (technical, business, team, time)? -->
27
+ <!-- What research/prototyping/experiments informed this decision? -->
28
+ <!-- What problem are we trying to solve? -->
29
+
30
+ ### Background
31
+ <!-- Additional context about the situation -->
32
+
33
+ ### Constraints
34
+ <!-- List key constraints that influenced the decision -->
35
+ - Constraint 1
36
+ - Constraint 2
37
+
38
+ ## Decision
39
+
40
+ <!-- The decision that was made - be specific and concrete -->
41
+ <!-- Use clear, declarative language: "We will use..." -->
42
+
43
+ ### Implementation Details
44
+ <!-- How will this decision be implemented? -->
45
+ <!-- Key technical specifics -->
46
+
47
+ ## Consequences
48
+
49
+ ### Positive Consequences
50
+ <!-- Benefits realized -->
51
+ <!-- Problems solved -->
52
+ - Benefit 1
53
+ - Benefit 2
54
+
55
+ ### Negative Consequences
56
+ <!-- Trade-offs accepted -->
57
+ <!-- Technical debt incurred -->
58
+ <!-- Limitations introduced -->
59
+ - Trade-off 1
60
+ - Trade-off 2
61
+
62
+ ### Neutral Consequences
63
+ <!-- Future work required -->
64
+ <!-- Dependencies created -->
65
+ <!-- Changes to team workflow -->
66
+ - Implication 1
67
+ - Implication 2
68
+
69
+ ## Alternatives Considered
70
+
71
+ ### Alternative 1: {Name}
72
+ **Description:** Brief description of this alternative
73
+
74
+ **Pros:**
75
+ - Pro 1
76
+ - Pro 2
77
+
78
+ **Cons:**
79
+ - Con 1
80
+ - Con 2
81
+
82
+ **Rejection Reason:** Why this option was not chosen
83
+
84
+ ---
85
+
86
+ ### Alternative 2: {Name}
87
+ **Description:** Brief description of this alternative
88
+
89
+ **Pros:**
90
+ - Pro 1
91
+ - Pro 2
92
+
93
+ **Cons:**
94
+ - Con 1
95
+ - Con 2
96
+
97
+ **Rejection Reason:** Why this option was not chosen
98
+
99
+ ---
100
+
101
+ ## Validation
102
+
103
+ <!-- How was this decision validated? -->
104
+ <!-- What tests/experiments were performed? -->
105
+ <!-- What metrics were collected? -->
106
+ <!-- What success criteria were met? -->
107
+
108
+ ### Tests Performed
109
+ - Test 1
110
+ - Test 2
111
+
112
+ ### Metrics Collected
113
+ - Metric 1: Value
114
+ - Metric 2: Value
115
+
116
+ ### Success Criteria
117
+ - [ ] Criterion 1
118
+ - [ ] Criterion 2
119
+
120
+ ## References
121
+
122
+ <!-- Links to relevant resources -->
123
+ - [Prototype code](url)
124
+ - [Benchmark results](url)
125
+ - [Team discussion](url)
126
+ - [Related documentation](url)
127
+
128
+ ## Notes
129
+
130
+ <!-- Any additional notes, future considerations, or follow-up items -->
131
+
132
+ ---
133
+
134
+ **Related ADRs:**
135
+ - ADR-XXX: Related Decision
136
+ - ADR-YYY: Another Related Decision