@mindfoldhq/trellis 0.6.0-beta.7 → 0.6.0-beta.8

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 (58) hide show
  1. package/dist/configurators/codex.d.ts.map +1 -1
  2. package/dist/configurators/codex.js +5 -3
  3. package/dist/configurators/codex.js.map +1 -1
  4. package/dist/configurators/shared.js +4 -4
  5. package/dist/configurators/shared.js.map +1 -1
  6. package/dist/migrations/manifests/0.6.0-beta.8.json +9 -0
  7. package/dist/templates/claude/agents/trellis-check.md +2 -2
  8. package/dist/templates/claude/agents/trellis-implement.md +8 -7
  9. package/dist/templates/codebuddy/agents/trellis-check.md +2 -2
  10. package/dist/templates/codebuddy/agents/trellis-implement.md +8 -7
  11. package/dist/templates/codex/agents/trellis-check.toml +4 -4
  12. package/dist/templates/codex/agents/trellis-implement.toml +4 -4
  13. package/dist/templates/codex/hooks/session-start.py +183 -119
  14. package/dist/templates/codex/skills/before-dev/SKILL.md +12 -6
  15. package/dist/templates/codex/skills/brainstorm/SKILL.md +113 -51
  16. package/dist/templates/codex/skills/check/SKILL.md +86 -18
  17. package/dist/templates/codex/skills/start/SKILL.md +33 -323
  18. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-context-loading.md +7 -4
  19. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-spec-structure.md +1 -1
  20. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-workflow.md +3 -2
  21. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/context-injection.md +5 -5
  22. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/spec-system.md +1 -1
  23. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/task-system.md +8 -6
  24. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +5 -4
  25. package/dist/templates/common/commands/continue.md +6 -5
  26. package/dist/templates/common/commands/start.md +7 -6
  27. package/dist/templates/common/skills/before-dev.md +12 -6
  28. package/dist/templates/common/skills/brainstorm.md +56 -42
  29. package/dist/templates/common/skills/check.md +7 -1
  30. package/dist/templates/copilot/hooks/session-start.py +183 -90
  31. package/dist/templates/copilot/prompts/before-dev.prompt.md +12 -6
  32. package/dist/templates/copilot/prompts/brainstorm.prompt.md +146 -84
  33. package/dist/templates/copilot/prompts/check.prompt.md +86 -18
  34. package/dist/templates/copilot/prompts/parallel.prompt.md +16 -8
  35. package/dist/templates/copilot/prompts/start.prompt.md +33 -367
  36. package/dist/templates/cursor/agents/trellis-check.md +2 -2
  37. package/dist/templates/cursor/agents/trellis-implement.md +8 -7
  38. package/dist/templates/droid/droids/trellis-check.md +2 -2
  39. package/dist/templates/droid/droids/trellis-implement.md +8 -7
  40. package/dist/templates/gemini/agents/trellis-implement.md +7 -6
  41. package/dist/templates/kiro/agents/trellis-check.json +1 -1
  42. package/dist/templates/kiro/agents/trellis-implement.json +1 -1
  43. package/dist/templates/opencode/agents/trellis-check.md +2 -2
  44. package/dist/templates/opencode/agents/trellis-implement.md +9 -8
  45. package/dist/templates/opencode/lib/session-utils.js +212 -123
  46. package/dist/templates/opencode/plugins/inject-subagent-context.js +23 -7
  47. package/dist/templates/opencode/plugins/inject-workflow-state.js +1 -4
  48. package/dist/templates/pi/extensions/trellis/index.ts.txt +7 -5
  49. package/dist/templates/qoder/agents/trellis-implement.md +7 -6
  50. package/dist/templates/shared-hooks/inject-subagent-context.py +36 -14
  51. package/dist/templates/shared-hooks/inject-workflow-state.py +18 -42
  52. package/dist/templates/shared-hooks/session-start.py +197 -163
  53. package/dist/templates/trellis/scripts/common/task_context.py +3 -3
  54. package/dist/templates/trellis/scripts/common/task_store.py +39 -7
  55. package/dist/templates/trellis/scripts/common/workflow_phase.py +7 -10
  56. package/dist/templates/trellis/scripts/task.py +3 -3
  57. package/dist/templates/trellis/workflow.md +98 -98
  58. package/package.json +1 -1
@@ -39,7 +39,7 @@ python3 ./.trellis/scripts/get_context.py --mode packages # list packages / la
39
39
 
40
40
  ### Task System
41
41
 
42
- Every task has its own directory under `.trellis/tasks/{MM-DD-name}/` holding `prd.md`, `implement.jsonl`, `check.jsonl`, `task.json`, optional `research/`, `info.md`.
42
+ Every task has its own directory under `.trellis/tasks/{MM-DD-name}/` holding `task.json`, `prd.md`, optional `design.md`, optional `implement.md`, optional `research/`, and context manifests (`implement.jsonl`, `check.jsonl`) for sub-agent-capable platforms.
43
43
 
