trekoon 0.2.9 → 0.3.1
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 +162 -26
- package/README.md +18 -15
- package/docs/ai-agents.md +49 -4
- package/docs/commands.md +90 -16
- package/docs/machine-contracts.md +120 -0
- package/docs/plans/r1-unified-skill-rewrite.md +290 -0
- package/docs/plans/r10-suggest-command-skill-integration.md +152 -0
- package/docs/plans/r9-task-done-diff-skill-integration.md +113 -0
- package/docs/quickstart.md +41 -12
- package/package.json +23 -1
- package/src/board/assets/app.js +1 -0
- package/src/board/assets/components/EpicRow.js +21 -6
- package/src/board/assets/components/EpicsOverview.js +5 -1
- package/src/board/assets/components/Notice.js +19 -12
- package/src/board/assets/components/Workspace.js +16 -5
- package/src/board/assets/components/helpers.js +17 -0
- package/src/board/assets/runtime/clipboard.js +34 -0
- package/src/board/assets/runtime/delegation.js +33 -0
- package/src/board/assets/state/actions.js +68 -0
- package/src/board/assets/state/store.js +1 -0
- package/src/board/assets/styles/board.css +156 -36
- package/src/board/routes.ts +2 -0
- package/src/commands/epic.ts +74 -3
- package/src/commands/session.ts +7 -75
- package/src/commands/subtask.ts +7 -5
- package/src/commands/suggest.ts +283 -0
- package/src/commands/sync-helpers.ts +75 -0
- package/src/commands/task-readiness.ts +8 -20
- package/src/commands/task.ts +59 -3
- package/src/domain/mutation-service.ts +69 -42
- package/src/domain/tracker-domain.ts +151 -22
- package/src/domain/types.ts +12 -0
- package/src/index.ts +1 -1
- package/src/io/output.ts +4 -2
- package/src/runtime/cli-shell.ts +26 -3
- package/src/runtime/command-types.ts +1 -1
- package/src/storage/database.ts +43 -1
- package/src/storage/events-retention.ts +57 -8
- package/src/storage/migrations.ts +58 -3
- package/src/sync/service.ts +101 -24
- package/src/sync/types.ts +1 -0
|
@@ -246,6 +246,126 @@ Behavior:
|
|
|
246
246
|
- machine output includes `metadata.compatibility` with migration guidance and
|
|
247
247
|
removal timing
|
|
248
248
|
|
|
249
|
+
## Compact envelope mode
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
trekoon --toon --compact task list
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
When `--compact` is passed, the `metadata` key is omitted from the TOON/JSON
|
|
256
|
+
envelope. The `ok`, `command`, `data`, `error`, and `meta` keys are unaffected.
|
|
257
|
+
|
|
258
|
+
## Status transition error contract
|
|
259
|
+
|
|
260
|
+
Invalid status transitions return:
|
|
261
|
+
|
|
262
|
+
```text
|
|
263
|
+
ok: false
|
|
264
|
+
error:
|
|
265
|
+
code: status_transition_invalid
|
|
266
|
+
message: "cannot transition <kind> <id> from '<from>' to '<to>'"
|
|
267
|
+
details:
|
|
268
|
+
entity: epic|task|subtask
|
|
269
|
+
id: <entity-id>
|
|
270
|
+
fromStatus: <current-status>
|
|
271
|
+
toStatus: <attempted-status>
|
|
272
|
+
allowedTransitions[]: <valid targets from current status>
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
## Epic progress contract
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
trekoon --toon epic progress <epic-id>
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
Payload fields:
|
|
282
|
+
|
|
283
|
+
```text
|
|
284
|
+
ok: true
|
|
285
|
+
command: epic.progress
|
|
286
|
+
data:
|
|
287
|
+
epicId: <epic-id>
|
|
288
|
+
title: <epic-title>
|
|
289
|
+
total
|
|
290
|
+
doneCount
|
|
291
|
+
inProgressCount
|
|
292
|
+
blockedCount
|
|
293
|
+
todoCount
|
|
294
|
+
readyCount
|
|
295
|
+
nextCandidate: { id, title } | null
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
## Task done enhanced contract
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
trekoon --toon task done <task-id>
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
Payload fields:
|
|
305
|
+
|
|
306
|
+
```text
|
|
307
|
+
ok: true
|
|
308
|
+
command: task.done
|
|
309
|
+
data:
|
|
310
|
+
completed: { ...task record... }
|
|
311
|
+
openSubtaskCount
|
|
312
|
+
openSubtaskIds[]
|
|
313
|
+
warning: "Warning: N subtask(s) still open." | null
|
|
314
|
+
unblocked[]:
|
|
315
|
+
id
|
|
316
|
+
kind: task
|
|
317
|
+
title
|
|
318
|
+
status
|
|
319
|
+
wasBlockedBy[]
|
|
320
|
+
next: { ...task tree... } | null
|
|
321
|
+
nextDeps[]
|
|
322
|
+
readiness:
|
|
323
|
+
readyCount
|
|
324
|
+
blockedCount
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
## Suggest command contract
|
|
328
|
+
|
|
329
|
+
```bash
|
|
330
|
+
trekoon --toon suggest [--epic <epic-id>]
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
Payload fields:
|
|
334
|
+
|
|
335
|
+
```text
|
|
336
|
+
ok: true
|
|
337
|
+
command: suggest
|
|
338
|
+
data:
|
|
339
|
+
suggestions[]:
|
|
340
|
+
priority
|
|
341
|
+
action
|
|
342
|
+
command
|
|
343
|
+
reason
|
|
344
|
+
category: recovery|sync|execution|planning
|
|
345
|
+
context:
|
|
346
|
+
totalEpics
|
|
347
|
+
activeEpic: <epic-id> | null
|
|
348
|
+
readyTasks
|
|
349
|
+
blockedTasks
|
|
350
|
+
inProgressTasks
|
|
351
|
+
syncBehind
|
|
352
|
+
pendingConflicts
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
## Owner field in update payloads
|
|
356
|
+
|
|
357
|
+
Task and subtask update payloads now include `owner` in their event data:
|
|
358
|
+
|
|
359
|
+
```text
|
|
360
|
+
data:
|
|
361
|
+
task | subtask:
|
|
362
|
+
...existing fields...
|
|
363
|
+
owner: <string> | null
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
The board API accepts `owner` on `PATCH /api/tasks/{id}` and
|
|
367
|
+
`PATCH /api/subtasks/{id}`.
|
|
368
|
+
|
|
249
369
|
## Related docs
|
|
250
370
|
|
|
251
371
|
- [Quickstart](quickstart.md)
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
# R1: Unified Trekoon Skill Rewrite
|
|
2
|
+
|
|
3
|
+
## Problem
|
|
4
|
+
|
|
5
|
+
The current skill stack requires three separate files loaded simultaneously:
|
|
6
|
+
|
|
7
|
+
| File | Lines | Tokens (~) | Purpose |
|
|
8
|
+
|------|-------|-----------|---------|
|
|
9
|
+
| `writing-plans/SKILL.md` | 264 | ~1300 | Planning methodology + Trekoon commands |
|
|
10
|
+
| `executing-plans/SKILL.md` | 205 | ~1000 | Execution orchestration + Trekoon commands |
|
|
11
|
+
| `trekoon/SKILL.md` | 333 | ~1600 | CLI operating guide |
|
|
12
|
+
| **Total** | **802** | **~3900** | |
|
|
13
|
+
|
|
14
|
+
Issues:
|
|
15
|
+
- ~800 lines of instructions loaded into every agent's context
|
|
16
|
+
- Significant duplication: `--toon` usage explained 3x, compact spec escaping 2x, session/next/done loop 2x
|
|
17
|
+
- `executing-plans` and `executing-plans-wt` are 80% identical
|
|
18
|
+
- Without the external skills, the base `trekoon` SKILL.md teaches mechanics but not methodology
|
|
19
|
+
- Agent must load 3 skills to get the full plan-execute workflow
|
|
20
|
+
|
|
21
|
+
## Proposed Solution
|
|
22
|
+
|
|
23
|
+
Replace the three-file stack with a single enhanced `SKILL.md` that has three operating modes activated by context. The agent loads ONE file and gets planning methodology, execution orchestration, AND CLI operations in ~450 lines (~2200 tokens) — a 44% reduction.
|
|
24
|
+
|
|
25
|
+
The `executing-plans-wt` variant stays separate because it adds TeamCreate/tmux-specific orchestration that only applies when the user explicitly requests worker teams.
|
|
26
|
+
|
|
27
|
+
## Rewritten Skill
|
|
28
|
+
|
|
29
|
+
```markdown
|
|
30
|
+
---
|
|
31
|
+
name: trekoon
|
|
32
|
+
description: Use Trekoon to create issues/tasks, plan backlog and sprints, create epics, update status, track progress, and manage dependencies/sync across repository workflows.
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
# Trekoon Skill
|
|
36
|
+
|
|
37
|
+
Trekoon is a local-first issue tracker for epics, tasks, and subtasks.
|
|
38
|
+
This skill covers planning, execution, and CLI operations. Use the mode
|
|
39
|
+
that matches your current activity.
|
|
40
|
+
|
|
41
|
+
## Non-negotiable defaults
|
|
42
|
+
|
|
43
|
+
- Always include `--toon` on every Trekoon command.
|
|
44
|
+
- Prefer the smallest sufficient scope.
|
|
45
|
+
- Prefer transactional bulk commands over many single-item commands.
|
|
46
|
+
- Prefer `--append` for progress notes instead of rewriting descriptions.
|
|
47
|
+
- Preview replace before `--apply`.
|
|
48
|
+
- Prefer `--ids` over `--all` for bulk updates.
|
|
49
|
+
- Never edit `.trekoon/trekoon.db` directly.
|
|
50
|
+
- Treat `.trekoon` as shared repo-scoped state; keep it gitignored.
|
|
51
|
+
- Never run `trekoon wipe --yes --toon` unless user explicitly asks.
|
|
52
|
+
- Statuses: `todo`, `in_progress`, `done`, `blocked` — use only these.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Mode A: Planning
|
|
57
|
+
|
|
58
|
+
Activate when: user asks to plan, design, or break down work.
|
|
59
|
+
|
|
60
|
+
### Clarify first
|
|
61
|
+
|
|
62
|
+
If requirements are unclear or have meaningful tradeoffs, ask before planning.
|
|
63
|
+
Present options with tradeoffs. Don't guess when the user can clarify in 10 seconds.
|
|
64
|
+
|
|
65
|
+
### Data model
|
|
66
|
+
|
|
67
|
+
- **Epic** = full feature outcome and constraints
|
|
68
|
+
- **Task** = one subsystem/domain work unit ownable by one agent
|
|
69
|
+
- **Subtask** = concrete implementation/test/verification step
|
|
70
|
+
- **Dependency** = strict prerequisite only (not "nice to have")
|
|
71
|
+
|
|
72
|
+
### Writing standard
|
|
73
|
+
|
|
74
|
+
**Epic title:** `<Area>: <deliverable> to <outcome> (<constraint>)`
|
|
75
|
+
**Epic description:** Goal & why now | In scope | Out of scope | Success criteria | Risks | Verification gates
|
|
76
|
+
|
|
77
|
+
**Task title:** `[<Subsystem>] <verb> <artifact> to <observable outcome>`
|
|
78
|
+
**Task description must include:**
|
|
79
|
+
- Concrete scope and affected paths/symbols
|
|
80
|
+
- Acceptance criteria (observable behavior)
|
|
81
|
+
- Verification commands
|
|
82
|
+
- File scope: Target files | Read-first files | Do-not-touch paths
|
|
83
|
+
- Parallelism note: "Can run in parallel with ..." or "Blocked by ..."
|
|
84
|
+
- Context loading hints: reference existing patterns to follow
|
|
85
|
+
|
|
86
|
+
**Subtask:** Imperative, specific titles. Description states exact artifact and completion signal.
|
|
87
|
+
|
|
88
|
+
### Parallelism & dependencies
|
|
89
|
+
|
|
90
|
+
- Tasks with no edge between them are parallel candidates
|
|
91
|
+
- Different subsystems = parallel; same subsystem = combine or sequence
|
|
92
|
+
- 3-4 tasks max per subsystem lane
|
|
93
|
+
- Add edges only for hard prerequisites; prefer task-to-task deps
|
|
94
|
+
- Validate acyclic assumptions before finalizing
|
|
95
|
+
|
|
96
|
+
### Execution handoff contract
|
|
97
|
+
|
|
98
|
+
Every plan must be directly executable without re-interpretation:
|
|
99
|
+
1. Lane ownership in title (`[Subsystem] ...`)
|
|
100
|
+
2. Dependency intent (explicit blocked-by / parallel-with)
|
|
101
|
+
3. Verification evidence (exact commands + expected outcome)
|
|
102
|
+
4. Completion semantics (`done` = verified; `blocked` = with reason)
|
|
103
|
+
|
|
104
|
+
### Create the plan
|
|
105
|
+
|
|
106
|
+
Use one-shot `epic create` when the graph is known. Use `epic expand` when
|
|
107
|
+
adding to existing epics. See Command Reference below for syntax.
|
|
108
|
+
|
|
109
|
+
Return to user: Epic ID + tasks by lane + dependency list + parallel batches + verification commands.
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Mode B: Execution
|
|
114
|
+
|
|
115
|
+
Activate when: user asks to execute, implement, or work through a plan/epic.
|
|
116
|
+
|
|
117
|
+
### Setup
|
|
118
|
+
|
|
119
|
+
1. Create a branch unless trivial
|
|
120
|
+
2. Ensure Trekoon initialized (`trekoon init --toon` if needed)
|
|
121
|
+
3. Load epic: `trekoon --toon session --epic <id>` or `trekoon --toon epic show <id> --all`
|
|
122
|
+
|
|
123
|
+
### Execution loop
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
1. trekoon --toon session [--epic <id>] # Orient
|
|
127
|
+
2. [if behind] trekoon --toon sync pull --from main
|
|
128
|
+
3. trekoon --toon task update <id> --status in_progress # Claim
|
|
129
|
+
4. [do work, update subtasks]
|
|
130
|
+
5. trekoon --toon task done <id> # Done + get next
|
|
131
|
+
6. Repeat from 3
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Orchestration (sub-agents)
|
|
135
|
+
|
|
136
|
+
Build execution graph from scheduler primitives:
|
|
137
|
+
- `task next --epic <id>` for top candidate
|
|
138
|
+
- `task ready --epic <id> --limit 50` for batch decisions
|
|
139
|
+
- `dep reverse <id>` for impact of completions
|
|
140
|
+
|
|
141
|
+
Group ready tasks by subsystem to minimize context loading:
|
|
142
|
+
- Same directory prefix / domain / intent = group together
|
|
143
|
+
- 3-4 tasks max per group
|
|
144
|
+
- Parallel groups: different subsystems
|
|
145
|
+
- Sequential groups: have dependency edges
|
|
146
|
+
|
|
147
|
+
Dispatch sub-agents per group with:
|
|
148
|
+
- Task IDs and titles to execute IN ORDER
|
|
149
|
+
- Instructions to claim (in_progress), update subtasks, append progress, and mark done
|
|
150
|
+
- Blocker reporting: append reason + set blocked status
|
|
151
|
+
|
|
152
|
+
### Auto-recovery
|
|
153
|
+
|
|
154
|
+
1. `dependency_blocked` error: refresh with `task ready`/`task next`, continue with ready candidate
|
|
155
|
+
2. Agent attempts fix (has context)
|
|
156
|
+
3. Can't fix: report failure with error output
|
|
157
|
+
4. Same error twice: stop and ask user
|
|
158
|
+
|
|
159
|
+
### Verify before completing
|
|
160
|
+
|
|
161
|
+
1. Code review all changes
|
|
162
|
+
2. Run full test suite
|
|
163
|
+
3. Manual verification (curl endpoints, run CLI commands, feed real data)
|
|
164
|
+
4. DX quality check (error messages, noise, consistency)
|
|
165
|
+
|
|
166
|
+
Record verification evidence via `--append`. Keep original descriptions stable.
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Mode C: Operations (Default)
|
|
171
|
+
|
|
172
|
+
Active always. CLI reference for reads, writes, search, sync.
|
|
173
|
+
|
|
174
|
+
### Agent loop (quick reference)
|
|
175
|
+
|
|
176
|
+
**session → claim → work → done → repeat**
|
|
177
|
+
|
|
178
|
+
`session` returns diagnostics, sync status, next task tree, blockers, readiness.
|
|
179
|
+
`task done` marks done and returns next candidate with full tree.
|
|
180
|
+
|
|
181
|
+
### Read policy
|
|
182
|
+
|
|
183
|
+
| Need | Command |
|
|
184
|
+
|---|---|
|
|
185
|
+
| Session startup | `trekoon --toon session` |
|
|
186
|
+
| Next task only | `trekoon --toon task next` |
|
|
187
|
+
| Ready options | `trekoon --toon task ready --limit 5` |
|
|
188
|
+
| Blockers for task | `trekoon --toon dep list <id>` |
|
|
189
|
+
| What item unblocks | `trekoon --toon dep reverse <id>` |
|
|
190
|
+
| Full task | `trekoon --toon task show <id> --all` |
|
|
191
|
+
| Full epic tree | `trekoon --toon epic show <id> --all` |
|
|
192
|
+
|
|
193
|
+
Avoid `task list --all` or `epic show --all` when narrower commands suffice.
|
|
194
|
+
|
|
195
|
+
### Creation policy
|
|
196
|
+
|
|
197
|
+
| Situation | Command |
|
|
198
|
+
|---|---|
|
|
199
|
+
| New epic + full graph | `epic create --task --subtask --dep` |
|
|
200
|
+
| Add to existing epic | `epic expand <id> --task --subtask --dep` |
|
|
201
|
+
| Sibling tasks | `task create-many --epic <id> --task` |
|
|
202
|
+
| Sibling subtasks | `subtask create-many <id> --subtask` |
|
|
203
|
+
| Dep edges on existing IDs | `dep add-many --dep` |
|
|
204
|
+
|
|
205
|
+
**Compact spec format:** `tempkey|title|description|status`
|
|
206
|
+
**Subtask spec:** `@parent-key|tempkey|title|description|status`
|
|
207
|
+
**Dep spec:** `@source|@target` or `<id>|<id>`
|
|
208
|
+
|
|
209
|
+
**Escaping:** `\|` = literal pipe, `\\` = backslash, `\n` = newline.
|
|
210
|
+
Any other `\X` is rejected. Rephrase operators like `!==` in descriptions.
|
|
211
|
+
|
|
212
|
+
**Temp keys:** `@key` references work only within the same invocation.
|
|
213
|
+
`dep add-many` requires real persisted IDs.
|
|
214
|
+
|
|
215
|
+
### Update policy
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
trekoon --toon task update <id> --append "note" --status in_progress
|
|
219
|
+
trekoon --toon task done <id>
|
|
220
|
+
trekoon --toon task update <id> --append "Blocked by <reason>" --status blocked
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Bulk: `--ids id1,id2` or `--all` with `--append` and/or `--status`.
|
|
224
|
+
|
|
225
|
+
### Search & replace
|
|
226
|
+
|
|
227
|
+
1. Search: `trekoon --toon epic search <id> "text"`
|
|
228
|
+
2. Preview: `trekoon --toon epic replace <id> --search "old" --replace "new"`
|
|
229
|
+
3. Apply: add `--apply` after preview looks correct
|
|
230
|
+
|
|
231
|
+
Scope: subtask (narrowest) > task > epic (widest). Use `--fields title,description`.
|
|
232
|
+
|
|
233
|
+
### Sync
|
|
234
|
+
|
|
235
|
+
- Same-branch sync is a no-op
|
|
236
|
+
- Cross-branch: `trekoon --toon sync pull --from main` before merge
|
|
237
|
+
- Conflicts: `sync conflicts list` → `sync conflicts show <id>` → `sync resolve <id> --use ours|theirs`
|
|
238
|
+
|
|
239
|
+
### Setup & recovery
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
trekoon --toon init
|
|
243
|
+
trekoon --toon session
|
|
244
|
+
trekoon --toon quickstart
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
Stop if `recoveryRequired` persists. Don't commit `.trekoon/trekoon.db`.
|
|
248
|
+
|
|
249
|
+
### Worktree notes
|
|
250
|
+
|
|
251
|
+
`sharedStorageRoot` may differ from `worktreeRoot` — expected.
|
|
252
|
+
`wipe` deletes shared storage for all linked worktrees.
|
|
253
|
+
|
|
254
|
+
## Tool selection
|
|
255
|
+
|
|
256
|
+
Use dedicated tools (Glob, Grep, Read, Edit, Write) over bash for file ops.
|
|
257
|
+
Run Trekoon, git, build/test commands via Bash.
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
## Token Analysis
|
|
261
|
+
|
|
262
|
+
| Metric | Before (3 files) | After (1 file) | Savings |
|
|
263
|
+
|--------|------------------|-----------------|---------|
|
|
264
|
+
| Lines | 802 | ~450 | -44% |
|
|
265
|
+
| Est. tokens | ~3900 | ~2200 | -44% |
|
|
266
|
+
| Files loaded | 3 | 1 | -67% |
|
|
267
|
+
| Duplicated concepts | 8+ | 0 | -100% |
|
|
268
|
+
|
|
269
|
+
## What Was Removed
|
|
270
|
+
|
|
271
|
+
1. **Tool selection tables** — duplicated across all 3 files; kept once at bottom
|
|
272
|
+
2. **LSP tool references** — OpenCode-specific; moved to executing-plans-wt only
|
|
273
|
+
3. **Mandatory commit policy** — project-level concern, belongs in AGENTS.md not skill
|
|
274
|
+
4. **Repeated `--toon` reminders** — mentioned once in defaults, not repeated per section
|
|
275
|
+
5. **Verification details** — condensed from 25 lines to 4 lines (same checklist, less prose)
|
|
276
|
+
6. **Compact spec examples** — kept 1 example per type instead of 2-3 per file
|
|
277
|
+
|
|
278
|
+
## What Was Added
|
|
279
|
+
|
|
280
|
+
1. **Mode-based activation** — agent knows which section to focus on based on context
|
|
281
|
+
2. **Status enforcement note** — only use `todo | in_progress | done | blocked`
|
|
282
|
+
3. **Condensed execution loop** — 6-line quick reference instead of spread across sections
|
|
283
|
+
4. **Orchestration in same file** — no need to load separate executing-plans skill
|
|
284
|
+
|
|
285
|
+
## Migration Path
|
|
286
|
+
|
|
287
|
+
1. Replace `.agents/skills/trekoon/SKILL.md` with the unified version
|
|
288
|
+
2. Keep `writing-plans` and `executing-plans` as deprecated aliases that redirect
|
|
289
|
+
3. Keep `executing-plans-wt` as standalone (adds TeamCreate-specific content)
|
|
290
|
+
4. Update `docs/ai-agents.md` to reference single skill instead of stack
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# R10: Suggest Command — Skill Integration Guide
|
|
2
|
+
|
|
3
|
+
## Feature Summary
|
|
4
|
+
|
|
5
|
+
A new `trekoon --toon suggest` command that returns actionable next-step
|
|
6
|
+
recommendations based on current tracker state. Designed for agents operating
|
|
7
|
+
without the full skill stack — makes Trekoon self-guiding.
|
|
8
|
+
|
|
9
|
+
### Response Shape
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
{
|
|
13
|
+
suggestions: [
|
|
14
|
+
{
|
|
15
|
+
priority: 1,
|
|
16
|
+
action: "sync pull --from main",
|
|
17
|
+
command: "trekoon --toon sync pull --from main",
|
|
18
|
+
reason: "3 events behind main branch",
|
|
19
|
+
category: "sync"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
priority: 2,
|
|
23
|
+
action: "claim task task-5",
|
|
24
|
+
command: "trekoon --toon task update task-5 --status in_progress",
|
|
25
|
+
reason: "highest priority ready task: [API] Design endpoint schema",
|
|
26
|
+
category: "execution"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
priority: 3,
|
|
30
|
+
action: "resolve conflict conflict-2",
|
|
31
|
+
command: "trekoon --toon sync conflicts show conflict-2",
|
|
32
|
+
reason: "1 unresolved sync conflict blocking accurate state",
|
|
33
|
+
category: "sync"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
context: {
|
|
37
|
+
totalEpics: 3,
|
|
38
|
+
activeEpic: "epic-1",
|
|
39
|
+
readyTasks: 4,
|
|
40
|
+
blockedTasks: 2,
|
|
41
|
+
inProgressTasks: 1,
|
|
42
|
+
syncBehind: 3,
|
|
43
|
+
pendingConflicts: 1
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Suggestion Rules Engine
|
|
49
|
+
|
|
50
|
+
The command evaluates these conditions in priority order:
|
|
51
|
+
|
|
52
|
+
| Priority | Condition | Suggestion |
|
|
53
|
+
|----------|-----------|------------|
|
|
54
|
+
| 1 | `recoveryRequired = true` | Run `trekoon init` to repair storage |
|
|
55
|
+
| 2 | `pendingConflicts > 0` | Inspect and resolve sync conflicts |
|
|
56
|
+
| 3 | `syncBehind > 0` | `sync pull --from main` |
|
|
57
|
+
| 4 | Tasks with `in_progress` status exist | Continue working on in-progress task (show task ID + title) |
|
|
58
|
+
| 5 | Ready tasks available | Claim highest-priority ready task |
|
|
59
|
+
| 6 | All tasks blocked | Show which dependencies are blocking and suggest focusing on those |
|
|
60
|
+
| 7 | All tasks done | Mark epic as done |
|
|
61
|
+
| 8 | No epics exist | Create first epic or run quickstart |
|
|
62
|
+
|
|
63
|
+
Maximum 3 suggestions returned to keep the response compact.
|
|
64
|
+
|
|
65
|
+
## Skill Integration
|
|
66
|
+
|
|
67
|
+
### Where to Document
|
|
68
|
+
|
|
69
|
+
In the unified SKILL.md, add to Mode C: Operations as a new section:
|
|
70
|
+
|
|
71
|
+
```markdown
|
|
72
|
+
### Guided mode (for bare agent usage)
|
|
73
|
+
|
|
74
|
+
When operating without the full planning/execution skill stack, use `suggest`
|
|
75
|
+
to get state-aware next steps:
|
|
76
|
+
|
|
77
|
+
trekoon --toon suggest [--epic <id>]
|
|
78
|
+
|
|
79
|
+
Returns up to 3 prioritized suggestions with ready-to-run commands.
|
|
80
|
+
Use this instead of manually combining session + ready + sync calls
|
|
81
|
+
when you need a quick decision about what to do next.
|
|
82
|
+
|
|
83
|
+
Suggestions cover: sync hygiene, conflict resolution, task claiming,
|
|
84
|
+
blocker analysis, and epic completion.
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Where to Reference in Default Agent Loop
|
|
88
|
+
|
|
89
|
+
Update the "Orient with a single call" section:
|
|
90
|
+
|
|
91
|
+
```markdown
|
|
92
|
+
### 1. Orient
|
|
93
|
+
|
|
94
|
+
For full diagnostics: `trekoon --toon session`
|
|
95
|
+
For quick "what should I do?": `trekoon --toon suggest`
|
|
96
|
+
|
|
97
|
+
`suggest` is lighter than `session` — it returns actionable commands
|
|
98
|
+
rather than raw state. Use `session` when you need the full picture;
|
|
99
|
+
use `suggest` when you just need the next step.
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Agent Behavior Change
|
|
103
|
+
|
|
104
|
+
### Before (bare agent, no skills)
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
agent receives "work on this project"
|
|
108
|
+
→ trekoon --toon session # raw diagnostics (agent must interpret)
|
|
109
|
+
→ trekoon --toon task ready # (agent must decide what to do)
|
|
110
|
+
→ trekoon --toon sync status # (agent must check sync separately)
|
|
111
|
+
→ (agent reasons about priorities and decides action)
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
The agent must understand Trekoon's state model to make good decisions.
|
|
115
|
+
Without the executing-plans skill, it often makes suboptimal choices.
|
|
116
|
+
|
|
117
|
+
### After (with suggest)
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
agent receives "work on this project"
|
|
121
|
+
→ trekoon --toon suggest
|
|
122
|
+
→ response: "sync pull (3 behind), then claim task-5 (highest priority ready)"
|
|
123
|
+
→ agent executes the suggested commands directly
|
|
124
|
+
→ trekoon --toon suggest # after completing, ask again
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
The agent doesn't need to understand Trekoon internals — the suggest command
|
|
128
|
+
encodes the decision logic that the executing-plans skill currently provides
|
|
129
|
+
through instruction text.
|
|
130
|
+
|
|
131
|
+
## Token Impact
|
|
132
|
+
|
|
133
|
+
| Scenario | Before (without skills) | After (with suggest) |
|
|
134
|
+
|----------|------------------------|---------------------|
|
|
135
|
+
| Orient + decide | session + ready + sync status = 3 calls | suggest = 1 call |
|
|
136
|
+
| Context needed | Agent reads ~400 token session response + reasons | Agent reads ~150 token suggest response + executes |
|
|
137
|
+
| Decision quality | Depends on agent's understanding of Trekoon | Consistent, encoded in suggest logic |
|
|
138
|
+
|
|
139
|
+
## Key Design Principle
|
|
140
|
+
|
|
141
|
+
`suggest` moves decision logic from the skill file (instruction tokens loaded
|
|
142
|
+
into every agent) into the CLI itself (zero token cost, computed at runtime).
|
|
143
|
+
This is the most direct way to make Trekoon work well without external skills.
|
|
144
|
+
|
|
145
|
+
## Implementation Notes
|
|
146
|
+
|
|
147
|
+
- The suggest command should be read-only (no mutations)
|
|
148
|
+
- Epic-scoped: `--epic <id>` limits suggestions to that epic's context
|
|
149
|
+
- Without `--epic`: considers all epics, suggests the most active one
|
|
150
|
+
- Reuses existing `buildTaskReadiness()` and `resolveSyncStatus()` internally
|
|
151
|
+
- Should be fast: single DB open, no transactions needed
|
|
152
|
+
- Human output: numbered list with reasons; TOON output: structured array
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# R9: Task Done Diff Response — Skill Integration Guide
|
|
2
|
+
|
|
3
|
+
## Feature Summary
|
|
4
|
+
|
|
5
|
+
When `task done <id>` completes, the response will include not just the next
|
|
6
|
+
candidate but also which tasks/subtasks were newly unblocked by this completion.
|
|
7
|
+
|
|
8
|
+
### Current Response Shape
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
{
|
|
12
|
+
markedDone: { id, title, status: "done" },
|
|
13
|
+
next: { id, epicId, title, description, status, subtasks[] } | null,
|
|
14
|
+
nextDeps: DependencyBlocker[],
|
|
15
|
+
readiness: { readyCount, blockedCount }
|
|
16
|
+
}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Proposed Response Shape
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
{
|
|
23
|
+
markedDone: { id, title, status: "done" },
|
|
24
|
+
unblocked: [
|
|
25
|
+
{ id, kind: "task"|"subtask", title, status, wasBlockedBy: [<completed-id>] }
|
|
26
|
+
],
|
|
27
|
+
next: { ... } | null,
|
|
28
|
+
nextDeps: DependencyBlocker[],
|
|
29
|
+
readiness: { readyCount, blockedCount }
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The `unblocked` array contains entities that transitioned from "has incomplete
|
|
34
|
+
dependencies" to "all dependencies done" as a direct result of this completion.
|
|
35
|
+
|
|
36
|
+
## Skill Integration
|
|
37
|
+
|
|
38
|
+
### Where to Document
|
|
39
|
+
|
|
40
|
+
In the unified SKILL.md (Mode B: Execution and Mode C: Operations), update the
|
|
41
|
+
`task done` documentation:
|
|
42
|
+
|
|
43
|
+
### Mode C: Operations — Update Policy
|
|
44
|
+
|
|
45
|
+
Add after the `task done` line:
|
|
46
|
+
|
|
47
|
+
```markdown
|
|
48
|
+
`task done` returns:
|
|
49
|
+
- `markedDone`: the completed task
|
|
50
|
+
- `unblocked`: tasks/subtasks newly unblocked by this completion
|
|
51
|
+
- `next`: next ready candidate with full tree
|
|
52
|
+
- `readiness`: updated ready/blocked counts
|
|
53
|
+
|
|
54
|
+
Use `unblocked` to decide whether to dispatch new sub-agents immediately
|
|
55
|
+
rather than calling `dep reverse` separately.
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Mode B: Execution — Orchestration
|
|
59
|
+
|
|
60
|
+
Replace the current "As tasks complete, re-evaluate graph readiness" with:
|
|
61
|
+
|
|
62
|
+
```markdown
|
|
63
|
+
### After task completion
|
|
64
|
+
|
|
65
|
+
When `task done` returns, check the `unblocked` array:
|
|
66
|
+
- If unblocked items belong to the same subsystem as an active agent, notify
|
|
67
|
+
that agent via SendMessage (worker teams) or include in next dispatch
|
|
68
|
+
- If unblocked items form a new parallel lane, dispatch a new sub-agent
|
|
69
|
+
- If `unblocked` is empty, no new work was freed — continue with `next`
|
|
70
|
+
|
|
71
|
+
This eliminates the need for a separate `dep reverse` call after each completion.
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Token Savings Per Execution Cycle
|
|
75
|
+
|
|
76
|
+
| Before | After | Saved |
|
|
77
|
+
|--------|-------|-------|
|
|
78
|
+
| `task done <id>` + `dep reverse <id>` = 2 calls | `task done <id>` = 1 call | 1 Trekoon invocation + response parsing per task completion |
|
|
79
|
+
|
|
80
|
+
For a 20-task epic, this saves ~20 CLI calls and ~20 response parses during execution.
|
|
81
|
+
|
|
82
|
+
## Agent Behavior Change
|
|
83
|
+
|
|
84
|
+
### Before (current)
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
agent completes task-5
|
|
88
|
+
→ trekoon task done task-5 # get next candidate
|
|
89
|
+
→ trekoon dep reverse task-5 # see what was unblocked
|
|
90
|
+
→ (agent reasons about whether to dispatch new sub-agents)
|
|
91
|
+
→ trekoon task ready --epic X # refresh ready queue
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### After (with R9)
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
agent completes task-5
|
|
98
|
+
→ trekoon task done task-5 # get next + unblocked list
|
|
99
|
+
→ (agent immediately knows: task-8 and task-12 were unblocked)
|
|
100
|
+
→ (dispatch decisions happen inline without extra calls)
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Implementation Notes
|
|
104
|
+
|
|
105
|
+
The `unblocked` computation should:
|
|
106
|
+
1. Snapshot the "blocked" set before marking done
|
|
107
|
+
2. Mark the task done
|
|
108
|
+
3. Recompute readiness for previously-blocked items
|
|
109
|
+
4. Return items that transitioned from blocked to ready
|
|
110
|
+
|
|
111
|
+
This is a diff of two readiness snapshots, not a full graph recomputation.
|
|
112
|
+
Keep it scoped to direct reverse dependencies of the completed task to avoid
|
|
113
|
+
O(all-tasks) cost on every completion.
|