trekoon 0.3.3 → 0.3.5
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/.agents/skills/trekoon/SKILL.md +93 -3
- package/README.md +152 -126
- package/docs/ai-agents.md +105 -104
- package/docs/commands.md +145 -167
- package/docs/machine-contracts.md +240 -68
- package/docs/quickstart.md +78 -148
- package/package.json +1 -1
- package/src/commands/help.ts +249 -253
- package/src/commands/quickstart.ts +73 -77
- package/src/commands/skills.ts +104 -19
- package/src/commands/sync.ts +188 -15
- package/src/domain/tracker-domain.ts +210 -37
- package/src/storage/events-retention.ts +72 -0
- package/src/storage/migrations.ts +28 -0
- package/src/sync/event-writes.ts +8 -6
- package/src/sync/service.ts +299 -64
- package/src/sync/types.ts +36 -0
package/docs/ai-agents.md
CHANGED
|
@@ -1,40 +1,38 @@
|
|
|
1
1
|
# AI agents and the Trekoon skill
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
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
|
|
6
|
+
## What the skill does
|
|
7
7
|
|
|
8
|
-
The bundled `trekoon` skill is the operating guide for agents. It
|
|
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
|
|
13
|
-
- use
|
|
14
|
-
- append progress and blocker notes instead of rewriting
|
|
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
|
|
16
|
+
- treat `.trekoon` as shared repo-scoped state
|
|
17
17
|
|
|
18
|
-
The skill ships with
|
|
19
|
-
|
|
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
|
|
23
|
+
SKILL.md <- command reference, status machine, agent loop
|
|
24
24
|
reference/
|
|
25
|
-
planning.md
|
|
26
|
-
execution.md
|
|
27
|
-
execution-with-team.md
|
|
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
|
|
31
|
-
|
|
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
|
-
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
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
|
|
67
|
-
/trekoon <id>
|
|
68
|
-
/trekoon <id> analyze
|
|
69
|
-
/trekoon <id> execute
|
|
70
|
-
/trekoon <id> plan the implementation
|
|
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
|
-
##
|
|
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
|
-
|
|
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
|
-
|
|
|
82
|
+
| Structured code review | `code-review-expert` | Want review before closing an epic |
|
|
88
83
|
|
|
89
|
-
|
|
84
|
+
Typical flow:
|
|
90
85
|
|
|
91
|
-
1. `/trekoon`
|
|
92
|
-
2. Plan the work (
|
|
93
|
-
3. Create
|
|
94
|
-
4. Execute the plan (
|
|
95
|
-
5. Update progress, blockers, and completion state as
|
|
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
|
|
92
|
+
## Default execution loop
|
|
98
93
|
|
|
99
|
-
The
|
|
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
|
|
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
|
|
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
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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
|
|
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
|
-
|
|
161
|
-
|
|
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
|
-
|
|
164
|
-
|
|
165
|
-
```
|
|
139
|
+
See [Command reference: Status machine](commands.md#status-machine) for the
|
|
140
|
+
full transition table.
|
|
166
141
|
|
|
167
|
-
##
|
|
142
|
+
## Cascade mode
|
|
168
143
|
|
|
169
|
-
When
|
|
170
|
-
|
|
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
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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 |
|
|
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.
|
|
241
|
-
2.
|
|
242
|
-
3.
|
|
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
|
-
-
|
|
255
|
-
- In linked worktrees, `sharedStorageRoot` may differ from `worktreeRoot`.
|
|
256
|
-
|
|
257
|
-
-
|
|
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
|
-
|
|
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
|
|