44
44
  ```bash
45
45
  # Task lifecycle
@@ -53,7 +53,7 @@ python3 ./.trellis/scripts/task.py list-archive
53
53
 
54
54
  # Code-spec context (injected into implement/check agents via JSONL).
55
55
  # `implement.jsonl` / `check.jsonl` are seeded on `task create` for sub-agent-capable
56
- # platforms; the AI curates real spec + research entries during Phase 1.3.
56
+ # platforms; the AI curates real spec + research entries during planning when needed.
57
57
  python3 ./.trellis/scripts/task.py add-context <name> <action> <file> <reason>
58
58
  python3 ./.trellis/scripts/task.py list-context <name> [action]
59
59
  python3 ./.trellis/scripts/task.py validate <name>
@@ -99,7 +99,7 @@ python3 ./.trellis/scripts/get_context.py --mode phase --step <X.Y> # detailed
99
99
  <!--
100
100
  WORKFLOW-STATE BREADCRUMB CONTRACT (read this before editing the tag blocks below)
101
101
 
102
- The 4 [workflow-state:STATUS] blocks embedded in the ## Phase Index section
102
+ The [workflow-state:STATUS] blocks embedded in the ## Phase Index section
103
103
  below are the SINGLE source of truth for the per-turn `<workflow-state>`
104
104
  breadcrumb that every supported AI platform's UserPromptSubmit hook
105
105
  reads. inject-workflow-state.py (Python platforms) and
@@ -114,15 +114,17 @@ python3 ./.trellis/scripts/get_context.py --mode phase --step <X.Y> # detailed
114
114
  Every workflow-walkthrough step marked `[required · once]` must have a
115
115
  matching enforcement line in its phase's [workflow-state:*] block. The
116
116
  breadcrumb is the only per-turn channel; if a mandatory step isn't
117
- mentioned there, the AI silently skips it (Phase 1.3 jsonl curation
117
+ mentioned there, the AI silently skips it (Phase 1 planning gate
118
118
  skip and Phase 3.4 commit skip both manifested via this gap).
119
119
 
120
120
  TAG ↔ PHASE scoping:
121
121
  [workflow-state:no_task] → no active task; before Phase 1
122
122
  [workflow-state:planning] → all of Phase 1 (status='planning')
123
+ [workflow-state:planning-inline] → Codex inline variant of Phase 1
123
124
  [workflow-state:in_progress] → Phase 2 + Phase 3.1-3.4
124
125
  (status stays 'in_progress' from
125
126
  task.py start until task.py archive)
127
+ [workflow-state:in_progress-inline] → Codex inline variant of Phase 2/3
126
128
  [workflow-state:completed] → currently DEAD: cmd_archive flips
127
129
  status and moves the dir in the same
128
130
  call, so the resolver loses the
@@ -142,45 +144,59 @@ python3 ./.trellis/scripts/get_context.py --mode phase --step <X.Y> # detailed
142
144
  ## Phase Index
143
145
 
144
146
  ```
