trekoon 0.3.2 → 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,36 +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 Project-local skill install/update/link",
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",
35
+ " update Alias for skills update",
34
36
  ].join("\n");
35
37
 
36
38
  const INIT_HELP = [
37
39
  "Usage: trekoon init [--json|--toon]",
38
40
  "",
39
- "Purpose:",
40
- " Initialize repo-scoped Trekoon storage (.trekoon) and database.",
41
- " In git worktrees, every worktree shares the same repository DB.",
42
- " 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.",
43
45
  "",
44
46
  "Examples:",
45
47
  " trekoon init",
@@ -49,17 +51,19 @@ const INIT_HELP = [
49
51
  const QUICKSTART_HELP = [
50
52
  "Usage: trekoon quickstart [--json|--toon]",
51
53
  "",
52
- "Purpose:",
53
- " 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>",
54
62
  "",
55
- "Flow:",
56
- " 1) trekoon --toon init",
57
- " 2) trekoon --toon sync status",
58
- " 3) Fail fast on recoveryRequired or tracked/ignored mismatch diagnostics",
59
- " 4) trekoon --toon task ready --limit 5",
60
- " 5) trekoon --toon task next",
61
- " 6) trekoon --toon dep reverse <task-or-subtask-id>",
62
- " 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",
63
67
  "",
64
68
  "Examples:",
65
69
  " trekoon quickstart",
@@ -69,16 +73,14 @@ const QUICKSTART_HELP = [
69
73
  const WIPE_HELP = [
70
74
  "Usage: trekoon wipe --yes [--json|--toon]",
71
75
  "",
72
- "Purpose:",
73
- " Remove the repository's shared Trekoon storage directory.",
74
- " 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.",
75
78
  "",
76
79
  "Options:",
77
- " --yes Required confirmation for destructive repo-wide removal.",
80
+ " --yes Required. Confirms you want the destructive delete.",
78
81
  "",
79
- "Recovery guidance:",
80
- " Use wipe only for explicit destructive recovery.",
81
- " 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.",
82
84
  "",
83
85
  "Examples:",
84
86
  " trekoon wipe --yes",
@@ -88,15 +90,12 @@ const BOARD_HELP = [
88
90
  "Usage: trekoon board <open|update>",
89
91
  "",
90
92
  "Subcommands:",
91
- " open",
92
- " Ensure board assets are installed, start a 127.0.0.1 board server,",
93
- " and launch the browser. Machine output includes server URL, fallback URL,",
94
- " and launch metadata.",
95
- " update",
96
- " 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.",
97
96
  "",
98
- "Environment overrides:",
99
- " 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).",
100
99
  "",
101
100
  "Examples:",
102
101
  " trekoon board open",
@@ -104,172 +103,135 @@ const BOARD_HELP = [
104
103
  ].join("\n");
105
104
 
106
105
  const EPIC_HELP = [
107
- "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]",
108
107
  "",
109
- "Create behavior:",
108
+ "Create:",
110
109
  " trekoon epic create --title \"...\" --description \"...\" [--status <status>]",
111
110
  " trekoon epic create --title \"...\" --description \"...\" [--task <spec>] [--subtask <spec>] [--dep <spec>]",
112
- " Preferred one-shot flow when the full tree is known up front.",
113
- " 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.",
114
113
  "",
115
- "Expand behavior:",
114
+ "Expand:",
116
115
  " trekoon epic expand <epic-id> [--task <spec>] [--subtask <spec>] [--dep <spec>]",
117
116
  " --task <temp-key>|<title>|<description>|<status>",
118
- ` --subtask <parent-ref>|<temp-key>|<title>|<description>|<status> (use ${"@"}<temp-key> for newly declared parents)`,
119
- ` --dep <source-ref>|<depends-on-ref> (refs can be ids or ${"@"}<temp-key>)`,
120
- " Escapes inside compact specs: \\| for |, \\\\ for \\, \\n, \\r, \\t",
121
- "",
122
- "List behavior:",
123
- " Defaults:",
124
- " - Open statuses only: in_progress, in-progress, todo",
125
- " - Limit: 10",
126
- " Flags:",
127
- " --status <csv> | --limit <n> | --cursor <n> | --all | --view table|compact",
128
- " Pagination:",
129
- " - --cursor is offset-like",
130
- " - Machine modes expose meta.pagination.hasMore / nextCursor",
131
- " Constraints:",
132
- " - --all is mutually exclusive with --status, --limit, and --cursor",
133
- "",
134
- "Show behavior:",
135
- " Views:",
136
- " - table: default view",
137
- " - compact: epic summary",
138
- " - tree: hierarchy",
139
- " - detail: descriptions",
140
- " Machine default:",
141
- " - With --all, machine modes default to detail",
142
- "",
143
- "Search/Replace behavior:",
144
- " search:",
145
- " - trekoon epic search <epic-id> \"search text\"",
146
- " - Options: --fields title|description|title,description, --preview",
147
- " - Scope: epic title/description + descendant task/subtask title/description",
148
- " replace:",
149
- " - trekoon epic replace <epic-id> --search \"text\" --replace \"text\"",
150
- " - Preview is default; use --apply to mutate",
151
- " - --preview and --apply are mutually exclusive",
152
- "",
153
- "Update behavior:",
154
- " Repo-wide bulk mode:",
155
- " trekoon epic update --all --append <text> [--status <status>]",
156
- " trekoon epic update --ids <csv> --append <text> [--status <status>]",
157
- " - preserves existing per-row bulk behavior; not one atomic multi-row update",
158
- " Descendant cascade mode:",
159
- " trekoon epic update <epic-id> --all --status done|todo",
160
- " - cascades atomically through descendant tasks and subtasks",
161
- " - blocked descendants abort the whole update",
162
- " - cascade mode supports only --status done|todo",
163
- " - 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.",
164
152
  ].join("\n");
165
153
 
166
154
  const TASK_HELP = [
167
155
  "Usage: trekoon task <create|create-many|list|show|ready|next|done|search|replace|update|delete> [options]",
168
156
  "",
169
- "Create-many behavior:",
157
+ "Create-many:",
170
158
  " trekoon task create-many --epic <epic-id> --task <spec> [--task <spec> ...]",
171
159
  " --task <temp-key>|<title>|<description>|<status>",
172
- " Rejects unexpected positional arguments and empty required fields.",
173
- " Repeated --task flags are applied in the order provided.",
174
- " Escapes inside compact specs: \\| for |, \\\\ for \\, \\n, \\r, \\t",
175
- "",
176
- "List behavior:",
177
- " Defaults:",
178
- " - Open statuses only: in_progress, in-progress, todo",
179
- " - Limit: 10",
180
- " Flags:",
181
- " --epic <id> | --status <csv> | --limit <n> | --cursor <n> | --all | --view table|compact",
182
- " Pagination:",
183
- " - --cursor is offset-like",
184
- " - Machine modes expose meta.pagination.hasMore / nextCursor",
185
- " Constraints:",
186
- " - --all is mutually exclusive with --status, --limit, and --cursor",
187
- "",
188
- "Show behavior:",
189
- " Views:",
190
- " - table: default view",
191
- " - compact: task summary",
192
- " - tree: hierarchy",
193
- " - detail: descriptions",
194
- " Machine default:",
195
- " - With --all, machine modes default to detail",
196
- "",
197
- "Ready/Next behavior:",
198
- " ready:",
199
- " - Returns deterministic unblocked candidates",
200
- " - Sort order: status, blockers, createdAt, id",
201
- " - Options: --limit <n>, --epic <id>",
202
- " next:",
203
- " - Returns top ready candidate",
204
- " - Option: --epic <id>",
205
- "",
206
- "Search/Replace behavior:",
207
- " search:",
208
- " - trekoon task search <task-id> \"search text\"",
209
- " - Options: --fields title|description|title,description, --preview",
210
- " - Scope: task title/description + descendant subtask title/description",
211
- " replace:",
212
- " - trekoon task replace <task-id> --search \"text\" --replace \"text\"",
213
- " - Preview is default; use --apply to mutate",
214
- " - --preview and --apply are mutually exclusive",
215
- "",
216
- "Update behavior:",
217
- " Repo-wide bulk mode:",
218
- " trekoon task update --all --append <text> [--status <status>]",
219
- " trekoon task update --ids <csv> --append <text> [--status <status>]",
220
- " - preserves existing per-row bulk behavior; not one atomic multi-row update",
221
- " Descendant cascade mode:",
222
- " trekoon task update <task-id> --all --status done|todo",
223
- " - cascades atomically through descendant subtasks",
224
- " - blocked descendants abort the whole update",
225
- " - cascade mode supports only --status done|todo",
226
- " - 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.",
227
201
  ].join("\n");
228
202
 
229
203
  const SUBTASK_HELP = [
230
204
  "Usage: trekoon subtask <create|create-many|list|search|replace|update|delete> [options]",
231
205
  "",
232
- "Create-many behavior:",
206
+ "Create-many:",
233
207
  " trekoon subtask create-many [<task-id>] [--task <task-id>] --subtask <spec> [--subtask <spec> ...]",
234
208
  " --subtask <temp-key>|<title>|<description>|<status>",
235
- " Positional <task-id> and --task may be combined only when equal.",
236
- " Rejects extra positional arguments and empty required fields.",
237
- " Repeated --subtask flags are applied in the order provided.",
238
- " Escapes inside compact specs: \\| for |, \\\\ for \\, \\n, \\r, \\t",
239
- "",
240
- "List behavior:",
241
- " Defaults:",
242
- " - Open statuses only: in_progress, in-progress, todo",
243
- " - Limit: 10",
244
- " Flags:",
245
- " --task <id> | --status <csv> | --limit <n> | --cursor <n> | --all | --view table|compact",
246
- " Pagination:",
247
- " - --cursor is offset-like",
248
- " - Machine modes expose meta.pagination.hasMore / nextCursor",
249
- " Constraints:",
250
- " - --all is mutually exclusive with --status, --limit, and --cursor",
251
- "",
252
- "Search/Replace behavior:",
253
- " search:",
254
- " - trekoon subtask search <subtask-id> \"search text\"",
255
- " - Options: --fields title|description|title,description, --preview",
256
- " - Scope: subtask title/description only",
257
- " replace:",
258
- " - trekoon subtask replace <subtask-id> --search \"text\" --replace \"text\"",
259
- " - Preview is default; use --apply to mutate",
260
- " - --preview and --apply are mutually exclusive",
261
- "",
262
- "Update behavior:",
263
- " Repo-wide bulk mode:",
264
- " trekoon subtask update --all --append <text> [--status <status>]",
265
- " trekoon subtask update --ids <csv> --append <text> [--status <status>]",
266
- " - preserves existing per-row bulk behavior; not one atomic multi-row update",
267
- " Positional-id cascade syntax:",
268
- " trekoon subtask update <subtask-id> --all --status done|todo",
269
- " - accepted for contract consistency",
270
- " - behaves like a normal single-subtask status update",
271
- " - positional id + --all supports only --status done|todo",
272
- " - 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.",
273
235
  ].join("\n");
274
236
 
275
237
  const DEP_HELP = [
@@ -277,13 +239,12 @@ const DEP_HELP = [
277
239
  "",
278
240
  "Subcommands:",
279
241
  " add <source-id> <depends-on-id>",
280
- " Create dependency edge: source depends on depends-on.",
242
+ " Create a dependency edge: source depends on depends-on.",
281
243
  " add-many --dep <source-ref>|<depends-on-ref> [--dep <spec> ...]",
282
- " Create validated dependency edges from compact specs in order.",
283
- " Standalone add-many resolves persisted ids only; @<temp-key>",
284
- " 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.",
285
246
  " remove <source-id> <depends-on-id>",
286
- " Remove one dependency edge if it exists.",
247
+ " Remove one dependency edge.",
287
248
  " list <source-id>",
288
249
  " Show direct dependencies for a node.",
289
250
  " reverse <target-id>",
@@ -299,13 +260,12 @@ const DEP_HELP = [
299
260
  const EVENTS_HELP = [
300
261
  "Usage: trekoon events prune [--dry-run] [--archive] [--retention-days <n>]",
301
262
  "",
302
- "Purpose:",
303
- " Manage retention for internal sync event log rows.",
263
+ "Cleans up old sync event log rows.",
304
264
  "",
305
265
  "Options:",
306
- " --dry-run Preview candidate/archive/delete counts only.",
307
- " --archive Copy pruned rows to event_archive before delete.",
308
- " --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).",
309
269
  "",
310
270
  "Examples:",
311
271
  " trekoon events prune --dry-run",
@@ -317,10 +277,8 @@ const MIGRATE_HELP = [
317
277
  "Usage: trekoon migrate <status|rollback> [--to-version <n>]",
318
278
  "",
319
279
  "Subcommands:",
320
- " status",
321
- " Show current schema version, latest version, and pending count.",
322
- " rollback [--to-version <n>]",
323
- " 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.",
324
282
  "",
325
283
  "Examples:",
326
284
  " trekoon migrate status",
@@ -333,22 +291,32 @@ const SYNC_HELP = [
333
291
  "",
334
292
  "Subcommands:",
335
293
  " status [--from <branch>]",
336
- " 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).",
337
295
  " pull --from <branch>",
338
- " Pull and apply upstream tracker events from a source branch.",
296
+ " Pull upstream tracker events from a source branch.",
339
297
  " conflicts list [--mode pending|all]",
340
- " List sync conflicts (default mode: pending).",
298
+ " List sync conflicts (default: pending only).",
341
299
  " conflicts show <conflict-id>",
342
300
  " Show full details for one conflict.",
343
- " resolve <conflict-id> --use ours|theirs",
344
- " 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.",
345
308
  "",
346
- "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:",
347
316
  " --compat legacy-sync-command-ids",
348
- " Emits legacy sync command IDs (sync_status, sync_pull, ...)",
349
- " in machine output only and includes deprecation metadata.",
350
- " Migration: remove --compat and consume dotted IDs (sync.status).",
351
- " 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).",
352
320
  "",
353
321
  "Examples:",
354
322
  " trekoon sync status",
@@ -361,15 +329,17 @@ const SYNC_HELP = [
361
329
  ].join("\n");
362
330
 
363
331
  const SESSION_HELP = [
364
- "Usage: trekoon session [--json|--toon]",
332
+ "Usage: trekoon session [--epic <epic-id>] [--json|--toon]",
365
333
  "",
366
- "Purpose:",
367
- " One-call agent orientation. Opens DB once and returns:",
368
- " - diagnostics: storageMode, recoveryRequired, recoveryStatus",
369
- " - sync: ahead/behind counts and pendingConflicts vs main",
370
- " - next: full task tree with subtasks for the top ready candidate (null if none)",
371
- " - nextDeps: blocker list with statuses for the next task (empty if none)",
372
- " - readiness: readyCount and blockedCount across all open tasks",
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",
340
+ "",
341
+ "Options:",
342
+ " --epic <epic-id> Scope readiness to a specific epic.",
373
343
  "",
374
344
  "Output modes:",
375
345
  " human Multi-section summary (default in TTY)",
@@ -379,37 +349,69 @@ const SESSION_HELP = [
379
349
  "Examples:",
380
350
  " trekoon session",
381
351
  " trekoon --toon session",
352
+ " trekoon --toon session --epic <epic-id>",
382
353
  " trekoon --json session",
383
354
  ].join("\n");
384
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
+
385
379
  const SKILLS_HELP = [
386
380
  "Usage:",
387
381
  " trekoon skills install [--link --editor opencode|claude|pi] [--to <path>] [--allow-outside-repo]",
382
+ " trekoon skills install -g|--global [--editor opencode|claude|pi]",
388
383
  " trekoon skills update",
389
384
  "",
390
- "Purpose:",
391
- " Install or refresh the project-local Trekoon skill asset.",
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.",
392
399
  "",
393
- "Install behavior:",
394
- " - Always installs canonical file to:",
395
- " <cwd>/.agents/skills/trekoon/SKILL.md",
396
- " - Use --link to also create an editor symlink named 'trekoon'.",
397
- " - --editor is required when --link is used (opencode|claude|pi).",
398
- " - --to overrides the symlink root for --link only.",
399
- " - Without --allow-outside-repo, link targets must resolve inside repo.",
400
- " - --allow-outside-repo requires --link and disables that boundary check.",
400
+ "Update:",
401
+ " Probes and repairs both global and local symlinks.",
402
+ " Reports per-entry status: ok, repointed, created, migrated, skipped.",
401
403
  "",
402
- "Update behavior:",
403
- " - Refreshes canonical SKILL file in the install path above.",
404
- " - Auto-creates or refreshes editor symlinks when editor config dir exists.",
405
- " - Skips editors with no config dir or conflicting paths.",
404
+ "Alias: trekoon update -> trekoon skills update",
406
405
  "",
407
406
  "Examples:",
408
407
  " trekoon skills install",
408
+ " trekoon skills install -g",
409
+ " trekoon skills install --global --editor claude",
409
410
  " trekoon skills install --link --editor opencode",
410
411
  " trekoon skills install --link --editor claude --to .claude/skills",
411
412
  " trekoon skills install --link --editor pi --to ../shared/skills --allow-outside-repo",
412
413
  " trekoon skills update",
414
+ " trekoon update",
413
415
  ].join("\n");
414
416
 
415
417
  const COMMAND_HELP: Record<string, string> = {
@@ -425,7 +427,9 @@ const COMMAND_HELP: Record<string, string> = {
425
427
  events: EVENTS_HELP,
426
428
  migrate: MIGRATE_HELP,
427
429
  sync: SYNC_HELP,
430
+ suggest: SUGGEST_HELP,
428
431
  skills: SKILLS_HELP,
432
+ update: "Usage: trekoon update [--json|--toon]\n\nAlias for: trekoon skills update\n\nProbes and repairs all installed global and local skill symlinks.",
429
433
  help: "Usage: trekoon help [command] [--json|--toon]",
430
434
  };
431
435