trekoon 0.4.2 → 0.4.3

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.
@@ -1,466 +1,256 @@
1
1
  # Execution Reference
2
2
 
3
- **You are an orchestrator.** Execute work from Trekoon, not markdown plan files.
4
- Spawn and coordinate sub-agents based on the task dependency graph and subsystem
5
- grouping so independent lanes run in parallel and dependent lanes run
6
- sequentially.
3
+ You are an orchestrator. Execute work from Trekoon, not markdown plan files.
4
+ Execution is complete only when the epic is marked `done`, all remaining work is
5
+ blocked with recorded reasons, or real user input is required.
7
6
 
8
- **Execute mode contract:** execution is complete only when the epic is marked
9
- `done`, all remaining work is blocked with recorded reasons, or user input is
10
- required to continue.
7
+ When executing an epic, use subagents by default for any meaningful work that
8
+ can run independently. Keep small or tightly coupled tasks in the parent agent.
9
+ Use your context for orchestration, dependency decisions, user communication,
10
+ and final synthesis.
11
11
 
12
- **Clarify ambiguity upfront.** If the plan has unclear requirements or meaningful
13
- tradeoffs, ask the user before starting.
12
+ If the plan has unclear requirements or meaningful tradeoffs, ask before
13
+ starting. Do not stop at status reporting when ready work exists.
14
14
 
15
- ## Choose execution shape first
15
+ ## Choose Shape
16
16
 
17
- Use the lightest shape that still preserves momentum:
17
+ - Direct work: one ready task, tiny change, narrow scope, or tightly coupled
18
+ work. Use the direct work loop below.
19
+ - Orchestrated work: multiple ready tasks across separable lanes. Build the
20
+ graph, group by lane, delegate meaningful independent lanes, and coordinate
21
+ completion from the parent session.
18
22
 
19
- - **Single-agent execution**: one ready task, narrow scope, or strongly coupled
20
- work. Use the `session claim work task done → repeat` loop from
21
- `SKILL.md`.
22
- - **Orchestrated execution**: multiple ready tasks across separable lanes. This
23
- file focuses on that path.
23
+ If a higher-priority harness policy blocks subagent use without explicit user
24
+ wording, tell the user immediately after the lane graph is known:
24
25
 
25
- Do not stop at status reporting when ready work exists.
26
-
27
- ## Build the execution graph
28
-
29
- Construct a runnable graph from Trekoon entities using the deterministic
30
- scheduler loop:
31
-
32
- 1. **Get the ready set for batching decisions:**
33
- ```bash
34
- trekoon --toon task ready --epic <epic-id> --limit 50
35
- ```
36
- 2. **Use reverse lookup when deciding what completed work unblocks:**
37
- ```bash
38
- trekoon --toon dep reverse <task-or-subtask-id>
39
- ```
40
- 3. **Load full context only when execution details are needed:**
41
- ```bash
42
- trekoon --toon epic show <epic-id> --all
43
- ```
44
-
45
- Prefer scheduler primitives (`task next`, `task ready`, `dep reverse`) over
46
- broad scans (`task list --all`, `epic show --all`).
26
+ ```text
27
+ I found <n> independent Trekoon lanes. This harness requires explicit
28
+ permission before I can spawn subagents. Should I delegate those lanes and keep
29
+ coordinating from the parent session?
30
+ ```
47
31
 
48
- ## Group tasks into lanes
32
+ ## Build The Graph
49
33
 
50
- Batch ready tasks by subsystem/domain to minimize repeated context loading:
34
+ Use scheduler reads before broad tree reads:
51
35
 
36
+ ```bash
37
+ trekoon --toon task ready --epic <epic-id> --limit 50
38
+ trekoon --toon dep reverse <task-or-subtask-id>
39
+ trekoon --toon epic show <epic-id> --all
52
40
  ```
53
- Without: Task 1 (auth/login) -> Agent 1 [explores auth/]
54
- Task 2 (auth/logout) -> Agent 2 [explores auth/ again]
55
-
56
- With: Tasks 1-2 (auth/*) -> Agent 1 [explores once, executes both]
57
- ```
58
-
59
- | Signal | Group together |
60
- |--------|----------------|
61
- | Same directory prefix | `src/auth/*` tasks |
62
- | Same domain/feature | Auth tasks, billing tasks |
63
- | Same `--owner` value | Tasks assigned to same lane |
64
- | Same Trekoon intent | Similar task title/description scope |
65
41
 
66
- **Limits:** 3-4 tasks max per group. Split if larger.
42
+ Group ready tasks by lane:
67
43
 
68
- **Parallel:** Groups touch different subsystems.
69
- **Sequential:** Groups have dependency edges between them.
44
+ - Same directory prefix.
45
+ - Same subsystem/domain.
46
+ - Same owner.
47
+ - Same implementation context.
70
48
 
71
- ## Mark epic in-progress
49
+ Keep each lane to about 3-4 tasks. Split larger lanes. Parallel lanes touch
50
+ different subsystems and have no dependency edge. Sequential lanes have hard
51
+ dependencies.
72
52
 
73
- Before dispatching any work, transition the epic so it reflects actual state:
53
+ Mark the epic in progress once, before dispatching:
74
54
 
75
55
  ```bash
76
56
  trekoon --toon epic update <epic-id> --status in_progress
77
57
  ```
78
58
 
79
- This must happen once, immediately after building the execution graph. If
80
- execution is interrupted, the epic is at least `in_progress` rather than `todo`.
59
+ ## Delegate Lanes
81
60
 
82
- ## Dispatch sub-agents
61
+ For each meaningful independent lane, spawn a subagent when the harness exposes
62
+ subagents. Keep local todo/task tools as a live progress display only; Trekoon
63
+ remains the durable source of truth.
83
64
 
84
- For each parallel lane group, spawn a sub-agent with a prompt like:
65
+ Prompt shape:
85
66
 
86
- ```
87
- Execute these Trekoon tasks IN ORDER unless task description says parallel
88
- subtasks:
67
+ ```text
68
+ Spawn or act as a write-capable subagent for this Trekoon execution lane.
69
+
70
+ Epic: <epic-id>
71
+ Lane owner: <lane-name>
72
+ Execute these Trekoon tasks IN ORDER unless task descriptions say parallel
73
+ subtasks are safe:
89
74
  - Task <id>: <title>
90
75
  - Task <id>: <title>
91
76
 
92
- Before starting each task:
93
- - claim and assign owner:
94
- trekoon --toon task claim <id> --owner <lane-name>
95
- - append a short start note:
96
- trekoon --toon task update <id> --append "Starting implementation"
77
+ Scope:
78
+ - Target files: <paths from task descriptions>
79
+ - Read first: <paths/patterns to inspect before editing>
80
+ - Do not touch: <paths owned by other lanes>
97
81
 
98
- While executing:
99
- - complete required subtasks, update subtask statuses
100
- - append meaningful progress notes (do not rewrite the task description)
101
- - respect the status machine: todo -> in_progress -> done (never skip)
82
+ Before each task:
83
+ - trekoon --toon task claim <id> --owner <lane-name>
84
+ - trekoon --toon task update <id> --append "Starting implementation"
85
+
86
+ While working:
87
+ - Complete required subtasks and update subtask statuses.
88
+ - Append meaningful progress notes; do not rewrite task descriptions.
89
+ - Respect status flow: todo -> in_progress -> done. Use task done for completion.
90
+ - Assume other agents may edit unrelated files. Do not revert unrelated changes.
102
91
 
103
92
  On completion:
104
- - append final verification evidence
105
- - mark done: trekoon --toon task done <id>
106
- (task done auto-transitions from todo/blocked through in_progress)
107
- - read the response: it includes unblocked downstream tasks and open
108
- subtask warnings — report these back
93
+ - Append verification evidence.
94
+ - trekoon --toon task done <id>
95
+ - Read and report unblocked tasks, open subtask warnings, and next candidate.
96
+ - For non-trivial code changes, report review result or review gap.
109
97
 
110
98
  If blocked:
111
- - append blocker reason, dependency id, and exact failing command/output
112
- - set status: trekoon --toon task update <id> --status blocked
99
+ - Append blocker reason, dependency id, and exact failing command/output.
100
+ - trekoon --toon task update <id> --append "Blocked by <reason>" --status blocked
113
101
 
114
- Use --compact to reduce output noise:
115
- trekoon --toon --compact task show <id>
102
+ Use --compact in noisy Trekoon reads. Do not create branches, commits, pushes,
103
+ or PRs unless the user explicitly asked and harness policy allows it.
116
104
 
117
- Only create branches, commits, or PRs if the user explicitly requested them and
118
- the current harness policy allows it. Always report files changed, verification
119
- results, and blockers.
105
+ Final report: tasks completed, files changed, checks, review result/gap,
106
+ task done response, blockers.
120
107
  ```
121
108
 
122
- ## Use task done response for orchestration
123
-
124
- When a sub-agent calls `task done`, the response includes:
125
-
126
- - **`unblocked`**: array of downstream tasks that became ready. Use this to
127
- decide what to launch next without re-querying the full readiness graph.
128
- - **`openSubtaskIds`/`warning`**: if subtasks remain open, decide whether to
129
- go back or proceed.
130
- - **`next`**: the next ready candidate with full tree and blockers.
131
-
132
- **Orchestration flow after each task done:**
133
-
134
- 1. Read `unblocked` from the response.
135
- 2. If unblocked tasks exist, group them by subsystem and dispatch new agents.
136
- 3. If no unblocked tasks, check `next` for the top candidate.
137
- 4. If neither exists, run `suggest --epic <id>` for guidance.
138
-
139
- ## Auto-recovery
140
-
141
- 1. Agent attempts to fix failures (has context).
142
- 2. If can't fix, report failure with error output.
143
- 3. Dispatch fix agent with context.
144
-
145
- **`status_transition_invalid`** — exact recovery sequence:
146
- 1. Run `trekoon --toon --compact task show <id>` to read the current status.
147
- 2. Append a blocker note: `trekoon --toon task update <id> --append "Blocked: status_transition_invalid from <attempted transition>; current status is <actual>"`.
148
- 3. Identify the valid intermediate transition (see `reference/status-machine.md`).
149
- 4. Apply the correct intermediate step, then retry the intended transition.
150
- 5. Only move on to the next task after the target task reaches the intended status or is explicitly marked `blocked`.
151
-
152
- **`dependency_blocked`** — exact recovery sequence:
153
- 1. Run `trekoon --toon --compact task show <id>` to identify which dependency is unmet.
154
- 2. Append a blocker note: `trekoon --toon task update <id> --append "Blocked: dependency_blocked; depends on <dep-id>"`.
155
- 3. Run `trekoon --toon task ready --epic <epic-id>` to get a ready candidate.
156
- 4. Only then continue with the ready candidate — do not retry the blocked task.
157
-
158
- ## Verify before closing
159
-
160
- All checks must pass before marking the epic complete:
161
-
162
- ### Code review
109
+ ## Use `task done` Responses
163
110
 
164
- Run your code-review command/flow. Fix issues before proceeding. Poor DX/UX is
165
- a bug.
111
+ `task done` returns:
166
112
 
167
- ### Automated tests
113
+ - `unblocked`: downstream tasks that became ready.
114
+ - `warning`/`openSubtaskIds`: incomplete subtasks to consciously handle.
115
+ - `next`: next ready candidate.
168
116
 
169
- Run the full test suite. All tests must pass.
117
+ After every completion:
170
118
 
171
- ### Manual verification
119
+ 1. Dispatch newly unblocked meaningful independent work to subagents when safe.
120
+ 2. If no unblocked tasks, inspect `next`.
121
+ 3. If neither exists, run `trekoon --toon suggest --epic <epic-id>`.
172
122
 
173
- Automated tests aren't sufficient. Actually exercise the changes:
123
+ ## Direct Work Loop
174
124
 
175
- - **API changes:** Curl endpoints with realistic payloads when the environment
176
- allows it.
177
- - **External integrations:** Test against real services when credentials and
178
- safe access are available; otherwise record the gap.
179
- - **CLI changes:** Run actual commands, verify output.
180
- - **Parser changes:** Feed real data, not just fixtures.
125
+ Use this loop for small, tightly coupled work, or after meaningful independent
126
+ lanes are already delegated.
181
127
 
182
- ### DX quality
183
-
184
- During manual testing, watch for friction: confusing errors, noisy output,
185
- inconsistent behavior, rough edges. Fix inline or document for follow-up.
186
-
187
- ### Record evidence
188
-
189
- Append verification results to Trekoon as progress notes:
190
-
191
- ```bash
192
- trekoon --toon task update <task-id> --append "All 358 tests pass, lint clean"
193
- ```
194
-
195
- ### Final progress check
196
-
197
- Before closing the epic, confirm completion state:
198
-
199
- ```bash
200
- trekoon --toon epic progress <epic-id>
201
- ```
202
-
203
- Verify: `doneCount` equals `total`, `todoCount`/`blockedCount`/`inProgressCount`
204
- are all 0.
205
-
206
- ## Cleanup
207
-
208
- After verification is complete:
209
-
210
- 1. **Verify all tasks are done:**
128
+ 1. Orient:
211
129
  ```bash
212
- trekoon --toon epic progress <epic-id>
130
+ trekoon --toon session
131
+ trekoon --toon session --epic <epic-id>
213
132
  ```
214
- All tasks must be `done` or clearly `blocked` with reason.
215
-
216
- 2. **Mark epic done** (already `in_progress` from the start step):
133
+ 2. If diagnostics show `recoveryRequired`, stop and run `trekoon --toon init`.
134
+ 3. If behind or conflicts exist, resolve sync before claiming work. Load
135
+ `reference/sync.md` for conflict handling.
136
+ 4. Claim:
217
137
  ```bash
218
- trekoon --toon epic update <epic-id> --status done
138
+ trekoon --toon task claim <task-id> --owner <name>
219
139
  ```
220
-
221
- 3. **Run suggest to confirm nothing remains:**
140
+ 5. Work and append notes:
141
+ ```bash
142
+ trekoon --toon task update <task-id> --append "Started implementation"
143
+ ```
144
+ 6. Update important subtasks explicitly:
145
+ ```bash
146
+ trekoon --toon subtask claim <subtask-id> --owner <name>
147
+ trekoon --toon subtask update <subtask-id> --append "Verified with fixture set" --status done
148
+ ```
149
+ 7. Finish or block:
222
150
  ```bash
223
- trekoon --toon suggest --epic <epic-id>
151
+ trekoon --toon task update <task-id> --append "Completed implementation and checks"
152
+ trekoon --toon task done <task-id>
153
+ trekoon --toon task update <task-id> --append "Blocked by <reason>" --status blocked
224
154
  ```
225
- Should return no actionable suggestions if the epic is cleanly closed.
155
+ 8. Repeat from the returned `unblocked`/`next` data. A fresh `session` is not
156
+ needed mid-loop unless you need updated diagnostics or switch epics.
226
157
 
227
- 4. **Return final execution summary:** completed tasks, remaining blockers,
228
- dependency state.
158
+ If `task done` warns about open subtasks, decide whether the task is genuinely
159
+ complete before moving on.
229
160
 
230
- ## Architectural fit
161
+ ## Recovery
231
162
 
232
- Changes should integrate cleanly with existing patterns. If a change fights the
233
- architecture, refactor first rather than bolt on. The goal is zero tech debt.
163
+ `status_transition_invalid`:
234
164
 
235
- ## Single-agent execution loop
165
+ 1. `trekoon --toon --compact task show <id>`
166
+ 2. Append the attempted transition and current status.
167
+ 3. Load `reference/status-machine.md`.
168
+ 4. Apply the valid intermediate transition, then retry.
169
+ 5. Continue only after the target task reaches the intended status or is marked
170
+ `blocked` with reason.
236
171
 
237
- Use this loop when one agent should continue the work directly. The primary loop
238
- is: **session → claim → work → task done → repeat**.
172
+ `dependency_blocked`:
239
173
 
240
- ### 1. Orient with a single call
174
+ 1. `trekoon --toon --compact task show <id>`
175
+ 2. Append the unmet dependency.
176
+ 3. `trekoon --toon task ready --epic <epic-id>`
177
+ 4. Continue with a ready candidate. Do not retry the blocked task until its
178
+ dependency is complete.
241
179
 
242
- ```bash
243
- trekoon --toon session
244
- ```
180
+ ## Verify Before Closing
245
181
 
246
- If you already know which epic you are working on, scope the session:
182
+ All applicable checks must pass before marking the epic done.
247
183
 
248
- ```bash
249
- trekoon --toon session --epic <epic-id>
250
- ```
184
+ ### Review
251
185
 
252
- `session` returns diagnostics, sync status, the next ready task with subtrees,
253
- blocker list, and readiness counts in one envelope. Use `--compact` to reduce
254
- output size when you do not need contract metadata:
186
+ For non-trivial implementation, run a separate review pass before closing the
187
+ task or epic. Prefer a specialized review agent/skill when available. Review
188
+ the actual diff for correctness, regressions, missing tests, security,
189
+ reliability, performance, and integration risks. Tiny docs/mechanical changes
190
+ may skip separate review, but record that decision.
255
191
 
256
- ```bash
257
- trekoon --toon --compact session
258
- ```
192
+ ### Tests and Manual Checks
259
193
 
260
- **After session returns, follow this decision tree in order:**
194
+ - Run the relevant automated tests for touched scope.
195
+ - Run broader tests when shared behavior, cross-module contracts, or user flows
196
+ changed.
197
+ - Exercise CLI/API/parser/integration changes with realistic inputs when
198
+ possible.
199
+ - Record gaps when credentials or external services are unavailable.
200
+ - Fix confusing errors, noisy output, inconsistent behavior, or rough DX.
261
201
 
262
- 1. **`recoveryRequired` is true?** → Stop. Run `trekoon --toon init` and
263
- re-check.
264
- 2. **`behind > 0`?** → Sync first: `trekoon --toon sync pull --from main`.
265
- This pulls tracker events (not git commits) so task states are current.
266
- 3. **`pendingConflicts > 0`?** → Resolve before claiming work:
267
- `trekoon --toon sync conflicts list`. For uniform conflicts, batch resolve:
268
- `trekoon --toon sync resolve --all --use ours` (or `--use theirs`). For
269
- mixed conflicts, inspect individually with `sync conflicts show <id>` and
270
- resolve per-conflict. See `reference/sync.md` for full conflict guidance.
271
- 4. **Session returned a next task?** → Proceed to step 2 (claim work).
272
- 5. **No next task and unsure what to do?** → Run `trekoon --toon suggest` for
273
- priority-ranked recommendations (see step 1b below).
274
-
275
- ### 1b. Get suggestions when stuck
276
-
277
- When the session has no clear next task, or you are unsure what action to take:
202
+ Append evidence:
278
203
 
279
204
  ```bash
280
- trekoon --toon suggest
281
- trekoon --toon suggest --epic <epic-id>
205
+ trekoon --toon task update <task-id> --append "Verified: <commands/results>"
206
+ trekoon --toon task update <task-id> --append "Review: <result or accepted gap>"
282
207
  ```
283
208
 
284
- `suggest` inspects recovery state, sync status, readiness, and epic progress,
285
- then returns up to 3 suggestions ranked by priority. Each suggestion includes a
286
- category (`recovery`, `sync`, `execution`, `planning`), a reason, and a
287
- ready-to-run command you can execute directly.
288
-
289
- Suggest respects the status machine — it will never recommend an invalid
290
- transition. Use it:
291
- - At session start when `readyCount` is 0 and you need guidance.
292
- - Mid-loop when all tasks are blocked and you need to decide what to unblock.
293
- - Before closing an epic to confirm the right next step.
209
+ ## Close The Epic
294
210
 
295
- ### 1c. Check epic progress
296
-
297
- When you need a quick dashboard before or during work on an epic:
211
+ Before closing:
298
212
 
299
213
  ```bash
300
214
  trekoon --toon epic progress <epic-id>
215
+ trekoon --toon suggest --epic <epic-id>
301
216
  ```
302
217
 
303
- Returns done/in_progress/blocked/todo counts, ready task count, and the next
304
- candidate. Use this:
305
- - Before starting a work session to gauge how much remains.
306
- - After completing several tasks to report progress to the user.
307
- - To decide whether an epic is ready to be marked done.
308
-
309
- ### 2. Claim work explicitly
310
-
311
- Once you know which task to work on, claim it atomically with `task claim`.
312
- `--owner` is required:
313
-
314
- ```bash
315
- trekoon --toon task claim <task-id> --owner <name>
316
- ```
317
-
318
- `task claim` sets `status=in_progress` and `owner=<name>` in a single
319
- compare-and-swap. It succeeds only when the task is in `todo` or `blocked`
320
- and is not already claimed by a different owner.
321
-
322
- For other (non-claim) status transitions such as moving to `blocked`, use
323
- `task update --status`:
324
-
325
- ```bash
326
- trekoon --toon task update <task-id> --status blocked
327
- ```
328
-
329
- To update ownership separately (e.g. reassign without claiming):
330
-
331
- ```bash
332
- trekoon --toon task update <task-id> --owner alice
333
- trekoon --toon subtask update <subtask-id> --owner bob
334
- ```
335
-
336
- ### 3. Work on the task
337
-
338
- While working, append progress notes:
339
-
340
- ```bash
341
- trekoon --toon task update <task-id> --append "Started implementation"
342
- trekoon --toon task update <task-id> --append "Blocked by <reason>" --status blocked
343
- ```
344
-
345
- ### 3b. Work on subtasks explicitly when they matter
346
-
347
- Use the same status discipline for subtasks when a task depends on concrete
348
- subtask progress:
349
-
350
- ```bash
351
- trekoon --toon subtask claim <subtask-id> --owner <name>
352
- trekoon --toon subtask update <subtask-id> --append "Implemented parser branch"
353
- trekoon --toon subtask update <subtask-id> --append "Verified with fixture set" --status done
354
- trekoon --toon subtask update <subtask-id> --append "Blocked by <reason>" --status blocked
355
- ```
356
-
357
- Use subtasks for real execution units, not filler. If a task has open subtasks
358
- when `task done` is called, treat the warning as a prompt to consciously decide
359
- whether the task is genuinely complete.
360
-
361
- ### 4. Finish or report a block
362
-
363
- When done, append a completion note then mark done:
364
-
365
- ```bash
366
- trekoon --toon task update <task-id> --append "Completed implementation and checks"
367
- trekoon --toon task done <task-id>
368
- ```
369
-
370
- `task done` works from any non-done status (`todo`, `in_progress`, `blocked`).
371
- It auto-transitions through `in_progress` when needed. The response includes:
372
-
373
- - **Next candidate**: the next ready task with its full tree and blockers.
374
- - **Unblocked tasks**: downstream tasks that became ready after this completion.
375
- Use this to decide what to claim next or to launch parallel work.
376
- - **Open subtask warning**: if subtasks remain incomplete (completion still
377
- proceeds, but the warning is surfaced so you can decide whether to go back).
378
-
379
- If blocked instead of done:
218
+ Verify all tasks are `done`, or all remaining work is `blocked` with recorded
219
+ reasons. Then mark the epic done:
380
220
 
381
221
  ```bash
382
- trekoon --toon task update <task-id> --append "Blocked by <reason>" --status blocked
222
+ trekoon --toon epic update <epic-id> --status done
383
223
  ```
384
224
 
385
- ### 5. Repeat
225
+ Return final summary: tasks completed, files changed, verification, review,
226
+ remaining blockers, and dependency state.
386
227
 
387
- After `task done`, the returned next-task envelope is sufficient to continue
388
- the loop from step 2. A fresh `session` call is not required mid-loop unless
389
- you need updated diagnostics, sync status, or want to switch epics.
228
+ ## Update And Read Policies
390
229
 
391
- Run `session` again at the start of each new conversation session.
230
+ Use descriptions as the durable work log. Append progress instead of rewriting
231
+ descriptions unless the plan itself is wrong.
392
232
 
393
- **When to use each command during the loop:**
233
+ Preferred commands:
394
234
 
395
- | Situation | Command |
235
+ | Need | Command |
396
236
  |---|---|
397
- | Start of session | `session` or `session --epic <id>` |
398
- | Unsure what to do next | `suggest` or `suggest --epic <id>` |
399
- | Quick progress check | `epic progress <epic-id>` |
400
- | Claim a task | `task claim <id> --owner <name>` |
401
- | Assign ownership | `task update <id> --owner <name>` |
402
- | Log progress | `task update <id> --append "..."` |
403
- | Mark done | `task done <id>` |
404
- | Report blocker | `task update <id> --append "..." --status blocked` |
405
- | Reduce output noise | Add `--compact` to any command |
406
-
407
- ## Update policy: prefer append-based progress logging
408
-
409
- Use descriptions as the durable work log. For progress updates, append instead
410
- of rewriting full descriptions.
411
-
412
- Status transitions must follow the status machine. Use `in_progress` as the
413
- intermediate step to reach `done`. Direct `todo → done` is invalid via
414
- `task update`; use `task done` instead, which auto-transitions.
415
-
416
- ### Preferred patterns
417
-
418
- ```bash
419
- trekoon --toon task claim <task-id> --owner <name>
420
- trekoon --toon task update <task-id> --append "Started implementation"
421
- trekoon --toon task update <task-id> --append "Completed implementation and checks"
422
- trekoon --toon task done <task-id>
423
- trekoon --toon task update <task-id> --append "Blocked by <reason>" --status blocked
424
- trekoon --toon task update <task-id> --owner alice
425
- ```
237
+ | Session diagnostics + next task | `trekoon --toon session` |
238
+ | Scoped session | `trekoon --toon session --epic <epic-id>` |
239
+ | Suggestions | `trekoon --toon suggest --epic <epic-id>` |
240
+ | Progress dashboard | `trekoon --toon epic progress <epic-id>` |
241
+ | Next task only | `trekoon --toon task next` |
242
+ | Ready set | `trekoon --toon task ready --epic <epic-id> --limit 50` |
243
+ | Direct blockers | `trekoon --toon dep list <task-id>` |
244
+ | What an item unblocks | `trekoon --toon dep reverse <task-or-subtask-id>` |
245
+ | One task | `trekoon --toon task show <task-id> --all` |
246
+ | One epic tree | `trekoon --toon epic show <epic-id> --all` |
247
+ | Reduce output | Add `--compact` |
426
248
 
427
- ### Bulk update rules
249
+ Bulk updates:
428
250
 
429
- - Bulk update is available for `epic update`, `task update`, and
430
- `subtask update`.
431
- - Bulk mode uses `--ids <csv>` or `--all`.
251
+ - Use `--ids <csv>` or `--all`; prefer `--ids`.
432
252
  - Bulk mode supports only `--append` and/or `--status`.
433
253
  - Do not pass a positional ID in bulk mode.
434
254
  - `--append` and `--description` are mutually exclusive.
435
- - Prefer `--ids` for narrow, explicit updates.
436
- - Use `--all` only for clear maintenance sweeps or when the user explicitly wants
437
- a broad update.
438
-
439
- Examples:
440
-
441
- ```bash
442
- trekoon --toon task update --ids id1,id2 --append "Waiting on release" --status blocked
443
- trekoon --toon epic update --ids epic1,epic2 --append "Sprint planning refreshed" --status in_progress
444
- ```
445
-
446
- ## Read policy: use the smallest sufficient read
447
-
448
- Use the narrowest command that answers the question.
449
-
450
- | Need | Preferred command |
451
- |---|---|
452
- | Session startup (diagnostics + sync + next task) | `trekoon --toon session` |
453
- | Session scoped to one epic | `trekoon --toon session --epic <epic-id>` |
454
- | Next-action suggestions | `trekoon --toon suggest` |
455
- | Epic progress dashboard | `trekoon --toon epic progress <epic-id>` |
456
- | Next task only | `trekoon --toon task next` |
457
- | A few ready options | `trekoon --toon task ready --limit 5` |
458
- | Direct blockers for one task | `trekoon --toon dep list <task-id>` |
459
- | What this item unblocks | `trekoon --toon dep reverse <task-or-subtask-id>` |
460
- | One full task payload | `trekoon --toon task show <task-id> --all` |
461
- | One full epic tree | `trekoon --toon epic show <epic-id> --all` |
462
- | Repeated text in one scope | `trekoon --toon epic\|task\|subtask search ...` |
463
-
464
- Avoid broad scans such as `task list --all` or `epic show --all` when
465
- `task next`, `task ready`, `dep list`, `dep reverse`, `suggest`, or `search`
466
- can answer the question more cheaply.
255
+ - Use `--all` only for clear maintenance sweeps or when the user explicitly
256
+ wants broad updates.