145
- Phase 1: Plan → figure out what to do (brainstorm + research → prd.md)
146
- Phase 2: Execute → write code and pass quality checks
147
- Phase 3: Finish → distill lessons + wrap-up
147
+ Phase 1: Plan → classify, get task-creation consent, then write planning artifacts
148
+ Phase 2: Execute → implement only after task status is in_progress
149
+ Phase 3: Finish → verify, update spec, commit, and wrap up
148
150
  ```
149
151
 
152
+ ### Request Triage
153
+
154
+ - Simple conversation or small task: ask only whether this turn should create a Trellis task. If the user says no, skip Trellis for this session.
155
+ - Complex task: ask whether you may create a Trellis task and enter planning. If the user says no, do not do broad inline implementation; explain, clarify scope, or suggest a smaller split.
156
+ - User approval to create a task is not approval to start implementation. Planning still happens first.
157
+
158
+ ### Planning Artifacts
159
+
160
+ - `prd.md` — requirements, constraints, and acceptance criteria. Do not put technical design or execution checklists here.
161
+ - `design.md` — technical design for complex tasks: boundaries, contracts, data flow, tradeoffs, compatibility, rollout / rollback shape.
162
+ - `implement.md` — execution plan for complex tasks: ordered checklist, validation commands, review gates, and rollback points.
163
+ - `implement.jsonl` / `check.jsonl` — spec and research manifests for sub-agent context. They do not replace `implement.md`.
164
+ - Lightweight tasks may be PRD-only. Complex tasks must have `prd.md`, `design.md`, and `implement.md` before `task.py start`.
165
+
150
166
  <!-- Per-turn breadcrumb: shown when there is no active task (before Phase 1) -->
151
167
 
152
168
  [workflow-state:no_task]
153
- No active task. **A Direct answer** pure Q&A / explanation / lookup / chat; no file writes + one-line answer + repo reads 2 files → AI judges, no override needed.
154
- **B Create a task** — any implementation / code change / build / refactor work. Entry sequence: (1) `python3 ./.trellis/scripts/task.py create "<title>"` to create the task (status=planning, breadcrumb switches to [workflow-state:planning] for brainstorm + jsonl phase guidance) → (2) load `trellis-brainstorm` skill to discuss requirements with the user and iterate on prd.md → (3) once prd is done and jsonl is curated, run `task.py start <task-dir>` to enter [workflow-state:in_progress] for the implementation skeleton. **"It looks small" is NOT grounds for downgrading B to A or C**.
155
- **C Inline change** (per-turn only, escape hatch for B) — the user's CURRENT message MUST contain one of: "skip trellis" / "no task" / "just do it" / "don't create a task" / "跳过 trellis" / "别走流程" / "小修一下" / "直接改" / "先别建任务" → briefly acknowledge ("ok, skipping trellis flow this turn"), then inline. **Without seeing one of these phrases you must NOT inline on your own**; do not invent an override the user never said.
169
+ No active task. First classify the current turn and ask for task-creation consent before creating any Trellis task.
170
+ Simple conversation / small task: ask only whether this turn should create a Trellis task. If the user says no, skip Trellis for this session.
171
+ Complex task: ask the user if you can create a Trellis task and enter the planning phase. If the user says no, explain, clarify scope, or suggest a smaller split.
156
172
  [/workflow-state:no_task]
157
173
 
158
174
  ### Phase 1: Plan
159
- - 1.0 Create task `[required · once]` (just `task.py create`; status enters planning)
160
- - 1.1 Requirement exploration `[required · repeatable]`
175
+ - 1.0 Create task `[required · once]` (only after task-creation consent)
176
+ - 1.1 Requirement exploration `[required · repeatable]` (`prd.md`; complex tasks also need `design.md` + `implement.md`)
161
177
  - 1.2 Research `[optional · repeatable]`
162
- - 1.3 Configure context `[required · once]` — Claude Code, Cursor, OpenCode, Codex, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi
163
- - 1.4 Activate task `[required · once]` (run `task.py start`; status → in_progress)
178
+ - 1.3 Configure context `[conditional · once]` — Claude Code, Cursor, OpenCode, Codex, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi
179
+ - 1.4 Activate task `[required · once]` (review gate, then `task.py start`; status → in_progress)
164
180
  - 1.5 Completion criteria
165
181
 
166
182
  <!-- Per-turn breadcrumb: shown throughout Phase 1 (status='planning') -->
167
183
 
168
184
  [workflow-state:planning]
169
- Load the `trellis-brainstorm` skill and iterate on prd.md with the user.
170
- Phase 1.3 (required, once): before `task.py start`, you MUST curate `implement.jsonl` and `check.jsonl` list the spec / research files sub-agents need so they get the right context injected. You may skip only if the jsonl already has agent-curated entries (the seed `_example` row alone doesn't count).
171
- Then run `task.py start <task-dir>` to flip status to in_progress.
185
+ Load `trellis-brainstorm`; stay in planning.
186
+ Lightweight: `prd.md` can be enough. Complex: finish `prd.md`, `design.md`, and `implement.md`; ask for review before `task.py start`.
187
+ Sub-agent mode: curate `implement.jsonl` and `check.jsonl` as spec/research manifests before start.
172
188
  [/workflow-state:planning]
173
189
 
174
190
  <!-- Per-turn breadcrumb: shown throughout Phase 1 when codex.dispatch_mode=inline.
175
191
  Codex-only opt-in alternate to [workflow-state:planning]. The main agent
176
- edits code directly in Phase 2, so Phase 1.3 jsonl curation is skipped —
192
+ edits code directly in Phase 2, so jsonl curation is skipped —
177
193
  the inline workflow loads `trellis-before-dev` instead of injecting JSONL
178
194
  into a sub-agent. -->
179
195
 
180
196
  [workflow-state:planning-inline]
181
- Load the `trellis-brainstorm` skill and iterate on prd.md with the user.
182
- Phase 1.3 jsonl curation is **skipped** in inline dispatch mode — the main session loads `trellis-before-dev` directly in Phase 2 and reads spec context itself, so there is no sub-agent to inject jsonl into.
183
- Then run `task.py start <task-dir>` to flip status to in_progress.
197
+ Load `trellis-brainstorm`; stay in planning.
198
+ Lightweight: `prd.md` can be enough. Complex: finish `prd.md`, `design.md`, and `implement.md`; ask for review before `task.py start`.
199
+ Inline mode: skip jsonl curation; Phase 2 reads artifacts/specs via `trellis-before-dev`.
184
200
  [/workflow-state:planning-inline]
185
201
 
186
202
  ### Phase 2: Execute
@@ -194,12 +210,12 @@ Then run `task.py start <task-dir>` to flip status to in_progress.
194
210
  therefore must cover every required step from implementation through
195
211
  commit, including Phase 3.3 spec update and Phase 3.4 commit. -->
196
212
 
213
+ Sub-agent dispatch protocol applies to all platforms and all sub-agents, including class-2 Codex/Copilot/Gemini/Qoder and `trellis-research`: every dispatch prompt starts with `Active task: <task path from task.py current>` before role-specific instructions.
214
+
197
215
  [workflow-state:in_progress]
198
- **Flow**: trellis-implement trellis-check trellis-update-spec commit (Phase 3.4) `/trellis:finish-work`.
199
- **Main-session default (no override)**: dispatch the `trellis-implement` / `trellis-check` sub-agents — the main agent does NOT edit code by default. Phase 3.4 commit (required, once): after trellis-update-spec, or whenever implementation is verifiably complete, the main agent **drives the commit** — state the commit plan in user-facing text, then run `git commit` — BEFORE suggesting `/trellis:finish-work`. `/finish-work` refuses to run on a dirty working tree (paths outside `.trellis/workspace/` and `.trellis/tasks/`).
200
- **Sub-agent self-exemption**: if you are already running as `trellis-implement`, implement directly from the loaded task context and do NOT spawn another `trellis-implement`; if you are already running as `trellis-check`, review/fix directly and do NOT spawn another `trellis-check`. The default dispatch rule applies to the main session only.
201
- **Sub-agent dispatch protocol (all platforms, all sub-agents)**: When you spawn `trellis-implement` / `trellis-check` / `trellis-research`, your dispatch prompt **MUST** start with one line: `Active task: <task path from \`task.py current\`>`. No exceptions. On class-2 platforms (codex / copilot / gemini / qoder) the sub-agent depends on this line because there is no hook to inject task context. On class-1 platforms (claude / cursor / opencode / kiro / codebuddy / droid) the line is normally redundant — the hook injects context directly — but it serves as a critical fallback when the hook fails (Windows + Claude Code PreToolUse silent skip, `--continue` resume, fork distribution, hooks disabled, etc.). For `trellis-research`, the line tells the sub-agent which `{task_dir}/research/` to write into.
202
- **Inline override** (per-turn only, escape hatch for sub-agent dispatch): the user's CURRENT message MUST explicitly contain one of: "do it inline" / "no sub-agent" / "你直接改" / "别派 sub-agent" / "main session 写就行" / "不用 sub-agent". **Without seeing one of these phrases you must NOT inline on your own**; do not invent an override the user never said.
216
+ Flow: `trellis-implement` -> `trellis-check` -> `trellis-update-spec` -> commit (Phase 3.4) -> `/trellis:finish-work`.
217
+ Main-session default: dispatch implement/check sub-agents. Sub-agent self-exemption: if already running as `trellis-implement`, do NOT spawn another `trellis-implement` or `trellis-check`; if already running as `trellis-check`, do NOT spawn another `trellis-check` or `trellis-implement`. Dispatch is main session only.
218
+ Dispatch prompt starts with `Active task: <task path from task.py current>`. Read context: jsonl entries -> `prd.md` -> `design.md if present` -> `implement.md if present`.
203
219
  [/workflow-state:in_progress]
