@mindfoldhq/trellis 0.3.3 → 0.3.5

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 (82) hide show
  1. package/README.md +4 -4
  2. package/dist/cli/index.js +1 -0
  3. package/dist/cli/index.js.map +1 -1
  4. package/dist/commands/init.d.ts +1 -0
  5. package/dist/commands/init.d.ts.map +1 -1
  6. package/dist/commands/init.js.map +1 -1
  7. package/dist/commands/update.d.ts.map +1 -1
  8. package/dist/commands/update.js +2 -7
  9. package/dist/commands/update.js.map +1 -1
  10. package/dist/configurators/index.d.ts.map +1 -1
  11. package/dist/configurators/index.js +15 -3
  12. package/dist/configurators/index.js.map +1 -1
  13. package/dist/configurators/kilo.d.ts +1 -1
  14. package/dist/configurators/kilo.d.ts.map +1 -1
  15. package/dist/configurators/kilo.js +2 -1
  16. package/dist/configurators/kilo.js.map +1 -1
  17. package/dist/configurators/qoder.d.ts +8 -0
  18. package/dist/configurators/qoder.d.ts.map +1 -0
  19. package/dist/configurators/qoder.js +52 -0
  20. package/dist/configurators/qoder.js.map +1 -0
  21. package/dist/migrations/manifests/0.3.4.json +21 -0
  22. package/dist/migrations/manifests/0.3.5.json +9 -0
  23. package/dist/templates/claude/commands/trellis/record-session.md +12 -16
  24. package/dist/templates/codex/skills/record-session/SKILL.md +13 -17
  25. package/dist/templates/cursor/commands/trellis-record-session.md +12 -16
  26. package/dist/templates/extract.d.ts +7 -0
  27. package/dist/templates/extract.d.ts.map +1 -1
  28. package/dist/templates/extract.js +13 -0
  29. package/dist/templates/extract.js.map +1 -1
  30. package/dist/templates/gemini/commands/trellis/record-session.toml +12 -16
  31. package/dist/templates/iflow/commands/trellis/record-session.md +12 -16
  32. package/dist/templates/iflow/hooks/session-start.py +1 -0
  33. package/dist/templates/kilo/index.d.ts +3 -3
  34. package/dist/templates/kilo/index.d.ts.map +1 -1
  35. package/dist/templates/kilo/index.js +7 -7
  36. package/dist/templates/kilo/index.js.map +1 -1
  37. package/dist/templates/kilo/{commands/trellis → workflows}/record-session.md +12 -16
  38. package/dist/templates/kiro/skills/record-session/SKILL.md +13 -17
  39. package/dist/templates/opencode/commands/trellis/record-session.md +12 -16
  40. package/dist/templates/qoder/index.d.ts +18 -0
  41. package/dist/templates/qoder/index.d.ts.map +1 -0
  42. package/dist/templates/qoder/index.js +40 -0
  43. package/dist/templates/qoder/index.js.map +1 -0
  44. package/dist/templates/qoder/skills/before-backend-dev/SKILL.md +18 -0
  45. package/dist/templates/qoder/skills/before-frontend-dev/SKILL.md +18 -0
  46. package/dist/templates/qoder/skills/brainstorm/SKILL.md +479 -0
  47. package/dist/templates/qoder/skills/break-loop/SKILL.md +130 -0
  48. package/dist/templates/qoder/skills/check-backend/SKILL.md +18 -0
  49. package/dist/templates/qoder/skills/check-cross-layer/SKILL.md +158 -0
  50. package/dist/templates/qoder/skills/check-frontend/SKILL.md +18 -0
  51. package/dist/templates/qoder/skills/create-command/SKILL.md +101 -0
  52. package/dist/templates/qoder/skills/finish-work/SKILL.md +134 -0
  53. package/dist/templates/qoder/skills/integrate-skill/SKILL.md +221 -0
  54. package/dist/templates/qoder/skills/onboard/SKILL.md +363 -0
  55. package/dist/templates/qoder/skills/record-session/SKILL.md +63 -0
  56. package/dist/templates/qoder/skills/start/SKILL.md +326 -0
  57. package/dist/templates/qoder/skills/update-spec/SKILL.md +290 -0
  58. package/dist/templates/trellis/scripts/add_session.py +3 -3
  59. package/dist/templates/trellis/scripts/common/cli_adapter.py +125 -20
  60. package/dist/templates/trellis/scripts/common/git_context.py +120 -0
  61. package/dist/templates/trellis/scripts/multi_agent/plan.py +4 -1
  62. package/dist/templates/trellis/scripts/multi_agent/start.py +5 -1
  63. package/dist/templates/trellis/scripts/task.py +26 -0
  64. package/dist/types/ai-tools.d.ts +3 -3
  65. package/dist/types/ai-tools.d.ts.map +1 -1
  66. package/dist/types/ai-tools.js +8 -0
  67. package/dist/types/ai-tools.js.map +1 -1
  68. package/package.json +1 -1
  69. /package/dist/templates/kilo/{commands/trellis → workflows}/before-backend-dev.md +0 -0
  70. /package/dist/templates/kilo/{commands/trellis → workflows}/before-frontend-dev.md +0 -0
  71. /package/dist/templates/kilo/{commands/trellis → workflows}/brainstorm.md +0 -0
  72. /package/dist/templates/kilo/{commands/trellis → workflows}/break-loop.md +0 -0
  73. /package/dist/templates/kilo/{commands/trellis → workflows}/check-backend.md +0 -0
  74. /package/dist/templates/kilo/{commands/trellis → workflows}/check-cross-layer.md +0 -0
  75. /package/dist/templates/kilo/{commands/trellis → workflows}/check-frontend.md +0 -0
  76. /package/dist/templates/kilo/{commands/trellis → workflows}/create-command.md +0 -0
  77. /package/dist/templates/kilo/{commands/trellis → workflows}/finish-work.md +0 -0
  78. /package/dist/templates/kilo/{commands/trellis → workflows}/integrate-skill.md +0 -0
  79. /package/dist/templates/kilo/{commands/trellis → workflows}/onboard.md +0 -0
  80. /package/dist/templates/kilo/{commands/trellis → workflows}/parallel.md +0 -0
  81. /package/dist/templates/kilo/{commands/trellis → workflows}/start.md +0 -0
  82. /package/dist/templates/kilo/{commands/trellis → workflows}/update-spec.md +0 -0
