@mindfoldhq/trellis 0.4.0-beta.7 → 0.4.0-beta.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.
Files changed (121) hide show
  1. package/README.md +10 -5
  2. package/dist/cli/index.js +2 -0
  3. package/dist/cli/index.js.map +1 -1
  4. package/dist/commands/init.d.ts +2 -0
  5. package/dist/commands/init.d.ts.map +1 -1
  6. package/dist/commands/init.js +34 -10
  7. package/dist/commands/init.js.map +1 -1
  8. package/dist/commands/update.d.ts.map +1 -1
  9. package/dist/commands/update.js +33 -2
  10. package/dist/commands/update.js.map +1 -1
  11. package/dist/configurators/codex.d.ts +7 -4
  12. package/dist/configurators/codex.d.ts.map +1 -1
  13. package/dist/configurators/codex.js +40 -10
  14. package/dist/configurators/codex.js.map +1 -1
  15. package/dist/configurators/copilot.d.ts +9 -0
  16. package/dist/configurators/copilot.d.ts.map +1 -0
  17. package/dist/configurators/copilot.js +34 -0
  18. package/dist/configurators/copilot.js.map +1 -0
  19. package/dist/configurators/index.d.ts +11 -1
  20. package/dist/configurators/index.d.ts.map +1 -1
  21. package/dist/configurators/index.js +59 -4
  22. package/dist/configurators/index.js.map +1 -1
  23. package/dist/configurators/windsurf.d.ts +8 -0
  24. package/dist/configurators/windsurf.d.ts.map +1 -0
  25. package/dist/configurators/windsurf.js +18 -0
  26. package/dist/configurators/windsurf.js.map +1 -0
  27. package/dist/migrations/manifests/0.4.0-beta.8.json +34 -0
  28. package/dist/migrations/manifests/0.4.0-beta.9.json +9 -0
  29. package/dist/templates/claude/commands/trellis/record-session.md +2 -1
  30. package/dist/templates/claude/hooks/inject-subagent-context.py +8 -1
  31. package/dist/templates/claude/hooks/ralph-loop.py +8 -1
  32. package/dist/templates/claude/hooks/session-start.py +31 -7
  33. package/dist/templates/claude/hooks/statusline.py +211 -0
  34. package/dist/templates/claude/settings.json +4 -0
  35. package/dist/templates/codex/agents/check.toml +23 -0
  36. package/dist/templates/codex/agents/implement.toml +19 -0
  37. package/dist/templates/codex/agents/research.toml +26 -0
  38. package/dist/templates/codex/codex-skills/parallel/SKILL.md +194 -0
  39. package/dist/templates/codex/config.toml +5 -0
  40. package/dist/templates/codex/hooks/session-start.py +228 -0
  41. package/dist/templates/codex/hooks.json +16 -0
  42. package/dist/templates/codex/index.d.ts +27 -5
  43. package/dist/templates/codex/index.d.ts.map +1 -1
  44. package/dist/templates/codex/index.js +60 -8
  45. package/dist/templates/codex/index.js.map +1 -1
  46. package/dist/templates/codex/skills/improve-ut/SKILL.md +69 -0
  47. package/dist/templates/codex/skills/record-session/SKILL.md +2 -1
  48. package/dist/templates/copilot/hooks/session-start.py +218 -0
  49. package/dist/templates/copilot/hooks.json +11 -0
  50. package/dist/templates/copilot/index.d.ts +23 -0
  51. package/dist/templates/copilot/index.d.ts.map +1 -0
  52. package/dist/templates/copilot/index.js +54 -0
  53. package/dist/templates/copilot/index.js.map +1 -0
  54. package/dist/templates/copilot/prompts/before-dev.prompt.md +33 -0
  55. package/dist/templates/copilot/prompts/brainstorm.prompt.md +491 -0
  56. package/dist/templates/copilot/prompts/break-loop.prompt.md +129 -0
  57. package/dist/templates/copilot/prompts/check-cross-layer.prompt.md +157 -0
  58. package/dist/templates/copilot/prompts/check.prompt.md +29 -0
  59. package/dist/templates/copilot/prompts/create-command.prompt.md +116 -0
  60. package/dist/templates/copilot/prompts/finish-work.prompt.md +157 -0
  61. package/dist/templates/copilot/prompts/integrate-skill.prompt.md +223 -0
  62. package/dist/templates/copilot/prompts/onboard.prompt.md +362 -0
  63. package/dist/templates/copilot/prompts/parallel.prompt.md +196 -0
  64. package/dist/templates/copilot/prompts/record-session.prompt.md +66 -0
  65. package/dist/templates/copilot/prompts/start.prompt.md +397 -0
  66. package/dist/templates/copilot/prompts/update-spec.prompt.md +358 -0
  67. package/dist/templates/cursor/commands/trellis-record-session.md +2 -1
  68. package/dist/templates/extract.d.ts +29 -0
  69. package/dist/templates/extract.d.ts.map +1 -1
  70. package/dist/templates/extract.js +51 -0
  71. package/dist/templates/extract.js.map +1 -1
  72. package/dist/templates/gemini/commands/trellis/record-session.toml +2 -1
  73. package/dist/templates/iflow/commands/trellis/record-session.md +2 -1
  74. package/dist/templates/iflow/hooks/inject-subagent-context.py +8 -1
  75. package/dist/templates/iflow/hooks/ralph-loop.py +8 -1
  76. package/dist/templates/iflow/hooks/session-start.py +31 -7
  77. package/dist/templates/kilo/workflows/record-session.md +2 -1
  78. package/dist/templates/kiro/skills/record-session/SKILL.md +2 -1
  79. package/dist/templates/markdown/agents.md +4 -0
  80. package/dist/templates/markdown/spec/backend/directory-structure.md +1 -1
  81. package/dist/templates/markdown/workspace-index.md +2 -0
  82. package/dist/templates/opencode/agents/dispatch.md +20 -19
  83. package/dist/templates/opencode/commands/trellis/record-session.md +2 -1
  84. package/dist/templates/opencode/lib/trellis-context.js +42 -2
  85. package/dist/templates/opencode/plugins/session-start.js +7 -27
  86. package/dist/templates/qoder/skills/record-session/SKILL.md +2 -1
  87. package/dist/templates/trellis/scripts/add_session.py +69 -16
  88. package/dist/templates/trellis/scripts/common/__init__.py +2 -0
  89. package/dist/templates/trellis/scripts/common/cli_adapter.py +108 -16
  90. package/dist/templates/trellis/scripts/common/developer.py +2 -2
  91. package/dist/templates/trellis/scripts/common/paths.py +57 -6
  92. package/dist/templates/trellis/scripts/common/task_store.py +6 -4
  93. package/dist/templates/trellis/scripts/common/task_utils.py +14 -8
  94. package/dist/templates/trellis/scripts/multi_agent/plan.py +7 -6
  95. package/dist/templates/trellis/scripts/multi_agent/start.py +16 -11
  96. package/dist/templates/trellis/scripts/task.py +1 -1
  97. package/dist/templates/windsurf/index.d.ts +21 -0
  98. package/dist/templates/windsurf/index.d.ts.map +1 -0
  99. package/dist/templates/windsurf/index.js +44 -0
  100. package/dist/templates/windsurf/index.js.map +1 -0
  101. package/dist/templates/windsurf/workflows/trellis-before-dev.md +31 -0
  102. package/dist/templates/windsurf/workflows/trellis-brainstorm.md +491 -0
  103. package/dist/templates/windsurf/workflows/trellis-break-loop.md +111 -0
  104. package/dist/templates/windsurf/workflows/trellis-check-cross-layer.md +157 -0
  105. package/dist/templates/windsurf/workflows/trellis-check.md +27 -0
  106. package/dist/templates/windsurf/workflows/trellis-create-command.md +154 -0
  107. package/dist/templates/windsurf/workflows/trellis-finish-work.md +147 -0
  108. package/dist/templates/windsurf/workflows/trellis-integrate-skill.md +220 -0
  109. package/dist/templates/windsurf/workflows/trellis-onboard.md +362 -0
  110. package/dist/templates/windsurf/workflows/trellis-record-session.md +66 -0
  111. package/dist/templates/windsurf/workflows/trellis-start.md +373 -0
  112. package/dist/templates/windsurf/workflows/trellis-update-spec.md +358 -0
  113. package/dist/types/ai-tools.d.ts +15 -3
  114. package/dist/types/ai-tools.d.ts.map +1 -1
  115. package/dist/types/ai-tools.js +34 -2
  116. package/dist/types/ai-tools.js.map +1 -1
  117. package/dist/utils/template-fetcher.d.ts +17 -4
  118. package/dist/utils/template-fetcher.d.ts.map +1 -1
  119. package/dist/utils/template-fetcher.js +94 -12
  120. package/dist/utils/template-fetcher.js.map +1 -1
  121. package/package.json +1 -1