204
220
 
205
221
  <!-- Per-turn breadcrumb: shown while status='in_progress' when
@@ -208,9 +224,9 @@ Then run `task.py start <task-dir>` to flip status to in_progress.
208
224
  instead of dispatching sub-agents. -->
209
225
 
210
226
  [workflow-state:in_progress-inline]
211
- **Flow** (inline mode): main session loads `trellis-before-dev` main session edits code → main session loads `trellis-check` run lint / type-check / tests → fix → `trellis-update-spec` commit (Phase 3.4) `/trellis:finish-work`.
212
- **Main-session default (inline dispatch_mode)**: the main agent edits code directly. Do NOT dispatch `trellis-implement` / `trellis-check` sub-agents. Load the `trellis-before-dev` skill before writing code; load the `trellis-check` skill before reporting completion.
213
- Phase 3.4 commit (required, once): after `trellis-update-spec`, or whenever implementation is verifiably complete, the main agent **drives the commit** — state the commit plan in user-facing text, then run `git commit` — BEFORE suggesting `/trellis:finish-work`. `/finish-work` refuses to run on a dirty working tree (paths outside `.trellis/workspace/` and `.trellis/tasks/`).
227
+ Flow: `trellis-before-dev` -> edit -> `trellis-check` -> validation -> `trellis-update-spec` -> commit (Phase 3.4) -> `/trellis:finish-work`.
228
+ Do not dispatch implement/check sub-agents in inline mode.
229
+ Read context: `prd.md` -> `design.md if present` -> `implement.md if present`, plus relevant spec/research loaded by skills.
214
230
  [/workflow-state:in_progress-inline]
215
231
 
216
232
  ### Phase 3: Finish
@@ -229,9 +245,7 @@ Phase 3.4 commit (required, once): after `trellis-update-spec`, or whenever impl
229
245
  channel as the live blocks. -->
230
246
 
231
247
  [workflow-state:completed]
