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.
package/docs/ai-agents.md CHANGED
@@ -1,40 +1,38 @@
1
1
  # AI agents and the Trekoon skill
2
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.
3
+ How to wire an AI agent into Trekoon so it can plan work, execute it, and keep
4
+ task state current as it goes.
5
5
 
6
- ## What the `trekoon` skill does
6
+ ## What the skill does
7
7
 
8
- The bundled `trekoon` skill is the operating guide for agents. It tells the
8
+ The bundled `trekoon` skill is the operating guide for agents. It teaches the
9
9
  agent to:
10
10
 
11
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
12
+ - prefer the smallest read that answers the question
13
+ - use batch planning commands when possible
14
+ - append progress and blocker notes instead of rewriting descriptions
15
15
  - preview scoped replace before `--apply`
16
- - treat `.trekoon` as shared repo-scoped operational state
16
+ - treat `.trekoon` as shared repo-scoped state
17
17
 
18
- The skill ships with bundled reference guides for planning and execution so the
19
- agent can handle the full plan-to-completion workflow from a single skill:
18
+ The skill ships with reference guides so the agent can handle the full
19
+ plan-to-completion workflow from one install:
20
20
 
21
21
  ```
22
22
  .agents/skills/trekoon/
23
- SKILL.md command reference, status machine, agent loop
23
+ SKILL.md <- command reference, status machine, agent loop
24
24
  reference/
25
- planning.md decomposition, writing standard, validation
26
- execution.md graph building, lane dispatch, verification
27
- execution-with-team.md Agent Teams pattern (Claude Code only)
25
+ planning.md <- decomposition, writing standard, validation
26
+ execution.md <- graph building, lane dispatch, verification
27
+ execution-with-team.md <- Agent Teams pattern (Claude Code only)
28
28
  ```
29
29
 
30
- The agent reads the relevant reference file on demand `planning.md` when asked
31
- to plan, `execution.md` when asked to execute, `execution-with-team.md` when Agent
30
+ The agent loads the relevant reference on demand: `planning.md` when asked to
31
+ plan, `execution.md` when asked to execute, `execution-with-team.md` when Agent
32
32
  Teams are available.
33
33
 
34
34
  ## Install the skill
35
35
 
36
- Install the bundled skill into the repository:
37
-
38
36
  ```bash
39
37
  trekoon skills install
40
38
  ```
@@ -51,10 +49,10 @@ trekoon skills update
51
49
 
52
50
  Path behavior:
53
51
 
54
- - canonical install path: `.agents/skills/trekoon/SKILL.md`
55
- - default OpenCode link path: `.opencode/skills/trekoon`
56
- - default Claude link path: `.claude/skills/trekoon`
57
- - default Pi link path: `.pi/skills/trekoon`
52
+ - Canonical install: `.agents/skills/trekoon/SKILL.md`
53
+ - OpenCode link: `.opencode/skills/trekoon`
54
+ - Claude link: `.claude/skills/trekoon`
55
+ - Pi link: `.pi/skills/trekoon`
58
56
  - `--to <path>` changes only the editor link root
59
57
  - `--allow-outside-repo` is for intentional external links
60
58
 
@@ -63,40 +61,37 @@ Path behavior:
63
61
  The skill accepts an optional entity ID and action text:
64
62
 
65
63
  ```
66
- /trekoon loads the skill normally
67
- /trekoon <id> resolves the entity, shows status and next steps
68
- /trekoon <id> analyze runs epic progress + suggest, reports findings
69
- /trekoon <id> execute starts the execution loop for the entity's epic
70
- /trekoon <id> plan the implementation decomposes into tasks/subtasks/deps
64
+ /trekoon -> loads the skill normally
65
+ /trekoon <id> -> resolves the entity, shows status and next steps
66
+ /trekoon <id> analyze -> runs epic progress + suggest, reports findings
67
+ /trekoon <id> execute -> starts the execution loop for the entity's epic
68
+ /trekoon <id> plan the implementation -> decomposes into tasks/subtasks/deps
71
69
  ```
