trekoon 0.4.2 → 0.4.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.
Files changed (40) hide show
  1. package/.agents/skills/trekoon/SKILL.md +97 -208
  2. package/.agents/skills/trekoon/reference/execution-with-team.md +87 -149
  3. package/.agents/skills/trekoon/reference/execution.md +170 -380
  4. package/.agents/skills/trekoon/reference/harness-primitives.md +77 -0
  5. package/.agents/skills/trekoon/reference/planning.md +193 -330
  6. package/.agents/skills/trekoon/reference/sync.md +56 -103
  7. package/README.md +29 -10
  8. package/docs/ai-agents.md +48 -4
  9. package/docs/commands.md +34 -25
  10. package/docs/machine-contracts.md +1 -1
  11. package/docs/quickstart.md +9 -9
  12. package/package.json +2 -2
  13. package/src/board/asset-root.ts +73 -0
  14. package/src/board/assets/app.js +5 -3
  15. package/src/board/assets/components/Component.js +6 -8
  16. package/src/board/assets/state/actions.js +3 -0
  17. package/src/board/assets/state/api.js +48 -34
  18. package/src/board/assets/state/store.js +3 -0
  19. package/src/board/event-bus.ts +15 -0
  20. package/src/board/routes.ts +94 -83
  21. package/src/board/server.ts +35 -8
  22. package/src/board/snapshot.ts +6 -0
  23. package/src/board/types.ts +2 -34
  24. package/src/board/wal-watcher.ts +170 -28
  25. package/src/commands/board.ts +20 -42
  26. package/src/commands/help.ts +11 -12
  27. package/src/commands/init.ts +0 -29
  28. package/src/commands/quickstart.ts +1 -1
  29. package/src/commands/skills.ts +17 -5
  30. package/src/domain/mutation-service.ts +61 -42
  31. package/src/domain/tracker-domain.ts +20 -16
  32. package/src/domain/types.ts +3 -0
  33. package/src/export/render-markdown.ts +1 -2
  34. package/src/runtime/daemon.ts +110 -49
  35. package/src/runtime/version.ts +10 -2
  36. package/src/storage/database.ts +9 -2
  37. package/src/storage/migrations.ts +19 -2
  38. package/src/storage/path.ts +0 -36
  39. package/src/sync/service.ts +47 -27
  40. package/src/board/install.ts +0 -196
@@ -1,104 +1,76 @@
1
- # Execution with Agent Teams Reference
1
+ # Execution With Agent Teams Reference
2
2
 
3
- **You are a team lead orchestrator.** Execute work from Trekoon using Agent
4
- Teams real parallel Claude Code instances coordinated via TeamCreate,
5
- TaskCreate, SendMessage, and shared task lists. Each teammate runs in its own
6
- tmux pane.
3
+ You are a team lead orchestrator. Use this file only for Claude Code Agent
4
+ Teams when the user explicitly asks for team execution and
5
+ `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=true`. This is a runtime-specific path,
6
+ not the default subagent path for Codex, OpenCode, Pi, or other harnesses.
7
7
 
8
- **Execute mode contract:** team execution is complete only when the epic is
9
- marked `done`, all remaining work is blocked with recorded reasons, or user
10
- input is required to continue.
8
+ Team execution is complete only when the epic is marked `done`, all remaining
9
+ work is blocked with recorded reasons, or real user input is required.
11
10
 
12
- **Prerequisite:** Agent Teams requires the Claude Code environment variable
13
- `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS` set to `"true"`. This feature is Claude
14
- Code only — it is not available in OpenCode or other harnesses.
11
+ Clarify meaningful ambiguity before starting.
15
12
 