232
- Code committed via Phase 3.4; run `/trellis:finish-work` to wrap up (archive the task + record session).
233
- If you reach this state with uncommitted code, return to Phase 3.4 first — `/finish-work` refuses to run on a dirty working tree.
234
- `task.py archive` deletes any runtime session files that still point at the archived task.
248
+ Code committed. Run `/trellis:finish-work`; if dirty, return to Phase 3.4 first.
235
249
  [/workflow-state:completed]
236
250
 
237
251
  ### Rules
@@ -240,60 +254,33 @@ If you reach this state with uncommitted code, return to Phase 3.4 first — `/f
240
254
  2. Run steps in order inside each Phase; `[required]` steps can't be skipped
241
255
  3. Phases can roll back (e.g., Execute reveals a prd defect → return to Plan to fix, then re-enter Execute)
242
256
  4. Steps tagged `[once]` are skipped if the output already exists; don't re-run
257
+ 5. Artifact presence informs the next step; missing `design.md` / `implement.md` is valid for lightweight tasks and incomplete planning for complex tasks.
243
258
 
244
- ### Skill Routing
259
+ ### Active Task Routing
245
260
 
246
- When a user request matches one of these intents, load the corresponding skill (or dispatch the corresponding sub-agent) first do not skip skills.
261
+ When a user request matches one of these intents inside an active task, route first, then load the detailed phase step if needed.
247
262
 
248
263
  [Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
249
264
 
250
- | User intent | Route |
251
- |---|---|
252
- | Wants a new feature / requirement unclear | `trellis-brainstorm` |
253
- | About to write code / start implementing | Dispatch the `trellis-implement` sub-agent per Phase 2.1 |
254
- | Finished writing / want to verify | Dispatch the `trellis-check` sub-agent per Phase 2.2 |
255
- | Stuck / fixed same bug several times | `trellis-break-loop` |
256
- | Spec needs update | `trellis-update-spec` |
257
-
258
- **Why `trellis-before-dev` is NOT in this table:** you are not the one writing code — the `trellis-implement` sub-agent is. Sub-agent platforms get spec context via `implement.jsonl` injection / prelude, not via the main thread loading `trellis-before-dev`.
265
+ - Planning or unclear requirements -> `trellis-brainstorm`.
266
+ - `in_progress` implementation/check -> dispatch `trellis-implement` / `trellis-check`.
267
+ - Repeated debugging -> `trellis-break-loop`; spec updates -> `trellis-update-spec`.
259
268
 
260
269
  [/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
261
270
 
262
271
  [codex-inline, Kilo, Antigravity, Windsurf]
263
272
 
264
- | User intent | Skill |
265
- |---|---|
266
- | Wants a new feature / requirement unclear | `trellis-brainstorm` |
267
- | About to write code / start implementing | `trellis-before-dev` (then implement directly in the main session) |
268
- | Finished writing / want to verify | `trellis-check` |
269
- | Stuck / fixed same bug several times | `trellis-break-loop` |
270
- | Spec needs update | `trellis-update-spec` |
273
+ - Planning or unclear requirements -> `trellis-brainstorm`.
274
+ - Before editing -> `trellis-before-dev`; after editing -> `trellis-check`.
275
+ - Repeated debugging -> `trellis-break-loop`; spec updates -> `trellis-update-spec`.
271
276
 
272
277
  [/codex-inline, Kilo, Antigravity, Windsurf]
273
278
 
274
- ### DO NOT skip skills
279
+ ### Guardrails
275
280
 
276
- [Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
277
-
278
- | What you're thinking | Why it's wrong |
279
- |---|---|
280
- | "This is simple, I'll just code it in the main thread" | Dispatching `trellis-implement` is the cheap path; skipping it tempts you to write code in the main thread and lose spec context — sub-agents get `implement.jsonl` injected, you don't |
281
- | "I already thought it through in plan mode" | Plan-mode output lives in memory — sub-agents can't see it; must be persisted to prd.md |
282
- | "I already know the spec" | The spec may have been updated since you last read it; the sub-agent gets the fresh copy, you may not |
283
- | "Code first, check later" | `trellis-check` surfaces issues you won't notice yourself; earlier is cheaper |
284
-
285
- [/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
286
-
287
- [codex-inline, Kilo, Antigravity, Windsurf]
288
-
289
- | What you're thinking | Why it's wrong |
290
- |---|---|
291
- | "This is simple, just code it" | Simple tasks often grow complex; `trellis-before-dev` takes under a minute and loads the spec context you'll need |
292
- | "I already thought it through in plan mode" | Plan-mode output lives in memory — must be persisted to prd.md before code |
293
- | "I already know the spec" | The spec may have been updated since you last read it; read again |
294
- | "Code first, check later" | `trellis-check` surfaces issues you won't notice yourself; earlier is cheaper |
295
-
296
- [/codex-inline, Kilo, Antigravity, Windsurf]
281
+ - Task creation approval is not implementation approval; implementation waits for `task.py start` after artifact review.
282
+ - PRD-only is valid for lightweight tasks; complex tasks need `design.md` + `implement.md`.
283
+ - Planning must be persisted to task artifacts; checks must run before reporting completion.
297
284
 
298
285
  ### Loading Step Detail
299
286
 
@@ -308,11 +295,11 @@ python3 ./.trellis/scripts/get_context.py --mode phase --step <step>
308
295
 
309
296
  ## Phase 1: Plan
310
297
 
311
- Goal: figure out what to build, produce a clear requirements doc and the context needed to implement it.
298
+ Goal: classify the request, get task-creation consent when a task is needed, and produce the planning artifacts required before implementation.
312
299
 
313
300
  #### 1.0 Create task `[required · once]`
314
301
 
315
- Create the task directory (status enters `planning`, the session active-task pointer auto-targets the new task when session identity is available):
302
+ Create the task directory only after task-creation consent. The command sets status to `planning`, writes `task.json`, creates a default `prd.md`, and auto-targets the new task when session identity is available:
316
303
 
317
304
  ```bash
