trekoon 0.3.3 → 0.3.4

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.
@@ -10,37 +10,38 @@ const ROOT_HELP = [
10
10
  " trekoon [global-options] <command> [command-options]",
11
11
  "",
12
12
  "Global options:",
13
- " --json Emit stable JSON machine output",
14
- " --toon Emit true TOON-encoded output",
15
- " --compat <mode> Enable explicit machine compatibility mode",
16
- " --help Show root or command help",
13
+ " --json Structured JSON output",
14
+ " --toon TOON-encoded output (preferred for agents)",
15
+ " --compat <mode> Machine compatibility mode",
16
+ " --help Show help for root or a command",
17
17
  " --version Print CLI version",
18
18
  "",
19
19
  "Commands:",
20
- " help Show root or command help",
21
- " init Initialize repo-shared .trekoon storage and DB",
22
- " quickstart Show shared-storage bootstrap + AI execution loop",
23
- " wipe Remove repo-shared Trekoon state (requires --yes)",
24
- " board Local board asset and browser commands",
25
- " epic Epic lifecycle commands",
26
- " task Task lifecycle commands",
27
- " subtask Subtask lifecycle commands",
28
- " dep Dependency graph commands",
29
- " events Event retention and cleanup commands",
30
- " migrate Migration status and rollback commands",
31
- " session One-call agent orientation (diagnostics + sync + next task)",
32
- " sync Cross-branch sync commands",
33
- " skills Skill install/update/link (local and global)",
20
+ " help Show help for root or a command",
21
+ " init Create or re-bootstrap .trekoon storage",
22
+ " quickstart Storage model, agent loop, and common patterns",
23
+ " wipe Delete repo-wide .trekoon state (requires --yes)",
24
+ " board Open or update the local board",
25
+ " epic Create, list, update, search, and track epics",
26
+ " task Create, list, update, search, and complete tasks",
27
+ " subtask Create, list, update, and search subtasks",
28
+ " dep Manage dependency edges between tasks and subtasks",
29
+ " events Prune old sync event log rows",
30
+ " migrate Check schema version or roll back migrations",
31
+ " session Agent orientation (diagnostics + sync + next task)",
32
+ " suggest Priority-ranked next-action suggestions",
33
+ " sync Pull events and resolve conflicts across branches",
34
+ " skills Install, link, or update the Trekoon skill",
34
35
  " update Alias for skills update",
35
36
  ].join("\n");
36
37
 
