@mindfoldhq/trellis 0.2.8 → 0.2.9
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/{readme.md → README.md}
RENAMED
|
@@ -181,7 +181,7 @@ No. Each person has their own space at `.trellis/workspace/{name}/`. Spec files
|
|
|
181
181
|
|
|
182
182
|
<p align="center">
|
|
183
183
|
<a href="https://github.com/mindfold-ai/Trellis/blob/main/LICENSE">FSL License</a> •
|
|
184
|
-
Made with care by
|
|
184
|
+
Made with care by Mindfold</a>
|
|
185
185
|
</p>
|
|
186
186
|
|
|
187
187
|
<p align="center">
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
# Update Spec - Capture Knowledge into Specifications
|
|
2
|
+
|
|
3
|
+
When you learn something valuable (from debugging, implementing, or discussion), use this command to update the relevant spec documents.
|
|
4
|
+
|
|
5
|
+
**Timing**: After completing a task, fixing a bug, or discovering a new pattern
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## When to Update Specs
|
|
10
|
+
|
|
11
|
+
| Trigger | Example | Target Spec |
|
|
12
|
+
|---------|---------|-------------|
|
|
13
|
+
| **Fixed a bug** | Found a subtle issue with error handling | `backend/error-handling.md` |
|
|
14
|
+
| **Discovered a pattern** | Found a better way to structure code | Relevant guidelines file |
|
|
15
|
+
| **Hit a gotcha** | Learned that X must be done before Y | Relevant spec + "Common Mistakes" section |
|
|
16
|
+
| **Established a convention** | Team agreed on naming pattern | `quality-guidelines.md` |
|
|
17
|
+
| **Cross-layer insight** | Understood how data flows between layers | `guides/cross-layer-thinking-guide.md` |
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Spec Structure Overview
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
.trellis/spec/
|
|
25
|
+
├── backend/ # Backend development standards
|
|
26
|
+
│ ├── index.md # Overview and links
|
|
27
|
+
│ └── *.md # Topic-specific guidelines
|
|
28
|
+
├── frontend/ # Frontend development standards
|
|
29
|
+
│ ├── index.md # Overview and links
|
|
30
|
+
│ └── *.md # Topic-specific guidelines
|
|
31
|
+
└── guides/ # Thinking guides
|
|
32
|
+
├── index.md # Guide index
|
|
33
|
+
└── *.md # Topic-specific guides
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Update Process
|
|
39
|
+
|
|
40
|
+
### Step 1: Identify What You Learned
|
|
41
|
+
|
|
42
|
+
Answer these questions:
|
|
43
|
+
|
|
44
|
+
1. **What did you learn?** (Be specific)
|
|
45
|
+
2. **Why is it important?** (What problem does it prevent?)
|
|
46
|
+
3. **Where does it belong?** (Which spec file?)
|
|
47
|
+
|
|
48
|
+
### Step 2: Classify the Update Type
|
|
49
|
+
|
|
50
|
+
| Type | Description | Action |
|
|
51
|
+
|------|-------------|--------|
|
|
52
|
+
| **New Pattern** | A reusable approach discovered | Add to "Patterns" section |
|
|
53
|
+
| **Forbidden Pattern** | Something that causes problems | Add to "Anti-patterns" or "Don't" section |
|
|
54
|
+
| **Common Mistake** | Easy-to-make error | Add to "Common Mistakes" section |
|
|
55
|
+
| **Convention** | Agreed-upon standard | Add to relevant section |
|
|
56
|
+
| **Gotcha** | Non-obvious behavior | Add warning callout |
|
|
57
|
+
|
|
58
|
+
### Step 3: Read the Target Spec
|
|
59
|
+
|
|
60
|
+
Before editing, read the current spec to:
|
|
61
|
+
- Understand existing structure
|
|
62
|
+
- Avoid duplicating content
|
|
63
|
+
- Find the right section for your update
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
cat .trellis/spec/<category>/<file>.md
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Step 4: Make the Update
|
|
70
|
+
|
|
71
|
+
Follow these principles:
|
|
72
|
+
|
|
73
|
+
1. **Be Specific**: Include concrete examples, not just abstract rules
|
|
74
|
+
2. **Explain Why**: State the problem this prevents
|
|
75
|
+
3. **Show Code**: Add code snippets for patterns
|
|
76
|
+
4. **Keep it Short**: One concept per section
|
|
77
|
+
|
|
78
|
+
### Step 5: Update the Index (if needed)
|
|
79
|
+
|
|
80
|
+
If you added a new section or the spec status changed, update the category's `index.md`.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Update Templates
|
|
85
|
+
|
|
86
|
+
### Adding a New Pattern
|
|
87
|
+
|
|
88
|
+
```markdown
|
|
89
|
+
### Pattern Name
|
|
90
|
+
|
|
91
|
+
**Problem**: What problem does this solve?
|
|
92
|
+
|
|
93
|
+
**Solution**: Brief description of the approach.
|
|
94
|
+
|
|
95
|
+
**Example**:
|
|
96
|
+
\`\`\`
|
|
97
|
+
// Good
|
|
98
|
+
code example
|
|
99
|
+
|
|
100
|
+
// Bad
|
|
101
|
+
code example
|
|
102
|
+
\`\`\`
|
|
103
|
+
|
|
104
|
+
**Why**: Explanation of why this works better.
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Adding a Forbidden Pattern
|
|
108
|
+
|
|
109
|
+
```markdown
|
|
110
|
+
### Don't: Pattern Name
|
|
111
|
+
|
|
112
|
+
**Problem**:
|
|
113
|
+
\`\`\`
|
|
114
|
+
// Don't do this
|
|
115
|
+
bad code example
|
|
116
|
+
\`\`\`
|
|
117
|
+
|
|
118
|
+
**Why it's bad**: Explanation of the issue.
|
|
119
|
+
|
|
120
|
+
**Instead**:
|
|
121
|
+
\`\`\`
|
|
122
|
+
// Do this instead
|
|
123
|
+
good code example
|
|
124
|
+
\`\`\`
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Adding a Common Mistake
|
|
128
|
+
|
|
129
|
+
```markdown
|
|
130
|
+
### Common Mistake: Description
|
|
131
|
+
|
|
132
|
+
**Symptom**: What goes wrong
|
|
133
|
+
|
|
134
|
+
**Cause**: Why this happens
|
|
135
|
+
|
|
136
|
+
**Fix**: How to correct it
|
|
137
|
+
|
|
138
|
+
**Prevention**: How to avoid it in the future
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Adding a Gotcha
|
|
142
|
+
|
|
143
|
+
```markdown
|
|
144
|
+
> **Warning**: Brief description of the non-obvious behavior.
|
|
145
|
+
>
|
|
146
|
+
> Details about when this happens and how to handle it.
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Interactive Mode
|
|
152
|
+
|
|
153
|
+
If you're unsure what to update, answer these prompts:
|
|
154
|
+
|
|
155
|
+
1. **What did you just finish?**
|
|
156
|
+
- [ ] Fixed a bug
|
|
157
|
+
- [ ] Implemented a feature
|
|
158
|
+
- [ ] Refactored code
|
|
159
|
+
- [ ] Had a discussion about approach
|
|
160
|
+
|
|
161
|
+
2. **What surprised you or was non-obvious?**
|
|
162
|
+
- (Describe the insight)
|
|
163
|
+
|
|
164
|
+
3. **Would this help someone else avoid the same problem?**
|
|
165
|
+
- Yes → Proceed to update spec
|
|
166
|
+
- No → Maybe not worth documenting
|
|
167
|
+
|
|
168
|
+
4. **Which area does it relate to?**
|
|
169
|
+
- [ ] Backend code
|
|
170
|
+
- [ ] Frontend code
|
|
171
|
+
- [ ] Cross-layer data flow
|
|
172
|
+
- [ ] Code organization/reuse
|
|
173
|
+
- [ ] Quality/testing
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## Quality Checklist
|
|
178
|
+
|
|
179
|
+
Before finishing your spec update:
|
|
180
|
+
|
|
181
|
+
- [ ] Is the content specific and actionable?
|
|
182
|
+
- [ ] Did you include a code example?
|
|
183
|
+
- [ ] Did you explain WHY, not just WHAT?
|
|
184
|
+
- [ ] Is it in the right spec file?
|
|
185
|
+
- [ ] Does it duplicate existing content?
|
|
186
|
+
- [ ] Would a new team member understand it?
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## Relationship to Other Commands
|
|
191
|
+
|
|
192
|
+
```
|
|
193
|
+
Development Flow:
|
|
194
|
+
Learn something → /update-spec → Knowledge captured
|
|
195
|
+
↑ ↓
|
|
196
|
+
/break-loop ←──────────────────── Future sessions benefit
|
|
197
|
+
(deep bug analysis)
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
- `/break-loop` - Analyzes bugs deeply, often reveals spec updates needed
|
|
201
|
+
- `/update-spec` - Actually makes the updates (this command)
|
|
202
|
+
- `/finish-work` - Reminds you to check if specs need updates
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## Core Philosophy
|
|
207
|
+
|
|
208
|
+
> **Specs are living documents. Every debugging session, every "aha moment" is an opportunity to make the spec better.**
|
|
209
|
+
|
|
210
|
+
The goal is **institutional memory**:
|
|
211
|
+
- What one person learns, everyone benefits from
|
|
212
|
+
- What AI learns in one session, persists to future sessions
|
|
213
|
+
- Mistakes become documented guardrails
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
# Update Spec - Capture Knowledge into Specifications
|
|
2
|
+
|
|
3
|
+
When you learn something valuable (from debugging, implementing, or discussion), use this command to update the relevant spec documents.
|
|
4
|
+
|
|
5
|
+
**Timing**: After completing a task, fixing a bug, or discovering a new pattern
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## When to Update Specs
|
|
10
|
+
|
|
11
|
+
| Trigger | Example | Target Spec |
|
|
12
|
+
|---------|---------|-------------|
|
|
13
|
+
| **Fixed a bug** | Found a subtle issue with error handling | `backend/error-handling.md` |
|
|
14
|
+
| **Discovered a pattern** | Found a better way to structure code | Relevant guidelines file |
|
|
15
|
+
| **Hit a gotcha** | Learned that X must be done before Y | Relevant spec + "Common Mistakes" section |
|
|
16
|
+
| **Established a convention** | Team agreed on naming pattern | `quality-guidelines.md` |
|
|
17
|
+
| **Cross-layer insight** | Understood how data flows between layers | `guides/cross-layer-thinking-guide.md` |
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Spec Structure Overview
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
.trellis/spec/
|
|
25
|
+
├── backend/ # Backend development standards
|
|
26
|
+
│ ├── index.md # Overview and links
|
|
27
|
+
│ └── *.md # Topic-specific guidelines
|
|
28
|
+
├── frontend/ # Frontend development standards
|
|
29
|
+
│ ├── index.md # Overview and links
|
|
30
|
+
│ └── *.md # Topic-specific guidelines
|
|
31
|
+
└── guides/ # Thinking guides
|
|
32
|
+
├── index.md # Guide index
|
|
33
|
+
└── *.md # Topic-specific guides
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Update Process
|
|
39
|
+
|
|
40
|
+
### Step 1: Identify What You Learned
|
|
41
|
+
|
|
42
|
+
Answer these questions:
|
|
43
|
+
|
|
44
|
+
1. **What did you learn?** (Be specific)
|
|
45
|
+
2. **Why is it important?** (What problem does it prevent?)
|
|
46
|
+
3. **Where does it belong?** (Which spec file?)
|
|
47
|
+
|
|
48
|
+
### Step 2: Classify the Update Type
|
|
49
|
+
|
|
50
|
+
| Type | Description | Action |
|
|
51
|
+
|------|-------------|--------|
|
|
52
|
+
| **New Pattern** | A reusable approach discovered | Add to "Patterns" section |
|
|
53
|
+
| **Forbidden Pattern** | Something that causes problems | Add to "Anti-patterns" or "Don't" section |
|
|
54
|
+
| **Common Mistake** | Easy-to-make error | Add to "Common Mistakes" section |
|
|
55
|
+
| **Convention** | Agreed-upon standard | Add to relevant section |
|
|
56
|
+
| **Gotcha** | Non-obvious behavior | Add warning callout |
|
|
57
|
+
|
|
58
|
+
### Step 3: Read the Target Spec
|
|
59
|
+
|
|
60
|
+
Before editing, read the current spec to:
|
|
61
|
+
- Understand existing structure
|
|
62
|
+
- Avoid duplicating content
|
|
63
|
+
- Find the right section for your update
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
cat .trellis/spec/<category>/<file>.md
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Step 4: Make the Update
|
|
70
|
+
|
|
71
|
+
Follow these principles:
|
|
72
|
+
|
|
73
|
+
1. **Be Specific**: Include concrete examples, not just abstract rules
|
|
74
|
+
2. **Explain Why**: State the problem this prevents
|
|
75
|
+
3. **Show Code**: Add code snippets for patterns
|
|
76
|
+
4. **Keep it Short**: One concept per section
|
|
77
|
+
|
|
78
|
+
### Step 5: Update the Index (if needed)
|
|
79
|
+
|
|
80
|
+
If you added a new section or the spec status changed, update the category's `index.md`.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Update Templates
|
|
85
|
+
|
|
86
|
+
### Adding a New Pattern
|
|
87
|
+
|
|
88
|
+
```markdown
|
|
89
|
+
### Pattern Name
|
|
90
|
+
|
|
91
|
+
**Problem**: What problem does this solve?
|
|
92
|
+
|
|
93
|
+
**Solution**: Brief description of the approach.
|
|
94
|
+
|
|
95
|
+
**Example**:
|
|
96
|
+
\`\`\`
|
|
97
|
+
// Good
|
|
98
|
+
code example
|
|
99
|
+
|
|
100
|
+
// Bad
|
|
101
|
+
code example
|
|
102
|
+
\`\`\`
|
|
103
|
+
|
|
104
|
+
**Why**: Explanation of why this works better.
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Adding a Forbidden Pattern
|
|
108
|
+
|
|
109
|
+
```markdown
|
|
110
|
+
### Don't: Pattern Name
|
|
111
|
+
|
|
112
|
+
**Problem**:
|
|
113
|
+
\`\`\`
|
|
114
|
+
// Don't do this
|
|
115
|
+
bad code example
|
|
116
|
+
\`\`\`
|
|
117
|
+
|
|
118
|
+
**Why it's bad**: Explanation of the issue.
|
|
119
|
+
|
|
120
|
+
**Instead**:
|
|
121
|
+
\`\`\`
|
|
122
|
+
// Do this instead
|
|
123
|
+
good code example
|
|
124
|
+
\`\`\`
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Adding a Common Mistake
|
|
128
|
+
|
|
129
|
+
```markdown
|
|
130
|
+
### Common Mistake: Description
|
|
131
|
+
|
|
132
|
+
**Symptom**: What goes wrong
|
|
133
|
+
|
|
134
|
+
**Cause**: Why this happens
|
|
135
|
+
|
|
136
|
+
**Fix**: How to correct it
|
|
137
|
+
|
|
138
|
+
**Prevention**: How to avoid it in the future
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Adding a Gotcha
|
|
142
|
+
|
|
143
|
+
```markdown
|
|
144
|
+
> **Warning**: Brief description of the non-obvious behavior.
|
|
145
|
+
>
|
|
146
|
+
> Details about when this happens and how to handle it.
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Interactive Mode
|
|
152
|
+
|
|
153
|
+
If you're unsure what to update, answer these prompts:
|
|
154
|
+
|
|
155
|
+
1. **What did you just finish?**
|
|
156
|
+
- [ ] Fixed a bug
|
|
157
|
+
- [ ] Implemented a feature
|
|
158
|
+
- [ ] Refactored code
|
|
159
|
+
- [ ] Had a discussion about approach
|
|
160
|
+
|
|
161
|
+
2. **What surprised you or was non-obvious?**
|
|
162
|
+
- (Describe the insight)
|
|
163
|
+
|
|
164
|
+
3. **Would this help someone else avoid the same problem?**
|
|
165
|
+
- Yes → Proceed to update spec
|
|
166
|
+
- No → Maybe not worth documenting
|
|
167
|
+
|
|
168
|
+
4. **Which area does it relate to?**
|
|
169
|
+
- [ ] Backend code
|
|
170
|
+
- [ ] Frontend code
|
|
171
|
+
- [ ] Cross-layer data flow
|
|
172
|
+
- [ ] Code organization/reuse
|
|
173
|
+
- [ ] Quality/testing
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## Quality Checklist
|
|
178
|
+
|
|
179
|
+
Before finishing your spec update:
|
|
180
|
+
|
|
181
|
+
- [ ] Is the content specific and actionable?
|
|
182
|
+
- [ ] Did you include a code example?
|
|
183
|
+
- [ ] Did you explain WHY, not just WHAT?
|
|
184
|
+
- [ ] Is it in the right spec file?
|
|
185
|
+
- [ ] Does it duplicate existing content?
|
|
186
|
+
- [ ] Would a new team member understand it?
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## Relationship to Other Commands
|
|
191
|
+
|
|
192
|
+
```
|
|
193
|
+
Development Flow:
|
|
194
|
+
Learn something → /update-spec → Knowledge captured
|
|
195
|
+
↑ ↓
|
|
196
|
+
/break-loop ←──────────────────── Future sessions benefit
|
|
197
|
+
(deep bug analysis)
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
- `/break-loop` - Analyzes bugs deeply, often reveals spec updates needed
|
|
201
|
+
- `/update-spec` - Actually makes the updates (this command)
|
|
202
|
+
- `/finish-work` - Reminds you to check if specs need updates
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## Core Philosophy
|
|
207
|
+
|
|
208
|
+
> **Specs are living documents. Every debugging session, every "aha moment" is an opportunity to make the spec better.**
|
|
209
|
+
|
|
210
|
+
The goal is **institutional memory**:
|
|
211
|
+
- What one person learns, everyone benefits from
|
|
212
|
+
- What AI learns in one session, persists to future sessions
|
|
213
|
+
- Mistakes become documented guardrails
|
package/package.json
CHANGED