318
305
  python3 ./.trellis/scripts/task.py create "<task title>" --slug <name>
@@ -320,9 +307,9 @@ python3 ./.trellis/scripts/task.py create "<task title>" --slug <name>
320
307
 
321
308
  `--slug` is the human-readable name only. Do **not** include the `MM-DD-` date prefix; `task.py create` adds that prefix automatically.
322
309
 
323
- After this command succeeds, the per-turn breadcrumb auto-switches to `[workflow-state:planning]`, telling the AI to enter the brainstorm + jsonl curation phase.
310
+ After this command succeeds, the per-turn breadcrumb auto-switches to `[workflow-state:planning]`, telling the AI to stay in planning.
324
311
 
325
- ⚠️ **Run only `create` here — do not also run `start`**. `start` flips status to `in_progress`, which switches the breadcrumb to the implementation phase before brainstorm + jsonl are done — the AI will silently skip them. Save `start` for step 1.4, after jsonl curation is complete.
312
+ Run only `create` here — do not also run `start`. `start` flips status to `in_progress`, which switches the breadcrumb to the implementation phase before planning artifacts are reviewed. Save `start` for step 1.4.
326
313
 
327
314
  Skip when `python3 ./.trellis/scripts/task.py current --source` already points to a task.
328
315
 
@@ -335,8 +322,10 @@ The brainstorm skill will guide you to:
335
322
  - Prefer researching over asking the user
336
323
  - Prefer offering options over open-ended questions
337
324
  - Update `prd.md` immediately after each user answer
325
+ - Keep `prd.md` focused on requirements and acceptance criteria
326
+ - For complex tasks, produce `design.md` and `implement.md` before implementation starts
338
327
 
339
- Return to this step whenever requirements change and revise `prd.md`.
328
+ Return to this step whenever requirements change and revise the relevant artifact.
340
329
 
341
330
  #### 1.2 Research `[optional · repeatable]`
342
331
 
@@ -371,7 +360,7 @@ Brainstorm and research can interleave freely — pause to research a technical
371
360
 
372
361
  [Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
373
362
 
374
- Curate `implement.jsonl` and `check.jsonl` so the Phase 2 sub-agents get the right spec context. These files were seeded on `task create` with a single self-describing `_example` line; your job here is to fill in real entries.
363
+ Curate `implement.jsonl` and `check.jsonl` so the Phase 2 sub-agents get the right spec/research context. These files were seeded on `task create` with a single self-describing `_example` line; your job here is to fill in real entries.
375
364
 
376
365
  **Location**: `{TASK_DIR}/implement.jsonl` and `{TASK_DIR}/check.jsonl` (already exist).
377
366
 
@@ -389,6 +378,8 @@ Curate `implement.jsonl` and `check.jsonl` so the Phase 2 sub-agents get the rig
389
378
  - `implement.jsonl` → specs + research the implement sub-agent needs to write code correctly
390
379
  - `check.jsonl` → specs for the check sub-agent (quality guidelines, check conventions, same research if needed)
391
380
 
381
+ These manifests do not replace `implement.md`. `implement.md` is the human-readable execution plan for a complex task; jsonl files only list context files to inject or load.
382
+
392
383
  **How to discover relevant specs**:
393
384
 
394
385
  ```bash
@@ -408,7 +399,7 @@ python3 ./.trellis/scripts/task.py add-context "$TASK_DIR" check "<path>" "<reas
408
399
 
409
400
  Delete the seed `_example` line once real entries exist (optional — it's skipped automatically by consumers).
410
401
 
411
- Skip when: `implement.jsonl` has agent-curated entries (the seed row alone doesn't count).
402
+ Skip when: `implement.jsonl` and `check.jsonl` have agent-curated entries (the seed row alone doesn't count).
412
403
 
413
404
  [/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
414
405
 
@@ -420,12 +411,14 @@ Skip this step. Context is loaded directly by the `trellis-before-dev` skill in
420
411
 
421
412
  #### 1.4 Activate task `[required · once]`
422
413
 
423
- Once prd.md is complete and 1.3 jsonl curation is done, flip the task status to `in_progress`:
414
+ After artifact review, flip the task status to `in_progress`:
424
415
 
425
416
  ```bash
426
417
  python3 ./.trellis/scripts/task.py start <task-dir>
427
418
  ```
428
419
 
420
+ For lightweight tasks, `prd.md` can be enough. For complex tasks, `prd.md`, `design.md`, and `implement.md` must exist and be reviewed before start. On sub-agent-capable platforms, curate jsonl manifests when extra spec or research context is needed; seed-only manifests are tolerated by consumers.
421
+
429
422
  After this command succeeds, the breadcrumb auto-switches to `[workflow-state:in_progress]`, and the rest of Phase 2 / 3 follows.
430
423
 
431
424
  If `task.py start` errors with a session-identity message (no context key from hook input, `TRELLIS_CONTEXT_ID`, or platform-native session env), follow the hint in the error to set up session identity, then retry.
@@ -435,14 +428,15 @@ If `task.py start` errors with a session-identity message (no context key from h
435
428
  | Condition | Required |
436
429
  |------|:---:|
437
430
  | `prd.md` exists | ✅ |
438
- | User confirms requirements | ✅ |
431
+ | User confirms task should enter implementation | ✅ |
439
432
  | `task.py start` has been run (status = in_progress) | ✅ |
440
433
  | `research/` has artifacts (complex tasks) | recommended |
441
- | `info.md` technical design (complex tasks) | optional |
434
+ | `design.md` exists (complex tasks) | |
435
+ | `implement.md` exists (complex tasks) | ✅ |
442
436
 
443
437
  [Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
444
438
 
445
- | `implement.jsonl` has agent-curated entries (not just the seed row) | |
439
+ | `implement.jsonl` / `check.jsonl` curated when extra spec or research context is needed | recommended |
446
440
 
447
441
  [/Claude Code, Cursor, OpenCode, codex-sub-agent, Kiro, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
448
442
 
@@ -450,7 +444,7 @@ If `task.py start` errors with a session-identity message (no context key from h
450
444
 
451
445
  ## Phase 2: Execute
452
446
 
453
- Goal: turn the prd into code that passes quality checks.
447
+ Goal: turn reviewed planning artifacts into code that passes quality checks.
454
448
 
455
449
  #### 2.1 Implement `[required · repeatable]`
456
450
 
@@ -459,12 +453,12 @@ Goal: turn the prd into code that passes quality checks.
459
453
  Spawn the implement sub-agent:
460
454
 
461
455
  - **Agent type**: `trellis-implement`
462
- - **Task description**: Implement the requirements per prd.md, consulting materials under `{TASK_DIR}/research/`; finish by running project lint and type-check
456
+ - **Task description**: Implement the reviewed task artifacts, consulting materials under `{TASK_DIR}/research/`; finish by running project lint and type-check
463
457
  - **Dispatch prompt guard**: Tell the spawned agent it is already the `trellis-implement` sub-agent and must implement directly, not spawn another `trellis-implement` / `trellis-check`.
464
458
 
465
459
  The platform hook/plugin auto-handles:
466
- - Reads `implement.jsonl` and injects the referenced spec files into the agent prompt
467
- - Injects prd.md content
460
+ - Reads `implement.jsonl` and injects referenced spec/research files into the agent prompt
461
+ - Injects `prd.md`, `design.md` if present, and `implement.md` if present
468
462
 
469
463
  [/Claude Code, Cursor, OpenCode, Gemini, Qoder, CodeBuddy, Copilot, Droid, Pi]
470
464
 
@@ -473,12 +467,12 @@ The platform hook/plugin auto-handles:
473
467
  Spawn the implement sub-agent:
474
468
 
475
469
  - **Agent type**: `trellis-implement`
476
- - **Task description**: Implement the requirements per prd.md, consulting materials under `{TASK_DIR}/research/`; finish by running project lint and type-check
470
+ - **Task description**: Implement the reviewed task artifacts, consulting materials under `{TASK_DIR}/research/`; finish by running project lint and type-check
477
471
  - **Dispatch prompt guard**: The prompt MUST start with `Active task: <task path>`, then explicitly say the spawned agent is already `trellis-implement` and must implement directly without spawning another `trellis-implement` / `trellis-check`.
478
472
 
479
473
  The Codex sub-agent definition auto-handles the context load requirement:
480
- - Resolves the active task with `task.py current --source`, then reads `prd.md` and `info.md` if present
481
- - Reads `implement.jsonl` and requires the agent to load each referenced spec file before coding
474
+ - Resolves the active task with `task.py current --source`, then reads `prd.md`, `design.md` if present, and `implement.md` if present
475
+ - Reads `implement.jsonl` and requires the agent to load each referenced spec/research file before coding
482
476
 
483
477
  [/codex-sub-agent]
484
478
 
@@ -487,21 +481,21 @@ The Codex sub-agent definition auto-handles the context load requirement:
487
481
  Spawn the implement sub-agent:
488
482
 
489
483
  - **Agent type**: `trellis-implement`
490
- - **Task description**: Implement the requirements per prd.md, consulting materials under `{TASK_DIR}/research/`; finish by running project lint and type-check
484
+ - **Task description**: Implement the reviewed task artifacts, consulting materials under `{TASK_DIR}/research/`; finish by running project lint and type-check
491
485
  - **Dispatch prompt guard**: Tell the spawned agent it is already the `trellis-implement` sub-agent and must implement directly, not spawn another `trellis-implement` / `trellis-check`.
492
486
 
493
487
  The platform prelude auto-handles the context load requirement:
494
- - Reads `implement.jsonl` and injects the referenced spec files into the agent prompt
495
- - Injects prd.md content
488
+ - Reads `implement.jsonl` and injects referenced spec/research files into the agent prompt
489
+ - Injects `prd.md`, `design.md` if present, and `implement.md` if present
496
490
 
497
491
  [/Kiro]
498
492
 
499
493
  [codex-inline, Kilo, Antigravity, Windsurf]
500
494
 
501
495
  1. Load the `trellis-before-dev` skill to read project guidelines
502
- 2. Read `{TASK_DIR}/prd.md` for requirements
496
+ 2. Read `{TASK_DIR}/prd.md`, then `design.md` if present, then `implement.md` if present
503
497
  3. Consult materials under `{TASK_DIR}/research/`
504
- 4. Implement the code per requirements
498
+ 4. Implement the code per reviewed artifacts
505
499
  5. Run project lint and type-check
506
500
 
507
501
  [/codex-inline, Kilo, Antigravity, Windsurf]
@@ -513,11 +507,12 @@ The platform prelude auto-handles the context load requirement:
513
507
  Spawn the check sub-agent:
514
508
 
515
509
  - **Agent type**: `trellis-check`
516
- - **Task description**: Review all code changes against spec and prd; fix any findings directly; ensure lint and type-check pass
510
+ - **Task description**: Review all code changes against specs and task artifacts; fix any findings directly; ensure lint and type-check pass
517
511
  - **Dispatch prompt guard**: Tell the spawned agent it is already the `trellis-check` sub-agent and must review/fix directly, not spawn another `trellis-check` / `trellis-implement`.
518
512
 
519
513
  The check agent's job:
520
514
  - Review code changes against specs
515
+ - Review code changes against `prd.md`, `design.md` if present, and `implement.md` if present
521
516
  - Auto-fix issues it finds
522
517
  - Run lint and typecheck to verify
523
518
 
@@ -635,15 +630,20 @@ This section is for developers who want to modify the Trellis workflow itself. A
635
630
 
636
631
  ### Changing what a step means
637
632
 
638
- Edit the corresponding step's walkthrough body in the Phase 1 / 2 / 3 sections above. **Critical constraint**: if you change a step's `[required · once]` marker or add a new `[required · once]` step, you MUST also add a matching enforcement line to that phase's `[workflow-state:STATUS]` tag block — otherwise the per-turn breadcrumb omits the reinforcement, and the AI silently skips the step. The regression tests assert this.
633
+ Edit the corresponding step's walkthrough body in the Phase 1 / 2 / 3 sections above. Critical invariants:
634
+ - No active task must triage first and ask for task-creation consent before creating a Trellis task.
635
+ - Planning must distinguish lightweight PRD-only tasks from complex tasks that require `prd.md`, `design.md`, and `implement.md` before start.
636
+ - Every required execution path must keep the Phase 3.4 commit reminder reachable before `/trellis:finish-work`.
639
637
 
640
- All 4 tag blocks live in the `## Phase Index` section above, immediately after each phase summary:
638
+ All tag blocks live in the `## Phase Index` section above, immediately after each phase summary:
641
639
 
642
640
  | Scope | Corresponding tag |
643
641
  |---|---|
644
642
  | No active task (before Phase 1) | `[workflow-state:no_task]` (after the Phase Index ASCII art) |
645
643
  | All of Phase 1 (task created → ready for implementation) | `[workflow-state:planning]` (after Phase 1 summary) |
644
+ | Codex inline Phase 1 | `[workflow-state:planning-inline]` |
646
645
  | Phase 2 + Phase 3.1–3.4 (implementation + check + wrap-up) | `[workflow-state:in_progress]` (after Phase 2 summary) |
646
+ | Codex inline Phase 2 + Phase 3.1–3.4 | `[workflow-state:in_progress-inline]` |
647
647
  | After Phase 3.5 (archived) | `[workflow-state:completed]` (after Phase 3 summary; **currently DEAD**) |
648
648
 
649
649
  ### Changing the per-turn prompt text
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindfoldhq/trellis",
3
- "version": "0.6.0-beta.7",
3
+ "version": "0.6.0-beta.8",
4
4
  "description": "AI capabilities grow like ivy — Trellis provides the structure to guide them along a disciplined path",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",