@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,268 @@
|
|
|
1
|
+
# PRD Creation Instructions for Claude Code
|
|
2
|
+
|
|
3
|
+
## When to Create a PRD
|
|
4
|
+
|
|
5
|
+
Create a PRD automatically when the user describes:
|
|
6
|
+
- A new product feature or capability
|
|
7
|
+
- A system enhancement or improvement
|
|
8
|
+
- A major technical initiative
|
|
9
|
+
- A user-facing functionality change
|
|
10
|
+
- Multi-step implementation requiring planning
|
|
11
|
+
|
|
12
|
+
## PRD Creation Process
|
|
13
|
+
|
|
14
|
+
### Step 1: Engage in Interactive Planning
|
|
15
|
+
|
|
16
|
+
When a user describes requirements, engage in collaborative discussion:
|
|
17
|
+
- Ask clarifying questions about scope and goals
|
|
18
|
+
- Discuss constraints (technical, time, budget, team)
|
|
19
|
+
- Explore user needs and pain points
|
|
20
|
+
- Consider alternatives and trade-offs
|
|
21
|
+
- Validate understanding before creating PRD
|
|
22
|
+
|
|
23
|
+
### Step 2: Determine PRD Structure
|
|
24
|
+
|
|
25
|
+
From the conversation, extract:
|
|
26
|
+
- **Purpose**: What problem are we solving?
|
|
27
|
+
- **Goals**: What do we want to achieve?
|
|
28
|
+
- **User needs**: Who benefits and how?
|
|
29
|
+
- **Features**: What functionality is needed?
|
|
30
|
+
- **Success criteria**: How do we measure success?
|
|
31
|
+
- **Constraints**: What limitations exist?
|
|
32
|
+
|
|
33
|
+
### Step 3: Create PRD Document
|
|
34
|
+
|
|
35
|
+
Use the template at `docs/prd/_template/prd-template.md` and populate:
|
|
36
|
+
|
|
37
|
+
**YAML Frontmatter:**
|
|
38
|
+
```yaml
|
|
39
|
+
id: [descriptive-kebab-case-id]
|
|
40
|
+
title: "[Clear, User-Focused Title]"
|
|
41
|
+
version: 1.0.0 # Start with 1.0.0
|
|
42
|
+
status: not_started # or in_progress if work has begun
|
|
43
|
+
created: [YYYY-MM-DD - today's date]
|
|
44
|
+
updated: [YYYY-MM-DD - today's date]
|
|
45
|
+
author: [Claude Code or user name if provided]
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**Content Sections:**
|
|
49
|
+
|
|
50
|
+
1. **Purpose and Goals**
|
|
51
|
+
- Clear problem statement
|
|
52
|
+
- High-level objectives
|
|
53
|
+
- Value proposition
|
|
54
|
+
|
|
55
|
+
2. **User Needs**
|
|
56
|
+
- Target audience definition
|
|
57
|
+
- User stories in "As a [role], I want [action] so that [benefit]" format
|
|
58
|
+
- Pain points being addressed
|
|
59
|
+
|
|
60
|
+
3. **Features and Functionality**
|
|
61
|
+
- List each major feature
|
|
62
|
+
- Link to separate feature markdown files
|
|
63
|
+
- Brief description of each feature
|
|
64
|
+
- Initial status (usually "planned")
|
|
65
|
+
|
|
66
|
+
4. **Design and User Experience** (Optional)
|
|
67
|
+
- Directory structures if relevant
|
|
68
|
+
- Workflow visualizations
|
|
69
|
+
- UI/UX considerations
|
|
70
|
+
|
|
71
|
+
5. **Release Criteria**
|
|
72
|
+
- Functional requirements (must-haves)
|
|
73
|
+
- Usability requirements
|
|
74
|
+
- Technical requirements
|
|
75
|
+
- Use checkboxes for trackability
|
|
76
|
+
|
|
77
|
+
6. **Success Metrics (KPIs)**
|
|
78
|
+
- Measurable goals
|
|
79
|
+
- Target values
|
|
80
|
+
- How success will be evaluated
|
|
81
|
+
|
|
82
|
+
7. **Constraints and Dependencies**
|
|
83
|
+
- Technical constraints
|
|
84
|
+
- Dependencies on other systems
|
|
85
|
+
- Known limitations or trade-offs
|
|
86
|
+
|
|
87
|
+
### Step 4: Create Feature Files
|
|
88
|
+
|
|
89
|
+
For each feature identified in the PRD:
|
|
90
|
+
|
|
91
|
+
1. Create `docs/prd/{prd-id}/features/{feature-name}.md`
|
|
92
|
+
2. Use the feature template at `docs/prd/_template/feature-template.md`
|
|
93
|
+
3. Fill out:
|
|
94
|
+
- **YAML frontmatter** with feature metadata
|
|
95
|
+
- **Description** of what the feature does
|
|
96
|
+
- **Acceptance Criteria** with checkboxes
|
|
97
|
+
- **Tasks** broken down with files and expected changes
|
|
98
|
+
- **Dependencies** on other features
|
|
99
|
+
- **Testing Strategy** for validation
|
|
100
|
+
|
|
101
|
+
**Feature YAML Frontmatter:**
|
|
102
|
+
```yaml
|
|
103
|
+
id: [feature-kebab-case-id]
|
|
104
|
+
prd_id: [parent-prd-id]
|
|
105
|
+
title: "[Feature Title]"
|
|
106
|
+
status: planned # planned | in_progress | complete
|
|
107
|
+
created: [YYYY-MM-DD]
|
|
108
|
+
updated: [YYYY-MM-DD]
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Step 5: Organize Directory Structure
|
|
112
|
+
|
|
113
|
+
Create the following structure:
|
|
114
|
+
```
|
|
115
|
+
docs/prd/{prd-id}/
|
|
116
|
+
├── prd.md
|
|
117
|
+
└── features/
|
|
118
|
+
├── feature-1.md
|
|
119
|
+
├── feature-2.md
|
|
120
|
+
└── feature-3.md
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Step 6: Save and Confirm
|
|
124
|
+
|
|
125
|
+
1. Save PRD to `docs/prd/{prd-id}/prd.md`
|
|
126
|
+
2. Save features to `docs/prd/{prd-id}/features/{feature-name}.md`
|
|
127
|
+
3. Tell user: "I've created PRD '{title}' with {N} features at docs/prd/{prd-id}/"
|
|
128
|
+
4. Offer to make adjustments or add more features
|
|
129
|
+
|
|
130
|
+
## Quality Checklist
|
|
131
|
+
|
|
132
|
+
Before finalizing a PRD, verify:
|
|
133
|
+
|
|
134
|
+
- [ ] All YAML frontmatter fields are filled
|
|
135
|
+
- [ ] ID is in kebab-case and unique
|
|
136
|
+
- [ ] Purpose clearly states the problem being solved
|
|
137
|
+
- [ ] User needs include specific user stories
|
|
138
|
+
- [ ] Each feature has its own markdown file
|
|
139
|
+
- [ ] Features link correctly from main PRD
|
|
140
|
+
- [ ] Acceptance criteria are testable
|
|
141
|
+
- [ ] Tasks are broken down granularly
|
|
142
|
+
- [ ] Success metrics are measurable
|
|
143
|
+
- [ ] No TODO or FIXME comments remain
|
|
144
|
+
- [ ] Markdown formatting is correct
|
|
145
|
+
- [ ] File names follow conventions
|
|
146
|
+
|
|
147
|
+
## Example Workflows
|
|
148
|
+
|
|
149
|
+
### Workflow 1: New Feature Request
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
User: "We need to add user authentication to our app"
|
|
153
|
+
|
|
154
|
+
Claude:
|
|
155
|
+
1. Ask: "What authentication methods? Email/password? OAuth? Both?"
|
|
156
|
+
2. Ask: "Any specific security requirements or compliance needs?"
|
|
157
|
+
3. Ask: "Do we need password reset, MFA, session management?"
|
|
158
|
+
4. Once clarified, create PRD:
|
|
159
|
+
- ID: user-authentication-system
|
|
160
|
+
- Features: email-auth, oauth-integration, password-reset, session-management
|
|
161
|
+
5. Create feature files for each
|
|
162
|
+
6. Save and confirm
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Workflow 2: Enhancement to Existing System
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
User: "Let's add real-time notifications to our chat app"
|
|
169
|
+
|
|
170
|
+
Claude:
|
|
171
|
+
1. Ask: "What events should trigger notifications?"
|
|
172
|
+
2. Ask: "Desktop, mobile, or both? Browser notifications?"
|
|
173
|
+
3. Ask: "How should users control notification preferences?"
|
|
174
|
+
4. Create PRD:
|
|
175
|
+
- ID: real-time-notifications
|
|
176
|
+
- Features: push-notifications, notification-preferences, notification-history
|
|
177
|
+
5. Create feature files
|
|
178
|
+
6. Reference any existing PRDs if relevant
|
|
179
|
+
7. Save and confirm
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Workflow 3: Technical Initiative
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
User: "We should refactor our API to use GraphQL"
|
|
186
|
+
|
|
187
|
+
Claude:
|
|
188
|
+
1. Ask: "What's driving this? Performance? Developer experience?"
|
|
189
|
+
2. Ask: "Full migration or gradual? Timeline?"
|
|
190
|
+
3. Ask: "Keep REST endpoints or deprecate them?"
|
|
191
|
+
4. Create PRD:
|
|
192
|
+
- ID: graphql-api-migration
|
|
193
|
+
- Features: graphql-schema-design, resolver-implementation, client-migration
|
|
194
|
+
5. Include migration strategy in PRD
|
|
195
|
+
6. Create feature files with detailed tasks
|
|
196
|
+
7. Save and confirm
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## Common Pitfalls to Avoid
|
|
200
|
+
|
|
201
|
+
❌ **Don't**: Create PRD without understanding user needs
|
|
202
|
+
✅ **Do**: Have a collaborative discussion first
|
|
203
|
+
|
|
204
|
+
❌ **Don't**: Write vague acceptance criteria like "Works well"
|
|
205
|
+
✅ **Do**: Be specific "User can log in within 2 seconds"
|
|
206
|
+
|
|
207
|
+
❌ **Don't**: Lump all functionality into one feature
|
|
208
|
+
✅ **Do**: Break down into logical, testable features
|
|
209
|
+
|
|
210
|
+
❌ **Don't**: Skip the constraints section
|
|
211
|
+
✅ **Do**: Document limitations upfront to set expectations
|
|
212
|
+
|
|
213
|
+
❌ **Don't**: Forget to link features in the main PRD
|
|
214
|
+
✅ **Do**: Use relative links: `[features/auth.md](features/auth.md)`
|
|
215
|
+
|
|
216
|
+
❌ **Don't**: Use technical jargon without explanation
|
|
217
|
+
✅ **Do**: Write for both technical and non-technical stakeholders
|
|
218
|
+
|
|
219
|
+
## Template Shortcuts
|
|
220
|
+
|
|
221
|
+
### Simple Feature PRD
|
|
222
|
+
```
|
|
223
|
+
Purpose: Add [capability] to [system] for [user benefit]
|
|
224
|
+
Features: 1-3 core features, each in separate file
|
|
225
|
+
Success: [Measurable outcome]
|
|
226
|
+
Timeline: [Estimated completion]
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### System Enhancement PRD
|
|
230
|
+
```
|
|
231
|
+
Purpose: Improve [existing system] by [enhancement]
|
|
232
|
+
Current Problems: [List pain points]
|
|
233
|
+
Proposed Solution: [High-level approach]
|
|
234
|
+
Features: Broken down by component or workflow
|
|
235
|
+
Migration Strategy: If replacing existing functionality
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### Technical Initiative PRD
|
|
239
|
+
```
|
|
240
|
+
Purpose: [Technical improvement] to achieve [business goal]
|
|
241
|
+
Technical Context: Current architecture and limitations
|
|
242
|
+
Proposed Architecture: New approach
|
|
243
|
+
Features: Implementation phases or components
|
|
244
|
+
Validation: How to test and measure success
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
## Integration with Planning System
|
|
248
|
+
|
|
249
|
+
PRDs work alongside the planning system:
|
|
250
|
+
- **Plan tool**: Use `plan accept` to create implementation plans
|
|
251
|
+
- **Plan feature**: Add features to existing PRDs
|
|
252
|
+
- **Plan implement**: Execute task-by-task with TDD
|
|
253
|
+
- **Git hooks**: Automatically track commit SHAs in feature files
|
|
254
|
+
|
|
255
|
+
When creating a PRD, you can offer to:
|
|
256
|
+
1. Create the PRD structure
|
|
257
|
+
2. Use the plan tool to create an implementation plan
|
|
258
|
+
3. Begin implementation with `plan implement`
|
|
259
|
+
|
|
260
|
+
## Final Notes
|
|
261
|
+
|
|
262
|
+
- **Be collaborative**: PRDs are living documents; expect iteration
|
|
263
|
+
- **Be thorough**: Better to over-document than under-document
|
|
264
|
+
- **Be clear**: Write for diverse audiences
|
|
265
|
+
- **Be realistic**: Set achievable goals and acknowledge constraints
|
|
266
|
+
- **Be helpful**: Offer to create PRD even if not explicitly requested
|
|
267
|
+
|
|
268
|
+
When in doubt, ask the user: "Would you like me to create a PRD to document these requirements?"
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
# Product Requirements Documents (PRDs)
|
|
2
|
+
|
|
3
|
+
This directory contains Product Requirements Documents (PRDs) for tiny-brain features and capabilities. PRDs provide structured documentation of product requirements with clear feature breakdown and implementation tracking.
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
PRDs in tiny-brain serve to:
|
|
8
|
+
- **Document requirements systematically** - Capture product needs with clear acceptance criteria
|
|
9
|
+
- **Organize features hierarchically** - Break down complex projects into manageable features and tasks
|
|
10
|
+
- **Track implementation progress** - Monitor completion through git commit integration
|
|
11
|
+
- **Maintain project history** - Preserve planning decisions and implementation details in the repository
|
|
12
|
+
|
|
13
|
+
## Directory Structure
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
docs/prd/
|
|
17
|
+
├── README.md # This file
|
|
18
|
+
├── _template/ # Templates for creating new PRDs
|
|
19
|
+
│ ├── prd-template.md # Blank PRD template
|
|
20
|
+
│ └── feature-template.md # Blank feature template
|
|
21
|
+
│
|
|
22
|
+
└── {prd-id}/ # Each PRD gets its own directory
|
|
23
|
+
├── prd.md # Main PRD document
|
|
24
|
+
└── features/ # Feature subdirectory
|
|
25
|
+
├── feature-1.md # Feature implementation plan
|
|
26
|
+
├── feature-2.md # Feature implementation plan
|
|
27
|
+
└── ...
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Creating a New PRD
|
|
31
|
+
|
|
32
|
+
### Method 1: Using the Plan Tool (Recommended)
|
|
33
|
+
|
|
34
|
+
The easiest way to create a PRD is through the tiny-brain plan tool:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# Start planning mode and describe your PRD
|
|
38
|
+
# The tool will help you create the PRD structure interactively
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
When using the plan tool with Claude Code:
|
|
42
|
+
1. Describe your project requirements in a planning discussion
|
|
43
|
+
2. Use `plan accept` to create the PRD from your discussion
|
|
44
|
+
3. Use `plan feature` to add individual features
|
|
45
|
+
4. Use `plan implement` to start task-by-task implementation
|
|
46
|
+
|
|
47
|
+
### Method 2: Manual Creation
|
|
48
|
+
|
|
49
|
+
You can also create PRDs manually by copying the templates:
|
|
50
|
+
|
|
51
|
+
1. **Copy the template directory:**
|
|
52
|
+
```bash
|
|
53
|
+
cp -r _template/ your-prd-name/
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
2. **Rename files:**
|
|
57
|
+
```bash
|
|
58
|
+
cd your-prd-name/
|
|
59
|
+
mv prd-template.md prd.md
|
|
60
|
+
mkdir features
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
3. **Fill in the template:**
|
|
64
|
+
- Update YAML frontmatter with your PRD details
|
|
65
|
+
- Replace placeholders with your content
|
|
66
|
+
- Create feature files in the `features/` subdirectory
|
|
67
|
+
|
|
68
|
+
## PRD Document Structure
|
|
69
|
+
|
|
70
|
+
### YAML Frontmatter
|
|
71
|
+
|
|
72
|
+
Every PRD must include YAML frontmatter at the top:
|
|
73
|
+
|
|
74
|
+
```yaml
|
|
75
|
+
---
|
|
76
|
+
id: unique-prd-id # Unique identifier (kebab-case)
|
|
77
|
+
title: Human Readable Title # Display title
|
|
78
|
+
version: 1.0.0 # Semantic version
|
|
79
|
+
status: not_started # not_started | in_progress | complete
|
|
80
|
+
created: YYYY-MM-DD # Creation date (ISO format)
|
|
81
|
+
updated: YYYY-MM-DD # Last update date (ISO format)
|
|
82
|
+
author: Author Name # Who created this PRD
|
|
83
|
+
---
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Required Sections
|
|
87
|
+
|
|
88
|
+
1. **Purpose and Goals** - What problem are you solving and why?
|
|
89
|
+
2. **User Needs** - Who are the users and what do they need?
|
|
90
|
+
3. **Features and Functionality** - List of features with links to feature files
|
|
91
|
+
4. **Release Criteria** - What defines "done" for this PRD?
|
|
92
|
+
5. **Success Metrics** - How will you measure success?
|
|
93
|
+
6. **Constraints and Dependencies** - Technical and external considerations
|
|
94
|
+
|
|
95
|
+
See `_template/prd-template.md` for the full structure with placeholders.
|
|
96
|
+
|
|
97
|
+
## Feature Document Structure
|
|
98
|
+
|
|
99
|
+
### YAML Frontmatter
|
|
100
|
+
|
|
101
|
+
Every feature must include YAML frontmatter:
|
|
102
|
+
|
|
103
|
+
```yaml
|
|
104
|
+
---
|
|
105
|
+
id: feature-id # Unique identifier (kebab-case)
|
|
106
|
+
prd_id: parent-prd-id # Reference to parent PRD
|
|
107
|
+
title: Feature Title # Display title
|
|
108
|
+
status: planned # planned | in_progress | complete
|
|
109
|
+
created: YYYY-MM-DD # Creation date (ISO format)
|
|
110
|
+
updated: YYYY-MM-DD # Last update date (ISO format)
|
|
111
|
+
---
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Required Sections
|
|
115
|
+
|
|
116
|
+
1. **Description** - What does this feature do?
|
|
117
|
+
2. **Acceptance Criteria** - Testable requirements (use checkboxes)
|
|
118
|
+
3. **Tasks** - Implementation tasks with file details
|
|
119
|
+
4. **Dependencies** - Other features or systems this depends on
|
|
120
|
+
5. **Testing Strategy** - How will you test this?
|
|
121
|
+
|
|
122
|
+
See `_template/feature-template.md` for the full structure with placeholders.
|
|
123
|
+
|
|
124
|
+
## Task Tracking with Git Commits
|
|
125
|
+
|
|
126
|
+
Features support automatic commit SHA tracking through git hooks. When you follow the TDD (Test-Driven Development) workflow with conventional commit messages, your tasks will automatically track commit SHAs.
|
|
127
|
+
|
|
128
|
+
### Commit Message Convention
|
|
129
|
+
|
|
130
|
+
Use these prefixes for automatic tracking:
|
|
131
|
+
|
|
132
|
+
- **`test:`** - Writing tests (Red phase)
|
|
133
|
+
- Tracked in: `testCommitSha` field
|
|
134
|
+
- Example: `test: add user authentication tests`
|
|
135
|
+
|
|
136
|
+
- **`feat:`** - Implementing feature (Green phase)
|
|
137
|
+
- Tracked in: `commitSha` field
|
|
138
|
+
- Example: `feat: implement user authentication`
|
|
139
|
+
|
|
140
|
+
- **`refactor:`** - Refactoring code (Refactor phase)
|
|
141
|
+
- Tracked in: `refactorCommitSha` field
|
|
142
|
+
- Example: `refactor: simplify authentication logic`
|
|
143
|
+
|
|
144
|
+
### How It Works
|
|
145
|
+
|
|
146
|
+
1. You commit with a structured message (e.g., `feat: add login button`)
|
|
147
|
+
2. A post-commit git hook captures the commit SHA and message
|
|
148
|
+
3. The hook calls `tiny-brain track-commit` to update feature markdown files
|
|
149
|
+
4. The appropriate SHA field is updated based on the commit prefix
|
|
150
|
+
5. Your feature file shows progress with commit references
|
|
151
|
+
|
|
152
|
+
### Example Task Tracking
|
|
153
|
+
|
|
154
|
+
In your feature markdown:
|
|
155
|
+
|
|
156
|
+
```markdown
|
|
157
|
+
### 1. Add user authentication (test: abc1234, impl: def5678, refactor: ghi9012)
|
|
158
|
+
✅ **Status**: complete
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
The SHAs are automatically populated as you commit with the appropriate prefixes.
|
|
162
|
+
|
|
163
|
+
## Example PRD
|
|
164
|
+
|
|
165
|
+
The `plan-system-refactoring/` directory contains a complete, real-world example PRD that demonstrates all the concepts:
|
|
166
|
+
|
|
167
|
+
- **Main PRD**: `plan-system-refactoring/prd.md`
|
|
168
|
+
- **6 Features**: In `plan-system-refactoring/features/`
|
|
169
|
+
- **Complete structure**: Shows all sections properly filled in
|
|
170
|
+
- **Active tracking**: Being actively worked on with commit SHAs
|
|
171
|
+
|
|
172
|
+
Use this as a reference when creating your own PRDs.
|
|
173
|
+
|
|
174
|
+
## Integration with Tiny-Brain
|
|
175
|
+
|
|
176
|
+
### Storage Locations
|
|
177
|
+
|
|
178
|
+
PRDs live in two places:
|
|
179
|
+
|
|
180
|
+
1. **Repository**: `docs/prd/{prd-id}/` (markdown files - version controlled)
|
|
181
|
+
- Contains the PRD structure, features, and tasks
|
|
182
|
+
- Tracked in git for history and collaboration
|
|
183
|
+
|
|
184
|
+
2. **Tiny-Brain Storage**: `~/.tiny-brain/{persona}/plans/` (JSON - progress tracking)
|
|
185
|
+
- Contains current state, progress metrics, and metadata
|
|
186
|
+
- Updated in real-time as work progresses
|
|
187
|
+
- References the PRD markdown files
|
|
188
|
+
|
|
189
|
+
### Plan Tool Operations
|
|
190
|
+
|
|
191
|
+
The plan tool provides several operations for working with PRDs:
|
|
192
|
+
|
|
193
|
+
- **`plan accept`** - Create a new PRD from planning discussion
|
|
194
|
+
- **`plan feature`** - Add a feature to the current PRD
|
|
195
|
+
- **`plan implement`** - Start implementing tasks one by one
|
|
196
|
+
- **`plan status`** - Show current progress
|
|
197
|
+
- **`plan list`** - List all plans
|
|
198
|
+
|
|
199
|
+
### Dashboard Integration
|
|
200
|
+
|
|
201
|
+
The tiny-brain dashboard displays:
|
|
202
|
+
- All PRDs with their current status
|
|
203
|
+
- Feature breakdown and progress
|
|
204
|
+
- Task-level detail with commit SHAs
|
|
205
|
+
- Real-time updates via Server-Sent Events (SSE)
|
|
206
|
+
|
|
207
|
+
## Best Practices
|
|
208
|
+
|
|
209
|
+
### 1. Keep PRDs Focused
|
|
210
|
+
- One PRD per major feature or capability
|
|
211
|
+
- Break large projects into multiple PRDs
|
|
212
|
+
- Each PRD should have a clear, single purpose
|
|
213
|
+
|
|
214
|
+
### 2. Write Clear Acceptance Criteria
|
|
215
|
+
- Make criteria testable and measurable
|
|
216
|
+
- Use checkboxes to track completion
|
|
217
|
+
- Be specific about what "done" means
|
|
218
|
+
|
|
219
|
+
### 3. Break Features into Tasks
|
|
220
|
+
- Each task should be completable in one session
|
|
221
|
+
- Tasks should be small enough for a single commit (or TDD cycle)
|
|
222
|
+
- Include file paths and expected changes
|
|
223
|
+
|
|
224
|
+
### 4. Follow TDD Workflow
|
|
225
|
+
- Write tests first (`test:` commit)
|
|
226
|
+
- Implement to pass tests (`feat:` commit)
|
|
227
|
+
- Refactor if needed (`refactor:` commit)
|
|
228
|
+
- Git hooks will track your progress automatically
|
|
229
|
+
|
|
230
|
+
### 5. Keep PRDs Updated
|
|
231
|
+
- Update status as features complete
|
|
232
|
+
- Add new features as scope evolves
|
|
233
|
+
- Document decisions and changes
|
|
234
|
+
- Commit PRD updates along with code changes
|
|
235
|
+
|
|
236
|
+
### 6. Link Related Work
|
|
237
|
+
- Reference related PRDs in dependencies
|
|
238
|
+
- Link to external documentation
|
|
239
|
+
- Cross-reference features that interact
|
|
240
|
+
- Maintain a clear hierarchy
|
|
241
|
+
|
|
242
|
+
## Questions?
|
|
243
|
+
|
|
244
|
+
For more information about the tiny-brain planning system:
|
|
245
|
+
- See the main README at the repository root
|
|
246
|
+
- Check the dashboard for visual progress tracking
|
|
247
|
+
- Review `plan-system-refactoring/` as a working example
|
|
248
|
+
- Use the plan tool for interactive guidance
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
**Note**: This PRD system is part of the tiny-brain planning refactoring project. The templates and structure are designed to support interactive PRD creation with Claude Code and automatic progress tracking through git hooks.
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: feature-id
|
|
3
|
+
prd_id: parent-prd-id
|
|
4
|
+
title: Feature Title
|
|
5
|
+
status: planned
|
|
6
|
+
created: YYYY-MM-DD
|
|
7
|
+
updated: YYYY-MM-DD
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Feature: [Feature Title]
|
|
11
|
+
|
|
12
|
+
## Description
|
|
13
|
+
|
|
14
|
+
[Provide a comprehensive description of what this feature does, why it's needed, and how it fits into the larger PRD. Be specific about the functionality it provides.]
|
|
15
|
+
|
|
16
|
+
## Acceptance Criteria
|
|
17
|
+
|
|
18
|
+
[List the specific, testable criteria that must be met for this feature to be considered complete. Use checkboxes for tracking.]
|
|
19
|
+
|
|
20
|
+
- [ ] Criterion 1: [Specific requirement]
|
|
21
|
+
- [ ] Criterion 2: [Specific requirement]
|
|
22
|
+
- [ ] Criterion 3: [Specific requirement]
|
|
23
|
+
- [ ] Criterion 4: [Specific requirement]
|
|
24
|
+
|
|
25
|
+
## Tasks
|
|
26
|
+
|
|
27
|
+
[List all implementation tasks. Each task should be a discrete unit of work that can be completed with a single commit (or small set of commits for TDD: test/impl/refactor). Tasks will automatically track commit SHAs when using git hooks with conventional commit messages.]
|
|
28
|
+
|
|
29
|
+
### 1. Task Name
|
|
30
|
+
[Brief description of what needs to be done]
|
|
31
|
+
|
|
32
|
+
**Files to modify/create:**
|
|
33
|
+
- `path/to/file1.ts`
|
|
34
|
+
- `path/to/file2.ts`
|
|
35
|
+
|
|
36
|
+
**Expected changes:**
|
|
37
|
+
- Change 1: [Description]
|
|
38
|
+
- Change 2: [Description]
|
|
39
|
+
- Change 3: [Description]
|
|
40
|
+
|
|
41
|
+
### 2. Task Name
|
|
42
|
+
[Brief description of what needs to be done]
|
|
43
|
+
|
|
44
|
+
**Files to modify/create:**
|
|
45
|
+
- `path/to/file1.ts`
|
|
46
|
+
|
|
47
|
+
**Expected changes:**
|
|
48
|
+
- Change 1: [Description]
|
|
49
|
+
- Change 2: [Description]
|
|
50
|
+
|
|
51
|
+
[Add more tasks as needed. Each task will track:
|
|
52
|
+
- testCommitSha: When you commit with "test: ..." prefix
|
|
53
|
+
- commitSha: When you commit with "feat: ..." prefix
|
|
54
|
+
- refactorCommitSha: When you commit with "refactor: ..." prefix]
|
|
55
|
+
|
|
56
|
+
## Dependencies
|
|
57
|
+
|
|
58
|
+
[List any dependencies this feature has on other features or external systems]
|
|
59
|
+
|
|
60
|
+
- **Feature/System 1**: [Description of dependency]
|
|
61
|
+
- **Feature/System 2**: [Description of dependency]
|
|
62
|
+
|
|
63
|
+
## Testing Strategy
|
|
64
|
+
|
|
65
|
+
[Describe how this feature will be tested]
|
|
66
|
+
|
|
67
|
+
### Unit Tests
|
|
68
|
+
- Test scenario 1
|
|
69
|
+
- Test scenario 2
|
|
70
|
+
- Test scenario 3
|
|
71
|
+
|
|
72
|
+
### Integration Tests
|
|
73
|
+
- Integration scenario 1
|
|
74
|
+
- Integration scenario 2
|
|
75
|
+
|
|
76
|
+
### Manual Testing
|
|
77
|
+
- Manual test case 1
|
|
78
|
+
- Manual test case 2
|
|
79
|
+
|
|
80
|
+
## Implementation Notes
|
|
81
|
+
|
|
82
|
+
[Optional: Add any technical notes, considerations, or important details for implementers]
|
|
83
|
+
|
|
84
|
+
- Note 1: [Important consideration]
|
|
85
|
+
- Note 2: [Technical detail]
|
|
86
|
+
- Note 3: [Edge case to handle]
|
|
87
|
+
|
|
88
|
+
## Workflow Example
|
|
89
|
+
|
|
90
|
+
[Optional: If this feature involves a specific workflow or process, document it here]
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Example command or workflow
|
|
94
|
+
step 1
|
|
95
|
+
step 2
|
|
96
|
+
step 3
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Benefits
|
|
100
|
+
|
|
101
|
+
[Optional: Highlight the key benefits this feature provides]
|
|
102
|
+
|
|
103
|
+
- ✅ Benefit 1
|
|
104
|
+
- ✅ Benefit 2
|
|
105
|
+
- ✅ Benefit 3
|