trekoon 0.2.6 → 0.2.7

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.
@@ -0,0 +1,198 @@
1
+ # AI agents and the Trekoon skill
2
+
3
+ Use this guide when an AI agent needs to plan work in Trekoon, execute it, and
4
+ keep task state current while it works.
5
+
6
+ ## What the `trekoon` skill does
7
+
8
+ The bundled `trekoon` skill is the operating guide for agents. It tells the
9
+ agent to:
10
+
11
+ - use `--toon` on Trekoon commands
12
+ - prefer the smallest sufficient read
13
+ - use transactional bulk planning commands when possible
14
+ - append progress and blocker notes instead of rewriting full descriptions
15
+ - preview scoped replace before `--apply`
16
+ - treat `.trekoon` as shared repo-scoped operational state
17
+
18
+ The canonical installed file lives at:
19
+
20
+ - `.agents/skills/trekoon/SKILL.md`
21
+
22
+ ## Install the skill
23
+
24
+ Install the bundled skill into the repository:
25
+
26
+ ```bash
27
+ trekoon skills install
28
+ ```
29
+
30
+ Create a project-local editor link when your agent environment supports it:
31
+
32
+ ```bash
33
+ trekoon skills install --link --editor opencode
34
+ trekoon skills install --link --editor claude
35
+ trekoon skills install --link --editor pi
36
+ trekoon skills install --link --editor opencode --to ./.custom-editor/skills
37
+ trekoon skills update
38
+ ```
39
+
40
+ Path behavior:
41
+
42
+ - canonical install path: `.agents/skills/trekoon/SKILL.md`
43
+ - default OpenCode link path: `.opencode/skills/trekoon`
44
+ - default Claude link path: `.claude/skills/trekoon`
45
+ - default Pi link path: `.pi/skills/trekoon`
46
+ - `--to <path>` changes only the editor link root
47
+ - `--allow-outside-repo` is for intentional external links
48
+
49
+ ## Recommended skill stack
50
+
51
+ If your agent environment supports skills, this is the cleanest split of
52
+ responsibilities:
53
+
54
+ | Job | Skill | Why |
55
+ | --- | --- | --- |
56
+ | Turn a request into a concrete backlog | `writing-plans` | Breaks work into epics, tasks, subtasks, and dependencies |
57
+ | Create and update tracker state | `trekoon` | Uses Trekoon safely and efficiently |
58
+ | Execute the plan in dependency order | `executing-plans` | Helps the agent work through the backlog without losing the sequence |
59
+ | Clarify architecture before planning | `architecting-systems` | Useful when boundaries or ownership are still fuzzy |
60
+
61
+ In practice, the flow is usually:
62
+
63
+ 1. plan the work
64
+ 2. load `trekoon`
65
+ 3. create or update the Trekoon graph
66
+ 4. execute the next ready task
67
+ 5. update progress, blockers, and completion state as work moves forward
68
+
69
+ ## Default execution loop for agents
70
+
71
+ The main loop is: **session → work → task done → repeat**.
72
+
73
+ Start with a single orientation call:
74
+
75
+ ```bash
76
+ trekoon --toon session
77
+ ```
78
+
79
+ If the session output shows you are behind, pull tracker events before claiming
80
+ work:
81
+
82
+ ```bash
83
+ trekoon --toon sync pull --from main
84
+ ```
85
+
86
+ Claim work, then finish or report a block:
87
+
88
+ ```bash
89
+ trekoon --toon task update <task-id> --status in_progress
90
+ trekoon --toon task done <task-id>
91
+ trekoon --toon task update <task-id> --append "Blocked by <reason>" --status blocked
92
+ ```
93
+
94
+ Use `task done` when the task is actually finished. It marks the task complete
95
+ and returns the next ready candidate with blockers inline.
96
+
97
+ ## Use descendant cascade mode when closing a whole tree
98
+
99
+ When an agent needs to close or reopen an entire epic or task tree from the
100
+ command layer, use positional-ID `update --all` instead of looping one row at a
101
+ time:
102
+
103
+ ```bash
104
+ trekoon --toon epic update <epic-id> --all --status done
105
+ trekoon --toon epic update <epic-id> --all --status todo
106
+ trekoon --toon task update <task-id> --all --status done
107
+ trekoon --toon task update <task-id> --all --status todo
108
+ trekoon --toon subtask update <subtask-id> --all --status done
109
+ ```
110
+
111
+ Notes:
112
+
113
+ - Epic/task cascade mode is atomic: blocked descendants abort the whole update
114
+ - Use it only with `--status done|todo`
115
+ - Do not combine positional ID + `--all` with `--append`, `--description`,
116
+ `--title`, or `--ids`
117
+ - Subtask positional-ID `--all` is accepted for contract consistency, but it is
118
+ equivalent to a normal single-subtask status update
119
+
120
+ ## Tell the agent exactly what to do
121
+
122
+ These prompts work well because they are explicit about the skill order and the
123
+ expected loop.
124
+
125
+ ### Plan first, then create the backlog
126
+
127
+ ```text
128
+ Load writing-plans, break this feature into one epic with tasks and subtasks,
129
+ then load trekoon and create that graph in Trekoon.
130
+ ```
131
+
132
+ ### Execute an existing backlog
133
+
134
+ ```text
135
+ Load trekoon, run `trekoon --toon session`, take the next ready task, do the
136
+ work, append progress notes, mark it done, and repeat until there are no ready
137
+ tasks or you hit a blocker.
138
+ ```
139
+
140
+ ### Use planning, tracking, and execution together
141
+
142
+ ```text
143
+ Load writing-plans to shape the backlog, load trekoon to create and update the
144
+ tasks, then load executing-plans and complete the work in dependency order.
145
+ ```
146
+
147
+ ## Keep reads small and mutations safe
148
+
149
+ Use the narrowest command that answers the question:
150
+
151
+ | Need | Preferred command |
152
+ | --- | --- |
153
+ | Session startup | `trekoon --toon session` |
154
+ | Next task only | `trekoon --toon task next` |
155
+ | A few ready options | `trekoon --toon task ready --limit 5` |
156
+ | One task with subtasks | `trekoon --toon task show <task-id> --all` |
157
+ | One epic tree | `trekoon --toon epic show <epic-id> --all` |
158
+ | Repeated text in one scope | `trekoon --toon epic|task|subtask search ...` |
159
+
160
+ For repeated text changes, use the safe replace loop:
161
+
162
+ 1. search the narrowest valid scope
163
+ 2. preview replace
164
+ 3. run `--apply` only after the preview matches the intended scope
165
+
166
+ Example:
167
+
168
+ ```bash
169
+ trekoon --toon epic search <epic-id> "path/to/somewhere"
170
+ trekoon --toon epic replace <epic-id> --search "path/to/somewhere" --replace "path/to/new-path"
171
+ trekoon --toon epic replace <epic-id> --search "path/to/somewhere" --replace "path/to/new-path" --apply
172
+ ```
173
+
174
+ ## Worktree and sync rules
175
+
176
+ - Treat `meta.storageRootDiagnostics` as the source of truth for storage.
177
+ - In linked worktrees, `sharedStorageRoot` may differ from `worktreeRoot`. That
178
+ is expected.
179
+ - Do not commit `.trekoon/trekoon.db` as a recovery fix.
180
+ - Run `trekoon sync status` at session start and before merge.
181
+ - Resolve sync conflicts explicitly when they appear.
182
+
183
+ Useful commands:
184
+
185
+ ```bash
186
+ trekoon --toon sync status
187
+ trekoon --toon sync pull --from main
188
+ trekoon --toon sync conflicts list
189
+ trekoon --toon sync conflicts show <conflict-id>
190
+ trekoon --toon sync resolve <conflict-id> --use ours
191
+ ```
192
+
193
+ ## Related docs
194
+
195
+ - [Quickstart](quickstart.md)
196
+ - [Command reference](commands.md)
197
+ - [Machine contracts](machine-contracts.md)
198
+ - [Installed skill source](../.agents/skills/trekoon/SKILL.md)
@@ -0,0 +1,126 @@
1
+ # Command reference
2
+
3
+ Use this page when you already know what Trekoon does and just need the command
4
+ surface, defaults, and flag rules.
5
+
6
+ ## Command surface
7
+
8
+ - `trekoon init`
9
+ - `trekoon help [command]`
10
+ - `trekoon quickstart`
11
+ - `trekoon epic <create|expand|list|show|search|replace|update|delete>`
12
+ - `trekoon session`
13
+ - `trekoon task <create|create-many|list|show|ready|next|done|search|replace|update|delete>`
14
+ - `trekoon subtask <create|create-many|list|search|replace|update|delete>`
15
+ - `trekoon dep <add|add-many|remove|list|reverse>`
16
+ - `trekoon events prune [--dry-run] [--archive] [--retention-days <n>]`
17
+ - `trekoon migrate <status|rollback> [--to-version <n>]`
18
+ - `trekoon sync <status|pull|resolve|conflicts>`
19
+ - `trekoon skills install [--link --editor opencode|claude|pi] [--to <path>] [--allow-outside-repo]`
20
+ - `trekoon skills update`
21
+ - `trekoon wipe --yes`
22
+
23
+ ## Global output modes
24
+
25
+ - `--json` for structured JSON output
26
+ - `--toon` for true TOON-encoded output
27
+ - `--compat <mode>` for explicit machine compatibility behavior
28
+ - `--help` for root and command help
29
+ - `--version` for CLI version
30
+
31
+ Global options can be used before or after the command:
32
+
33
+ ```bash
34
+ trekoon --toon quickstart
35
+ trekoon quickstart --toon
36
+ trekoon --json quickstart
37
+ trekoon quickstart --json
38
+ ```
39
+
40
+ Trekoon uses long-form options for command and subcommand flags. Root help and
41
+ version aliases `-h` and `-v` are also supported.
42
+
43
+ ## Human views
44
+
45
+ - List and show commands default to table output in human mode.
46
+ - Use `--view compact` to restore compact pipe output.
47
+ - `epic list`, `task list`, and `subtask list` support `--view table|compact`.
48
+ - `epic show` and `task show` support `--view table|compact|tree|detail`.
49
+
50
+ ## List defaults and filters
51
+
52
+ These defaults apply to `epic list`, `task list`, and `subtask list`:
53
+
54
+ - Default scope: open work only (`in_progress`, `in-progress`, `todo`)
55
+ - Default limit: `10`
56
+ - Status filter: `--status in_progress,todo`
57
+ - Custom limit: `--limit <n>`
58
+ - Cursor pagination: `--cursor <n>`
59
+ - All rows and statuses: `--all`
60
+ - `--all` is mutually exclusive with `--status`, `--limit`, and `--cursor`
61
+
62
+ ## Update modes
63
+
64
+ `epic update`, `task update`, and `subtask update` now have two meanings for
65
+ `--all`, depending on whether you also pass a positional ID.
66
+
67
+ ### Repo-wide bulk mode
68
+
69
+ Use `update --all` or `update --ids <csv>` when you want to target multiple
70
+ top-level rows directly.
71
+
72
+ This mode preserves the existing per-row update behavior. It is **not** the same
73
+ as descendant cascade mode and is not one atomic multi-row transaction.
74
+
75
+ - Target all rows: `--all`
76
+ - Target specific rows: `--ids <id1,id2,...>`
77
+ - Bulk mode supports only `--append <text>`, `--status <status>`, or both
78
+ - In bulk mode, do not pass a positional ID
79
+ - `--all` and `--ids` are mutually exclusive
80
+ - `--append` and `--description` are mutually exclusive
81
+
82
+ Examples:
83
+
84
+ ```bash
85
+ trekoon task update --all --status in_progress
86
+ trekoon task update --ids <task-1>,<task-2> --append "\nFollow-up note"
87
+ trekoon subtask update --all --status done
88
+ trekoon subtask update --ids <subtask-1>,<subtask-2> --append "\nFollow-up note"
89
+ trekoon epic update --ids <epic-1>,<epic-2> --status done
90
+ ```
91
+
92
+ ### Descendant cascade mode
93
+
94
+ Use positional-ID `update <id> --all --status done|todo` when you want to close
95
+ or reopen a whole tree from one root.
96
+
97
+ - `trekoon epic update <epic-id> --all --status done|todo`
98
+ - updates the epic and all descendant tasks/subtasks in one atomic operation
99
+ - `trekoon task update <task-id> --all --status done|todo`
100
+ - updates the task and all descendant subtasks in one atomic operation
101
+ - `trekoon subtask update <subtask-id> --all --status done|todo`
102
+ - accepts the same syntax for consistency, but behaves like a normal
103
+ single-subtask status update because there are no descendants
104
+ - Positional-ID cascade mode supports only `--status done|todo`
105
+ - Do not combine positional ID + `--all` with `--ids`, `--append`,
106
+ `--description`, or `--title`
107
+ - For epic/task cascades, unresolved external dependencies abort the whole
108
+ update with `dependency_blocked`; no partial writes are committed
109
+ - Successful machine output includes `data.cascade` with the root, target
110
+ status, atomic flag, changed IDs, unchanged IDs, and per-kind counts
111
+
112
+ Examples:
113
+
114
+ ```bash
115
+ trekoon epic update <epic-id> --all --status done
116
+ trekoon epic update <epic-id> --all --status todo
117
+ trekoon task update <task-id> --all --status done
118
+ trekoon task update <task-id> --all --status todo
119
+ trekoon subtask update <subtask-id> --all --status done
120
+ ```
121
+
122
+ ## Related docs
123
+
124
+ - [Quickstart](quickstart.md)
125
+ - [AI agents and the Trekoon skill](ai-agents.md)
126
+ - [Machine contracts](machine-contracts.md)
@@ -0,0 +1,253 @@
1
+ # Machine contracts
2
+
3
+ Use `--toon` for production agent loops. Use `--json` only when an integration
4
+ explicitly requires JSON.
5
+
6
+ ## Base envelope
7
+
8
+ All machine responses use the same top-level shape:
9
+
10
+ ```text
11
+ ok: true|false
12
+ command: <stable command id>
13
+ data: <payload>
14
+ metadata:
15
+ contractVersion: "1.0.0"
16
+ requestId: req-<stable-id>
17
+ ```
18
+
19
+ Most subcommand identifiers are dot-namespaced, such as `task.list` or
20
+ `sync.pull`. Root-level commands may use single-token IDs such as `help`,
21
+ `init`, `quickstart`, `wipe`, or `version`.
22
+
23
+ Additional metadata may appear when relevant:
24
+
25
+ - `metadata.compatibility` when `--compat` mode is active
26
+ - `meta.storageRootDiagnostics` when storage resolves from a non-canonical cwd
27
+
28
+ ## Ready queue contract
29
+
30
+ ```bash
31
+ trekoon --toon task ready --limit 3
32
+ ```
33
+
34
+ Payload fields:
35
+
36
+ ```text
37
+ ok: true
38
+ command: task.ready
39
+ data:
40
+ candidates[]:
41
+ task: { id, epicId, title, status, ... }
42
+ readiness: { isReady, reason }
43
+ blockerSummary: { blockedByCount, totalDependencies, blockedBy[] }
44
+ ranking: { rank, blockerCount, statusPriority }
45
+ blocked[]: (same shape, non-ready items)
46
+ summary:
47
+ totalOpenTasks
48
+ readyCount
49
+ returnedCount
50
+ appliedLimit
51
+ blockedCount
52
+ unresolvedDependencyCount
53
+ ```
54
+
55
+ ## Reverse dependency walk
56
+
57
+ ```bash
58
+ trekoon --toon dep reverse <task-or-subtask-id>
59
+ ```
60
+
61
+ Payload fields:
62
+
63
+ ```text
64
+ ok: true
65
+ command: dep.reverse
66
+ data:
67
+ targetId: <id>
68
+ targetKind: task|subtask
69
+ blockedNodes[]: { id, kind, distance, isDirect }
70
+ ```
71
+
72
+ ## Pagination contract for list calls
73
+
74
+ ```bash
75
+ trekoon --toon task list --status todo --limit 2
76
+ trekoon --toon task list --status todo --limit 2 --cursor 2
77
+ ```
78
+
79
+ Cursor rules:
80
+
81
+ - `--cursor <n>` is offset-like pagination for `epic list`, `task list`, and
82
+ `subtask list`
83
+ - do not combine `--all` with `--cursor`
84
+ - machine consumers should page using `meta.pagination.hasMore` and
85
+ `meta.pagination.nextCursor`
86
+
87
+ Payload fields:
88
+
89
+ ```text
90
+ ok: true
91
+ command: task.list
92
+ data:
93
+ tasks[]: ...
94
+ metadata:
95
+ contractVersion: "1.0.0"
96
+ requestId: req-<stable-id>
97
+ meta:
98
+ pagination: { hasMore, nextCursor }
99
+ ```
100
+
101
+ ## Descendant cascade update contract
102
+
103
+ ```bash
104
+ trekoon --toon epic update <epic-id> --all --status done
105
+ trekoon --toon task update <task-id> --all --status todo
106
+ ```
107
+
108
+ Success payload fields for epic/task cascade mode:
109
+
110
+ ```text
111
+ ok: true
112
+ command: epic.update | task.update
113
+ data:
114
+ epic | task: { ...updated root row... }
115
+ cascade:
116
+ mode: descendants
117
+ root: { kind: epic|task, id: <root-id> }
118
+ targetStatus: done|todo
119
+ atomic: true
120
+ changedIds[]
121
+ unchangedIds[]
122
+ counts:
123
+ scope
124
+ changed
125
+ unchanged
126
+ blockers
127
+ changedEpics
128
+ changedTasks
129
+ changedSubtasks
130
+ ```
131
+
132
+ Failure contract for blocked epic/task cascade mode:
133
+
134
+ ```text
135
+ ok: false
136
+ error:
137
+ code: dependency_blocked
138
+ data:
139
+ entity: epic|task
140
+ id: <root-id>
141
+ status: done|todo
142
+ atomic: true
143
+ changedIds[]
144
+ unchangedIds[]
145
+ blockerCount
146
+ blockedNodeIds[]
147
+ unresolvedDependencyIds[]
148
+ blockers[]:
149
+ sourceId
150
+ sourceKind
151
+ dependsOnId
152
+ dependsOnKind
153
+ dependsOnStatus
154
+ inScope
155
+ willCascade
156
+ ```
157
+
158
+ Notes:
159
+
160
+ - `subtask update <subtask-id> --all --status done|todo` is accepted, but it
161
+ returns the normal single-subtask `subtask.update` payload because there are
162
+ no descendants to traverse
163
+ - Cascade mode is reserved for status-only close/reopen operations; combine
164
+ append/title/description changes in separate commands
165
+
166
+ ## Batch create and expand payloads
167
+
168
+ Trekoon uses stable batch payloads for one-shot graph creation and sibling batch
169
+ creation commands.
170
+
171
+ ### `epic create` and `epic expand`
172
+
173
+ ```bash
174
+ trekoon --toon epic create --title "..." --description "..." --task "..."
175
+ trekoon --toon epic expand <epic-id> --task "..."
176
+ ```
177
+
178
+ Payload fields:
179
+
180
+ ```text
181
+ ok: true
182
+ command: epic.create | epic.expand
183
+ data:
184
+ epic: { ... } # epic.create only
185
+ epicId: <epic-id> # epic.expand only
186
+ tasks[]
187
+ subtasks[]
188
+ dependencies[]
189
+ result:
190
+ mappings[]: { kind, tempKey, id }
191
+ counts: { tasks, subtasks, dependencies }
192
+ ```
193
+
194
+ ### `task create-many`
195
+
196
+ ```bash
197
+ trekoon --toon task create-many --epic <epic-id> --task "..."
198
+ ```
199
+
200
+ Payload fields:
201
+
202
+ ```text
203
+ ok: true
204
+ command: task.create-many
205
+ data:
206
+ epicId: <epic-id>
207
+ tasks[]
208
+ result:
209
+ mappings[]: { kind: task, tempKey, id }
210
+ ```
211
+
212
+ ### `subtask create-many`
213
+
214
+ ```bash
215
+ trekoon --toon subtask create-many --task <task-id> --subtask "..."
216
+ ```
217
+
218
+ Payload fields:
219
+
220
+ ```text
221
+ ok: true
222
+ command: subtask.create-many
223
+ data:
224
+ taskId: <task-id>
225
+ subtasks[]
226
+ result:
227
+ mappings[]: { kind: subtask, tempKey, id }
228
+ ```
229
+
230
+ ## Sync compatibility mode
231
+
232
+ Compatibility mode exists for integrations that still consume legacy sync
233
+ command IDs:
234
+
235
+ ```bash
236
+ trekoon --json --compat legacy-sync-command-ids sync status
237
+ trekoon --toon --compat legacy-sync-command-ids sync pull --from main
238
+ ```
239
+
240
+ Behavior:
241
+
242
+ - default output uses canonical dotted IDs such as `sync.status`
243
+ - compatibility mode rewrites sync command IDs to legacy forms such as
244
+ `sync_status`
245
+ - compatibility mode is machine-only and valid only for `sync` commands
246
+ - machine output includes `metadata.compatibility` with migration guidance and
247
+ removal timing
248
+
249
+ ## Related docs
250
+
251
+ - [Quickstart](quickstart.md)
252
+ - [Command reference](commands.md)
253
+ - [AI agents and the Trekoon skill](ai-agents.md)
@@ -0,0 +1,13 @@
1
+ <section name="problem">
2
+ Add a no-install HTML board generated by Trekoon that opens fast and lets developers browse epics, filter/search, and manage tasks with kanban and list views. It should support inline editing, drag-and-drop status changes, and a GitLab-like task detail view with subtasks and dependencies. The board should be created on `trekoon init`, open via a CLI command, and be updatable with a future `trekoon board update` command. Include light/dark mode.
3
+ </section>
4
+
5
+ <section name="findings">
6
+ - Visual design: Soft studio aesthetic with warm neutrals, layered surfaces, subtle gradients, and refined typography to keep dense data readable and calm.
7
+ - Data flow: Pinia as the primary client-side state layer coordinating epics, filters/search, kanban status moves, and task edits across views.
8
+ - UX flow: Emphasize speed, keyboard-first actions, progressive disclosure, inline editing, and context preservation using a split-view layout.
9
+ </section>
10
+
11
+ <section name="recommendation">
12
+ Generate a static `board/index.html` on `trekoon init` with Vue + Tailwind via CDN, Pinia for shared state, and a small JSON payload from `trekoon epic list --all` embedded as initial data. Use a split-view layout: left column for epics and filters/search, right column for epic details with a tabbed kanban/list switch and a task detail drawer. Provide drag-and-drop in kanban to update status, inline edits in list rows, and a GitLab-style task detail view with subtasks and dependencies. Add a `trekoon board open` command to open the HTML file and a `trekoon board update` command to refresh the generated assets. Support light/dark mode via CSS variables and a theme toggle persisted in localStorage.
13
+ </section>