16
- - [Claude Agent Teams documentation](https://code.claude.com/docs/en/agent-teams.md)
13
+ ## Start
17
14
 
18
- **Clarify ambiguity upfront.** If the plan has unclear requirements or meaningful
19
- tradeoffs, ask the user before starting.
20
-
21
- ## Build the execution graph
22
-
23
- Same as the standard execution reference — use `task ready`, `dep reverse`, and
24
- lane grouping to construct a runnable graph. See `reference/execution.md` for
25
- the full scheduler loop and lane grouping rules.
26
-
27
- ## Mark epic in-progress
28
-
29
- Before dispatching any work, transition the epic so it reflects actual state:
15
+ Build the graph with the standard execution reference: `task ready`,
16
+ `dep reverse`, lane grouping, and first-wave validation. Then mark the epic in
17
+ progress:
30
18
 
31
19
  ```bash
32
20
  trekoon --toon epic update <epic-id> --status in_progress
33
21
  ```
34
22
 
35
- This must happen once, immediately after building the execution graph. If
36
- execution is interrupted, the epic is at least `in_progress` rather than `todo`.
23
+ ## Create Team And Tasks
37
24
 
38
- ## Create the team
25
+ 1. Create the team:
39
26
 
40
- Use **TeamCreate** to set up the team, then **TaskCreate** to populate the
41
- shared task list, then **Agent** with `team_name` to spawn teammates.
42
-
43
- ### Step 1: Create the team
44
-
45
- ```
27
+ ```text
46
28
  TeamCreate:
47
29
  team_name: "<epic-slug>"
48
30
  description: "Executing epic <epic-id>: <title>"
49
31
  ```
50
32
 
51
- ### Step 2: Create tasks in the shared task list
52
-
53
- For each task group from the execution graph, create a task:
33
+ 2. Create one shared team task per lane:
54
34
 
55
- ```
35
+ ```text
56
36
  TaskCreate:
57
- subject: "<lane description>: <task-ids/titles>"
37
+ subject: "<lane>: <task-ids/titles>"
58
38
  description: |
59
- Execute these Trekoon tasks IN ORDER unless task description says
39
+ Execute these Trekoon tasks IN ORDER unless task descriptions allow
60
40
  parallel subtasks:
61
41
  - Task <id>: <title>
62
- - Task <id>: <title>
63
42
 
64
- Before starting each task:
65
- - claim and assign owner:
66
- trekoon --toon task claim <id> --owner <lane-name>
67
- - append a short start note:
68
- trekoon --toon task update <id> --append "Starting implementation"
43
+ Before each task:
44
+ - trekoon --toon task claim <id> --owner <lane-name>
45
+ - trekoon --toon task update <id> --append "Starting implementation"
69
46
 
70
- While executing:
71
- - complete required subtasks, update subtask statuses
72
- - append meaningful progress notes (do not rewrite task description)
73
- - respect the status machine: todo -> in_progress -> done (never skip)
74
- - use --compact to reduce output noise:
75
- trekoon --toon --compact task show <id>
47
+ While working:
48
+ - Complete required subtasks.
49
+ - Append progress notes; do not rewrite task descriptions.
50
+ - Use task done for completion.
51
+ - Use --compact for noisy Trekoon reads.
76
52
 
77
53
  On completion:
78
- - append final verification evidence
79
- - mark done: trekoon --toon task done <id>
80
- (task done auto-transitions from todo/blocked through in_progress)
81
- - read the response: it includes unblocked downstream tasks and open
82
- subtask warnings report these back via SendMessage
54
+ - Append verification evidence.
55
+ - trekoon --toon task done <id>
56
+ - Report unblocked tasks, open subtask warnings, and next candidate via
57
+ SendMessage.
58
+ - Report review result or review gap for non-trivial code changes.
83
59
 
84
60
  If blocked:
85
- - append blocker reason, dependency id, and exact failing command/output
86
- - set status: trekoon --toon task update <id> --status blocked
87
- - notify team lead via SendMessage with blocker details
61
+ - Append blocker reason, dependency id, and exact failing command/output.
62
+ - trekoon --toon task update <id> --append "Blocked by <reason>" --status blocked
63
+ - Notify team lead via SendMessage.
88
64
 
89
- Only create branches, commits, or PRs if the user explicitly requested
90
- them and the current harness policy allows it.
91
- Report: files changed, verification results, blockers
65
+ Do not create branches, commits, pushes, or PRs unless the user explicitly
66
+ asked and harness policy allows it.
92
67
  ```
93
68
 
94
- Use `blockedBy` via TaskUpdate to set dependencies between tasks that require
95
- sequential execution.
69
+ Use `blockedBy` via TaskUpdate for team tasks that must run sequentially.
96
70
 
97
- ### Step 3: Spawn teammates
71
+ 3. Spawn one teammate per parallel lane:
98
72
 
99
- For each parallel lane, spawn a teammate using the Agent tool:
100
-
101
- ```
73
+ ```text
102
74
  Agent:
103
75
  name: "developer-1"
104
76
  team_name: "<epic-slug>"
@@ -106,118 +78,84 @@ Agent:
106
78
  description: "<lane>: <task titles>"
107
79
  prompt: |
108
80
  You are a developer on team "<epic-slug>".
109
- Check TaskList for your assigned tasks and work through them.
110
- Use TaskUpdate to claim tasks (set owner to your name) and mark
111
- them completed.
112
-
113
- Before starting each Trekoon task, claim it in Trekoon:
81
+ Work through your TaskList assignment.
82
+ Claim each Trekoon task before editing:
114
83
  trekoon --toon task claim <trekoon-task-id> --owner <your-name>
115
84
 
116
- Status machine rules:
117
- - todo -> in_progress -> done (valid)
118
- - todo -> done (INVALID — use task done which auto-transitions)
119
- - in_progress -> blocked (valid, with reason)
120
- - blocked -> in_progress (valid, to resume)
121
-
122
- When you complete a Trekoon task with `task done`, read the response:
123
- - unblocked: tasks that became ready — report via SendMessage
124
- - warning: open subtasks — report via SendMessage
125
- - next: next ready candidate
85
+ Use task done for completion. Read and report unblocked tasks, warnings,
86
+ and next candidate via SendMessage.
126
87
 
127
- Communicate with teammates via SendMessage if you need coordination.
128
- After completing a task, check TaskList for the next available task.
88
+ Communicate blockers and coordination needs via SendMessage.
129
89
  ```
130
90
 
131
- **Teammate count:** 3-5 teammates for most epics. Don't over-parallelize.
91
+ Use 3-5 teammates for most epics. Do not over-parallelize. Use
92
+ `general-purpose` for implementation and `Explore`/`Plan` only for read-only
93
+ research or planning.
132
94
 
133
- **Agent types:**
134
- - Use `general-purpose` for implementation work (has edit/write/bash access)
135
- - Use `Explore` or `Plan` only for read-only research or planning tasks
136
-
137
- ## Coordinate as team lead
95
+ ## Coordinate
138
96
 
139
97
  Your job as team lead:
140
98
 
141
- 1. **Monitor progress** — teammates send messages when they complete tasks or
142
- hit blockers.
143
- 2. **Use task done responses** — when a teammate reports `unblocked` tasks from
144
- a `task done` response, create new team tasks via TaskCreate for the
145
- unblocked work and assign to idle teammates.
146
- 3. **Unblock work** — when a teammate reports a blocker, help resolve it or
147
- reassign.
148
- 4. **Assign ownership** — use TaskUpdate with `owner` to assign tasks to idle
149
- teammates. Also set Trekoon owner:
99
+ 1. Monitor SendMessage updates.
100
+ 2. When a teammate reports `unblocked` tasks from `task done`, create new team
101
+ tasks and assign idle teammates.
102
+ 3. Help resolve or reassign blockers.
103
+ 4. Keep Trekoon owners current:
150
104
  ```bash
151
105
  trekoon --toon task update <task-id> --owner <teammate-name>
152
106
  ```
153
- 5. **Send messages** — use SendMessage to direct teammates, never plain text
154
- output.
155
- 6. **Check progress** — periodically run `epic progress` to gauge completion:
107
+ 5. Use SendMessage to direct teammates.
108
+ 6. Check progress:
156
109
  ```bash
157
110
  trekoon --toon epic progress <epic-id>
158
111
  ```
159
- 7. **Get suggestions when stuck** — when all teammates are blocked:
112
+ 7. When all teammates are blocked, run:
160
113
  ```bash
161
114
  trekoon --toon suggest --epic <epic-id>
162
115
  ```
163
116
 
164
- ## Auto-recovery
165
-
166
- Teammate attempts to fix failures. If can't fix, teammate reports failure with
167
- error output via SendMessage; dispatch fix instructions in response.
117
+ ## Recovery
168
118
 
169
- **`status_transition_invalid`** exact recovery sequence:
170
- 1. Run `trekoon --toon --compact task show <id>` to read the current status.
171
- 2. Append a blocker note: `trekoon --toon task update <id> --append "Blocked: status_transition_invalid from <attempted transition>; current status is <actual>"`.
172
- 3. Identify the valid intermediate transition (see `reference/status-machine.md`).
173
- 4. Apply the correct intermediate step, then retry the intended transition.
174
- 5. Only move on to the next task after the target task reaches the intended status or is explicitly marked `blocked`.
175
- 6. Report resolution via SendMessage.
119
+ Use the standard execution recovery rules. Teammates should try to fix failures
120
+ with their local context. If they cannot, they must report exact command/output
121
+ via SendMessage so you can give fix instructions or reassign.
176
122
 
177
- **`dependency_blocked`** exact recovery sequence:
178
- 1. Run `trekoon --toon --compact task show <id>` to identify which dependency is unmet.
179
- 2. Append a blocker note: `trekoon --toon task update <id> --append "Blocked: dependency_blocked; depends on <dep-id>"`.
180
- 3. Run `trekoon --toon task ready --epic <epic-id>` to get a ready candidate.
181
- 4. Only then continue with the ready candidate — do not retry the blocked task.
182
- 5. Notify team lead via SendMessage with blocker details.
123
+ For `status_transition_invalid`, inspect current status with:
183
124
 
184
- ## Verify and close
125
+ ```bash
126
+ trekoon --toon --compact task show <id>
127
+ ```
185
128
 
186
- Same verification steps as the standard execution reference: code review,
187
- automated tests, manual verification, DX quality, record evidence, final
188
- progress check. See `reference/execution.md` for details.
129
+ For `dependency_blocked`, inspect the dependency, append a blocker note, then
130
+ continue with a ready candidate from:
189
131
 
190
- ## Shutdown and cleanup
132
+ ```bash
133
+ trekoon --toon task ready --epic <epic-id>
134
+ ```
191
135
 
192
- After all work is verified:
136
+ ## Verify And Close
193
137
 
194
- 1. **Check everything is done:**
195
- ```bash
196
- trekoon --toon epic progress <epic-id>
197
- ```
138
+ Use the standard execution verification rules: review, automated tests, manual
139
+ checks, DX quality, and Trekoon evidence notes.
198
140
 
199
- 2. **Confirm nothing remains:**
200
- ```bash
201
- trekoon --toon suggest --epic <epic-id>
202
- ```
203
- Should return no actionable suggestions.
141
+ After all work is verified:
204
142
 
205
- 3. **Mark epic done** (already `in_progress` from the start step):
206
- ```bash
207
- trekoon --toon epic update <epic-id> --status done
208
- ```
143
+ ```bash
144
+ trekoon --toon epic progress <epic-id>
145
+ trekoon --toon suggest --epic <epic-id>
146
+ trekoon --toon epic update <epic-id> --status done
147
+ ```
209
148
 
210
- 4. **Shutdown teammates** — send `shutdown_request` via SendMessage to each.
211
- 5. **Delete the team** use TeamDelete to clean up team and task directories.
212
- 6. Return final execution summary: completed tasks, remaining blockers,
213
- dependency state.
149
+ Then send `shutdown_request` to each teammate, delete the team with TeamDelete,
150
+ and return completed tasks, files changed, verification, review, remaining
151
+ blockers, and dependency state.
214
152
 
215
- ## Team orchestration tools
153
+ ## Team Tools
216
154
 
217
155
  | Purpose | Tool |
218
- |---------|------|
219
- | Create the team | `TeamCreate` |
220
- | Manage shared task list | `TaskCreate` / `TaskList` / `TaskUpdate` / `TaskGet` |
221
- | Spawn teammates | `Agent` (with `team_name`) |
156
+ |---|---|
157
+ | Create team | `TeamCreate` |
158
+ | Manage shared tasks | `TaskCreate` / `TaskList` / `TaskUpdate` / `TaskGet` |
159
+ | Spawn teammates | `Agent` with `team_name` |
222
160
  | Communicate | `SendMessage` |
223
161
  | Clean up | `TeamDelete` |