37
38
  const INIT_HELP = [
38
39
  "Usage: trekoon init [--json|--toon]",
39
40
  "",
40
- "Purpose:",
41
- " Initialize repo-scoped Trekoon storage (.trekoon) and database.",
42
- " In git worktrees, every worktree shares the same repository DB.",
43
- " Keep .trekoon gitignored; committing the SQLite DB is not a recovery path.",
41
+ "Creates or re-bootstraps the repo-scoped .trekoon directory and database.",
42
+ "In worktree setups, every worktree shares the same DB.",
43
+ "",
44
+ "Keep .trekoon gitignored. Committing the SQLite DB is not a recovery path.",
44
45
  "",
45
46
  "Examples:",
46
47
  " trekoon init",
@@ -50,17 +51,19 @@ const INIT_HELP = [
50
51
  const QUICKSTART_HELP = [
51
52
  "Usage: trekoon quickstart [--json|--toon]",
52
53
  "",
53
- "Purpose:",
54
- " Show shared-storage bootstrap, diagnostics, and the canonical AI loop.",
54
+ "Prints the storage model, agent execution loop, and common command patterns.",
55
+ "",
56
+ "Recommended startup flow:",
57
+ " 1. trekoon --toon session",
58
+ " 2. Stop if diagnostics report recoveryRequired or a tracked/ignored mismatch",
59
+ " 3. If behind: trekoon --toon sync pull --from main",
60
+ " 4. Claim work: trekoon --toon task update <task-id> --status in_progress",
61
+ " 5. Finish: trekoon --toon task done <task-id>",
55
62
  "",
56
- "Flow:",
57
- " 1) trekoon --toon init",
58
- " 2) trekoon --toon sync status",
59
- " 3) Fail fast on recoveryRequired or tracked/ignored mismatch diagnostics",
60
- " 4) trekoon --toon task ready --limit 5",
61
- " 5) trekoon --toon task next",
62
- " 6) trekoon --toon dep reverse <task-or-subtask-id>",
63
- " 7) trekoon --toon task update <task-id> --status in_progress",
63
+ "Manual bootstrap (if you need step-by-step):",
64
+ " 1. trekoon --toon init",
65
+ " 2. trekoon --toon sync status",
66
+ " 3. trekoon --toon task next",
64
67
  "",
65
68
  "Examples:",
66
69
  " trekoon quickstart",
@@ -70,16 +73,14 @@ const QUICKSTART_HELP = [
70
73
  const WIPE_HELP = [
71
74
  "Usage: trekoon wipe --yes [--json|--toon]",
72
75
  "",
73
- "Purpose:",
74
- " Remove the repository's shared Trekoon storage directory.",
75
- " In git worktrees this erases the same .trekoon state for every linked worktree.",
76
+ "Deletes the shared .trekoon directory for the entire repository.",
77
+ "In worktree setups, this erases state for every linked worktree.",
76
78
  "",
77
79
  "Options:",
78
- " --yes Required confirmation for destructive repo-wide removal.",
80
+ " --yes Required. Confirms you want the destructive delete.",
79
81
  "",
80
- "Recovery guidance:",
81
- " Use wipe only for explicit destructive recovery.",
82
- " Do not use wipe to fix gitignore mistakes or to replace bootstrap diagnostics.",
82
+ "This is a last-resort recovery tool. Don't use it to fix gitignore",
83
+ "issues or replace proper bootstrap diagnostics.",
83
84
  "",
84
85
  "Examples:",
85
86
  " trekoon wipe --yes",
@@ -89,15 +90,12 @@ const BOARD_HELP = [
89
90
  "Usage: trekoon board <open|update>",
90
91
  "",
91
92
  "Subcommands:",
92
- " open",
93
- " Ensure board assets are installed, start a 127.0.0.1 board server,",
94
- " and launch the browser. Machine output includes server URL, fallback URL,",
95
- " and launch metadata.",
96
- " update",
97
- " Refresh board runtime assets only. Does not start the server or open a browser.",
93
+ " open Install board assets, start a local server on 127.0.0.1,",
94
+ " and open the browser. Returns the board URL and a fallback URL.",
95
+ " update Refresh board runtime assets only. No server, no browser.",
98
96
  "",
99
- "Environment overrides:",
100
- " TREKOON_BOARD_ASSET_ROOT Optional asset source override for tests and local development.",
97
+ "Environment:",
98
+ " TREKOON_BOARD_ASSET_ROOT Override the bundled asset source (tests/dev only).",
101
99
  "",
102
100
  "Examples:",
103
101
  " trekoon board open",
@@ -105,172 +103,135 @@ const BOARD_HELP = [
105
103
  ].join("\n");
106
104
 
107
105
  const EPIC_HELP = [
108
- "Usage: trekoon epic <create|expand|list|show|search|replace|update|delete> [options]",
106
+ "Usage: trekoon epic <create|expand|list|show|search|replace|update|delete|progress> [options]",
109
107
  "",
110
- "Create behavior:",
108
+ "Create:",
111
109
  " trekoon epic create --title \"...\" --description \"...\" [--status <status>]",
112
110
  " trekoon epic create --title \"...\" --description \"...\" [--task <spec>] [--subtask <spec>] [--dep <spec>]",
113
- " Preferred one-shot flow when the full tree is known up front.",
114
- " Uses the same compact spec grammar as epic expand and returns mappings/counts.",
111
+ " When the full tree is known, the second form creates everything in one shot",
112
+ " and returns mappings/counts. Same compact spec grammar as epic expand.",
115
113
  "",
116
- "Expand behavior:",
114
+ "Expand:",
117
115
  " trekoon epic expand <epic-id> [--task <spec>] [--subtask <spec>] [--dep <spec>]",
118
116
  " --task <temp-key>|<title>|<description>|<status>",
119
- ` --subtask <parent-ref>|<temp-key>|<title>|<description>|<status> (use ${"@"}<temp-key> for newly declared parents)`,
120
- ` --dep <source-ref>|<depends-on-ref> (refs can be ids or ${"@"}<temp-key>)`,
121
- " Escapes inside compact specs: \\| for |, \\\\ for \\, \\n, \\r, \\t",
122
- "",
123
- "List behavior:",
124
- " Defaults:",
125
- " - Open statuses only: in_progress, in-progress, todo",
126
- " - Limit: 10",
127
- " Flags:",
128
- " --status <csv> | --limit <n> | --cursor <n> | --all | --view table|compact",
129
- " Pagination:",
130
- " - --cursor is offset-like",
131
- " - Machine modes expose meta.pagination.hasMore / nextCursor",
132
- " Constraints:",
133
- " - --all is mutually exclusive with --status, --limit, and --cursor",
134
- "",
135
- "Show behavior:",
136
- " Views:",
137
- " - table: default view",
138
- " - compact: epic summary",
139
- " - tree: hierarchy",
140
- " - detail: descriptions",
141
- " Machine default:",
142
- " - With --all, machine modes default to detail",
143
- "",
144
- "Search/Replace behavior:",
145
- " search:",
146
- " - trekoon epic search <epic-id> \"search text\"",
147
- " - Options: --fields title|description|title,description, --preview",
148
- " - Scope: epic title/description + descendant task/subtask title/description",
149
- " replace:",
150
- " - trekoon epic replace <epic-id> --search \"text\" --replace \"text\"",
151
- " - Preview is default; use --apply to mutate",
152
- " - --preview and --apply are mutually exclusive",
153
- "",
154
- "Update behavior:",
155
- " Repo-wide bulk mode:",
156
- " trekoon epic update --all --append <text> [--status <status>]",
157
- " trekoon epic update --ids <csv> --append <text> [--status <status>]",
158
- " - preserves existing per-row bulk behavior; not one atomic multi-row update",
159
- " Descendant cascade mode:",
160
- " trekoon epic update <epic-id> --all --status done|todo",
161
- " - cascades atomically through descendant tasks and subtasks",
162
- " - blocked descendants abort the whole update",
163
- " - cascade mode supports only --status done|todo",
164
- " - do not combine positional id + --all with --ids, --append, --description, or --title",
117
+ ` --subtask <parent-ref>|<temp-key>|<title>|<description>|<status> (${"@"}<temp-key> for new parents)`,
118
+ ` --dep <source-ref>|<depends-on-ref> (refs can be IDs or ${"@"}<temp-key>)`,
119
+ " Escapes in compact specs: \\| for |, \\\\ for \\, \\n, \\r, \\t",
120
+ "",
121
+ "List:",
122
+ " Defaults: open work only (in_progress, todo), limit 10.",
123
+ " --status <csv> | --limit <n> | --cursor <n> | --all | --view table|compact",
124
+ " Pagination: --cursor is offset-like. Machine output has meta.pagination.hasMore / nextCursor.",
125
+ " --all is mutually exclusive with --status, --limit, and --cursor.",
126
+ "",
127
+ "Show:",
128
+ " --view table (default) | compact | tree | detail",
129
+ " With --all in machine mode, defaults to detail view.",
130
+ "",
131
+ "Search/Replace:",
132
+ " trekoon epic search <epic-id> \"search text\" [--fields title|description|title,description] [--preview]",
133
+ " Searches epic + descendant task/subtask titles and descriptions.",
134
+ "",
135
+ " trekoon epic replace <epic-id> --search \"text\" --replace \"text\" [--apply]",
136
+ " Preview is default. Use --apply to write changes. --preview and --apply are mutually exclusive.",
137
+ "",
138
+ "Update (bulk mode, no positional ID):",
139
+ " trekoon epic update --all --append <text> [--status <status>]",
140
+ " trekoon epic update --ids <csv> --append <text> [--status <status>]",
141
+ " Per-row updates, not one atomic transaction.",
142
+ "",
143
+ "Update (cascade mode, with positional ID):",
144
+ " trekoon epic update <epic-id> --all --status done|todo",
145
+ " Cascades atomically through all descendant tasks and subtasks.",
146
+ " Blocked descendants abort the whole update. Only --status done|todo is supported.",
147
+ " Don't combine positional ID + --all with --ids, --append, --description, or --title.",
148
+ "",
149
+ "Progress:",
150
+ " trekoon epic progress <epic-id>",
151
+ " Returns done/in_progress/blocked/todo counts, readyCount, and nextCandidate.",
165
152
  ].join("\n");
166
153
 
167
154
  const TASK_HELP = [
168
155
  "Usage: trekoon task <create|create-many|list|show|ready|next|done|search|replace|update|delete> [options]",
169
156
  "",
170
- "Create-many behavior:",
157
+ "Create-many:",
171
158
  " trekoon task create-many --epic <epic-id> --task <spec> [--task <spec> ...]",
172
159
  " --task <temp-key>|<title>|<description>|<status>",
173
- " Rejects unexpected positional arguments and empty required fields.",
174
- " Repeated --task flags are applied in the order provided.",
175
- " Escapes inside compact specs: \\| for |, \\\\ for \\, \\n, \\r, \\t",
176
- "",
177
- "List behavior:",
178
- " Defaults:",
179
- " - Open statuses only: in_progress, in-progress, todo",
180
- " - Limit: 10",
181
- " Flags:",
182
- " --epic <id> | --status <csv> | --limit <n> | --cursor <n> | --all | --view table|compact",
183
- " Pagination:",
184
- " - --cursor is offset-like",
185
- " - Machine modes expose meta.pagination.hasMore / nextCursor",
186
- " Constraints:",
187
- " - --all is mutually exclusive with --status, --limit, and --cursor",
188
- "",
189
- "Show behavior:",
190
- " Views:",
191
- " - table: default view",
192
- " - compact: task summary",
193
- " - tree: hierarchy",
194
- " - detail: descriptions",
195
- " Machine default:",
196
- " - With --all, machine modes default to detail",
197
- "",
198
- "Ready/Next behavior:",
199
- " ready:",
200
- " - Returns deterministic unblocked candidates",
201
- " - Sort order: status, blockers, createdAt, id",
202
- " - Options: --limit <n>, --epic <id>",
203
- " next:",
204
- " - Returns top ready candidate",
205
- " - Option: --epic <id>",
206
- "",
207
- "Search/Replace behavior:",
208
- " search:",
209
- " - trekoon task search <task-id> \"search text\"",
210
- " - Options: --fields title|description|title,description, --preview",
211
- " - Scope: task title/description + descendant subtask title/description",
212
- " replace:",
213
- " - trekoon task replace <task-id> --search \"text\" --replace \"text\"",
214
- " - Preview is default; use --apply to mutate",
215
- " - --preview and --apply are mutually exclusive",
216
- "",
217
- "Update behavior:",
218
- " Repo-wide bulk mode:",
219
- " trekoon task update --all --append <text> [--status <status>]",
220
- " trekoon task update --ids <csv> --append <text> [--status <status>]",
221
- " - preserves existing per-row bulk behavior; not one atomic multi-row update",
222
- " Descendant cascade mode:",
223
- " trekoon task update <task-id> --all --status done|todo",
224
- " - cascades atomically through descendant subtasks",
225
- " - blocked descendants abort the whole update",
226
- " - cascade mode supports only --status done|todo",
227
- " - do not combine positional id + --all with --ids, --append, --description, or --title",
160
+ " Multiple --task flags are applied in order.",
161
+ " Escapes in compact specs: \\| for |, \\\\ for \\, \\n, \\r, \\t",
162
+ "",
163
+ "List:",
164
+ " Defaults: open work only (in_progress, todo), limit 10.",
165
+ " --epic <id> | --status <csv> | --limit <n> | --cursor <n> | --all | --view table|compact",
166
+ " Pagination: --cursor is offset-like. Machine output has meta.pagination.hasMore / nextCursor.",
167
+ " --all is mutually exclusive with --status, --limit, and --cursor.",
168
+ "",
169
+ "Show:",
170
+ " --view table (default) | compact | tree | detail",
171
+ " With --all in machine mode, defaults to detail view.",
172
+ "",
173
+ "Ready/Next:",
174
+ " ready Returns unblocked candidates sorted by status, blockers, createdAt, id.",
175
+ " Options: --limit <n>, --epic <id>",
176
+ " next Returns the top ready candidate. Option: --epic <id>",
177
+ "",
178
+ "Done:",
179
+ " trekoon task done <task-id>",
180
+ " Marks the task complete, auto-transitions through in_progress if needed,",
181
+ " reports unblocked downstream tasks, warns about open subtasks, and returns",
182
+ " the next ready candidate.",
183
+ "",
184
+ "Search/Replace:",
185
+ " trekoon task search <task-id> \"search text\" [--fields title|description|title,description] [--preview]",
186
+ " Searches task + descendant subtask titles and descriptions.",
187
+ "",
188
+ " trekoon task replace <task-id> --search \"text\" --replace \"text\" [--apply]",
189
+ " Preview is default. Use --apply to write changes. --preview and --apply are mutually exclusive.",
190
+ "",
191
+ "Update (bulk mode, no positional ID):",
192
+ " trekoon task update --all --append <text> [--status <status>]",
193
+ " trekoon task update --ids <csv> --append <text> [--status <status>]",
194
+ " Per-row updates, not one atomic transaction.",
195
+ "",
196
+ "Update (cascade mode, with positional ID):",
197
+ " trekoon task update <task-id> --all --status done|todo",
198
+ " Cascades atomically through descendant subtasks.",
199
+ " Blocked descendants abort the whole update. Only --status done|todo is supported.",
200
+ " Don't combine positional ID + --all with --ids, --append, --description, or --title.",
228
201
  ].join("\n");
229
202
 
230
203
  const SUBTASK_HELP = [
231
204
  "Usage: trekoon subtask <create|create-many|list|search|replace|update|delete> [options]",
232
205
  "",
233
- "Create-many behavior:",
206
+ "Create-many:",
234
207
  " trekoon subtask create-many [<task-id>] [--task <task-id>] --subtask <spec> [--subtask <spec> ...]",
235
208
  " --subtask <temp-key>|<title>|<description>|<status>",
236
- " Positional <task-id> and --task may be combined only when equal.",
237
- " Rejects extra positional arguments and empty required fields.",
238
- " Repeated --subtask flags are applied in the order provided.",
239
- " Escapes inside compact specs: \\| for |, \\\\ for \\, \\n, \\r, \\t",
240
- "",
241
- "List behavior:",
242
- " Defaults:",
243
- " - Open statuses only: in_progress, in-progress, todo",
244
- " - Limit: 10",
245
- " Flags:",
246
- " --task <id> | --status <csv> | --limit <n> | --cursor <n> | --all | --view table|compact",
247
- " Pagination:",
248
- " - --cursor is offset-like",
249
- " - Machine modes expose meta.pagination.hasMore / nextCursor",
250
- " Constraints:",
251
- " - --all is mutually exclusive with --status, --limit, and --cursor",
252
- "",
253
- "Search/Replace behavior:",
254
- " search:",
255
- " - trekoon subtask search <subtask-id> \"search text\"",
256
- " - Options: --fields title|description|title,description, --preview",
257
- " - Scope: subtask title/description only",
258
- " replace:",
259
- " - trekoon subtask replace <subtask-id> --search \"text\" --replace \"text\"",
260
- " - Preview is default; use --apply to mutate",
261
- " - --preview and --apply are mutually exclusive",
262
- "",
263
- "Update behavior:",
264
- " Repo-wide bulk mode:",
265
- " trekoon subtask update --all --append <text> [--status <status>]",
266
- " trekoon subtask update --ids <csv> --append <text> [--status <status>]",
267
- " - preserves existing per-row bulk behavior; not one atomic multi-row update",
268
- " Positional-id cascade syntax:",
269
- " trekoon subtask update <subtask-id> --all --status done|todo",
270
- " - accepted for contract consistency",
271
- " - behaves like a normal single-subtask status update",
272
- " - positional id + --all supports only --status done|todo",
273
- " - do not combine positional id + --all with --ids, --append, --description, or --title",
209
+ " Positional <task-id> and --task can be combined only when equal.",
210
+ " Multiple --subtask flags are applied in order.",
211
+ " Escapes in compact specs: \\| for |, \\\\ for \\, \\n, \\r, \\t",
212
+ "",
213
+ "List:",
214
+ " Defaults: open work only (in_progress, todo), limit 10.",
215
+ " --task <id> | --status <csv> | --limit <n> | --cursor <n> | --all | --view table|compact",
216
+ " Pagination: --cursor is offset-like. Machine output has meta.pagination.hasMore / nextCursor.",
217
+ " --all is mutually exclusive with --status, --limit, and --cursor.",
218
+ "",
219
+ "Search/Replace:",
220
+ " trekoon subtask search <subtask-id> \"search text\" [--fields title|description|title,description] [--preview]",
221
+ " Searches subtask title and description only.",
222
+ "",
223
+ " trekoon subtask replace <subtask-id> --search \"text\" --replace \"text\" [--apply]",
224
+ " Preview is default. Use --apply to write changes. --preview and --apply are mutually exclusive.",
225
+ "",
226
+ "Update (bulk mode, no positional ID):",
227
+ " trekoon subtask update --all --append <text> [--status <status>]",
228
+ " trekoon subtask update --ids <csv> --append <text> [--status <status>]",
229
+ " Per-row updates, not one atomic transaction.",
230
+ "",
231
+ "Update (positional-ID cascade syntax):",
232
+ " trekoon subtask update <subtask-id> --all --status done|todo",
233
+ " Accepted for consistency, but just updates the one subtask (no descendants).",
234
+ " Don't combine positional ID + --all with --ids, --append, --description, or --title.",
274
235
  ].join("\n");
275
236
 
276
237
  const DEP_HELP = [
@@ -278,13 +239,12 @@ const DEP_HELP = [
278
239
  "",
279
240
  "Subcommands:",
280
241
  " add <source-id> <depends-on-id>",
281
- " Create dependency edge: source depends on depends-on.",
242
+ " Create a dependency edge: source depends on depends-on.",
282
243
  " add-many --dep <source-ref>|<depends-on-ref> [--dep <spec> ...]",
283
- " Create validated dependency edges from compact specs in order.",
284
- " Standalone add-many resolves persisted ids only; @<temp-key>",
285
- " refs are reserved for higher-level compact batch workflows.",
244
+ " Create multiple edges from compact specs in order.",
245
+ " Uses persisted IDs only; @<temp-key> refs are for batch workflows.",
286
246
  " remove <source-id> <depends-on-id>",
287
- " Remove one dependency edge if it exists.",
247
+ " Remove one dependency edge.",
288
248
  " list <source-id>",
289
249
  " Show direct dependencies for a node.",
290
250
  " reverse <target-id>",
@@ -300,13 +260,12 @@ const DEP_HELP = [
300
260
  const EVENTS_HELP = [
301
261
  "Usage: trekoon events prune [--dry-run] [--archive] [--retention-days <n>]",
302
262
  "",
303
- "Purpose:",
304
- " Manage retention for internal sync event log rows.",
263
+ "Cleans up old sync event log rows.",
305
264
  "",
306
265
  "Options:",
307
- " --dry-run Preview candidate/archive/delete counts only.",
308
- " --archive Copy pruned rows to event_archive before delete.",
309
- " --retention-days <n> Keep last n days (positive integer, default 90).",
266
+ " --dry-run Preview counts only, don't delete anything.",
267
+ " --archive Copy pruned rows to event_archive before deleting.",
268
+ " --retention-days <n> Keep the last n days (positive integer, default 90).",
310
269
  "",
311
270
  "Examples:",
312
271
  " trekoon events prune --dry-run",
@@ -318,10 +277,8 @@ const MIGRATE_HELP = [
318
277
  "Usage: trekoon migrate <status|rollback> [--to-version <n>]",
319
278
  "",
320
279
  "Subcommands:",
321
- " status",
322
- " Show current schema version, latest version, and pending count.",
323
- " rollback [--to-version <n>]",
324
- " Roll back migrations; default target is one version back.",
280
+ " status Show current schema version, latest version, and pending count.",
281
+ " rollback [--to-version <n>] Roll back migrations. Defaults to one version back.",
325
282
  "",
326
283
  "Examples:",
327
284
  " trekoon migrate status",
@@ -334,22 +291,32 @@ const SYNC_HELP = [
334
291
  "",
335
292
  "Subcommands:",
336
293
  " status [--from <branch>]",
337
- " Show ahead/behind counts and pending conflicts vs source branch (default: main).",
294
+ " Ahead/behind counts and pending conflicts vs a source branch (default: main).",
338
295
  " pull --from <branch>",
339
- " Pull and apply upstream tracker events from a source branch.",
296
+ " Pull upstream tracker events from a source branch.",
340
297
  " conflicts list [--mode pending|all]",
341
- " List sync conflicts (default mode: pending).",
298
+ " List sync conflicts (default: pending only).",
342
299
  " conflicts show <conflict-id>",
343
300
  " Show full details for one conflict.",
344
- " resolve <conflict-id> --use ours|theirs",
345
- " Resolve a pending conflict by selecting ours or theirs.",
301
+ " resolve <conflict-id> --use ours|theirs [--dry-run]",
302
+ " Resolve a conflict. --dry-run previews without writing.",
303
+ "",
304
+ "Ours vs theirs:",
305
+ " Conflicts are field-level (e.g., status, title, description on one entity).",
306
+ " --use ours Keep the current DB value. Nothing is written.",
307
+ " --use theirs Overwrite the DB field with the source-branch value.",
346
308
  "",
347
- "Compatibility mode:",
309
+ " Example: epic abc123, field: status",
310
+ " ours (current DB): in_progress",
311
+ " theirs (source branch): done",
312
+ " --use ours -> stays in_progress",
313
+ " --use theirs -> becomes done",
314
+ "",
315
+ "Compatibility:",
348
316
  " --compat legacy-sync-command-ids",
349
- " Emits legacy sync command IDs (sync_status, sync_pull, ...)",
350
- " in machine output only and includes deprecation metadata.",
351
- " Migration: remove --compat and consume dotted IDs (sync.status).",
352
- " Planned compatibility window closes after 2026-09-30.",
317
+ " Emits legacy sync command IDs (sync_status, sync_pull, ...) in machine",
318
+ " output. Includes deprecation metadata. Window closes after 2026-09-30.",
319
+ " Migration: drop --compat and use dotted IDs (sync.status).",
353
320
  "",
354
321
  "Examples:",
355
322
  " trekoon sync status",
@@ -362,15 +329,17 @@ const SYNC_HELP = [
362
329
  ].join("\n");
363
330
 
364
331
  const SESSION_HELP = [
365
- "Usage: trekoon session [--json|--toon]",
332
+ "Usage: trekoon session [--epic <epic-id>] [--json|--toon]",
333
+ "",
334
+ "One-call agent orientation. Opens the DB once and returns:",
335
+ " - diagnostics: storageMode, recoveryRequired, recoveryStatus",
336
+ " - sync: ahead/behind counts and pendingConflicts vs main",
337
+ " - next: full task tree with subtasks for the top ready candidate (null if none)",
338
+ " - nextDeps: blocker list with statuses (empty if none)",
339
+ " - readiness: readyCount and blockedCount across all open tasks",
366
340
  "",
367
- "Purpose:",
368
- " One-call agent orientation. Opens DB once and returns:",
369
- " - diagnostics: storageMode, recoveryRequired, recoveryStatus",
370
- " - sync: ahead/behind counts and pendingConflicts vs main",
371
- " - next: full task tree with subtasks for the top ready candidate (null if none)",
372
- " - nextDeps: blocker list with statuses for the next task (empty if none)",
373
- " - readiness: readyCount and blockedCount across all open tasks",
341
+ "Options:",
342
+ " --epic <epic-id> Scope readiness to a specific epic.",
374
343
  "",
375
344
  "Output modes:",
376
345
  " human Multi-section summary (default in TTY)",
@@ -380,42 +349,59 @@ const SESSION_HELP = [
380
349
  "Examples:",
381
350
  " trekoon session",
382
351
  " trekoon --toon session",
352
+ " trekoon --toon session --epic <epic-id>",
383
353
  " trekoon --json session",
384
354
  ].join("\n");
385
355
 
356
+ const SUGGEST_HELP = [
357
+ "Usage: trekoon suggest [--epic <epic-id>] [--json|--toon]",
358
+ "",
359
+ "Returns up to 3 priority-ranked next-action suggestions based on recovery",
360
+ "state, sync status, task readiness, and epic progress.",
361
+ "",
362
+ "Options:",
363
+ " --epic <epic-id> Scope suggestions to a specific epic.",
364
+ "",
365
+ "Categories:",
366
+ " recovery Storage needs repair",
367
+ " sync Behind main or pending conflicts",
368
+ " execution In-progress or ready tasks to pick up",
369
+ " planning All blocked, epic close, or empty tracker",
370
+ "",
371
+ "Each suggestion includes an action, a ready-to-run command, and a reason.",
372
+ "",
373
+ "Examples:",
374
+ " trekoon suggest",
375
+ " trekoon --toon suggest",
376
+ " trekoon --toon suggest --epic <epic-id>",
377
+ ].join("\n");
378
+
386
379
  const SKILLS_HELP = [
387
380
  "Usage:",
388
381
  " trekoon skills install [--link --editor opencode|claude|pi] [--to <path>] [--allow-outside-repo]",
389
382
  " trekoon skills install -g|--global [--editor opencode|claude|pi]",
390
383
  " trekoon skills update",
391
384
  "",
392
- "Purpose:",
393
- " Install or refresh the Trekoon skill asset locally or globally.",
394
- "",
395
- "Local install behavior (default):",
396
- " - Creates a directory symlink at <cwd>/.agents/skills/trekoon pointing to",
397
- " the bundled package source, so the skill always matches the installed version.",
398
- " - Use --link to also create an editor symlink named 'trekoon'.",
399
- " - --editor is required when --link is used (opencode|claude|pi).",
400
- " - --to overrides the symlink root for --link only.",
401
- " - Without --allow-outside-repo, link targets must resolve inside repo.",
402
- " - --allow-outside-repo requires --link and disables that boundary check.",
403
- "",
404
- "Global install behavior (-g|--global):",
405
- " - Creates a global anchor symlink at ~/.agents/skills/trekoon pointing to",
406
- " the bundled package source.",
407
- " - Creates per-editor symlinks under each editor's global skills directory",
408
- " (~/.claude/skills/, ~/.config/opencode/skills/, ~/.pi/skills/).",
409
- " - Use --editor to install for a single editor only.",
410
- "",
411
- "Update behavior:",
412
- " - Probes and repairs both global and local anchor/editor symlinks.",
413
- " - Reports per-entry status: ok, repointed, created, migrated, skipped.",
414
- " - Skips entries that are not installed; creates local editor links when",
415
- " the editor config dir exists.",
416
- "",
417
- "Alias:",
418
- " trekoon update → trekoon skills update",
385
+ "Installs or refreshes the Trekoon skill so AI agents can plan and execute.",
386
+ "",
387
+ "Local install (default):",
388
+ " Creates a symlink at .agents/skills/trekoon pointing to the bundled source,",
389
+ " so the skill always matches the installed CLI version.",
390
+ " --link Also create an editor symlink named 'trekoon'.",
391
+ " --editor <name> Required with --link (opencode|claude|pi).",
392
+ " --to <path> Override the symlink root for --link only.",
393
+ " --allow-outside-repo Allow links outside the repo (requires --link).",
394
+ "",
395
+ "Global install (-g|--global):",
396
+ " Creates a global symlink at ~/.agents/skills/trekoon and per-editor symlinks",
397
+ " under each editor's global skills directory.",
398
+ " --editor <name> Install for a single editor only.",
399
+ "",
400
+ "Update:",
401
+ " Probes and repairs both global and local symlinks.",
402
+ " Reports per-entry status: ok, repointed, created, migrated, skipped.",
403
+ "",
404
+ "Alias: trekoon update -> trekoon skills update",
419
405
  "",
420
406
  "Examples:",
421
407
  " trekoon skills install",
@@ -441,6 +427,7 @@ const COMMAND_HELP: Record<string, string> = {
441
427
  events: EVENTS_HELP,
442
428
  migrate: MIGRATE_HELP,
443
429
  sync: SYNC_HELP,
430
+ suggest: SUGGEST_HELP,
444
431
  skills: SKILLS_HELP,
445
432
  update: "Usage: trekoon update [--json|--toon]\n\nAlias for: trekoon skills update\n\nProbes and repairs all installed global and local skill symlinks.",
446
433
  help: "Usage: trekoon help [command] [--json|--toon]",