trekoon 0.2.0 → 0.2.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 +174 -301
- package/README.md +215 -4
- package/package.json +1 -1
- package/src/commands/arg-parser.ts +116 -0
- package/src/commands/dep.ts +197 -25
- package/src/commands/epic.ts +490 -28
- package/src/commands/error-utils.ts +111 -0
- package/src/commands/events.ts +23 -3
- package/src/commands/help.ts +36 -4
- package/src/commands/init.ts +11 -3
- package/src/commands/migrate.ts +11 -4
- package/src/commands/subtask.ts +224 -26
- package/src/commands/sync.ts +7 -1
- package/src/commands/task.ts +197 -26
- package/src/domain/mutation-service.ts +152 -0
- package/src/domain/tracker-domain.ts +503 -0
- package/src/domain/types.ts +80 -0
- package/src/sync/service.ts +42 -0
|
@@ -7,382 +7,255 @@ description: Use Trekoon to create issues/tasks, plan backlog and sprints, creat
|
|
|
7
7
|
|
|
8
8
|
Trekoon is a local-first issue tracker for epics, tasks, and subtasks.
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
**Every trekoon command MUST include `--toon` for machine-readable output.**
|
|
13
|
-
|
|
14
|
-
The `--toon` flag outputs structured YAML-like data that is easy to parse. Never run trekoon commands without it.
|
|
15
|
-
|
|
16
|
-
### TOON Output Format
|
|
17
|
-
|
|
18
|
-
All `--toon` output follows this structure:
|
|
19
|
-
|
|
20
|
-
```yaml
|
|
21
|
-
ok: true
|
|
22
|
-
command: task.list
|
|
23
|
-
data:
|
|
24
|
-
tasks[0]:
|
|
25
|
-
id: abc-123
|
|
26
|
-
epicId: epic-456
|
|
27
|
-
title: Implement feature X
|
|
28
|
-
status: todo
|
|
29
|
-
createdAt: 1700000000000
|
|
30
|
-
updatedAt: 1700000000000
|
|
31
|
-
tasks[1]:
|
|
32
|
-
id: def-789
|
|
33
|
-
epicId: epic-456
|
|
34
|
-
title: Write tests
|
|
35
|
-
status: in_progress
|
|
36
|
-
createdAt: 1700000001000
|
|
37
|
-
updatedAt: 1700000001000
|
|
38
|
-
metadata:
|
|
39
|
-
contractVersion: 1.0.0
|
|
40
|
-
requestId: req-abc12345
|
|
41
|
-
```
|
|
10
|
+
This skill is the agent operating guide, not the full CLI reference. Use it to
|
|
11
|
+
pick the right command with the fewest reads and mutations.
|
|
42
12
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
```yaml
|
|
46
|
-
ok: false
|
|
47
|
-
command: task.show
|
|
48
|
-
data: {}
|
|
49
|
-
metadata:
|
|
50
|
-
contractVersion: 1.0.0
|
|
51
|
-
requestId: req-def67890
|
|
52
|
-
error:
|
|
53
|
-
code: not_found
|
|
54
|
-
message: task not found: invalid-id
|
|
55
|
-
```
|
|
13
|
+
## Non-negotiable defaults
|
|
56
14
|
|
|
57
|
-
|
|
15
|
+
- Always include `--toon` on every Trekoon command.
|
|
16
|
+
- Prefer the smallest sufficient scope.
|
|
17
|
+
- Prefer transactional bulk commands over many single-item commands.
|
|
18
|
+
- Prefer `--append` for progress notes, completion notes, and blocker notes.
|
|
19
|
+
- Preview replace before `--apply`.
|
|
20
|
+
- Prefer `--ids` over `--all` for bulk updates.
|
|
21
|
+
- Never edit `.trekoon/trekoon.db` directly.
|
|
22
|
+
- Never run `trekoon wipe --yes --toon` unless the user explicitly asks for it.
|
|
58
23
|
|
|
59
|
-
|
|
60
|
-
|-------|---------|
|
|
61
|
-
| `ok` | `true` if command succeeded, `false` on error |
|
|
62
|
-
| `command` | The command that was executed (e.g., `task.list`, `epic.create`) |
|
|
63
|
-
| `data` | The response payload (tasks, epics, dependencies, etc.) |
|
|
64
|
-
| `metadata` | Contract metadata (`contractVersion`, `requestId`) |
|
|
65
|
-
| `meta` | Optional command-specific metadata (pagination/defaults/filters/diagnostics) |
|
|
66
|
-
| `error` | Present only on failure, contains `code` and `message` |
|
|
24
|
+
## Default agent loop
|
|
67
25
|
|
|
68
|
-
|
|
26
|
+
Run this loop each session:
|
|
69
27
|
|
|
70
|
-
|
|
28
|
+
1. Check sync baseline:
|
|
71
29
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
- Unknown options fail fast with deterministic `unknown_option` errors and may include:
|
|
76
|
-
- `data.option`
|
|
77
|
-
- `data.allowedOptions`
|
|
78
|
-
- `data.suggestions`
|
|
30
|
+
```bash
|
|
31
|
+
trekoon --toon sync status
|
|
32
|
+
```
|
|
79
33
|
|
|
80
|
-
|
|
34
|
+
If this returns `missing_branch_db` on a fresh branch or worktree, continue
|
|
35
|
+
with local task selection and treat sync as unavailable for now.
|
|
81
36
|
|
|
82
|
-
|
|
37
|
+
2. Pick the next item deterministically:
|
|
83
38
|
|
|
84
|
-
|
|
39
|
+
```bash
|
|
40
|
+
trekoon --toon task next
|
|
41
|
+
trekoon --toon task ready --limit 5
|
|
42
|
+
```
|
|
85
43
|
|
|
86
|
-
|
|
87
|
-
trekoon --toon --compat legacy-sync-command-ids sync status
|
|
88
|
-
```
|
|
44
|
+
3. Inspect dependencies or downstream impact when needed:
|
|
89
45
|
|
|
90
|
-
|
|
46
|
+
```bash
|
|
47
|
+
trekoon --toon dep list <task-id>
|
|
48
|
+
trekoon --toon dep reverse <task-or-subtask-id>
|
|
49
|
+
```
|
|
91
50
|
|
|
92
|
-
|
|
51
|
+
4. Claim work explicitly:
|
|
93
52
|
|
|
94
|
-
|
|
53
|
+
```bash
|
|
54
|
+
trekoon --toon task update <task-id> --status in_progress
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
5. Finish or report a block with appended context:
|
|
95
58
|
|
|
96
|
-
|
|
59
|
+
```bash
|
|
60
|
+
trekoon --toon task update <task-id> --append "Completed implementation and checks" --status done
|
|
61
|
+
trekoon --toon task update <task-id> --append "Blocked by <reason>" --status blocked
|
|
62
|
+
```
|
|
97
63
|
|
|
98
|
-
Recommended statuses for consistent workflows:
|
|
64
|
+
Recommended statuses for consistent workflows: `todo`, `in_progress`, `done`.
|
|
99
65
|
|
|
100
|
-
|
|
101
|
-
|--------|---------|
|
|
102
|
-
| `todo` | Work not started (default for new items) |
|
|
103
|
-
| `in_progress` | Actively being worked on |
|
|
104
|
-
| `done` | Completed successfully |
|
|
66
|
+
## Read policy: use the smallest sufficient read
|
|
105
67
|
|
|
106
|
-
|
|
68
|
+
Use the narrowest command that answers the question.
|
|
107
69
|
|
|
108
|
-
|
|
70
|
+
| Need | Preferred command |
|
|
71
|
+
|---|---|
|
|
72
|
+
| Next task | `trekoon --toon task next` |
|
|
73
|
+
| A few ready options | `trekoon --toon task ready --limit 5` |
|
|
74
|
+
| Direct blockers for one task | `trekoon --toon dep list <task-id>` |
|
|
75
|
+
| What this item unblocks | `trekoon --toon dep reverse <task-or-subtask-id>` |
|
|
76
|
+
| One full task payload | `trekoon --toon task show <task-id> --all` |
|
|
77
|
+
| One full epic tree | `trekoon --toon epic show <epic-id> --all` |
|
|
78
|
+
| Repeated text in one scope | `trekoon --toon epic|task|subtask search ...` |
|
|
109
79
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
| `in_progress → done` | When you COMPLETE the work and it is ready |
|
|
80
|
+
Avoid broad scans such as `task list --all` or `epic show --all` when
|
|
81
|
+
`task next`, `task ready`, `dep list`, `dep reverse`, or `search` can answer the
|
|
82
|
+
question more cheaply.
|
|
114
83
|
|
|
115
|
-
|
|
84
|
+
## Creation policy: prefer bulk planning workflows
|
|
116
85
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
trekoon task update <task-id> --status done --toon
|
|
120
|
-
trekoon subtask update <subtask-id> --status done --toon
|
|
121
|
-
trekoon epic update <epic-id> --status done --toon
|
|
122
|
-
```
|
|
86
|
+
When creating multiple related records, do not loop through repeated single-item
|
|
87
|
+
creates unless only one record is needed.
|
|
123
88
|
|
|
124
|
-
|
|
89
|
+
### Which command to use
|
|
125
90
|
|
|
126
|
-
|
|
91
|
+
| Situation | Preferred command |
|
|
92
|
+
|---|---|
|
|
93
|
+
| New epic and full graph already known | `trekoon --toon epic create ... --task ... --subtask ... --dep ...` |
|
|
94
|
+
| Existing epic needs linked additions | `trekoon --toon epic expand <epic-id> ...` |
|
|
95
|
+
| Multiple sibling tasks under one epic | `trekoon --toon task create-many --epic <epic-id> --task ...` |
|
|
96
|
+
| Multiple sibling subtasks under one task | `trekoon --toon subtask create-many <task-id> --subtask ...` |
|
|
97
|
+
| Multiple dependency edges across existing IDs | `trekoon --toon dep add-many --dep ...` |
|
|
98
|
+
| One record only | `epic create`, `task create`, or `subtask create` |
|
|
127
99
|
|
|
128
|
-
###
|
|
100
|
+
### Critical temp-key rule
|
|
129
101
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
102
|
+
- Use plain temp keys when declaring records in compact specs, for example
|
|
103
|
+
`task-api` or `sub-tests`.
|
|
104
|
+
- Refer to those records later in the same invocation as `@task-api` or
|
|
105
|
+
`@sub-tests`.
|
|
106
|
+
- `@temp-key` references work in same-invocation graph workflows such as
|
|
107
|
+
one-shot `epic create` and `epic expand`.
|
|
108
|
+
- `dep add-many` does **not** resolve temp keys from earlier commands. Use real
|
|
109
|
+
persisted IDs there.
|
|
136
110
|
|
|
137
|
-
|
|
138
|
-
- `<depends-on-id>`: The task/subtask that must be completed first
|
|
111
|
+
### Compact examples
|
|
139
112
|
|
|
140
|
-
|
|
113
|
+
#### One-shot epic creation
|
|
141
114
|
|
|
142
|
-
|
|
115
|
+
Use this when the epic does not exist yet and you already know the tree.
|
|
143
116
|
|
|
144
117
|
```bash
|
|
145
|
-
trekoon
|
|
118
|
+
trekoon --toon epic create \
|
|
119
|
+
--title "Batch command rollout" \
|
|
120
|
+
--description "Ship linked planning in one transaction" \
|
|
121
|
+
--task "task-api|Design API|Define compact grammar|todo" \
|
|
122
|
+
--task "task-cli|Wire CLI|Hook parser and output|todo" \
|
|
123
|
+
--subtask "@task-api|sub-tests|Write tests|Cover parser cases|todo" \
|
|
124
|
+
--dep "@task-cli|@task-api"
|
|
146
125
|
```
|
|
147
126
|
|
|
148
|
-
|
|
149
|
-
- `sourceId`: the task you're checking
|
|
150
|
-
- `dependsOnId`: what must be done first
|
|
151
|
-
- `dependsOnKind`: "task" or "subtask"
|
|
152
|
-
|
|
153
|
-
### Dependency Rules
|
|
154
|
-
|
|
155
|
-
1. A task with dependencies should only be marked `in_progress` when ALL dependencies have status `done`
|
|
156
|
-
2. Dependencies can only exist between tasks and subtasks (not epics)
|
|
157
|
-
3. Cycles are automatically detected and rejected
|
|
158
|
-
|
|
159
|
-
## 3) Task Completion Flow
|
|
160
|
-
|
|
161
|
-
### Canonical dependency-aware execution loop
|
|
162
|
-
|
|
163
|
-
Run this sequence every session:
|
|
164
|
-
|
|
165
|
-
1. Sync branch/worktree status:
|
|
166
|
-
```bash
|
|
167
|
-
trekoon sync status --toon
|
|
168
|
-
```
|
|
169
|
-
2. Pull deterministic ready candidates (or next candidate):
|
|
170
|
-
```bash
|
|
171
|
-
trekoon task ready --limit 5 --toon
|
|
172
|
-
trekoon task next --toon
|
|
173
|
-
```
|
|
174
|
-
3. Inspect downstream impact before changes:
|
|
175
|
-
```bash
|
|
176
|
-
trekoon dep reverse <task-or-subtask-id> --toon
|
|
177
|
-
```
|
|
178
|
-
4. Start work with explicit status updates:
|
|
179
|
-
```bash
|
|
180
|
-
trekoon task update <task-id> --status in_progress --toon
|
|
181
|
-
```
|
|
182
|
-
5. Finish or block with appended context + final status:
|
|
183
|
-
```bash
|
|
184
|
-
trekoon task update <task-id> --append "Completed implementation" --status done --toon
|
|
185
|
-
trekoon task update <task-id> --append "Blocked by <reason>" --status blocked --toon
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
### When Completing a Task
|
|
127
|
+
#### Expand an existing epic
|
|
189
128
|
|
|
190
|
-
|
|
191
|
-
```bash
|
|
192
|
-
trekoon task update <task-id> --status done --toon
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
2. To find the next task that was blocked by this one:
|
|
196
|
-
- Inspect downstream nodes: `trekoon dep reverse <task-id> --toon`
|
|
197
|
-
- Pull ready queue: `trekoon task ready --limit 5 --toon`
|
|
198
|
-
- Pick one deterministically: `trekoon task next --toon`
|
|
199
|
-
|
|
200
|
-
### Finding Next Work
|
|
129
|
+
Use this when the epic already exists and the new batch needs internal links.
|
|
201
130
|
|
|
202
131
|
```bash
|
|
203
|
-
trekoon
|
|
204
|
-
|
|
205
|
-
|
|
132
|
+
trekoon --toon epic expand <epic-id> \
|
|
133
|
+
--task "task-docs|Document workflow|Write operator guide|todo" \
|
|
134
|
+
--subtask "@task-docs|sub-examples|Add examples|Show canonical flows|todo" \
|
|
135
|
+
--dep "@sub-examples|@task-docs"
|
|
206
136
|
```
|
|
207
137
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
## 4) Load existing work first
|
|
211
|
-
|
|
212
|
-
Before creating or changing anything, inspect current context:
|
|
138
|
+
#### Create sibling tasks or subtasks
|
|
213
139
|
|
|
214
140
|
```bash
|
|
215
|
-
trekoon epic
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
141
|
+
trekoon --toon task create-many --epic <epic-id> \
|
|
142
|
+
--task "seed-api|Design API|Define grammar|todo" \
|
|
143
|
+
--task "seed-cli|Wire CLI|Hook output|todo"
|
|
144
|
+
|
|
145
|
+
trekoon --toon subtask create-many <task-id> \
|
|
146
|
+
--subtask "seed-tests|Write tests|Cover happy path|todo" \
|
|
147
|
+
--subtask "seed-docs|Document flow|Add notes|todo"
|
|
219
148
|
```
|
|
220
149
|
|
|
221
|
-
|
|
222
|
-
- open work only (`in_progress`, `in-progress`, `todo`)
|
|
223
|
-
- prioritized as `in_progress`/`in-progress` first, then `todo`
|
|
224
|
-
- default limit `10`
|
|
225
|
-
- `--cursor <n>` is offset-like pagination for list endpoints
|
|
226
|
-
- Filter list explicitly when needed:
|
|
150
|
+
#### Add dependencies after records already exist
|
|
227
151
|
|
|
228
152
|
```bash
|
|
229
|
-
trekoon
|
|
230
|
-
|
|
231
|
-
|
|
153
|
+
trekoon --toon dep add-many \
|
|
154
|
+
--dep "<task-b>|<task-a>" \
|
|
155
|
+
--dep "<subtask-c>|<task-b>"
|
|
232
156
|
```
|
|
233
157
|
|
|
234
|
-
|
|
235
|
-
- `--all` cannot be combined with `--cursor`.
|
|
236
|
-
- Machine pagination contract is in `meta.pagination.hasMore` and
|
|
237
|
-
`meta.pagination.nextCursor`.
|
|
238
|
-
- Machine list/show responses may also include:
|
|
239
|
-
- `meta.defaults`
|
|
240
|
-
- `meta.filters`
|
|
241
|
-
- `meta.truncation`
|
|
242
|
-
- `epic show <id> --all --toon`: full epic tree (tasks + subtasks)
|
|
243
|
-
- `task show <id> --all --toon`: task plus its subtasks
|
|
244
|
-
|
|
245
|
-
### Canonical storage root behavior
|
|
158
|
+
## Update policy: prefer append-based progress logging
|
|
246
159
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
- In non-git directories, Trekoon falls back to invocation cwd.
|
|
250
|
-
- If invocation cwd differs from canonical root, machine output may include
|
|
251
|
-
`meta.storageRootDiagnostics`.
|
|
160
|
+
Use descriptions as the durable work log. For progress updates, append instead
|
|
161
|
+
of rewriting full descriptions.
|
|
252
162
|
|
|
253
|
-
###
|
|
254
|
-
|
|
255
|
-
| Command | `--view` options |
|
|
256
|
-
|---------|------------------|
|
|
257
|
-
| `list` | `table` (default), `compact` |
|
|
258
|
-
| `show` | `table` (default), `compact`, `tree`, `detail` |
|
|
259
|
-
|
|
260
|
-
## 5) Create work (epic/task/subtask)
|
|
163
|
+
### Preferred patterns
|
|
261
164
|
|
|
262
165
|
```bash
|
|
263
|
-
trekoon
|
|
264
|
-
trekoon task
|
|
265
|
-
trekoon
|
|
166
|
+
trekoon --toon task update <task-id> --append "Started implementation" --status in_progress
|
|
167
|
+
trekoon --toon task update <task-id> --append "Completed implementation and checks" --status done
|
|
168
|
+
trekoon --toon task update <task-id> --append "Blocked by <reason>" --status blocked
|
|
266
169
|
```
|
|
267
170
|
|
|
268
|
-
|
|
269
|
-
- `description` is required for epic/task create and it must be well written.
|
|
270
|
-
- `status` defaults to `todo` if omitted.
|
|
271
|
-
- `description` is optional for subtask create.
|
|
171
|
+
### Bulk update rules
|
|
272
172
|
|
|
273
|
-
|
|
173
|
+
- Bulk update is available for `epic update`, `task update`, and
|
|
174
|
+
`subtask update`.
|
|
175
|
+
- Bulk mode uses `--ids <csv>` or `--all`.
|
|
176
|
+
- Bulk mode supports only `--append` and/or `--status`.
|
|
177
|
+
- Do not pass a positional ID in bulk mode.
|
|
178
|
+
- `--append` and `--description` are mutually exclusive.
|
|
179
|
+
- Prefer `--ids` for narrow, explicit updates.
|
|
180
|
+
- Use `--all` only for clear maintenance sweeps or when the user explicitly wants
|
|
181
|
+
a broad update.
|
|
274
182
|
|
|
275
|
-
|
|
183
|
+
Examples:
|
|
276
184
|
|
|
277
185
|
```bash
|
|
278
|
-
trekoon
|
|
279
|
-
trekoon
|
|
280
|
-
trekoon subtask update <subtask-id> --title "..." --description "..." --status in_progress --toon
|
|
186
|
+
trekoon --toon task update --ids id1,id2 --append "Waiting on release" --status blocked
|
|
187
|
+
trekoon --toon epic update --ids epic1,epic2 --append "Sprint planning refreshed" --status in_progress
|
|
281
188
|
```
|
|
282
189
|
|
|
283
|
-
|
|
190
|
+
## Search and replace policy
|
|
284
191
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
trekoon task update --ids id1,id2 --append "..." --status in_progress --toon
|
|
192
|
+
Use scoped search before manual tree reads when you need to locate repeated
|
|
193
|
+
paths, labels, owners, or migration targets.
|
|
288
194
|
|
|
289
|
-
|
|
290
|
-
trekoon epic update --ids id1,id2 --append "..." --status in_progress --toon
|
|
291
|
-
```
|
|
195
|
+
### Scope choice
|
|
292
196
|
|
|
293
|
-
|
|
294
|
-
- `--all` and `--ids` are mutually exclusive.
|
|
295
|
-
- In bulk mode, do not pass a positional ID.
|
|
296
|
-
- Bulk update supports `--append` and/or `--status`.
|
|
197
|
+
Prefer the narrowest valid root:
|
|
297
198
|
|
|
298
|
-
|
|
199
|
+
1. `subtask search` or `subtask replace`
|
|
200
|
+
2. `task search` or `task replace`
|
|
201
|
+
3. `epic search` or `epic replace`
|
|
299
202
|
|
|
300
|
-
|
|
301
|
-
locate or migrate repeated text inside one issue tree.
|
|
203
|
+
Scope behavior:
|
|
302
204
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
trekoon subtask search <subtask-id> "path/to/somewhere" --toon
|
|
205
|
+
- `subtask` scope scans only that subtask.
|
|
206
|
+
- `task` scope scans the task plus descendant subtasks.
|
|
207
|
+
- `epic` scope scans the epic plus descendant tasks and subtasks.
|
|
307
208
|
|
|
308
|
-
|
|
309
|
-
trekoon epic replace <epic-id> --search "path/to/somewhere" --replace "path/to/new-path" --apply --toon
|
|
310
|
-
```
|
|
209
|
+
### Safe replace workflow
|
|
311
210
|
|
|
312
|
-
|
|
211
|
+
1. Search first.
|
|
212
|
+
2. Preview replace.
|
|
213
|
+
3. Apply only after preview matches the intended scope.
|
|
313
214
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
`epic`.
|
|
319
|
-
- Keep prompts deterministic: literal search text, explicit IDs, no regex
|
|
320
|
-
assumptions.
|
|
321
|
-
|
|
322
|
-
Agent contract for epic-scoped replace:
|
|
323
|
-
|
|
324
|
-
- Exact search command:
|
|
325
|
-
`trekoon epic search <epic-id> "path/to/somewhere" --toon`
|
|
326
|
-
- Exact replace command:
|
|
327
|
-
`trekoon epic replace <epic-id> --search "path/to/somewhere" --replace "path/to/new-path" --toon`
|
|
328
|
-
- Apply command:
|
|
329
|
-
`trekoon epic replace <epic-id> --search "path/to/somewhere" --replace "path/to/new-path" --apply --toon`
|
|
330
|
-
- Epic scope includes the epic title/description plus every task and subtask
|
|
331
|
-
title/description in that epic tree.
|
|
332
|
-
|
|
333
|
-
Compact TOON fields to expect:
|
|
334
|
-
|
|
335
|
-
```text
|
|
336
|
-
ok: true
|
|
337
|
-
command: epic.search
|
|
338
|
-
data:
|
|
339
|
-
scope: epic
|
|
340
|
-
query: { search, fields[], mode: preview }
|
|
341
|
-
matches[]: { kind, id, fields[]: { field, count, snippet } }
|
|
342
|
-
summary: { matchedEntities, matchedFields, totalMatches }
|
|
343
|
-
metadata:
|
|
344
|
-
contractVersion: 1.0.0
|
|
345
|
-
requestId: req-<id>
|
|
346
|
-
```
|
|
347
|
-
|
|
348
|
-
```text
|
|
349
|
-
ok: true
|
|
350
|
-
command: epic.replace
|
|
351
|
-
data:
|
|
352
|
-
scope: epic
|
|
353
|
-
query: { search, replace, fields[], mode: preview|apply }
|
|
354
|
-
matches[]: { kind, id, fields[]: { field, count, snippet } }
|
|
355
|
-
summary: { matchedEntities, matchedFields, totalMatches, mode }
|
|
356
|
-
metadata:
|
|
357
|
-
contractVersion: 1.0.0
|
|
358
|
-
requestId: req-<id>
|
|
215
|
+
```bash
|
|
216
|
+
trekoon --toon epic search <epic-id> "path/to/somewhere"
|
|
217
|
+
trekoon --toon epic replace <epic-id> --search "path/to/somewhere" --replace "path/to/new-path"
|
|
218
|
+
trekoon --toon epic replace <epic-id> --search "path/to/somewhere" --replace "path/to/new-path" --apply
|
|
359
219
|
```
|
|
360
220
|
|
|
361
|
-
|
|
221
|
+
Guardrails:
|
|
362
222
|
|
|
363
|
-
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
-
|
|
367
|
-
-
|
|
368
|
-
|
|
369
|
-
to `"apply"`.
|
|
223
|
+
- Use literal, explicit search text.
|
|
224
|
+
- Narrow fields when useful: `--fields title`, `--fields description`, or
|
|
225
|
+
`--fields title,description`.
|
|
226
|
+
- Do not jump straight to `--apply`.
|
|
227
|
+
- Prefer scoped search/replace over manually reading a whole tree and editing
|
|
228
|
+
many records one by one.
|
|
370
229
|
|
|
371
|
-
##
|
|
230
|
+
## Setup and fallback
|
|
372
231
|
|
|
373
|
-
|
|
374
|
-
2. In the target repository/worktree, initialize tracker state:
|
|
232
|
+
If Trekoon is unavailable or state is missing:
|
|
375
233
|
|
|
376
234
|
```bash
|
|
377
|
-
trekoon
|
|
235
|
+
trekoon --toon init
|
|
236
|
+
trekoon --toon quickstart
|
|
237
|
+
trekoon --help --toon
|
|
378
238
|
```
|
|
379
239
|
|
|
380
|
-
|
|
381
|
-
|
|
240
|
+
Use `quickstart` for the canonical execution loop. Use `--help --toon` when you
|
|
241
|
+
need exact syntax.
|
|
382
242
|
|
|
383
|
-
|
|
243
|
+
## Sync reminders
|
|
384
244
|
|
|
385
|
-
|
|
245
|
+
- Run `trekoon --toon sync status` at session start and before PR or merge.
|
|
246
|
+
- Before merge, pull tracker events from the base branch:
|
|
386
247
|
|
|
387
|
-
|
|
388
|
-
|
|
248
|
+
```bash
|
|
249
|
+
trekoon --toon sync pull --from main
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
- If conflicts exist, inspect and resolve them explicitly:
|
|
253
|
+
|
|
254
|
+
```bash
|
|
255
|
+
trekoon --toon sync conflicts list
|
|
256
|
+
trekoon --toon sync conflicts show <conflict-id>
|
|
257
|
+
trekoon --toon sync resolve <conflict-id> --use ours
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
Trekoon stores local state in `.trekoon/trekoon.db`. In git repos and
|
|
261
|
+
worktrees, storage resolves from the repository root.
|