@mindfoldhq/trellis 0.4.0-beta.8 → 0.4.0-rc.0
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 +10 -5
- package/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +165 -13
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +14 -2
- package/dist/commands/update.js.map +1 -1
- package/dist/configurators/codex.d.ts.map +1 -1
- package/dist/configurators/codex.js +2 -1
- package/dist/configurators/codex.js.map +1 -1
- package/dist/configurators/copilot.d.ts +9 -0
- package/dist/configurators/copilot.d.ts.map +1 -0
- package/dist/configurators/copilot.js +34 -0
- package/dist/configurators/copilot.js.map +1 -0
- package/dist/configurators/index.d.ts.map +1 -1
- package/dist/configurators/index.js +32 -1
- package/dist/configurators/index.js.map +1 -1
- package/dist/configurators/windsurf.d.ts +8 -0
- package/dist/configurators/windsurf.d.ts.map +1 -0
- package/dist/configurators/windsurf.js +18 -0
- package/dist/configurators/windsurf.js.map +1 -0
- package/dist/migrations/manifests/0.4.0-beta.10.json +9 -0
- package/dist/migrations/manifests/0.4.0-beta.9.json +9 -0
- package/dist/migrations/manifests/0.4.0-rc.0.json +9 -0
- package/dist/templates/claude/hooks/inject-subagent-context.py +8 -1
- package/dist/templates/claude/hooks/ralph-loop.py +18 -10
- package/dist/templates/claude/hooks/session-start.py +60 -19
- package/dist/templates/claude/hooks/statusline.py +218 -0
- package/dist/templates/claude/settings.json +4 -0
- package/dist/templates/codex/hooks/session-start.py +60 -21
- package/dist/templates/codex/hooks.json +1 -1
- package/dist/templates/copilot/hooks/session-start.py +243 -0
- package/dist/templates/copilot/hooks.json +11 -0
- package/dist/templates/copilot/index.d.ts +23 -0
- package/dist/templates/copilot/index.d.ts.map +1 -0
- package/dist/templates/copilot/index.js +54 -0
- package/dist/templates/copilot/index.js.map +1 -0
- package/dist/templates/copilot/prompts/before-dev.prompt.md +33 -0
- package/dist/templates/copilot/prompts/brainstorm.prompt.md +491 -0
- package/dist/templates/copilot/prompts/break-loop.prompt.md +129 -0
- package/dist/templates/copilot/prompts/check-cross-layer.prompt.md +157 -0
- package/dist/templates/copilot/prompts/check.prompt.md +29 -0
- package/dist/templates/copilot/prompts/create-command.prompt.md +116 -0
- package/dist/templates/copilot/prompts/finish-work.prompt.md +157 -0
- package/dist/templates/copilot/prompts/integrate-skill.prompt.md +223 -0
- package/dist/templates/copilot/prompts/onboard.prompt.md +362 -0
- package/dist/templates/copilot/prompts/parallel.prompt.md +196 -0
- package/dist/templates/copilot/prompts/record-session.prompt.md +66 -0
- package/dist/templates/copilot/prompts/start.prompt.md +397 -0
- package/dist/templates/copilot/prompts/update-spec.prompt.md +358 -0
- package/dist/templates/extract.d.ts +18 -0
- package/dist/templates/extract.d.ts.map +1 -1
- package/dist/templates/extract.js +32 -0
- package/dist/templates/extract.js.map +1 -1
- package/dist/templates/iflow/hooks/inject-subagent-context.py +8 -1
- package/dist/templates/iflow/hooks/ralph-loop.py +8 -1
- package/dist/templates/iflow/hooks/session-start.py +60 -19
- package/dist/templates/markdown/spec/backend/directory-structure.md +1 -1
- package/dist/templates/opencode/agents/dispatch.md +20 -19
- package/dist/templates/opencode/lib/trellis-context.js +35 -239
- package/dist/templates/opencode/plugins/inject-subagent-context.js +71 -121
- package/dist/templates/opencode/plugins/session-start.js +150 -146
- package/dist/templates/trellis/scripts/add_session.py +6 -1
- package/dist/templates/trellis/scripts/common/__init__.py +2 -0
- package/dist/templates/trellis/scripts/common/cli_adapter.py +87 -9
- package/dist/templates/trellis/scripts/common/paths.py +57 -6
- package/dist/templates/trellis/scripts/common/task_store.py +6 -4
- package/dist/templates/trellis/scripts/common/task_utils.py +14 -8
- package/dist/templates/trellis/scripts/multi_agent/start.py +9 -5
- package/dist/templates/trellis/scripts/task.py +1 -1
- package/dist/templates/trellis/workflow.md +17 -4
- package/dist/templates/windsurf/index.d.ts +21 -0
- package/dist/templates/windsurf/index.d.ts.map +1 -0
- package/dist/templates/windsurf/index.js +44 -0
- package/dist/templates/windsurf/index.js.map +1 -0
- package/dist/templates/windsurf/workflows/trellis-before-dev.md +31 -0
- package/dist/templates/windsurf/workflows/trellis-brainstorm.md +491 -0
- package/dist/templates/windsurf/workflows/trellis-break-loop.md +111 -0
- package/dist/templates/windsurf/workflows/trellis-check-cross-layer.md +157 -0
- package/dist/templates/windsurf/workflows/trellis-check.md +27 -0
- package/dist/templates/windsurf/workflows/trellis-create-command.md +154 -0
- package/dist/templates/windsurf/workflows/trellis-finish-work.md +147 -0
- package/dist/templates/windsurf/workflows/trellis-integrate-skill.md +220 -0
- package/dist/templates/windsurf/workflows/trellis-onboard.md +362 -0
- package/dist/templates/windsurf/workflows/trellis-record-session.md +66 -0
- package/dist/templates/windsurf/workflows/trellis-start.md +373 -0
- package/dist/templates/windsurf/workflows/trellis-update-spec.md +358 -0
- package/dist/types/ai-tools.d.ts +5 -3
- package/dist/types/ai-tools.d.ts.map +1 -1
- package/dist/types/ai-tools.js +21 -1
- package/dist/types/ai-tools.js.map +1 -1
- package/dist/utils/template-fetcher.d.ts +17 -4
- package/dist/utils/template-fetcher.d.ts.map +1 -1
- package/dist/utils/template-fetcher.js +94 -12
- package/dist/utils/template-fetcher.js.map +1 -1
- 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
|
|
@@ -91,6 +91,17 @@ export declare function getAntigravityTemplatePath(): string;
|
|
|
91
91
|
* @deprecated Use getAntigravityTemplatePath() instead.
|
|
92
92
|
*/
|
|
93
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;
|
|
94
105
|
/**
|
|
95
106
|
* Get the path to the qoder templates directory.
|
|
96
107
|
*
|
|
@@ -105,6 +116,13 @@ export declare function getQoderTemplatePath(): string;
|
|
|
105
116
|
* These are GENERIC templates, not the Trellis project's own .codebuddy/ configuration.
|
|
106
117
|
*/
|
|
107
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;
|
|
108
126
|
/**
|
|
109
127
|
* Read a file from the .trellis directory
|
|
110
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,CAE7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AW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAI3D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAI3D;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAI7D;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAIzD;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAS9C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAI3D;AAED;;;;;;GAMG;AACH,wBAAsB,cAAc,CAClC,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,GACjC,OAAO,CAAC,IAAI,CAAC,CAIf"}
|
|
@@ -165,6 +165,25 @@ export function getAntigravityTemplatePath() {
|
|
|
165
165
|
export function getAntigravitySourcePath() {
|
|
166
166
|
return getAntigravityTemplatePath();
|
|
167
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
|
+
}
|
|
168
187
|
/**
|
|
169
188
|
* Get the path to the qoder templates directory.
|
|
170
189
|
*
|
|
@@ -191,6 +210,19 @@ export function getCodebuddyTemplatePath() {
|
|
|
191
210
|
}
|
|
192
211
|
throw new Error("Could not find codebuddy templates directory. Expected at templates/codebuddy/");
|
|
193
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
|
+
}
|
|
194
226
|
/**
|
|
195
227
|
* Read a file from the .trellis directory
|
|
196
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,C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|
try:
|
|
100
100
|
with open(current_task_file, "r", encoding="utf-8") as f:
|
|
101
101
|
content = f.read().strip()
|
|
102
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
|
@@ -254,6 +278,32 @@ def _resolve_spec_scope(
|
|
|
254
278
|
return None
|
|
255
279
|
|
|
256
280
|
|
|
281
|
+
def _build_workflow_toc(workflow_path: Path) -> str:
|
|
282
|
+
"""Build a compact section index for workflow.md (lazy-load the full file on demand).
|
|
283
|
+
|
|
284
|
+
Replaces full-file injection to keep additionalContext payload small.
|
|
285
|
+
The full file is accessible via: Read tool on .trellis/workflow.md
|
|
286
|
+
"""
|
|
287
|
+
content = read_file(workflow_path)
|
|
288
|
+
if not content:
|
|
289
|
+
return "No workflow.md found"
|
|
290
|
+
|
|
291
|
+
toc_lines = [
|
|
292
|
+
"# Development Workflow — Section Index",
|
|
293
|
+
"Full guide: .trellis/workflow.md (read on demand)",
|
|
294
|
+
"",
|
|
295
|
+
]
|
|
296
|
+
for line in content.splitlines():
|
|
297
|
+
if line.startswith("## "):
|
|
298
|
+
toc_lines.append(line)
|
|
299
|
+
|
|
300
|
+
toc_lines += [
|
|
301
|
+
"",
|
|
302
|
+
"To read a section: use the Read tool on .trellis/workflow.md",
|
|
303
|
+
]
|
|
304
|
+
return "\n".join(toc_lines)
|
|
305
|
+
|
|
306
|
+
|
|
257
307
|
def main():
|
|
258
308
|
if should_skip_injection():
|
|
259
309
|
sys.exit(0)
|
|
@@ -261,7 +311,6 @@ def main():
|
|
|
261
311
|
# iFlow don't have an env for project, use `.` instead
|
|
262
312
|
project_dir = Path(".").resolve()
|
|
263
313
|
trellis_dir = project_dir / ".trellis"
|
|
264
|
-
iflow_dir = project_dir / ".iflow"
|
|
265
314
|
|
|
266
315
|
# Load config for scope filtering and legacy detection
|
|
267
316
|
is_mono, packages, scope_config, task_pkg, default_pkg = _load_trellis_config(trellis_dir)
|
|
@@ -287,8 +336,7 @@ Read and follow all instructions below carefully.
|
|
|
287
336
|
output.write("\n</current-state>\n\n")
|
|
288
337
|
|
|
289
338
|
output.write("<workflow>\n")
|
|
290
|
-
|
|
291
|
-
output.write(workflow_content)
|
|
339
|
+
output.write(_build_workflow_toc(trellis_dir / "workflow.md"))
|
|
292
340
|
output.write("\n</workflow>\n\n")
|
|
293
341
|
|
|
294
342
|
output.write("<guidelines>\n")
|
|
@@ -330,20 +378,13 @@ Read and follow all instructions below carefully.
|
|
|
330
378
|
|
|
331
379
|
output.write("</guidelines>\n\n")
|
|
332
380
|
|
|
333
|
-
output.write("<instructions>\n")
|
|
334
|
-
start_md = read_file(
|
|
335
|
-
iflow_dir / "commands" / "trellis" / "start.md", "No start.md found"
|
|
336
|
-
)
|
|
337
|
-
output.write(start_md)
|
|
338
|
-
output.write("\n</instructions>\n\n")
|
|
339
|
-
|
|
340
381
|
# R2: Check task status and inject structured tag
|
|
341
382
|
task_status = _get_task_status(trellis_dir)
|
|
342
383
|
output.write(f"<task-status>\n{task_status}\n</task-status>\n\n")
|
|
343
384
|
|
|
344
385
|
output.write("""<ready>
|
|
345
|
-
Context loaded.
|
|
346
|
-
|
|
386
|
+
Context loaded. Workflow index, project state, and guidelines are already injected above — do NOT re-read them.
|
|
387
|
+
Wait for the user's first message, then handle it following the workflow guide.
|
|
347
388
|
If there is an active task, ask whether to continue it.
|
|
348
389
|
</ready>""")
|
|
349
390
|
|
|
@@ -239,7 +239,7 @@ Templates use `.txt` extension to:
|
|
|
239
239
|
```typescript
|
|
240
240
|
import { downloadTemplate } from "giget";
|
|
241
241
|
|
|
242
|
-
await downloadTemplate("gh:mindfold-ai/
|
|
242
|
+
await downloadTemplate("gh:mindfold-ai/marketplace/specs/electron-fullstack", {
|
|
243
243
|
dir: destDir,
|
|
244
244
|
preferOffline: true,
|
|
245
245
|
});
|