@@ -0,0 +1,326 @@
1
+ ---
2
+ name: start
3
+ description: "Start Session"
4
+ ---
5
+
6
+ # Start Session
7
+
8
+ Initialize your AI development session and begin working on tasks.
9
+
10
+ ---
11
+
12
+ ## Operation Types
13
+
14
+ | Marker | Meaning | Executor |
15
+ |--------|---------|----------|
16
+ | `[AI]` | Bash scripts or Task calls executed by AI | You (AI) |
17
+ | `[USER]` | Skills executed by user | User |
18
+
19
+ ---
20
+
21
+ ## Initialization `[AI]`
22
+
23
+ ### Step 1: Understand Development Workflow
24
+
25
+ First, read the workflow guide to understand the development process:
26
+
27
+ ```bash
28
+ cat .trellis/workflow.md
29
+ ```
30
+
31
+ **Follow the instructions in workflow.md** - it contains:
32
+ - Core principles (Read Before Write, Follow Standards, etc.)
33
+ - File system structure
34
+ - Development process
35
+ - Best practices
36
+
37
+ ### Step 2: Get Current Context
38
+
39
+ ```bash
40
+ python3 ./.trellis/scripts/get_context.py
41
+ ```
42
+
43
+ This shows: developer identity, git status, current task (if any), active tasks.
44
+
45
+ ### Step 3: Read Guidelines Index
46
+
47
+ ```bash
48
+ cat .trellis/spec/frontend/index.md # Frontend guidelines
49
+ cat .trellis/spec/backend/index.md # Backend guidelines
50
+ cat .trellis/spec/guides/index.md # Thinking guides
51
+ ```
52
+
53
+ ### Step 4: Report and Ask
54
+
55
+ Report what you learned and ask: "What would you like to work on?"
56
+
57
+ ---
58
+
59
+ ## Task Classification
60
+
61
+ When user describes a task, classify it:
62
+
63
+ | Type | Criteria | Workflow |
64
+ |------|----------|----------|
65
+ | **Question** | User asks about code, architecture, or how something works | Answer directly |
66
+ | **Trivial Fix** | Typo fix, comment update, single-line change, < 5 minutes | Direct Edit |
67
+ | **Development Task** | Any code change that: modifies logic, adds features, fixes bugs, touches multiple files | **Task Workflow** |
68
+
69
+ ### Decision Rule
70
+
71
+ > **If in doubt, use Task Workflow.**
72
+ >
73
+ > Task Workflow ensures specs are injected to agents, resulting in higher quality code.
74
+ > The overhead is minimal, but the benefit is significant.
75
+
76
+ ---
77
+
78
+ ## Question / Trivial Fix
79
+
80
+ For questions or trivial fixes, work directly:
81
+
82
+ 1. Answer question or make the fix
83
+ 2. If code was changed, remind user to run `$finish-work`
84
+
85
+ ---
86
+
87
+ ## Task Workflow (Development Tasks)
88
+
89
+ **Why this workflow?**
90
+ - Research Agent analyzes what specs are needed
91
+ - Specs are configured in jsonl files
92
+ - Implement Agent receives specs via Hook injection
93
+ - Check Agent verifies against specs
94
+ - Result: Code that follows project conventions automatically
95
+
96
+ ### Overview: Two Entry Points
97
+
98
+ ```
99
+ From Brainstorm (Complex Task):
100
+ PRD confirmed → Research → Configure Context → Activate → Implement → Check → Complete
101
+
102
+ From Simple Task:
103
+ Confirm → Create Task → Write PRD → Research → Configure Context → Activate → Implement → Check → Complete
104
+ ```
105
+
106
+ **Key principle: Research happens AFTER requirements are clear (PRD exists).**
107
+
108
+ ---
109
+
110
+ ### Phase 1: Establish Requirements
111
+
112
+ #### Path A: From Brainstorm (skip to Phase 2)
113
+
114
+ PRD and task directory already exist from brainstorm. Skip directly to Phase 2.
115
+
116
+ #### Path B: From Simple Task
117
+
118
+ **Step 1: Confirm Understanding** `[AI]`
119
+
120
+ Quick confirm:
121
+ - What is the goal?
122
+ - What type of development? (frontend / backend / fullstack)
123
+ - Any specific requirements or constraints?
124
+
125
+ **Step 2: Create Task Directory** `[AI]`
126
+
127
+ ```bash
128
+ TASK_DIR=$(python3 ./.trellis/scripts/task.py create "<title>" --slug <name>)
129
+ ```
130
+
131
+ **Step 3: Write PRD** `[AI]`
132
+
133
+ Create `prd.md` in the task directory with:
134
+
135
+ ```markdown
136
+ # <Task Title>
137
+
138
+ ## Goal
139
+ <What we're trying to achieve>
140
+
141
+ ## Requirements
142
+ - <Requirement 1>
143
+ - <Requirement 2>
144
+
145
+ ## Acceptance Criteria
146
+ - [ ] <Criterion 1>
147
+ - [ ] <Criterion 2>
148
+
149
+ ## Technical Notes
150
+ <Any technical decisions or constraints>
151
+ ```
152
+
153
+ ---
154
+
155
+ ### Phase 2: Prepare for Implementation (shared)
156
+
157
+ > Both paths converge here. PRD and task directory must exist before proceeding.
158
+
159
+ **Step 4: Code-Spec Depth Check** `[AI]`
160
+
161
+ If the task touches infra or cross-layer contracts, do not start implementation until code-spec depth is defined.
162
+
163
+ Trigger this requirement when the change includes any of:
164
+ - New or changed command/API signatures
165
+ - Database schema or migration changes
166
+ - Infra integrations (storage, queue, cache, secrets, env contracts)
167
+ - Cross-layer payload transformations
168
+
169
+ Must-have before proceeding:
170
+ - [ ] Target spec files to update are identified
171
+ - [ ] Concrete contract is defined (signature, fields, env keys)
172
+ - [ ] Validation and error matrix is defined
173
+ - [ ] At least one Good/Base/Bad case is defined
174
+
175
+ **Step 5: Research the Codebase** `[AI]`
176
+
177
+ Based on the confirmed PRD, call Research Agent to find relevant specs and patterns:
178
+
179
+ ```
180
+ Task(
181
+ subagent_type: "research",
182
+ prompt: "Analyze the codebase for this task:
183
+
184
+ Task: <goal from PRD>
185
+ Type: <frontend/backend/fullstack>
186
+
187
+ Please find:
188
+ 1. Relevant spec files in .trellis/spec/
189
+ 2. Existing code patterns to follow (find 2-3 examples)
190
+ 3. Files that will likely need modification
191
+
192
+ Output:
193
+ ## Relevant Specs
194
+ - <path>: <why it's relevant>
195
+
196
+ ## Code Patterns Found
197
+ - <pattern>: <example file path>
198
+
199
+ ## Files to Modify
200
+ - <path>: <what change>",
201
+ model: "opus"
202
+ )
203
+ ```
204
+
205
+ **Step 6: Configure Context** `[AI]`
206
+
207
+ Initialize default context:
208
+
209
+ ```bash
210
+ python3 ./.trellis/scripts/task.py init-context "$TASK_DIR" <type>
211
+ # type: backend | frontend | fullstack
212
+ ```
213
+
214
+ Add specs found by Research Agent:
215
+
216
+ ```bash
217
+ # For each relevant spec and code pattern:
218
+ python3 ./.trellis/scripts/task.py add-context "$TASK_DIR" implement "<path>" "<reason>"
219
+ python3 ./.trellis/scripts/task.py add-context "$TASK_DIR" check "<path>" "<reason>"
220
+ ```
221
+
222
+ **Step 7: Activate Task** `[AI]`
223
+
224
+ ```bash
225
+ python3 ./.trellis/scripts/task.py start "$TASK_DIR"
226
+ ```
227
+
228
+ This sets `.current-task` so hooks can inject context.
229
+
230
+ ---
231
+
232
+ ### Phase 3: Execute (shared)
233
+
234
+ **Step 8: Implement** `[AI]`
235
+
236
+ Call Implement Agent (specs are auto-injected by hook):
237
+
238
+ ```
239
+ Task(
240
+ subagent_type: "implement",
241
+ prompt: "Implement the task described in prd.md.
242
+
243
+ Follow all specs that have been injected into your context.
244
+ Run lint and typecheck before finishing.",
245
+ model: "opus"
246
+ )
247
+ ```
248
+
249
+ **Step 9: Check Quality** `[AI]`
250
+
251
+ Call Check Agent (specs are auto-injected by hook):
252
+
253
+ ```
254
+ Task(
255
+ subagent_type: "check",
256
+ prompt: "Review all code changes against the specs.
257
+
258
+ Fix any issues you find directly.
259
+ Ensure lint and typecheck pass.",
260
+ model: "opus"
261
+ )
262
+ ```
263
+
264
+ **Step 10: Complete** `[AI]`
265
+
266
+ 1. Verify lint and typecheck pass
267
+ 2. Report what was implemented
268
+ 3. Remind user to:
269
+ - Test the changes
270
+ - Commit when ready
271
+ - Run `$record-session` to record this session
272
+
273
+ ---
274
+
275
+ ## Continuing Existing Task
276
+
277
+ If `get_context.py` shows a current task:
278
+
279
+ 1. Read the task's `prd.md` to understand the goal
280
+ 2. Check `task.json` for current status and phase
281
+ 3. Ask user: "Continue working on <task-name>?"
282
+
283
+ If yes, resume from the appropriate step (usually Step 7 or 8).
284
+
285
+ ---
286
+
287
+ ## Skills Reference
288
+
289
+ ### User Skills `[USER]`
290
+
291
+ | Command | When to Use |
292
+ |---------|-------------|
293
+ | `$start` | Begin a session (this skill) |
294
+ | `$parallel` | Complex tasks needing isolated worktree |
295
+ | `$finish-work` | Before committing changes |
296
+ | `$record-session` | After completing a task |
297
+
298
+ ### AI Scripts `[AI]`
299
+
300
+ | Script | Purpose |
301
+ |--------|---------|
302
+ | `python3 ./.trellis/scripts/get_context.py` | Get session context |
303
+ | `python3 ./.trellis/scripts/task.py create` | Create task directory |
304
+ | `python3 ./.trellis/scripts/task.py init-context` | Initialize jsonl files |
305
+ | `python3 ./.trellis/scripts/task.py add-context` | Add spec to jsonl |
306
+ | `python3 ./.trellis/scripts/task.py start` | Set current task |
307
+ | `python3 ./.trellis/scripts/task.py finish` | Clear current task |
308
+ | `python3 ./.trellis/scripts/task.py archive` | Archive completed task |
309
+
310
+ ### Sub Agents `[AI]`
311
+
312
+ | Agent | Purpose | Hook Injection |
313
+ |-------|---------|----------------|
314
+ | research | Analyze codebase | No (reads directly) |
315
+ | implement | Write code | Yes (implement.jsonl) |
316
+ | check | Review & fix | Yes (check.jsonl) |
317
+ | debug | Fix specific issues | Yes (debug.jsonl) |
318
+
319
+ ---
320
+
321
+ ## Key Principle
322
+
323
+ > **Specs are injected, not remembered.**
324
+ >
325
+ > The Task Workflow ensures agents receive relevant specs automatically.
326
+ > This is more reliable than hoping the AI "remembers" conventions.
@@ -0,0 +1,290 @@
1
+ ---
2
+ name: update-spec
3
+ description: "Update Code-Spec - Capture Executable Contracts"
4
+ ---
5
+
6
+ # Update Spec - Capture Knowledge into Specifications
7
+
8
+ When you learn something valuable (from debugging, implementing, or discussion), use this command to update the relevant spec documents.
9
+
10
+ **Timing**: After completing a task, fixing a bug, or discovering a new pattern
11
+
12
+ ---
13
+
14
+ ## When to Update Specs
15
+
16
+ | Trigger | Example | Target Spec |
17
+ |---------|---------|-------------|
18
+ | **Implemented a feature** | Added template download with giget | Relevant `backend/` or `frontend/` file |
19
+ | **Made a design decision** | Used type field + mapping table for extensibility | Relevant spec + "Design Decisions" section |
20
+ | **Fixed a bug** | Found a subtle issue with error handling | `backend/error-handling.md` |
21
+ | **Discovered a pattern** | Found a better way to structure code | Relevant `backend/` or `frontend/` file |
22
+ | **Hit a gotcha** | Learned that X must be done before Y | Relevant spec + "Common Mistakes" section |
23
+ | **Established a convention** | Team agreed on naming pattern | `quality-guidelines.md` |
24
+ | **New thinking trigger** | "Don't forget to check X before doing Y" | `guides/*.md` (as a checklist item, not detailed rules) |
25
+
26
+ **Key Insight**: Spec updates are NOT just for problems. Every feature implementation contains design decisions and project conventions that future AI/developers need to know.
27
+
28
+ ---
29
+
30
+ ## Spec Structure Overview
31
+
32
+ ```
33
+ .trellis/spec/
34
+ ├── backend/ # Backend coding standards
35
+ │ ├── index.md # Overview and links
36
+ │ └── *.md # Topic-specific guidelines
37
+ ├── frontend/ # Frontend coding standards
38
+ │ ├── index.md # Overview and links
39
+ │ └── *.md # Topic-specific guidelines
40
+ └── guides/ # Thinking checklists (NOT coding specs!)
41
+ ├── index.md # Guide index
42
+ └── *.md # Topic-specific guides
43
+ ```
44
+
45
+ ### CRITICAL: Spec vs Guide - Know the Difference
46
+
47
+ | Type | Location | Purpose | Content Style |
48
+ |------|----------|---------|---------------|
49
+ | **Spec** | `backend/*.md`, `frontend/*.md` | Tell AI "how to write code" | Detailed rules, code examples, forbidden patterns |
50
+ | **Guide** | `guides/*.md` | Help AI "what to think about" | Checklists, questions, pointers to specs |
51
+
52
+ **Decision Rule**: Ask yourself:
53
+
54
+ - "This is **how to write** the code" → Put in `backend/` or `frontend/`
55
+ - "This is **what to consider** before writing" → Put in `guides/`
56
+
57
+ **Example**:
58
+
59
+ | Learning | Wrong Location | Correct Location |
60
+ |----------|----------------|------------------|
61
+ | "Use `reconfigure()` not `TextIOWrapper` for Windows stdout" | ❌ `guides/cross-platform-thinking-guide.md` | ✅ `backend/script-conventions.md` |
62
+ | "Remember to check encoding when writing cross-platform code" | ❌ `backend/script-conventions.md` | ✅ `guides/cross-platform-thinking-guide.md` |
63
+
64
+ **Guides should be short checklists that point to specs**, not duplicate the detailed rules.
65
+
66
+ ---
67
+
68
+ ## Update Process
69
+
70
+ ### Step 1: Identify What You Learned
71
+
72
+ Answer these questions:
73
+
74
+ 1. **What did you learn?** (Be specific)
75
+ 2. **Why is it important?** (What problem does it prevent?)
76
+ 3. **Where does it belong?** (Which spec file?)
77
+
78
+ ### Step 2: Classify the Update Type
79
+
80
+ | Type | Description | Action |
81
+ |------|-------------|--------|
82
+ | **Design Decision** | Why we chose approach X over Y | Add to "Design Decisions" section |
83
+ | **Project Convention** | How we do X in this project | Add to relevant section with examples |
84
+ | **New Pattern** | A reusable approach discovered | Add to "Patterns" section |
85
+ | **Forbidden Pattern** | Something that causes problems | Add to "Anti-patterns" or "Don't" section |
86
+ | **Common Mistake** | Easy-to-make error | Add to "Common Mistakes" section |
87
+ | **Convention** | Agreed-upon standard | Add to relevant section |
88
+ | **Gotcha** | Non-obvious behavior | Add warning callout |
89
+
90
+ ### Step 3: Read the Target Spec
91
+
92
+ Before editing, read the current spec to:
93
+ - Understand existing structure
94
+ - Avoid duplicating content
95
+ - Find the right section for your update
96
+
97
+ ```bash
98
+ cat .trellis/spec/<category>/<file>.md
99
+ ```
100
+
101
+ ### Step 4: Make the Update
102
+
103
+ Follow these principles:
104
+
105
+ 1. **Be Specific**: Include concrete examples, not just abstract rules
106
+ 2. **Explain Why**: State the problem this prevents
107
+ 3. **Show Code**: Add code snippets for patterns
108
+ 4. **Keep it Short**: One concept per section
109
+
110
+ ### Step 5: Update the Index (if needed)
111
+
112
+ If you added a new section or the spec status changed, update the category's `index.md`.
113
+
114
+ ---
115
+
116
+ ## Update Templates
117
+
118
+ ### Adding a Design Decision
119
+
120
+ ```markdown
121
+ ### Design Decision: [Decision Name]
122
+
123
+ **Context**: What problem were we solving?
124
+
125
+ **Options Considered**:
126
+ 1. Option A - brief description
127
+ 2. Option B - brief description
128
+
129
+ **Decision**: We chose Option X because...
130
+
131
+ **Example**:
132
+ \`\`\`typescript
133
+ // How it's implemented
134
+ code example
135
+ \`\`\`
136
+
137
+ **Extensibility**: How to extend this in the future...
138
+ ```
139
+
140
+ ### Adding a Project Convention
141
+
142
+ ```markdown
143
+ ### Convention: [Convention Name]
144
+
145
+ **What**: Brief description of the convention.
146
+
147
+ **Why**: Why we do it this way in this project.
148
+
149
+ **Example**:
150
+ \`\`\`typescript
151
+ // How to follow this convention
152
+ code example
153
+ \`\`\`
154
+
155
+ **Related**: Links to related conventions or specs.
156
+ ```
157
+
158
+ ### Adding a New Pattern
159
+
160
+ ```markdown
161
+ ### Pattern Name
162
+
163
+ **Problem**: What problem does this solve?
164
+
165
+ **Solution**: Brief description of the approach.
166
+
167
+ **Example**:
168
+ \`\`\`
169
+ // Good
170
+ code example
171
+
172
+ // Bad
173
+ code example
174
+ \`\`\`
175
+
176
+ **Why**: Explanation of why this works better.
177
+ ```
178
+
179
+ ### Adding a Forbidden Pattern
180
+
181
+ ```markdown
182
+ ### Don't: Pattern Name
183
+
184
+ **Problem**:
185
+ \`\`\`
186
+ // Don't do this
187
+ bad code example
188
+ \`\`\`
189
+
190
+ **Why it's bad**: Explanation of the issue.
191
+
192
+ **Instead**:
193
+ \`\`\`
194
+ // Do this instead
195
+ good code example
196
+ \`\`\`
197
+ ```
198
+
199
+ ### Adding a Common Mistake
200
+
201
+ ```markdown
202
+ ### Common Mistake: Description
203
+
204
+ **Symptom**: What goes wrong
205
+
206
+ **Cause**: Why this happens
207
+
208
+ **Fix**: How to correct it
209
+
210
+ **Prevention**: How to avoid it in the future
211
+ ```
212
+
213
+ ### Adding a Gotcha
214
+
215
+ ```markdown
216
+ > **Warning**: Brief description of the non-obvious behavior.
217
+ >
218
+ > Details about when this happens and how to handle it.
219
+ ```
220
+
221
+ ---
222
+
223
+ ## Interactive Mode
224
+
225
+ If you're unsure what to update, answer these prompts:
226
+
227
+ 1. **What did you just finish?**
228
+ - [ ] Fixed a bug
229
+ - [ ] Implemented a feature
230
+ - [ ] Refactored code
231
+ - [ ] Had a discussion about approach
232
+
233
+ 2. **What did you learn or decide?**
234
+ - Design decision (why X over Y)
235
+ - Project convention (how we do X)
236
+ - Non-obvious behavior (gotcha)
237
+ - Better approach (pattern)
238
+
239
+ 3. **Would future AI/developers need to know this?**
240
+ - To understand how the code works → Yes, update spec
241
+ - To maintain or extend the feature → Yes, update spec
242
+ - To avoid repeating mistakes → Yes, update spec
243
+ - Purely one-off implementation detail → Maybe skip
244
+
245
+ 4. **Which area does it relate to?**
246
+ - [ ] Backend code
247
+ - [ ] Frontend code
248
+ - [ ] Cross-layer data flow
249
+ - [ ] Code organization/reuse
250
+ - [ ] Quality/testing
251
+
252
+ ---
253
+
254
+ ## Quality Checklist
255
+
256
+ Before finishing your spec update:
257
+
258
+ - [ ] Is the content specific and actionable?
259
+ - [ ] Did you include a code example?
260
+ - [ ] Did you explain WHY, not just WHAT?
261
+ - [ ] Is it in the right spec file?
262
+ - [ ] Does it duplicate existing content?
263
+ - [ ] Would a new team member understand it?
264
+
265
+ ---
266
+
267
+ ## Relationship to Other Commands
268
+
269
+ ```
270
+ Development Flow:
271
+ Learn something → $update-spec → Knowledge captured
272
+ ↑ ↓
273
+ $break-loop ←──────────────────── Future sessions benefit
274
+ (deep bug analysis)
275
+ ```
276
+
277
+ - `$break-loop` - Analyzes bugs deeply, often reveals spec updates needed
278
+ - `$update-spec` - Actually makes the updates (this skill)
279
+ - `$finish-work` - Reminds you to check if specs need updates
280
+
281
+ ---
282
+
283
+ ## Core Philosophy
284
+
285
+ > **Specs are living documents. Every debugging session, every "aha moment" is an opportunity to make the spec better.**
286
+
287
+ The goal is **institutional memory**:
288
+ - What one person learns, everyone benefits from
289
+ - What AI learns in one session, persists to future sessions
290
+ - Mistakes become documented guardrails
@@ -272,16 +272,16 @@ def update_index(
272
272
  # =============================================================================
273
273
 
274
274
  def _auto_commit_workspace(repo_root: Path) -> None:
275
- """Stage .trellis/workspace and commit with a configured message."""
275
+ """Stage .trellis/workspace and .trellis/tasks, then commit with a configured message."""
276
276
  commit_msg = get_session_commit_message(repo_root)
277
277
  subprocess.run(
278
- ["git", "add", "-A", ".trellis/workspace"],
278
+ ["git", "add", "-A", ".trellis/workspace", ".trellis/tasks"],
279
279
  cwd=repo_root,
280
280
  capture_output=True,
281
281
  )
282
282
  # Check if there are staged changes
283
283
  result = subprocess.run(
284
- ["git", "diff", "--cached", "--quiet", "--", ".trellis/workspace"],
284
+ ["git", "diff", "--cached", "--quiet", "--", ".trellis/workspace", ".trellis/tasks"],
285
285
  cwd=repo_root,
286
286
  )
287
287
  if result.returncode == 0: