trekoon 0.2.6 → 0.2.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.
- package/README.md +102 -708
- package/docs/ai-agents.md +198 -0
- package/docs/commands.md +226 -0
- package/docs/machine-contracts.md +253 -0
- package/docs/plans/2026-03-15-trekoon-board-design.md +13 -0
- package/docs/quickstart.md +207 -0
- package/package.json +3 -1
- package/src/board/assets/app.js +1498 -0
- package/src/board/assets/components/AppShell.js +17 -0
- package/src/board/assets/components/BoardTopbar.js +78 -0
- package/src/board/assets/components/ClampedText.js +31 -0
- package/src/board/assets/components/EpicRow.js +62 -0
- package/src/board/assets/components/EpicsOverview.js +43 -0
- package/src/board/assets/components/WorkspaceHeader.js +70 -0
- package/src/board/assets/components/assetMap.js +65 -0
- package/src/board/assets/index.html +76 -0
- package/src/board/assets/main.js +27 -0
- package/src/board/assets/manifest.json +12 -0
- package/src/board/assets/state/actions.js +334 -0
- package/src/board/assets/state/api.js +126 -0
- package/src/board/assets/state/store.js +172 -0
- package/src/board/assets/styles/board.css +1127 -0
- package/src/board/assets/utils/dom.js +308 -0
- package/src/board/install.ts +196 -0
- package/src/board/open-browser.ts +131 -0
- package/src/board/routes.ts +299 -0
- package/src/board/server.ts +184 -0
- package/src/board/snapshot.ts +277 -0
- package/src/board/types.ts +43 -0
- package/src/commands/board.ts +158 -0
- package/src/commands/epic.ts +104 -3
- package/src/commands/help.ts +52 -13
- package/src/commands/init.ts +29 -0
- package/src/commands/subtask.ts +78 -1
- package/src/commands/task.ts +113 -7
- package/src/domain/mutation-service.ts +116 -0
- package/src/domain/tracker-domain.ts +261 -5
- package/src/domain/types.ts +51 -0
- package/src/runtime/cli-shell.ts +5 -0
- package/src/storage/path.ts +36 -0
package/README.md
CHANGED
|
@@ -2,761 +2,155 @@
|
|
|
2
2
|
|
|
3
3
|
AI-first issue tracking for humans and agents.
|
|
4
4
|
|
|
5
|
-
Trekoon is a
|
|
5
|
+
Trekoon is a local-first CLI for planning and execution inside a repository. It
|
|
6
|
+
keeps work in a shared **epic → task → subtask** graph so humans and agents can
|
|
7
|
+
work against the same state, from the terminal, with deterministic machine
|
|
8
|
+
output when automation needs it.
|
|
6
9
|
|
|
7
|
-
##
|
|
10
|
+
## What it is for
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
Then verify:
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
trekoon --help
|
|
19
|
-
trekoon quickstart
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
Alternative (npm global install):
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
npm i -g trekoon
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## What Trekoon is
|
|
29
|
-
|
|
30
|
-
- Local-first CLI issue tracker
|
|
31
|
-
- Structured hierarchy: **epic → task → subtask**
|
|
32
|
-
- UUID-based references for durable linking across branches/worktrees
|
|
33
|
-
- Dependency-aware planning and execution
|
|
34
|
-
- Output modes:
|
|
35
|
-
- **Human mode** for terminal users
|
|
36
|
-
- **JSON mode** for stable machine parsing
|
|
37
|
-
- **TOON mode** for true TOON-encoded payloads
|
|
38
|
-
|
|
39
|
-
## What Trekoon aims to accomplish
|
|
40
|
-
|
|
41
|
-
1. Make issue tracking fast enough for daily terminal use.
|
|
42
|
-
2. Make issue data deterministic and machine-readable for AI automation.
|
|
43
|
-
3. Keep one repo-scoped state store that every worktree can coordinate through safely.
|
|
44
|
-
4. Stay minimal in code size while preserving robustness and clear boundaries.
|
|
45
|
-
|
|
46
|
-
## Command surface
|
|
47
|
-
|
|
48
|
-
- `trekoon init`
|
|
49
|
-
- `trekoon help [command]`
|
|
50
|
-
- `trekoon quickstart`
|
|
51
|
-
- `trekoon epic <create|expand|list|show|search|replace|update|delete>`
|
|
52
|
-
- `trekoon session`
|
|
53
|
-
- `trekoon task <create|create-many|list|show|ready|next|done|search|replace|update|delete>`
|
|
54
|
-
- `trekoon subtask <create|create-many|list|search|replace|update|delete>`
|
|
55
|
-
- `trekoon dep <add|add-many|remove|list|reverse>`
|
|
56
|
-
- `trekoon events prune [--dry-run] [--archive] [--retention-days <n>]`
|
|
57
|
-
- `trekoon migrate <status|rollback> [--to-version <n>]`
|
|
58
|
-
- `trekoon sync <status|pull|resolve|conflicts>`
|
|
59
|
-
- `trekoon skills install [--link --editor opencode|claude|pi] [--to <path>] [--allow-outside-repo]`
|
|
60
|
-
- `trekoon skills update`
|
|
61
|
-
- `trekoon wipe --yes`
|
|
62
|
-
|
|
63
|
-
Global output modes:
|
|
64
|
-
|
|
65
|
-
- `--json` for structured JSON output
|
|
66
|
-
- `--toon` for true TOON-encoded output (not JSON text)
|
|
67
|
-
- `--compat <mode>` for explicit machine compatibility behavior
|
|
68
|
-
- `--help` for root and command help
|
|
69
|
-
- `--version` for CLI version
|
|
70
|
-
|
|
71
|
-
Global options can be used before or after the command:
|
|
72
|
-
|
|
73
|
-
```bash
|
|
74
|
-
trekoon --toon quickstart
|
|
75
|
-
trekoon quickstart --toon
|
|
76
|
-
trekoon --json quickstart
|
|
77
|
-
trekoon quickstart --json
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
Trekoon options use long form (`--option`) for command/subcommand flags.
|
|
81
|
-
Root help/version aliases `-h` and `-v` are also supported.
|
|
82
|
-
|
|
83
|
-
Human view options:
|
|
84
|
-
|
|
85
|
-
- List and show commands default to table output in human mode.
|
|
86
|
-
- Use `--view compact` to restore compact pipe output.
|
|
87
|
-
- `epic list`, `task list`, and `subtask list` support `--view table|compact`.
|
|
88
|
-
- `epic show` and `task show` support `--view table|compact|tree|detail`.
|
|
89
|
-
|
|
90
|
-
List defaults and filters (`epic list`, `task list`, `subtask list`):
|
|
91
|
-
|
|
92
|
-
- Default scope: open work only (`in_progress`, `in-progress`, `todo`)
|
|
93
|
-
- Default limit: `10`
|
|
94
|
-
- Status filter: `--status in_progress,todo` (CSV)
|
|
95
|
-
- Custom limit: `--limit <n>`
|
|
96
|
-
- Cursor pagination: `--cursor <n>` (offset-like start index for next page)
|
|
97
|
-
- All rows and statuses: `--all`
|
|
98
|
-
- `--all` is mutually exclusive with `--status`, `--limit`, and `--cursor`
|
|
99
|
-
|
|
100
|
-
Bulk updates (`epic update`, `task update`, `subtask update`):
|
|
101
|
-
|
|
102
|
-
- Target all rows: `--all`
|
|
103
|
-
- Target specific rows: `--ids <id1,id2,...>`
|
|
104
|
-
- Bulk updates support only `--append <text>` and/or `--status <status>`
|
|
105
|
-
- In bulk mode, do not pass a positional id
|
|
106
|
-
- `--all` and `--ids` are mutually exclusive
|
|
107
|
-
- `--append` and `--description` are mutually exclusive
|
|
108
|
-
|
|
109
|
-
Examples:
|
|
110
|
-
|
|
111
|
-
```bash
|
|
112
|
-
trekoon task update --all --status in_progress
|
|
113
|
-
trekoon task update --ids <task-1>,<task-2> --append "\nFollow-up note"
|
|
114
|
-
trekoon subtask update --all --status done
|
|
115
|
-
trekoon subtask update --ids <subtask-1>,<subtask-2> --append "\nFollow-up note"
|
|
116
|
-
trekoon epic update --ids <epic-1>,<epic-2> --status done
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
## Quickstart
|
|
120
|
-
|
|
121
|
-
Trekoon is local-first, but in git repos and worktrees it is **repo-shared**:
|
|
122
|
-
every worktree for the same repository resolves to one shared `.trekoon`
|
|
123
|
-
directory and one shared `.trekoon/trekoon.db`.
|
|
124
|
-
|
|
125
|
-
- `worktreeRoot` identifies the current checkout.
|
|
126
|
-
- `sharedStorageRoot` identifies the repository root that owns `.trekoon`.
|
|
127
|
-
- `databaseFile` points at the shared SQLite database.
|
|
128
|
-
- `.trekoon` stays gitignored on purpose because the DB is operational state,
|
|
129
|
-
not source code.
|
|
130
|
-
- Committing `.trekoon/trekoon.db` is the wrong fix for drift because it bakes
|
|
131
|
-
machine-local state and stale snapshots into Git.
|
|
132
|
-
|
|
133
|
-
Outside git repos, Trekoon falls back to the invocation cwd.
|
|
134
|
-
|
|
135
|
-
When machine output is enabled (`--json`/`--toon`) and a command resolves
|
|
136
|
-
storage from a non-canonical cwd, Trekoon emits
|
|
137
|
-
`meta.storageRootDiagnostics` so automation can verify the storage contract.
|
|
138
|
-
|
|
139
|
-
### 1) Initialize
|
|
140
|
-
|
|
141
|
-
```bash
|
|
142
|
-
trekoon init
|
|
143
|
-
trekoon --version
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
Bootstrap expectations:
|
|
147
|
-
|
|
148
|
-
- Run `trekoon --toon init` once per repository to create or re-bootstrap the
|
|
149
|
-
shared storage root.
|
|
150
|
-
- Run `trekoon --toon sync status` before agent work to inspect diagnostics.
|
|
151
|
-
- If diagnostics report `recoveryRequired`, a tracked/ignored mismatch, or an
|
|
152
|
-
ambiguous recovery path, stop and repair setup before continuing.
|
|
153
|
-
- Do **not** continue with task selection after broken bootstrap warnings.
|
|
154
|
-
|
|
155
|
-
### 2) Create epic → task → subtask
|
|
156
|
-
|
|
157
|
-
```bash
|
|
158
|
-
trekoon epic create --title "Agent backlog stabilization" --description "Track stabilization work" --status todo
|
|
159
|
-
trekoon task create --title "Implement sync status" --description "Add status reporting" --epic <epic-id> --status todo
|
|
160
|
-
trekoon subtask create --task <task-id> --title "Add cursor model" --status todo
|
|
161
|
-
trekoon task list
|
|
162
|
-
trekoon task list --status done
|
|
163
|
-
trekoon task list --limit 25
|
|
164
|
-
trekoon task list --all --view compact
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
### 2a) Preferred one-shot epic creation
|
|
168
|
-
|
|
169
|
-
When you already know the epic tree, create the epic, tasks, subtasks, and
|
|
170
|
-
dependencies in one invocation.
|
|
171
|
-
|
|
172
|
-
```bash
|
|
173
|
-
trekoon epic create \
|
|
174
|
-
--title "Batch command rollout" \
|
|
175
|
-
--description "Ship one-shot planning workflows" \
|
|
176
|
-
--task "task-a|First task|First description|todo" \
|
|
177
|
-
--task "task-b|Second task|Second description|todo" \
|
|
178
|
-
--subtask "@task-a|sub-a|First subtask|Subtask description|todo" \
|
|
179
|
-
--dep "@task-b|@task-a" \
|
|
180
|
-
--dep "@sub-a|@task-a"
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
Use this when:
|
|
184
|
-
|
|
185
|
-
- the epic does not exist yet
|
|
186
|
-
- later records need to reference earlier created records via `@temp-key`
|
|
187
|
-
- you want one atomic create step and one machine response with mappings/counts
|
|
188
|
-
|
|
189
|
-
Compact machine output adds:
|
|
190
|
-
|
|
191
|
-
```text
|
|
192
|
-
command: epic.create
|
|
193
|
-
data:
|
|
194
|
-
epic: created epic row
|
|
195
|
-
tasks[]: created tasks in input order
|
|
196
|
-
subtasks[]: created subtasks in input order
|
|
197
|
-
dependencies[]: created dependencies in input order
|
|
198
|
-
result:
|
|
199
|
-
mappings[]: { kind: task|subtask, tempKey, id }
|
|
200
|
-
counts: { tasks, subtasks, dependencies }
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
### 3) Add dependencies
|
|
204
|
-
|
|
205
|
-
```bash
|
|
206
|
-
trekoon dep add <task-id> <depends-on-id>
|
|
207
|
-
trekoon dep list <task-id>
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
### 3a) Batch planning commands
|
|
211
|
-
|
|
212
|
-
Use compact batch commands when one invocation needs to create or link multiple
|
|
213
|
-
items atomically. Use the single-item commands when you already have persisted
|
|
214
|
-
UUIDs and only need one mutation.
|
|
215
|
-
|
|
216
|
-
#### `task create-many`
|
|
217
|
-
|
|
218
|
-
Create multiple tasks under one epic in declared order.
|
|
219
|
-
|
|
220
|
-
```bash
|
|
221
|
-
trekoon task create-many \
|
|
222
|
-
--epic <epic-id> \
|
|
223
|
-
--task "seed-api|Design API|Define batch grammar|todo" \
|
|
224
|
-
--task "seed-cli|Wire CLI|Hook parser and output|in_progress"
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
Compact spec:
|
|
228
|
-
|
|
229
|
-
- `--task <temp-key>|<title>|<description>|<status>`
|
|
230
|
-
- escape `\|`, `\\`, `\n`, `\r`, `\t`
|
|
231
|
-
- repeated `--task` flags are preserved in the exact order provided
|
|
232
|
-
- temp keys are local mapping labels, not persisted IDs
|
|
233
|
-
|
|
234
|
-
Rollback semantics:
|
|
235
|
-
|
|
236
|
-
- Trekoon validates the full batch before inserts
|
|
237
|
-
- duplicate temp keys, empty required fields, or invalid input fail the whole
|
|
238
|
-
command
|
|
239
|
-
- no partial task rows are kept on failure
|
|
240
|
-
|
|
241
|
-
Compact machine output:
|
|
242
|
-
|
|
243
|
-
```text
|
|
244
|
-
command: task.create-many
|
|
245
|
-
data:
|
|
246
|
-
epicId: <epic-id>
|
|
247
|
-
tasks[]: created task rows in input order
|
|
248
|
-
result:
|
|
249
|
-
mappings[]: { kind: task, tempKey, id }
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
#### `subtask create-many`
|
|
253
|
-
|
|
254
|
-
Create multiple subtasks under one existing task.
|
|
255
|
-
|
|
256
|
-
```bash
|
|
257
|
-
trekoon subtask create-many <task-id> \
|
|
258
|
-
--subtask "seed-tests|Write tests|Cover happy path|todo" \
|
|
259
|
-
--subtask "seed-docs|Document flow|Add operator notes|todo"
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
Equivalent explicit parent form:
|
|
263
|
-
|
|
264
|
-
```bash
|
|
265
|
-
trekoon subtask create-many \
|
|
266
|
-
--task <task-id> \
|
|
267
|
-
--subtask "seed-tests|Write tests|Cover happy path|todo"
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
Rules:
|
|
271
|
-
|
|
272
|
-
- positional `<task-id>` or `--task <task-id>` may be used
|
|
273
|
-
- if both are provided, they must be identical or the command fails
|
|
274
|
-
- repeated `--subtask` flags are applied in declared order
|
|
275
|
-
|
|
276
|
-
Rollback semantics:
|
|
277
|
-
|
|
278
|
-
- full batch prevalidation happens before inserts
|
|
279
|
-
- duplicate temp keys, conflicting task ids, or invalid specs abort the whole
|
|
280
|
-
command
|
|
281
|
-
- no partial subtasks are kept on failure
|
|
282
|
-
|
|
283
|
-
Compact machine output:
|
|
12
|
+
- Fast issue tracking for day-to-day terminal use
|
|
13
|
+
- One repo-scoped task graph that works across branches and worktrees
|
|
14
|
+
- Stable machine-readable output for AI workflows (`--toon`, `--json`)
|
|
15
|
+
- Minimal command surface with strong planning and execution primitives
|
|
284
16
|
|
|
285
|
-
|
|
286
|
-
command: subtask.create-many
|
|
287
|
-
data:
|
|
288
|
-
taskId: <task-id>
|
|
289
|
-
subtasks[]: created subtask rows in input order
|
|
290
|
-
result:
|
|
291
|
-
mappings[]: { kind: subtask, tempKey, id }
|
|
292
|
-
```
|
|
293
|
-
|
|
294
|
-
#### `dep add-many`
|
|
295
|
-
|
|
296
|
-
Create multiple dependency edges in one ordered, transactional operation.
|
|
297
|
-
|
|
298
|
-
```bash
|
|
299
|
-
trekoon dep add-many \
|
|
300
|
-
--dep "<task-b>|<task-a>" \
|
|
301
|
-
--dep "<subtask-c>|<task-b>"
|
|
302
|
-
```
|
|
303
|
-
|
|
304
|
-
Compact spec:
|
|
305
|
-
|
|
306
|
-
- `--dep <source-ref>|<depends-on-ref>`
|
|
307
|
-
- repeated `--dep` flags are applied in declared order
|
|
308
|
-
- standalone `dep add-many` resolves persisted IDs only
|
|
309
|
-
- `@temp-key` refs are **not** resolved from earlier commands; they are reserved
|
|
310
|
-
for same-invocation workflows such as `epic expand`
|
|
311
|
-
|
|
312
|
-
Rollback semantics:
|
|
313
|
-
|
|
314
|
-
- validation covers the full dependency set before insert
|
|
315
|
-
- missing ids, unresolved `@temp-key` refs, duplicates, or cycles fail the whole
|
|
316
|
-
batch
|
|
317
|
-
- no partial dependency edges are inserted on failure
|
|
318
|
-
|
|
319
|
-
Compact machine output:
|
|
320
|
-
|
|
321
|
-
```text
|
|
322
|
-
command: dep.add-many
|
|
323
|
-
data:
|
|
324
|
-
dependencies[]: created dependency rows in input order
|
|
325
|
-
result:
|
|
326
|
-
mappings[]: []
|
|
327
|
-
```
|
|
328
|
-
|
|
329
|
-
#### `epic expand`
|
|
330
|
-
|
|
331
|
-
Expand one existing epic by creating tasks, subtasks, and dependencies in one
|
|
332
|
-
transaction. Use this when the epic already exists and you want to add a linked
|
|
333
|
-
batch later.
|
|
334
|
-
|
|
335
|
-
```bash
|
|
336
|
-
trekoon epic expand <epic-id> \
|
|
337
|
-
--task "task-api|Design API|Define compact grammar|todo" \
|
|
338
|
-
--task "task-cli|Wire CLI|Hook parser and output|todo" \
|
|
339
|
-
--subtask "@task-api|sub-tests|Write tests|Cover parser cases|todo" \
|
|
340
|
-
--dep "@task-cli|@task-api" \
|
|
341
|
-
--dep "@sub-tests|@task-api"
|
|
342
|
-
```
|
|
343
|
-
|
|
344
|
-
Compact specs:
|
|
345
|
-
|
|
346
|
-
- `--task <temp-key>|<title>|<description>|<status>`
|
|
347
|
-
- `--subtask <parent-ref>|<temp-key>|<title>|<description>|<status>`
|
|
348
|
-
- `--dep <source-ref>|<depends-on-ref>`
|
|
349
|
-
- `@temp-key` refs may target tasks/subtasks declared earlier in the same
|
|
350
|
-
`epic expand` invocation
|
|
351
|
-
|
|
352
|
-
Background phases:
|
|
353
|
-
|
|
354
|
-
1. validate all compact specs and duplicate temp keys
|
|
355
|
-
2. create tasks transactionally
|
|
356
|
-
3. resolve subtask parent temp keys and create subtasks
|
|
357
|
-
4. resolve dependency refs and link dependencies
|
|
358
|
-
5. append task, subtask, then dependency events
|
|
359
|
-
6. roll back the full expansion if any phase fails
|
|
360
|
-
|
|
361
|
-
Compact machine output:
|
|
362
|
-
|
|
363
|
-
```text
|
|
364
|
-
command: epic.expand
|
|
365
|
-
data:
|
|
366
|
-
epicId: <epic-id>
|
|
367
|
-
tasks[]: created tasks in input order
|
|
368
|
-
subtasks[]: created subtasks in input order
|
|
369
|
-
dependencies[]: created dependencies in input order
|
|
370
|
-
result:
|
|
371
|
-
mappings[]: { kind: task|subtask, tempKey, id }
|
|
372
|
-
counts: { tasks, subtasks, dependencies }
|
|
373
|
-
```
|
|
374
|
-
|
|
375
|
-
When to choose which command:
|
|
376
|
-
|
|
377
|
-
- use `task create-many` for sibling tasks under one known epic
|
|
378
|
-
- use `subtask create-many` for sibling subtasks under one known task
|
|
379
|
-
- use `dep add-many` only when every endpoint already has a persisted ID
|
|
380
|
-
- use `epic create` with batch specs when the epic does not exist yet and the
|
|
381
|
-
whole graph is known up front
|
|
382
|
-
- use `epic expand` when the epic already exists and one batch must add linked
|
|
383
|
-
tasks/subtasks/dependencies with `@temp-key` references
|
|
384
|
-
|
|
385
|
-
### 4) AI execution loop for agents
|
|
17
|
+
## Why it exists
|
|
386
18
|
|
|
387
|
-
|
|
19
|
+
Trekoon exists to make task tracking cheap enough to use while coding, and
|
|
20
|
+
structured enough that agents can read, update, and complete work without
|
|
21
|
+
guessing.
|
|
388
22
|
|
|
389
|
-
|
|
390
|
-
task with subtasks, blocker list, and readiness counts:
|
|
23
|
+
## Install
|
|
391
24
|
|
|
392
|
-
|
|
393
|
-
trekoon --toon session
|
|
394
|
-
```
|
|
395
|
-
|
|
396
|
-
Claim work, then finish or report a block:
|
|
397
|
-
|
|
398
|
-
```bash
|
|
399
|
-
trekoon --toon task update <task-id> --status in_progress
|
|
400
|
-
trekoon --toon task done <task-id>
|
|
401
|
-
trekoon --toon task update <task-id> --append "Blocked by <reason>" --status blocked
|
|
402
|
-
```
|
|
403
|
-
|
|
404
|
-
`task done` marks the task done and returns the next ready task with
|
|
405
|
-
dependencies inline, replacing the old multi-step transition.
|
|
406
|
-
|
|
407
|
-
Fail-fast rules:
|
|
408
|
-
|
|
409
|
-
- Treat `meta.storageRootDiagnostics` as the source of truth for worktree
|
|
410
|
-
storage.
|
|
411
|
-
- In linked worktrees, `sharedStorageRoot` may differ from `worktreeRoot`; that
|
|
412
|
-
is expected.
|
|
413
|
-
- If `recoveryRequired` is `true`, stop and follow the reported bootstrap or
|
|
414
|
-
recovery action.
|
|
415
|
-
- Do not fall back to a separate per-worktree DB or continue after missing
|
|
416
|
-
shared storage.
|
|
417
|
-
|
|
418
|
-
<details>
|
|
419
|
-
<summary>Legacy manual bootstrap (use <code>session</code> instead)</summary>
|
|
420
|
-
|
|
421
|
-
```bash
|
|
422
|
-
trekoon --toon init
|
|
423
|
-
trekoon --toon sync status
|
|
424
|
-
trekoon --toon task ready --limit 5
|
|
425
|
-
trekoon --toon task next
|
|
426
|
-
trekoon --toon dep reverse <task-or-subtask-id>
|
|
427
|
-
trekoon --toon task update <task-id> --status in_progress
|
|
428
|
-
trekoon --toon task update <task-id> --append "Completed implementation and checks" --status done
|
|
429
|
-
```
|
|
430
|
-
|
|
431
|
-
</details>
|
|
432
|
-
|
|
433
|
-
### 5) Use TOON output for agent workflows
|
|
434
|
-
|
|
435
|
-
```bash
|
|
436
|
-
trekoon --toon epic show <epic-id>
|
|
437
|
-
trekoon --toon task show <task-id>
|
|
438
|
-
```
|
|
439
|
-
|
|
440
|
-
Optional alternative for integrations that explicitly require JSON:
|
|
441
|
-
|
|
442
|
-
```bash
|
|
443
|
-
trekoon --json epic show <epic-id>
|
|
444
|
-
trekoon --json task show <task-id>
|
|
445
|
-
```
|
|
446
|
-
|
|
447
|
-
### 6) Scoped search for repeated text
|
|
448
|
-
|
|
449
|
-
Use scoped search before manual tree reads when you need to locate repeated
|
|
450
|
-
paths, labels, or migration targets.
|
|
25
|
+
Recommended (global install with Bun):
|
|
451
26
|
|
|
452
27
|
```bash
|
|
453
|
-
|
|
454
|
-
trekoon --toon task search <task-id> "path/to/somewhere"
|
|
455
|
-
trekoon --toon subtask search <subtask-id> "path/to/somewhere"
|
|
28
|
+
bun add -g trekoon
|
|
456
29
|
```
|
|
457
30
|
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
- `epic search` scans the epic title/description plus every task and subtask
|
|
461
|
-
title/description in that epic tree.
|
|
462
|
-
- `task search` scans the task title/description plus descendant subtask
|
|
463
|
-
title/description.
|
|
464
|
-
- `subtask search` scans only that subtask's title/description.
|
|
465
|
-
- Add `--fields title`, `--fields description`, or
|
|
466
|
-
`--fields title,description` when you need a narrower scan.
|
|
467
|
-
|
|
468
|
-
### 7) Preview first, then apply scoped replace
|
|
469
|
-
|
|
470
|
-
Use search first to confirm the scope, then run replace in preview mode, and
|
|
471
|
-
only use `--apply` after the preview matches the intended migration.
|
|
31
|
+
Alternative (npm global install):
|
|
472
32
|
|
|
473
33
|
```bash
|
|
474
|
-
|
|
475
|
-
trekoon --toon epic replace <epic-id> --search "path/to/somewhere" --replace "path/to/new-path"
|
|
476
|
-
trekoon --toon epic replace <epic-id> --search "path/to/somewhere" --replace "path/to/new-path" --apply
|
|
477
|
-
```
|
|
478
|
-
|
|
479
|
-
Use this loop for low-risk agent workflows:
|
|
480
|
-
|
|
481
|
-
1. `search` when you need the smallest possible read before deciding whether a
|
|
482
|
-
migration is needed.
|
|
483
|
-
2. preview `replace` to verify the exact candidate set and changed fields.
|
|
484
|
-
3. `replace --apply` only after the preview output matches the intended scope.
|
|
485
|
-
|
|
486
|
-
Epic-scoped replace applies across the epic title/description and every task and
|
|
487
|
-
subtask title/description in that epic tree.
|
|
488
|
-
|
|
489
|
-
Compact TOON expectations for agents:
|
|
490
|
-
|
|
491
|
-
```text
|
|
492
|
-
ok: true
|
|
493
|
-
command: epic.search
|
|
494
|
-
data:
|
|
495
|
-
scope: epic
|
|
496
|
-
query: { search, fields[], mode: preview }
|
|
497
|
-
matches[]: { kind, id, fields[]: { field, count, snippet } }
|
|
498
|
-
summary: { matchedEntities, matchedFields, totalMatches }
|
|
499
|
-
metadata:
|
|
500
|
-
contractVersion: 1.0.0
|
|
501
|
-
requestId: req-<id>
|
|
502
|
-
```
|
|
503
|
-
|
|
504
|
-
```text
|
|
505
|
-
ok: true
|
|
506
|
-
command: epic.replace
|
|
507
|
-
data:
|
|
508
|
-
scope: epic
|
|
509
|
-
query: { search, replace, fields[], mode: preview|apply }
|
|
510
|
-
matches[]: { kind, id, fields[]: { field, count, snippet } }
|
|
511
|
-
summary: { matchedEntities, matchedFields, totalMatches, mode }
|
|
512
|
-
metadata:
|
|
513
|
-
contractVersion: 1.0.0
|
|
514
|
-
requestId: req-<id>
|
|
34
|
+
npm i -g trekoon
|
|
515
35
|
```
|
|
516
36
|
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
- `epic search` and preview `epic replace` traverse the epic first, then
|
|
520
|
-
descendant tasks, then descendant subtasks.
|
|
521
|
-
- Within each record, Trekoon checks `title` before `description` so output stays
|
|
522
|
-
deterministic and low-token.
|
|
523
|
-
- Preview reports the candidate set without mutating records.
|
|
524
|
-
- `--apply` reuses the same scoped traversal, updates only rows with real text
|
|
525
|
-
changes, and returns the matched rows with `query.mode` and `summary.mode`
|
|
526
|
-
set to `"apply"`.
|
|
527
|
-
|
|
528
|
-
### 8) Sync workflow for worktrees
|
|
529
|
-
|
|
530
|
-
- Run `trekoon sync status` at session start and before PR/merge.
|
|
531
|
-
- Run `trekoon sync pull --from main` before merge to align tracker state.
|
|
532
|
-
- If conflicts exist, resolve explicitly:
|
|
37
|
+
Verify the install:
|
|
533
38
|
|
|
534
39
|
```bash
|
|
535
|
-
trekoon
|
|
536
|
-
trekoon
|
|
537
|
-
trekoon sync conflicts list
|
|
538
|
-
trekoon sync conflicts show <conflict-id>
|
|
539
|
-
trekoon sync resolve <conflict-id> --use ours
|
|
40
|
+
trekoon --help
|
|
41
|
+
trekoon quickstart
|
|
540
42
|
```
|
|
541
43
|
|
|
542
|
-
|
|
543
|
-
react deterministically:
|
|
544
|
-
|
|
545
|
-
- `diagnostics.malformedPayloadEvents`
|
|
546
|
-
- `diagnostics.applyRejectedEvents`
|
|
547
|
-
- `diagnostics.quarantinedEvents`
|
|
548
|
-
- `diagnostics.conflictEvents`
|
|
549
|
-
- `diagnostics.errorHints`
|
|
550
|
-
|
|
551
|
-
Worktree diagnostics and recovery:
|
|
552
|
-
|
|
553
|
-
- Inspect `storageMode`, `repoCommonDir`, `worktreeRoot`, `sharedStorageRoot`,
|
|
554
|
-
and `databaseFile` in machine output when debugging worktree behavior.
|
|
555
|
-
- If a worktree resolves shared storage outside its checkout, that is expected
|
|
556
|
-
for linked worktrees and should not be “fixed” by committing `.trekoon`.
|
|
557
|
-
- If Git contains a tracked `.trekoon/trekoon.db`, remove it from Git history or
|
|
558
|
-
the index as appropriate, keep `.trekoon` ignored, and re-run
|
|
559
|
-
`trekoon --toon init`.
|
|
560
|
-
- Use `trekoon wipe --yes` only for explicit destructive recovery; it deletes
|
|
561
|
-
the shared storage root for the entire repository, not just the current
|
|
562
|
-
worktree.
|
|
563
|
-
|
|
564
|
-
Compatibility mode for legacy sync command IDs:
|
|
44
|
+
## Commands
|
|
565
45
|
|
|
566
|
-
|
|
567
|
-
trekoon --json --compat legacy-sync-command-ids sync status
|
|
568
|
-
trekoon --toon --compat legacy-sync-command-ids sync pull --from main
|
|
569
|
-
```
|
|
46
|
+
These are the commands most people need to recognize quickly:
|
|
570
47
|
|
|
571
|
-
|
|
48
|
+
| Goal | Commands |
|
|
49
|
+
| --- | --- |
|
|
50
|
+
| Initialize a repo | `trekoon init` |
|
|
51
|
+
| Install/open/update the local board | `trekoon board open`, `trekoon board update` |
|
|
52
|
+
| Learn the CLI | `trekoon help [command]`, `trekoon quickstart` |
|
|
53
|
+
| Plan work | `trekoon epic ...`, `trekoon task ...`, `trekoon subtask ...`, `trekoon dep ...` |
|
|
54
|
+
| Start an execution session | `trekoon session` |
|
|
55
|
+
| Keep worktrees in sync | `trekoon sync ...` |
|
|
56
|
+
| Install or refresh the AI skill | `trekoon skills install`, `trekoon skills update` |
|
|
57
|
+
| Maintenance | `trekoon events prune ...`, `trekoon migrate ...`, `trekoon wipe --yes` |
|
|
572
58
|
|
|
573
|
-
|
|
574
|
-
- Compatibility mode rewrites sync command IDs to legacy forms
|
|
575
|
-
(`sync_status`, `sync_pull`, ...).
|
|
576
|
-
- Compatibility mode is machine-only and valid only for `sync` commands.
|
|
577
|
-
- Machine output includes `metadata.compatibility` with:
|
|
578
|
-
- deprecation warning code
|
|
579
|
-
- migration guidance
|
|
580
|
-
- canonical + compatibility command IDs
|
|
581
|
-
- removal window (`removalAfter: 2026-09-30`)
|
|
582
|
-
- Migration path: remove `--compat legacy-sync-command-ids` and consume dotted
|
|
583
|
-
command IDs directly.
|
|
59
|
+
Machine output modes:
|
|
584
60
|
|
|
585
|
-
|
|
61
|
+
- `--toon` for true TOON-encoded payloads
|
|
62
|
+
- `--json` for JSON output
|
|
63
|
+
- `--compat <mode>` for explicit compatibility behavior
|
|
64
|
+
- `--help` and `--version` at the root or command level
|
|
586
65
|
|
|
587
|
-
|
|
588
|
-
|
|
66
|
+
For the full command surface, flags, filters, and bulk update rules, read the
|
|
67
|
+
[command reference](docs/commands.md).
|
|
589
68
|
|
|
590
|
-
|
|
69
|
+
## Local board workflow
|
|
591
70
|
|
|
592
|
-
|
|
71
|
+
Trekoon ships a no-extra-install local board for browsing and updating work in a
|
|
72
|
+
browser.
|
|
593
73
|
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
trekoon
|
|
597
|
-
|
|
598
|
-
trekoon
|
|
599
|
-
|
|
600
|
-
trekoon skills update
|
|
601
|
-
```
|
|
74
|
+
- `trekoon init` creates the shared `.trekoon` storage, database, and board
|
|
75
|
+
runtime under `.trekoon/board`
|
|
76
|
+
- `trekoon board open` ensures those bundled board assets are installed, starts a
|
|
77
|
+
token-gated loopback server on `127.0.0.1`, and launches the browser
|
|
78
|
+
- `trekoon board update` refreshes the board runtime assets only; it does not
|
|
79
|
+
start the server or open a browser
|
|
602
80
|
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
- Default opencode link path: `.opencode/skills/trekoon`
|
|
606
|
-
- Default claude link path: `.claude/skills/trekoon`
|
|
607
|
-
- Default pi link path: `.pi/skills/trekoon`
|
|
608
|
-
- `--to <path>` overrides the editor root for link creation only.
|
|
609
|
-
- `--to` does **not** move or copy `SKILL.md` to that path.
|
|
610
|
-
- By default, link targets must resolve inside the current working directory root.
|
|
611
|
-
- Editor symlinks are written with relative targets so repo-local links survive
|
|
612
|
-
moving the repository.
|
|
613
|
-
- Use `--allow-outside-repo` only for intentional external links.
|
|
614
|
-
- When override is used, install prints a warning and includes confirmation
|
|
615
|
-
fields in machine output.
|
|
616
|
-
- Re-running install is idempotent: it refreshes `SKILL.md` and reuses/replaces
|
|
617
|
-
the same symlink target.
|
|
618
|
-
- `trekoon skills update` is idempotent: it refreshes canonical
|
|
619
|
-
`.agents/skills/trekoon/SKILL.md` and creates or refreshes default editor
|
|
620
|
-
links when their config directories exist.
|
|
621
|
-
- Update skips editors with no config dir and leaves conflicts untouched while
|
|
622
|
-
reporting actionable path context.
|
|
623
|
-
- If the link destination exists as a non-link path, install fails with an
|
|
624
|
-
actionable conflict error.
|
|
625
|
-
|
|
626
|
-
How `--to` works (step-by-step):
|
|
627
|
-
|
|
628
|
-
1. Trekoon always installs/copies to:
|
|
629
|
-
- `<cwd>/.agents/skills/trekoon/SKILL.md`
|
|
630
|
-
2. If `--link` is present, Trekoon creates a `trekoon` symlink directory entry.
|
|
631
|
-
3. `--to <path>` sets the symlink root directory.
|
|
632
|
-
4. Final link path is:
|
|
633
|
-
- `<resolved-to-path>/trekoon -> <relative path to <cwd>/.agents/skills/trekoon>`
|
|
634
|
-
|
|
635
|
-
Example:
|
|
81
|
+
Keep the operator path simple:
|
|
636
82
|
|
|
637
83
|
```bash
|
|
638
|
-
trekoon
|
|
84
|
+
trekoon board open
|
|
639
85
|
```
|
|
640
86
|
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
- `<cwd>/.agents/skills/trekoon/SKILL.md` (copied file)
|
|
644
|
-
- `<cwd>/.custom-editor/skills/trekoon` (symlink)
|
|
645
|
-
- symlink target: relative path to `<cwd>/.agents/skills/trekoon`
|
|
646
|
-
|
|
647
|
-
Trekoon does not mutate global editor config directories.
|
|
648
|
-
|
|
649
|
-
### 10) Pre-merge checklist
|
|
650
|
-
|
|
651
|
-
- [ ] `trekoon sync status` shows no unresolved conflicts
|
|
652
|
-
- [ ] done tasks/subtasks are marked completed
|
|
653
|
-
- [ ] dependency graph has no stale blockers
|
|
654
|
-
- [ ] final AI check: `trekoon --toon epic show <epic-id>`
|
|
655
|
-
- [ ] no one tried to commit `.trekoon/trekoon.db` as a worktree fix
|
|
656
|
-
|
|
657
|
-
## Machine-contract recipes (--toon)
|
|
658
|
-
|
|
659
|
-
Use `--toon` for production agent loops. The examples below show command +
|
|
660
|
-
expected envelope fields.
|
|
661
|
-
|
|
662
|
-
Base envelope fields (all machine responses):
|
|
87
|
+
Use `trekoon board update` only when you want to refresh the copied runtime
|
|
88
|
+
assets without opening a session.
|
|
663
89
|
|
|
664
|
-
|
|
665
|
-
ok: true|false
|
|
666
|
-
command: <stable command id>
|
|
667
|
-
data: <payload>
|
|
668
|
-
metadata:
|
|
669
|
-
contractVersion: "1.0.0"
|
|
670
|
-
requestId: req-<stable-id>
|
|
671
|
-
```
|
|
90
|
+
The browser flow is local-only by design:
|
|
672
91
|
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
92
|
+
- Trekoon copies the board shell and app files into repo-shared storage, so the
|
|
93
|
+
board still starts with one CLI command and no separate frontend build step
|
|
94
|
+
- the board server binds only to `127.0.0.1`
|
|
95
|
+
- every `board open` session uses a per-session token in the URL/API requests
|
|
96
|
+
- command output always includes a manual fallback URL if the browser launch
|
|
97
|
+
fails
|
|
676
98
|
|
|
677
|
-
|
|
99
|
+
Current runtime expectations:
|
|
678
100
|
|
|
679
|
-
-
|
|
680
|
-
-
|
|
681
|
-
|
|
101
|
+
- the local runtime is served from `.trekoon/board`
|
|
102
|
+
- the shell currently loads Vue from `unpkg.com`, Tailwind from
|
|
103
|
+
`cdn.tailwindcss.com`, and Google-hosted fonts/icons when the page renders
|
|
104
|
+
- if your environment blocks those hosts, `trekoon board open` still starts the
|
|
105
|
+
local server, but the browser UI may render without the enhanced shell until
|
|
106
|
+
network access is restored
|
|
682
107
|
|
|
683
|
-
|
|
108
|
+
Current board behavior to expect:
|
|
684
109
|
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
110
|
+
- the topbar is a compact single-row navbar showing the workspace name, active
|
|
111
|
+
epic context, Epics and Board navigation, search, theme toggle, and a
|
|
112
|
+
workspace info popover
|
|
113
|
+
- wide screens show the epic switcher sidebar, task workspace, and task
|
|
114
|
+
inspector together; narrower screens collapse these into stacked panels or
|
|
115
|
+
drawer-style views
|
|
116
|
+
- the page scrolls naturally as a single SPA surface; modal overlays (task
|
|
117
|
+
detail, subtask editor) lock body scroll while open
|
|
118
|
+
- overview cards are the primary entry point into an epic; clicking a card opens
|
|
119
|
+
that epic's board workspace
|
|
120
|
+
- task cards show truncated descriptions; clicking anywhere on a card opens the
|
|
121
|
+
task detail modal with the full description
|
|
122
|
+
- search is debounced and filters client-side across titles, descriptions,
|
|
123
|
+
statuses, and subtask content
|
|
688
124
|
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
```text
|
|
692
|
-
ok: true
|
|
693
|
-
command: task.ready
|
|
694
|
-
data:
|
|
695
|
-
candidates[]:
|
|
696
|
-
task: { id, epicId, title, status, ... }
|
|
697
|
-
readiness: { isReady, reason }
|
|
698
|
-
blockerSummary: { blockedByCount, totalDependencies, blockedBy[] }
|
|
699
|
-
ranking: { rank, blockerCount, statusPriority }
|
|
700
|
-
blocked[]: (same shape, non-ready items)
|
|
701
|
-
summary: {
|
|
702
|
-
totalOpenTasks,
|
|
703
|
-
readyCount,
|
|
704
|
-
returnedCount,
|
|
705
|
-
appliedLimit,
|
|
706
|
-
blockedCount,
|
|
707
|
-
unresolvedDependencyCount,
|
|
708
|
-
}
|
|
709
|
-
```
|
|
125
|
+
For the full lifecycle and examples, read [Quickstart](docs/quickstart.md) and
|
|
126
|
+
[Command reference](docs/commands.md).
|
|
710
127
|
|
|
711
|
-
|
|
128
|
+
## AI skill
|
|
712
129
|
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
```
|
|
130
|
+
Trekoon ships with a bundled `trekoon` skill for AI agents. It teaches the
|
|
131
|
+
agent to:
|
|
716
132
|
|
|
717
|
-
|
|
133
|
+
- use `--toon` by default
|
|
134
|
+
- prefer the smallest sufficient read
|
|
135
|
+
- use bulk planning commands when possible
|
|
136
|
+
- keep progress in Trekoon with append-based updates
|
|
137
|
+
- treat `.trekoon` as shared repo-scoped operational state
|
|
718
138
|
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
command: dep.reverse
|
|
722
|
-
data:
|
|
723
|
-
targetId: <id>
|
|
724
|
-
targetKind: task|subtask
|
|
725
|
-
blockedNodes[]: { id, kind, distance, isDirect }
|
|
726
|
-
```
|
|
139
|
+
Read [AI agents and the Trekoon skill](docs/ai-agents.md) for installation,
|
|
140
|
+
editor linking, recommended skill combinations, and example prompts.
|
|
727
141
|
|
|
728
|
-
|
|
142
|
+
## Read next
|
|
729
143
|
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
- `--cursor <n>` is offset-like pagination for list endpoints (`epic list`,
|
|
738
|
-
`task list`, `subtask list`).
|
|
739
|
-
- Do not combine `--all` with `--cursor`.
|
|
740
|
-
- Machine consumers should page using `meta.pagination.hasMore` and
|
|
741
|
-
`meta.pagination.nextCursor`.
|
|
742
|
-
|
|
743
|
-
Payload fields:
|
|
744
|
-
|
|
745
|
-
```text
|
|
746
|
-
ok: true
|
|
747
|
-
command: task.list
|
|
748
|
-
data:
|
|
749
|
-
tasks[]: ...
|
|
750
|
-
metadata:
|
|
751
|
-
contractVersion: "1.0.0"
|
|
752
|
-
requestId: req-<stable-id>
|
|
753
|
-
meta:
|
|
754
|
-
pagination: { hasMore, nextCursor }
|
|
755
|
-
```
|
|
144
|
+
- [Quickstart](docs/quickstart.md)
|
|
145
|
+
- [Command reference](docs/commands.md)
|
|
146
|
+
- [AI agents and the Trekoon skill](docs/ai-agents.md)
|
|
147
|
+
- [Machine contracts](docs/machine-contracts.md)
|
|
148
|
+
- [Contributing](CONTRIBUTING.md)
|
|
149
|
+
- [Changelog](CHANGELOG.md)
|
|
756
150
|
|
|
757
151
|
## Implementation principles
|
|
758
152
|
|
|
759
153
|
- Minimal, composable modules
|
|
760
154
|
- Strict validation at command boundaries
|
|
761
|
-
- Stable automation
|
|
155
|
+
- Stable automation envelopes for JSON and TOON modes
|
|
762
156
|
- No unnecessary feature sprawl
|