72
70
 
73
71
  The skill resolves the ID as an epic, task, or subtask. For tasks and subtasks,
74
72
  it scopes session/suggest/progress calls to the parent epic automatically.
75
73
 
76
- ## Skill stack
77
-
78
- The `trekoon` skill is self-contained for the full plan-to-completion workflow.
79
- It bundles planning methodology, execution orchestration, and the command
80
- reference in one install.
74
+ ## Companion skills
81
75
 
82
- For specialized needs, these optional companion skills add value:
76
+ The `trekoon` skill handles the full plan-to-completion workflow on its own.
77
+ These optional companions add value for specialized needs:
83
78
 
84
79
  | Job | Skill | When to use |
85
80
  | --- | --- | --- |
86
81
  | Clarify architecture before planning | `architecting-systems` | Boundaries or ownership are still fuzzy |
87
- | Specialized code review | `code-review-expert` | Want structured review before closing an epic |
82
+ | Structured code review | `code-review-expert` | Want review before closing an epic |
88
83
 
89
- In practice, the flow is:
84
+ Typical flow:
90
85
 
91
- 1. `/trekoon` load the skill
92
- 2. Plan the work (skill reads `reference/planning.md` internally)
93
- 3. Create or update the Trekoon graph
94
- 4. Execute the plan (skill reads `reference/execution.md` internally)
95
- 5. Update progress, blockers, and completion state as work moves forward
86
+ 1. `/trekoon` to load the skill
87
+ 2. Plan the work (reads `reference/planning.md` internally)
88
+ 3. Create the Trekoon graph
89
+ 4. Execute the plan (reads `reference/execution.md` internally)
90
+ 5. Update progress, blockers, and completion state as you go
96
91
 
97
- ## Default execution loop for agents
92
+ ## Default execution loop
98
93
 
99
- The main loop is: **session work task done repeat**.
94
+ The core loop: **session, work, task done, repeat**.
100
95
 
101
96
  Start with a single orientation call, optionally scoped to an epic:
102
97
 
@@ -105,15 +100,14 @@ trekoon --toon session
105
100
  trekoon --toon session --epic <epic-id>
106
101
  ```
107
102
 
108
- Or use `suggest` for priority-ranked next-action recommendations:
103
+ Or use `suggest` for priority-ranked recommendations:
109
104
 
110
105
  ```bash
111
106
  trekoon --toon suggest
112
107
  trekoon --toon suggest --epic <epic-id>
113
108
  ```
114
109
 
115
- If the session output shows you are behind, pull tracker events before claiming
116
- work:
110
+ If the session shows you're behind, pull tracker events before claiming work:
117
111
 
118
112
  ```bash
119
113
  trekoon --toon sync pull --from main
@@ -127,74 +121,47 @@ trekoon --toon task done <task-id>
127
121
  trekoon --toon task update <task-id> --append "Blocked by <reason>" --status blocked
128
122
  ```
129
123
 
130
- Use `task done` when the task is actually finished. It marks the task complete
131
- and returns the next ready candidate with blockers inline. `task done`
132
- auto-transitions through `in_progress` when the current status is `todo` or
133
- `blocked`. The response also reports newly unblocked downstream tasks and warns
134
- about incomplete subtasks.
135
-
136
- Use `--compact` to strip contract metadata from envelopes when you do not need
137
- it:
124
+ Use `task done` when the task is actually finished. It marks the task complete,
125
+ auto-transitions through `in_progress` if needed, reports newly unblocked
126
+ downstream tasks, warns about incomplete subtasks, and returns the next ready
127
+ candidate. Strip envelope metadata with `--compact` when you don't need it:
138
128
 
139
129
  ```bash
140
130
  trekoon --toon --compact task done <task-id>
141
131
  ```
142
132
 
143
- ## Status machine rules
144
-
145
- Trekoon enforces valid status transitions. Do not attempt direct jumps like
146
- `todo → done` — they will fail with `status_transition_invalid`. Use `task done`
147
- for completing tasks (it handles the intermediate step automatically).
148
-
149
- Valid transitions:
150
-
151
- | From | Allowed targets |
152
- | --- | --- |
153
- | `todo` | `in_progress`, `blocked` |
154
- | `in_progress` | `done`, `blocked` |
155
- | `blocked` | `in_progress`, `todo` |
156
- | `done` | `in_progress` |
157
-
158
- ## Track epic progress
133
+ ## Status machine
159
134
 
160
- Use `epic progress` to get a summary of task status counts and the next ready
161
- candidate for an epic:
135
+ Trekoon enforces valid transitions. Don't try direct jumps like `todo` to
136
+ `done`; they fail with `status_transition_invalid`. Use `task done` for
137
+ completing tasks (it handles the intermediate step).
162
138
 
163
- ```bash
164
- trekoon --toon epic progress <epic-id>
165
- ```
139
+ See [Command reference: Status machine](commands.md#status-machine) for the
140
+ full transition table.
166
141
 
167
- ## Use descendant cascade mode when closing a whole tree
142
+ ## Cascade mode
168
143
 
169
- When an agent needs to close or reopen an entire epic or task tree from the
170
- command layer, use positional-ID `update --all` instead of looping one row at a
171
- time:
144
+ When you need to close or reopen an entire epic or task tree, use positional-ID
145
+ `update --all` instead of looping one row at a time:
172
146
 
173
147
  ```bash
174
148
  trekoon --toon epic update <epic-id> --all --status done
175
- trekoon --toon epic update <epic-id> --all --status todo
176
149
  trekoon --toon task update <task-id> --all --status done
177
- trekoon --toon task update <task-id> --all --status todo
178
- trekoon --toon subtask update <subtask-id> --all --status done
179
150
  ```
180
151
 
181
- Notes:
182
-
183
- - Epic/task cascade mode is atomic: blocked descendants abort the whole update
184
- - Use it only with `--status done|todo`
185
- - Do not combine positional ID + `--all` with `--append`, `--description`,
186
- `--title`, or `--ids`
187
- - Subtask positional-ID `--all` is accepted for contract consistency, but it is
188
- equivalent to a normal single-subtask status update
152
+ Epic and task cascades are atomic. If any descendant is blocked, the whole update
153
+ fails. Only `--status done|todo` is supported. See
154
+ [Command reference: Cascade mode](commands.md#cascade-mode-with-positional-id)
155
+ for the full rules.
189
156
 
190
157
  ## Tell the agent exactly what to do
191
158
 
192
- These prompts work well because they are explicit about the expected workflow.
159
+ These prompts work well because they're explicit about the expected workflow.
193
160
 
194
161
  ### Plan first, then create the backlog
195
162
 
196
163
  ```text
197
- /trekoon plan this feature as one epic with tasks, subtasks, and dependencies,
164
+ /trekoon -- plan this feature as one epic with tasks, subtasks, and dependencies,
198
165
  then create the graph in Trekoon.
199
166
  ```
200
167
 
@@ -207,7 +174,7 @@ then create the graph in Trekoon.
207
174
  Or more explicitly:
208
175
 
209
176
  ```text
210
- /trekoon run session, take the next ready task, do the work, append progress
177
+ /trekoon -- run session, take the next ready task, do the work, append progress
211
178
  notes, mark it done, and repeat until there are no ready tasks or you hit a
212
179
  blocker.
213
180
  ```
@@ -215,7 +182,7 @@ blocker.
215
182
  ### Plan and execute end to end
216
183
 
217
184
  ```text
218
- /trekoon plan this feature, create the backlog, then execute the tasks in
185
+ /trekoon -- plan this feature, create the backlog, then execute the tasks in
219
186
  dependency order until the epic is complete.