@@ -0,0 +1,358 @@
1
+ ---
2
+ description: "Trellis Copilot prompt: Update Code-Spec - Capture Executable Contracts"
3
+ ---
4
+
5
+ # Update Code-Spec - Capture Executable Contracts
6
+
7
+ When you learn something valuable (from debugging, implementing, or discussion), use this command to update the relevant code-spec documents.
8
+
9
+ **Timing**: After completing a task, fixing a bug, or discovering a new pattern
10
+
11
+ ---
12
+
13
+ ## Code-Spec First Rule (CRITICAL)
14
+
15
+ In this project, "spec" for implementation work means **code-spec**:
16
+ - Executable contracts (not principle-only text)
17
+ - Concrete signatures, payload fields, env keys, and boundary behavior
18
+ - Testable validation/error behavior
19
+
20
+ If the change touches infra or cross-layer contracts, code-spec depth is mandatory.
21
+
22
+ ### Mandatory Triggers
23
+
24
+ Apply code-spec depth when the change includes any of:
25
+ - New/changed command or API signature
26
+ - Cross-layer request/response contract change
27
+ - Database schema/migration change
28
+ - Infra integration (storage, queue, cache, secrets, env wiring)
29
+
30
+ ### Mandatory Output (7 Sections)
31
+
32
+ For triggered tasks, include all sections below:
33
+ 1. Scope / Trigger
34
+ 2. Signatures (command/API/DB)
35
+ 3. Contracts (request/response/env)
36
+ 4. Validation & Error Matrix
37
+ 5. Good/Base/Bad Cases
38
+ 6. Tests Required (with assertion points)
39
+ 7. Wrong vs Correct (at least one pair)
40
+
41
+ ---
42
+
43
+ ## When to Update Code-Specs
44
+
45
+ | Trigger | Example | Target Spec |
46
+ |---------|---------|-------------|
47
+ | **Implemented a feature** | Added template download with giget | Relevant `backend/` or `frontend/` file |
48
+ | **Made a design decision** | Used type field + mapping table for extensibility | Relevant code-spec + "Design Decisions" section |
49
+ | **Fixed a bug** | Found a subtle issue with error handling | `backend/error-handling.md` |
50
+ | **Discovered a pattern** | Found a better way to structure code | Relevant `backend/` or `frontend/` file |
51
+ | **Hit a gotcha** | Learned that X must be done before Y | Relevant code-spec + "Common Mistakes" section |
52
+ | **Established a convention** | Team agreed on naming pattern | `quality-guidelines.md` |
53
+ | **New thinking trigger** | "Don't forget to check X before doing Y" | `guides/*.md` (as a checklist item, not detailed rules) |
54
+
55
+ **Key Insight**: Code-spec updates are NOT just for problems. Every feature implementation contains design decisions and contracts that future AI/developers need to execute safely.
56
+
57
+ ---
58
+
59
+ ## Spec Structure Overview
60
+
61
+ ```
62
+ .trellis/spec/
63
+ ├── backend/ # Backend coding standards
64
+ �? ├── index.md # Overview and links
65
+ �? └── *.md # Topic-specific guidelines
66
+ ├── frontend/ # Frontend coding standards
67
+ �? ├── index.md # Overview and links
68
+ �? └── *.md # Topic-specific guidelines
69
+ └── guides/ # Thinking checklists (NOT coding specs!)
70
+ ├── index.md # Guide index
71
+ └── *.md # Topic-specific guides
72
+ ```
73
+
74
+ ### CRITICAL: Code-Spec vs Guide - Know the Difference
75
+
76
+ | Type | Location | Purpose | Content Style |
77
+ |------|----------|---------|---------------|
78
+ | **Code-Spec** | `backend/*.md`, `frontend/*.md` | Tell AI "how to implement safely" | Signatures, contracts, matrices, cases, test points |
79
+ | **Guide** | `guides/*.md` | Help AI "what to think about" | Checklists, questions, pointers to specs |
80
+
81
+ **Decision Rule**: Ask yourself:
82
+
83
+ - "This is **how to write** the code" �?Put in `backend/` or `frontend/`
84
+ - "This is **what to consider** before writing" �?Put in `guides/`
85
+
86
+ **Example**:
87
+
88
+ | Learning | Wrong Location | Correct Location |
89
+ |----------|----------------|------------------|
90
+ | "Use `reconfigure()` not `TextIOWrapper` for Windows stdout" | �?`guides/cross-platform-thinking-guide.md` | �?`backend/script-conventions.md` |
91
+ | "Remember to check encoding when writing cross-platform code" | �?`backend/script-conventions.md` | �?`guides/cross-platform-thinking-guide.md` |
92
+
93
+ **Guides should be short checklists that point to specs**, not duplicate the detailed rules.
94
+
95
+ ---
96
+
97
+ ## Update Process
98
+
99
+ ### Step 1: Identify What You Learned
100
+
101
+ Answer these questions:
102
+
103
+ 1. **What did you learn?** (Be specific)
104
+ 2. **Why is it important?** (What problem does it prevent?)
105
+ 3. **Where does it belong?** (Which spec file?)
106
+
107
+ ### Step 2: Classify the Update Type
108
+
109
+ | Type | Description | Action |
110
+ |------|-------------|--------|
111
+ | **Design Decision** | Why we chose approach X over Y | Add to "Design Decisions" section |
112
+ | **Project Convention** | How we do X in this project | Add to relevant section with examples |
113
+ | **New Pattern** | A reusable approach discovered | Add to "Patterns" section |
114
+ | **Forbidden Pattern** | Something that causes problems | Add to "Anti-patterns" or "Don't" section |
115
+ | **Common Mistake** | Easy-to-make error | Add to "Common Mistakes" section |
116
+ | **Convention** | Agreed-upon standard | Add to relevant section |
117
+ | **Gotcha** | Non-obvious behavior | Add warning callout |
118
+
119
+ ### Step 3: Read the Target Code-Spec
120
+
121
+ Before editing, read the current code-spec to:
122
+ - Understand existing structure
123
+ - Avoid duplicating content
124
+ - Find the right section for your update
125
+
126
+ ```bash
127
+ cat .trellis/spec/<category>/<file>.md
128
+ ```
129
+
130
+ ### Step 4: Make the Update
131
+
132
+ Follow these principles:
133
+
134
+ 1. **Be Specific**: Include concrete examples, not just abstract rules
135
+ 2. **Explain Why**: State the problem this prevents
136
+ 3. **Show Contracts**: Add signatures, payload fields, and error behavior
137
+ 4. **Show Code**: Add code snippets for key patterns
138
+ 5. **Keep it Short**: One concept per section
139
+
140
+ ### Step 5: Update the Index (if needed)
141
+
142
+ If you added a new section or the code-spec status changed, update the category's `index.md`.
143
+
144
+ ---
145
+
146
+ ## Update Templates
147
+
148
+ ### Mandatory Template for Infra/Cross-Layer Work
149
+
150
+ ```markdown
151
+ ## Scenario: <name>
152
+
153
+ ### 1. Scope / Trigger
154
+ - Trigger: <why this requires code-spec depth>
155
+
156
+ ### 2. Signatures
157
+ - Backend command/API/DB signature(s)
158
+
159
+ ### 3. Contracts
160
+ - Request fields (name, type, constraints)
161
+ - Response fields (name, type, constraints)
162
+ - Environment keys (required/optional)
163
+
164
+ ### 4. Validation & Error Matrix
165
+ - <condition> -> <error>
166
+
167
+ ### 5. Good/Base/Bad Cases
168
+ - Good: ...
169
+ - Base: ...
170
+ - Bad: ...
171
+
172
+ ### 6. Tests Required
173
+ - Unit/Integration/E2E with assertion points
174
+
175
+ ### 7. Wrong vs Correct
176
+ #### Wrong
177
+ ...
178
+ #### Correct
179
+ ...
180
+ ```
181
+
182
+ ### Adding a Design Decision
183
+
184
+ ```markdown
185
+ ### Design Decision: [Decision Name]
186
+
187
+ **Context**: What problem were we solving?
188
+
189
+ **Options Considered**:
190
+ 1. Option A - brief description
191
+ 2. Option B - brief description
192
+
193
+ **Decision**: We chose Option X because...
194
+
195
+ **Example**:
196
+ \`\`\`typescript
197
+ // How it's implemented
198
+ code example
199
+ \`\`\`
200
+
201
+ **Extensibility**: How to extend this in the future...
202
+ ```
203
+
204
+ ### Adding a Project Convention
205
+
206
+ ```markdown
207
+ ### Convention: [Convention Name]
208
+
209
+ **What**: Brief description of the convention.
210
+
211
+ **Why**: Why we do it this way in this project.
212
+
213
+ **Example**:
214
+ \`\`\`typescript
215
+ // How to follow this convention
216
+ code example
217
+ \`\`\`
218
+
219
+ **Related**: Links to related conventions or specs.
220
+ ```
221
+
222
+ ### Adding a New Pattern
223
+
224
+ ```markdown
225
+ ### Pattern Name
226
+
227
+ **Problem**: What problem does this solve?
228
+
229
+ **Solution**: Brief description of the approach.
230
+
231
+ **Example**:
232
+ \`\`\`
233
+ // Good
234
+ code example
235
+
236
+ // Bad
237
+ code example
238
+ \`\`\`
239
+
240
+ **Why**: Explanation of why this works better.
241
+ ```
242
+
243
+ ### Adding a Forbidden Pattern
244
+
245
+ ```markdown
246
+ ### Don't: Pattern Name
247
+
248
+ **Problem**:
249
+ \`\`\`
250
+ // Don't do this
251
+ bad code example
252
+ \`\`\`
253
+
254
+ **Why it's bad**: Explanation of the issue.
255
+
256
+ **Instead**:
257
+ \`\`\`
258
+ // Do this instead
259
+ good code example
260
+ \`\`\`
261
+ ```
262
+
263
+ ### Adding a Common Mistake
264
+
265
+ ```markdown
266
+ ### Common Mistake: Description
267
+
268
+ **Symptom**: What goes wrong
269
+
270
+ **Cause**: Why this happens
271
+
272
+ **Fix**: How to correct it
273
+
274
+ **Prevention**: How to avoid it in the future
275
+ ```
276
+
277
+ ### Adding a Gotcha
278
+
279
+ ```markdown
280
+ > **Warning**: Brief description of the non-obvious behavior.
281
+ >
282
+ > Details about when this happens and how to handle it.
283
+ ```
284
+
285
+ ---
286
+
287
+ ## Interactive Mode
288
+
289
+ If you're unsure what to update, answer these prompts:
290
+
291
+ 1. **What did you just finish?**
292
+ - [ ] Fixed a bug
293
+ - [ ] Implemented a feature
294
+ - [ ] Refactored code
295
+ - [ ] Had a discussion about approach
296
+
297
+ 2. **What did you learn or decide?**
298
+ - Design decision (why X over Y)
299
+ - Project convention (how we do X)
300
+ - Non-obvious behavior (gotcha)
301
+ - Better approach (pattern)
302
+
303
+ 3. **Would future AI/developers need to know this?**
304
+ - To understand how the code works �?Yes, update spec
305
+ - To maintain or extend the feature �?Yes, update spec
306
+ - To avoid repeating mistakes �?Yes, update spec
307
+ - Purely one-off implementation detail �?Maybe skip
308
+
309
+ 4. **Which area does it relate to?**
310
+ - [ ] Backend code
311
+ - [ ] Frontend code
312
+ - [ ] Cross-layer data flow
313
+ - [ ] Code organization/reuse
314
+ - [ ] Quality/testing
315
+
316
+ ---
317
+
318
+ ## Quality Checklist
319
+
320
+ Before finishing your code-spec update:
321
+
322
+ - [ ] Is the content specific and actionable?
323
+ - [ ] Did you include a code example?
324
+ - [ ] Did you explain WHY, not just WHAT?
325
+ - [ ] Did you include executable signatures/contracts?
326
+ - [ ] Did you include validation and error matrix?
327
+ - [ ] Did you include Good/Base/Bad cases?
328
+ - [ ] Did you include required tests with assertion points?
329
+ - [ ] Is it in the right code-spec file?
330
+ - [ ] Does it duplicate existing content?
331
+ - [ ] Would a new team member understand it?
332
+
333
+ ---
334
+
335
+ ## Relationship to Other Commands
336
+
337
+ ```
338
+ Development Flow:
339
+ Learn something �?/ �?Knowledge captured
340
+ �? �?
341
+ / ←──────────────────── Future sessions benefit
342
+ (deep bug analysis)
343
+ ```
344
+
345
+ - `/` - Analyzes bugs deeply, often reveals spec updates needed
346
+ - `/` - Actually makes the updates (this command)
347
+ - `/` - Reminds you to check if specs need updates
348
+
349
+ ---
350
+
351
+ ## Core Philosophy
352
+
353
+ > **Code-specs are living documents. Every debugging session, every "aha moment" is an opportunity to make the implementation contract clearer.**
354
+
355
+ The goal is **institutional memory**:
356
+ - What one person learns, everyone benefits from
357
+ - What AI learns in one session, persists to future sessions
358
+ - Mistakes become documented guardrails
@@ -46,6 +46,7 @@ EOF
46
46
  **Auto-completes**:
47
47
  - [OK] Appends session to journal-N.md
48
48
  - [OK] Auto-detects line count, creates new file if >2000 lines
49
+ - [OK] Auto-detects Branch context (`--branch` override; otherwise Branch = task.json -> current git branch; missing values are omitted gracefully)
49
50
  - [OK] Updates index.md (Total Sessions +1, Last Active, line stats, history)
50
51
  - [OK] Auto-commits .trellis/workspace and .trellis/tasks changes
51
52
 
@@ -56,6 +57,6 @@ EOF
56
57
  | Command | Purpose |
57
58
  |---------|---------|
58
59
  | `python3 ./.trellis/scripts/get_context.py --mode record` | Get context for record-session |
59
- | `python3 ./.trellis/scripts/add_session.py --title "..." --commit "..."` | **One-click add session (recommended)** |
60
+ | `python3 ./.trellis/scripts/add_session.py --title "..." --commit "..."` | **One-click add session (recommended, branch auto-complete)** |
60
61
  | `python3 ./.trellis/scripts/task.py archive <name>` | Archive completed task (auto-commits) |
61
62
  | `python3 ./.trellis/scripts/task.py list` | List active tasks |
@@ -51,6 +51,17 @@ export declare function getIflowTemplatePath(): string;
51
51
  * @deprecated Use getIflowTemplatePath() instead.
52
52
  */
53
53
  export declare function getIflowSourcePath(): string;
54
+ /**
55
+ * Get the path to the Codex templates directory.
56
+ *
57
+ * This reads from src/templates/codex/ (development) or dist/templates/codex/ (production).
58
+ * These are GENERIC templates, not the Trellis project's own .agents/.codex configuration.
59
+ */
60
+ export declare function getCodexTemplatePath(): string;
61
+ /**
62
+ * @deprecated Use getCodexTemplatePath() instead.
63
+ */
64
+ export declare function getCodexSourcePath(): string;
54
65
  /**
55
66
  * Get the path to the kilo templates directory.
56
67
  *
@@ -80,6 +91,17 @@ export declare function getAntigravityTemplatePath(): string;
80
91
  * @deprecated Use getAntigravityTemplatePath() instead.
81
92
  */
82
93
  export declare function getAntigravitySourcePath(): string;
94
+ /**
95
+ * Get the path to the windsurf templates directory.
96
+ *
97
+ * This reads from src/templates/windsurf/ (development) or dist/templates/windsurf/ (production).
98
+ * These are GENERIC templates, not the Trellis project's own .windsurf/workflows configuration.
99
+ */
100
+ export declare function getWindsurfTemplatePath(): string;
101
+ /**
102
+ * @deprecated Use getWindsurfTemplatePath() instead.
103
+ */
104
+ export declare function getWindsurfSourcePath(): string;
83
105
  /**
84
106
  * Get the path to the qoder templates directory.
85
107
  *
@@ -94,6 +116,13 @@ export declare function getQoderTemplatePath(): string;
94
116
  * These are GENERIC templates, not the Trellis project's own .codebuddy/ configuration.
95
117
  */