220
187
  ```
221
188
 
@@ -223,7 +190,7 @@ dependency order until the epic is complete.
223
190
 
224
191
  Use the narrowest command that answers the question:
225
192
 
226
- | Need | Preferred command |
193
+ | Need | Command |
227
194
  | --- | --- |
228
195
  | Session startup | `trekoon --toon session` |
229
196
  | Session scoped to epic | `trekoon --toon session --epic <epic-id>` |
@@ -237,11 +204,9 @@ Use the narrowest command that answers the question:
237
204
 
238
205
  For repeated text changes, use the safe replace loop:
239
206
 
240
- 1. search the narrowest valid scope
241
- 2. preview replace
242
- 3. run `--apply` only after the preview matches the intended scope
243
-
244
- Example:
207
+ 1. Search the narrowest valid scope
208
+ 2. Preview replace
209
+ 3. Run `--apply` only after the preview matches the intended scope
245
210
 
246
211
  ```bash
247
212
  trekoon --toon epic search <epic-id> "path/to/somewhere"
@@ -249,22 +214,58 @@ trekoon --toon epic replace <epic-id> --search "path/to/somewhere" --replace "pa
249
214
  trekoon --toon epic replace <epic-id> --search "path/to/somewhere" --replace "path/to/new-path" --apply
250
215
  ```
251
216
 
217
+ ## Shared-database model
218
+
219
+ Trekoon uses one live SQLite database per repository at
220
+ `<repoRoot>/.trekoon/trekoon.db`. In worktree setups, storage resolves from the
221
+ shared repository root, so all linked worktrees read and write the same database.
222
+
223
+ What this means for agents:
224
+
225
+ - **Worktrees share state.** A task marked `done` in one worktree is `done`
226
+ everywhere immediately.
227
+ - **Branch checkout doesn't switch tracker state.** The database lives outside
228
+ the git object store. `git checkout feature-branch` doesn't roll back the
229
+ task graph.
230
+ - **Sync moves events, not database snapshots.** Use `sync pull --from main`
231
+ to import events, not file copies.
232
+
252
233
  ## Worktree and sync rules
253
234
 
254
- - Treat `meta.storageRootDiagnostics` as the source of truth for storage.
255
- - In linked worktrees, `sharedStorageRoot` may differ from `worktreeRoot`. That
256
- is expected.
257
- - Do not commit `.trekoon/trekoon.db` as a recovery fix.
235
+ - `meta.storageRootDiagnostics` is the source of truth for storage location.
236
+ - In linked worktrees, `sharedStorageRoot` may differ from `worktreeRoot`.
237
+ That's expected.
238
+ - Don't commit `.trekoon/trekoon.db` as a recovery fix.
258
239
  - Run `trekoon sync status` at session start and before merge.
259
240
  - Resolve sync conflicts explicitly when they appear.
260
241
 
261
- Useful commands:
242
+ ### Ours vs theirs
243
+
244
+ Conflicts are field-level, not whole-record. Each conflict targets a single
245
+ field (`status`, `title`, `description`, etc.) on one entity.
246
+
247
+ - `--use ours` keeps the current DB value. The entity isn't written, but the
248
+ conflict is marked resolved and a resolution event is appended.
249
+ - `--use theirs` overwrites the DB field with the source-branch value.
250
+
251
+ Always inspect conflicts before resolving. Choosing `theirs` without looking
252
+ can overwrite in-progress work. Use `--dry-run` to preview first:
253
+
254
+ ```bash
255
+ trekoon --toon sync resolve <conflict-id> --use theirs --dry-run
256
+ ```
257
+
258
+ In human mode (no `--toon`), `--use theirs` shows a confirmation prompt with a
259
+ 30-second timeout that defaults to rejection. Toon mode skips the prompt.
260
+
261
+ Quick reference:
262
262
 
263
263
  ```bash
264
264
  trekoon --toon sync status
265
265
  trekoon --toon sync pull --from main
266
266
  trekoon --toon sync conflicts list
267
267
  trekoon --toon sync conflicts show <conflict-id>
268
+ trekoon --toon sync resolve <conflict-id> --use theirs --dry-run
268
269
  trekoon --toon sync resolve <conflict-id> --use ours
269
270
  ```
270
271