96
118
  export declare function getCodebuddyTemplatePath(): string;
119
+ /**
120
+ * Get the path to the copilot templates directory.
121
+ *
122
+ * This reads from src/templates/copilot/ (development) or dist/templates/copilot/ (production).
123
+ * These are GENERIC templates, not the Trellis project's own .github/copilot/ configuration.
124
+ */
125
+ export declare function getCopilotTemplatePath(): string;
97
126
  /**
98
127
  * Read a file from the .trellis directory
99
128
  * @param relativePath - Path relative to .trellis/ (e.g., 'scripts/task.py')
@@ -1 +1 @@
1
- {"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../src/templates/extract.ts"],"names":[],"mappings":"AAQA,KAAK,gBAAgB,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAE5D;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAU/C;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAS9C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAS9C;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,CAShD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAS7C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAS5C;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAS5C;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,IAAI,MAAM,CASnD;AAED;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAEjD;AAED;;;;;GAKG;AACH,wBA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AIf"}
1
+ {"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../src/templates/extract.ts"],"names":[],"mappings":"AAQA,KAAK,gBAAgB,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAE5D;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAU/C;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAS9C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAS9C;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,CAShD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAS7C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAS7C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAS5C;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAS5C;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,IAAI,MAAM,CASnD;AAED;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAEjD;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,CAShD;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAS7C;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,IAAI,M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25 @@ export function getIflowTemplatePath() {
95
95
  export function getIflowSourcePath() {
96
96
  return getIflowTemplatePath();
97
97
  }
98
+ /**
99
+ * Get the path to the Codex templates directory.
100
+ *
101
+ * This reads from src/templates/codex/ (development) or dist/templates/codex/ (production).
102
+ * These are GENERIC templates, not the Trellis project's own .agents/.codex configuration.
103
+ */
104
+ export function getCodexTemplatePath() {
105
+ const templatePath = path.join(__dirname, "codex");
106
+ if (fs.existsSync(templatePath)) {
107
+ return templatePath;
108
+ }
109
+ throw new Error("Could not find codex templates directory. Expected at templates/codex/");
110
+ }
111
+ /**
112
+ * @deprecated Use getCodexTemplatePath() instead.
113
+ */
114
+ export function getCodexSourcePath() {
115
+ return getCodexTemplatePath();
116
+ }
98
117
  /**
99
118
  * Get the path to the kilo templates directory.
100
119
  *
@@ -146,6 +165,25 @@ export function getAntigravityTemplatePath() {
146
165
  export function getAntigravitySourcePath() {
147
166
  return getAntigravityTemplatePath();
148
167
  }
168
+ /**
169
+ * Get the path to the windsurf templates directory.
170
+ *
171
+ * This reads from src/templates/windsurf/ (development) or dist/templates/windsurf/ (production).
172
+ * These are GENERIC templates, not the Trellis project's own .windsurf/workflows configuration.
173
+ */
174
+ export function getWindsurfTemplatePath() {
175
+ const templatePath = path.join(__dirname, "windsurf");
176
+ if (fs.existsSync(templatePath)) {
177
+ return templatePath;
178
+ }
179
+ throw new Error("Could not find windsurf templates directory. Expected at templates/windsurf/");
180
+ }
181
+ /**
182
+ * @deprecated Use getWindsurfTemplatePath() instead.
183
+ */
184
+ export function getWindsurfSourcePath() {
185
+ return getWindsurfTemplatePath();
186
+ }
149
187
  /**
150
188
  * Get the path to the qoder templates directory.
151
189
  *
@@ -172,6 +210,19 @@ export function getCodebuddyTemplatePath() {
172
210
  }
173
211
  throw new Error("Could not find codebuddy templates directory. Expected at templates/codebuddy/");
174
212
  }
213
+ /**
214
+ * Get the path to the copilot templates directory.
215
+ *
216
+ * This reads from src/templates/copilot/ (development) or dist/templates/copilot/ (production).
217
+ * These are GENERIC templates, not the Trellis project's own .github/copilot/ configuration.
218
+ */
219
+ export function getCopilotTemplatePath() {
220
+ const templatePath = path.join(__dirname, "copilot");
221
+ if (fs.existsSync(templatePath)) {
222
+ return templatePath;
223
+ }
224
+ throw new Error("Could not find copilot templates directory. Expected at templates/copilot/");
225
+ }
175
226
  /**
176
227
  * Read a file from the .trellis directory
177
228
  * @param relativePath - Path relative to .trellis/ (e.g., 'scripts/task.py')
@@ -1 +1 @@
1
- {"version":3,"file":"extract.js","sourceRoot":"","sources":["../../src/templates/extract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAE/D,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAI3C;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB;IACpC,mDAAmD;IACnD,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACrD,IAAI,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAChC,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,MAAM,IAAI,KAAK,CACb,4EAA4E,CAC7E,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO,sBAAsB,EAAE,CAAC;AAClC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB;IACnC,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACpD,IAAI,EAAE,CAAC,UAAU,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KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;YAC1E,MAAM,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC,CAAC;QACnE,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -49,6 +49,7 @@ EOF
49
49
  **Auto-completes**:
50
50
  - [OK] Appends session to journal-N.md
51
51
  - [OK] Auto-detects line count, creates new file if >2000 lines
52
+ - [OK] Auto-detects Branch context (`--branch` override; otherwise Branch = task.json -> current git branch; missing values are omitted gracefully)
52
53
  - [OK] Updates index.md (Total Sessions +1, Last Active, line stats, history)
53
54
  - [OK] Auto-commits .trellis/workspace and .trellis/tasks changes
54
55
 
@@ -59,7 +60,7 @@ EOF
59
60
  | Command | Purpose |
60
61
  |---------|---------|
61
62
  | `python3 ./.trellis/scripts/get_context.py --mode record` | Get context for record-session |
62
- | `python3 ./.trellis/scripts/add_session.py --title "..." --commit "..."` | **One-click add session (recommended)** |
63
+ | `python3 ./.trellis/scripts/add_session.py --title "..." --commit "..."` | **One-click add session (recommended, branch auto-complete)** |
63
64
  | `python3 ./.trellis/scripts/task.py archive <name>` | Archive completed task (auto-commits) |
64
65
  | `python3 ./.trellis/scripts/task.py list` | List active tasks |
65
66
  """
@@ -46,6 +46,7 @@ EOF
46
46
  **Auto-completes**:
47
47
  - [OK] Appends session to journal-N.md
48
48
  - [OK] Auto-detects line count, creates new file if >2000 lines
49
+ - [OK] Auto-detects Branch context (`--branch` override; otherwise Branch = task.json -> current git branch; missing values are omitted gracefully)
49
50
  - [OK] Updates index.md (Total Sessions +1, Last Active, line stats, history)
50
51
  - [OK] Auto-commits .trellis/workspace and .trellis/tasks changes
51
52
 
@@ -56,6 +57,6 @@ EOF
56
57
  | Command | Purpose |
57
58
  |---------|---------|
58
59
  | `python3 ./.trellis/scripts/get_context.py --mode record` | Get context for record-session |
59
- | `python3 ./.trellis/scripts/add_session.py --title "..." --commit "..."` | **One-click add session (recommended)** |
60
+ | `python3 ./.trellis/scripts/add_session.py --title "..." --commit "..."` | **One-click add session (recommended, branch auto-complete)** |
60
61
  | `python3 ./.trellis/scripts/task.py archive <name>` | Archive completed task (auto-commits) |
61
62
  | `python3 ./.trellis/scripts/task.py list` | List active tasks |
@@ -99,7 +99,14 @@ def get_current_task(repo_root: str) -> str | None:
99
99
  try:
100
100
  with open(current_task_file, "r", encoding="utf-8") as f:
101
101
  content = f.read().strip()
102
- return content if content else None
102
+ if not content:
103
+ return None
104
+ normalized = content.replace("\\", "/")
105
+ while normalized.startswith("./"):
106
+ normalized = normalized[2:]
107
+ if normalized.startswith("tasks/"):
108
+ normalized = f".trellis/{normalized}"
109
+ return normalized
103
110
  except Exception:
104
111
  return None
105
112
 
@@ -72,7 +72,14 @@ def get_current_task(repo_root: str) -> str | None:
72
72
  try:
73
73
  with open(current_task_file, "r", encoding="utf-8") as f:
74
74
  content = f.read().strip()
75
- return content if content else None
75
+ if not content:
76
+ return None
77
+ normalized = content.replace("\\", "/")
78
+ while normalized.startswith("./"):
79
+ normalized = normalized[2:]
80
+ if normalized.startswith("tasks/"):
81
+ normalized = f".trellis/{normalized}"
82
+ return normalized
76
83
  except Exception:
77
84
  return None
78
85
 
@@ -66,23 +66,47 @@ def run_script(script_path: Path) -> str:
66
66
  return "No context available"
67
67
 
68
68
 
69
+ def _normalize_task_ref(task_ref: str) -> str:
70
+ normalized = task_ref.strip()
71
+ if not normalized:
72
+ return ""
73
+
74
+ path_obj = Path(normalized)
75
+ if path_obj.is_absolute():
76
+ return str(path_obj)
77
+
78
+ normalized = normalized.replace("\\", "/")
79
+ while normalized.startswith("./"):
80
+ normalized = normalized[2:]
81
+
82
+ if normalized.startswith("tasks/"):
83
+ return f".trellis/{normalized}"
84
+
85
+ return normalized
86
+
87
+
88
+ def _resolve_task_dir(trellis_dir: Path, task_ref: str) -> Path:
89
+ normalized = _normalize_task_ref(task_ref)
90
+ path_obj = Path(normalized)
91
+ if path_obj.is_absolute():
92
+ return path_obj
93
+ if normalized.startswith(".trellis/"):
94
+ return trellis_dir.parent / path_obj
95
+ return trellis_dir / "tasks" / path_obj
96
+
97
+
69
98
  def _get_task_status(trellis_dir: Path) -> str:
70
99
  """Check current task status and return structured status string."""
71
100
  current_task_file = trellis_dir / ".current-task"
72
101
  if not current_task_file.is_file():
73
102
  return "Status: NO ACTIVE TASK\nNext: Describe what you want to work on"
74
103
 
75
- task_ref = current_task_file.read_text(encoding="utf-8").strip()
104
+ task_ref = _normalize_task_ref(current_task_file.read_text(encoding="utf-8").strip())
76
105
  if not task_ref:
77
106
  return "Status: NO ACTIVE TASK\nNext: Describe what you want to work on"
78
107
 
79
108
  # Resolve task directory
80
- if Path(task_ref).is_absolute():
81
- task_dir = Path(task_ref)
82
- elif task_ref.startswith(".trellis/"):
83
- task_dir = trellis_dir.parent / task_ref
84
- else:
85
- task_dir = trellis_dir / "tasks" / task_ref
109
+ task_dir = _resolve_task_dir(trellis_dir, task_ref)
86
110
  if not task_dir.is_dir():
87
111
  return f"Status: STALE POINTER\nTask: {task_ref}\nNext: Task directory not found. Run: python3 ./.trellis/scripts/task.py finish"
88
112
 
@@ -46,6 +46,7 @@ EOF
46
46
  **Auto-completes**:
47
47
  - [OK] Appends session to journal-N.md
48
48
  - [OK] Auto-detects line count, creates new file if >2000 lines
49
+ - [OK] Auto-detects Branch context (`--branch` override; otherwise Branch = task.json -> current git branch; missing values are omitted gracefully)
49
50
  - [OK] Updates index.md (Total Sessions +1, Last Active, line stats, history)
50
51
  - [OK] Auto-commits .trellis/workspace and .trellis/tasks changes
51
52
 
@@ -56,6 +57,6 @@ EOF
56
57
  | Command | Purpose |
57
58
  |---------|---------|
58
59
  | `python3 ./.trellis/scripts/get_context.py --mode record` | Get context for record-session |
59
- | `python3 ./.trellis/scripts/add_session.py --title "..." --commit "..."` | **One-click add session (recommended)** |
60
+ | `python3 ./.trellis/scripts/add_session.py --title "..." --commit "..."` | **One-click add session (recommended, branch auto-complete)** |
60
61
  | `python3 ./.trellis/scripts/task.py archive <name>` | Archive completed task (auto-commits) |
61
62
  | `python3 ./.trellis/scripts/task.py list` | List active tasks |