trekoon 0.2.0 → 0.2.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/.agents/skills/trekoon/SKILL.md +232 -297
- package/README.md +288 -16
- 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 +83 -17
- package/src/commands/init.ts +115 -9
- package/src/commands/migrate.ts +11 -4
- package/src/commands/quickstart.ts +76 -30
- package/src/commands/session.ts +223 -0
- package/src/commands/skills.ts +100 -63
- package/src/commands/subtask.ts +224 -26
- package/src/commands/sync.ts +64 -17
- package/src/commands/task-readiness.ts +147 -0
- package/src/commands/task.ts +277 -168
- package/src/commands/wipe.ts +15 -5
- 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/runtime/cli-shell.ts +83 -5
- package/src/storage/database.ts +86 -0
- package/src/storage/migrations.ts +48 -0
- package/src/storage/path.ts +70 -21
- package/src/storage/schema.ts +9 -2
- package/src/storage/worktree-recovery.ts +376 -0
- package/src/sync/branch-db.ts +87 -35
- package/src/sync/git-context.ts +7 -2
- package/src/sync/service.ts +131 -95
- package/src/sync/types.ts +2 -0
|
@@ -7,382 +7,317 @@ 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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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.
|
|
12
|
+
|
|
13
|
+
## Non-negotiable defaults
|
|
14
|
+
|
|
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
|
+
- Treat `.trekoon` as shared repo-scoped operational state in git worktrees.
|
|
23
|
+
- Keep `.trekoon` gitignored; do not commit the SQLite DB as a recovery fix.
|
|
24
|
+
- Never run `trekoon wipe --yes --toon` unless the user explicitly asks for it.
|
|
25
|
+
|
|
26
|
+
## Default agent loop
|
|
27
|
+
|
|
28
|
+
The primary loop is: **session → work → task done → repeat**.
|
|
42
29
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
```
|
|
46
|
-
|
|
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
|
|
30
|
+
### 1. Orient with a single call
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
trekoon --toon session
|
|
55
34
|
```
|
|
56
35
|
|
|
57
|
-
|
|
36
|
+
`session` replaces the old five-call bootstrap sequence
|
|
37
|
+
(init + sync status + task next + dep list + task show) with a single DB open.
|
|
38
|
+
It returns diagnostics, sync status, the full next-task tree with subtasks, blocker
|
|
39
|
+
list, and readiness counts in one envelope.
|
|
58
40
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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` |
|
|
41
|
+
Fail fast if the envelope reports `recoveryRequired`, a storage mismatch, or any
|
|
42
|
+
bootstrap error. In linked worktrees, `sharedStorageRoot` may differ from
|
|
43
|
+
`worktreeRoot`; that is expected because the repo shares one DB across checkouts.
|
|
67
44
|
|
|
68
|
-
|
|
45
|
+
### 2. Claim work explicitly
|
|
69
46
|
|
|
70
|
-
|
|
47
|
+
```bash
|
|
48
|
+
trekoon --toon task update <task-id> --status in_progress
|
|
49
|
+
```
|
|
71
50
|
|
|
72
|
-
|
|
73
|
-
- Command IDs are stable and typically dot namespaced (`task.list`, `sync.status`).
|
|
74
|
-
- Some root commands use single-token IDs (`help`, `init`, `quickstart`, `wipe`, `version`).
|
|
75
|
-
- Unknown options fail fast with deterministic `unknown_option` errors and may include:
|
|
76
|
-
- `data.option`
|
|
77
|
-
- `data.allowedOptions`
|
|
78
|
-
- `data.suggestions`
|
|
51
|
+
### 3. Finish or report a block
|
|
79
52
|
|
|
80
|
-
|
|
53
|
+
```bash
|
|
54
|
+
trekoon --toon task done <task-id>
|
|
55
|
+
trekoon --toon task update <task-id> --append "Blocked by <reason>" --status blocked
|
|
56
|
+
```
|
|
81
57
|
|
|
82
|
-
|
|
58
|
+
`task done` replaces the old three-call transition sequence
|
|
59
|
+
(mark done + get next + load deps + show task) with a single call that marks the
|
|
60
|
+
task done and returns the next ready candidate with its full tree and blockers.
|
|
83
61
|
|
|
84
|
-
|
|
62
|
+
Append a completion note before calling `task done` when useful:
|
|
85
63
|
|
|
86
64
|
```bash
|
|
87
|
-
trekoon --toon
|
|
65
|
+
trekoon --toon task update <task-id> --append "Completed implementation and checks"
|
|
66
|
+
trekoon --toon task done <task-id>
|
|
88
67
|
```
|
|
89
68
|
|
|
90
|
-
|
|
69
|
+
### 4. Repeat
|
|
91
70
|
|
|
92
|
-
|
|
71
|
+
Run `session` again at the start of each new session. After `task done`, the
|
|
72
|
+
returned next-task envelope is sufficient to continue; a fresh `session` call is
|
|
73
|
+
not required mid-loop unless you need updated diagnostics or sync status.
|
|
93
74
|
|
|
94
|
-
|
|
75
|
+
Recommended statuses for consistent workflows: `todo`, `in_progress`, `done`.
|
|
95
76
|
|
|
96
|
-
|
|
77
|
+
## Read policy: use the smallest sufficient read
|
|
97
78
|
|
|
98
|
-
|
|
79
|
+
Use the narrowest command that answers the question.
|
|
99
80
|
|
|
100
|
-
|
|
|
101
|
-
|
|
102
|
-
|
|
|
103
|
-
|
|
|
104
|
-
|
|
|
81
|
+
| Need | Preferred command |
|
|
82
|
+
|---|---|
|
|
83
|
+
| Session startup (diagnostics + sync + next task) | `trekoon --toon session` |
|
|
84
|
+
| Next task only | `trekoon --toon task next` |
|
|
85
|
+
| A few ready options | `trekoon --toon task ready --limit 5` |
|
|
86
|
+
| Direct blockers for one task | `trekoon --toon dep list <task-id>` |
|
|
87
|
+
| What this item unblocks | `trekoon --toon dep reverse <task-or-subtask-id>` |
|
|
88
|
+
| One full task payload | `trekoon --toon task show <task-id> --all` |
|
|
89
|
+
| One full epic tree | `trekoon --toon epic show <epic-id> --all` |
|
|
90
|
+
| Repeated text in one scope | `trekoon --toon epic|task|subtask search ...` |
|
|
105
91
|
|
|
106
|
-
|
|
92
|
+
Avoid broad scans such as `task list --all` or `epic show --all` when
|
|
93
|
+
`task next`, `task ready`, `dep list`, `dep reverse`, or `search` can answer the
|
|
94
|
+
question more cheaply.
|
|
107
95
|
|
|
108
|
-
|
|
96
|
+
## Creation policy: prefer bulk planning workflows
|
|
109
97
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
| `todo → in_progress` | When you START working on a task/subtask/epic |
|
|
113
|
-
| `in_progress → done` | When you COMPLETE the work and it is ready |
|
|
98
|
+
When creating multiple related records, do not loop through repeated single-item
|
|
99
|
+
creates unless only one record is needed.
|
|
114
100
|
|
|
115
|
-
###
|
|
101
|
+
### Which command to use
|
|
116
102
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
trekoon
|
|
120
|
-
trekoon
|
|
121
|
-
trekoon epic
|
|
122
|
-
|
|
103
|
+
| Situation | Preferred command |
|
|
104
|
+
|---|---|
|
|
105
|
+
| New epic and full graph already known | `trekoon --toon epic create ... --task ... --subtask ... --dep ...` |
|
|
106
|
+
| Existing epic needs linked additions | `trekoon --toon epic expand <epic-id> ...` |
|
|
107
|
+
| Multiple sibling tasks under one epic | `trekoon --toon task create-many --epic <epic-id> --task ...` |
|
|
108
|
+
| Multiple sibling subtasks under one task | `trekoon --toon subtask create-many <task-id> --subtask ...` |
|
|
109
|
+
| Multiple dependency edges across existing IDs | `trekoon --toon dep add-many --dep ...` |
|
|
110
|
+
| One record only | `epic create`, `task create`, or `subtask create` |
|
|
123
111
|
|
|
124
|
-
|
|
112
|
+
### Compact spec escaping rules
|
|
125
113
|
|
|
126
|
-
|
|
114
|
+
Compact specs (pipe-delimited `--task`, `--subtask`, `--dep` values) use `\` as
|
|
115
|
+
the escape character. Only these sequences are valid:
|
|
127
116
|
|
|
128
|
-
|
|
117
|
+
| Sequence | Produces |
|
|
118
|
+
|---|---|
|
|
119
|
+
| `\|` | literal `|` (not a field separator) |
|
|
120
|
+
| `\\` | literal `\` |
|
|
121
|
+
| `\n` | newline |
|
|
122
|
+
| `\r` | carriage return |
|
|
123
|
+
| `\t` | tab |
|
|
129
124
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
trekoon dep list <source-id> --toon
|
|
133
|
-
trekoon dep remove <source-id> <depends-on-id> --toon
|
|
134
|
-
trekoon dep reverse <task-or-subtask-id> --toon
|
|
135
|
-
```
|
|
125
|
+
Any other `\X` combination (e.g., `\!`, `\=`, `\$`) is rejected with
|
|
126
|
+
`Invalid escape sequence`. To avoid accidental escapes:
|
|
136
127
|
|
|
137
|
-
-
|
|
138
|
-
|
|
128
|
+
- Do not use `!=` or similar operators in description text; rephrase instead
|
|
129
|
+
(e.g., "null does not equal sourceBranch" instead of "null !== sourceBranch").
|
|
130
|
+
- If a literal backslash is needed, double it: `\\`.
|
|
131
|
+
- When using shell line continuations (`\` at end of line), ensure the next
|
|
132
|
+
line's first character is not one that forms an invalid escape with `\`.
|
|
139
133
|
|
|
140
|
-
###
|
|
134
|
+
### Critical temp-key rule
|
|
141
135
|
|
|
142
|
-
|
|
136
|
+
- Use plain temp keys when declaring records in compact specs, for example
|
|
137
|
+
`task-api` or `sub-tests`.
|
|
138
|
+
- Refer to those records later in the same invocation as `@task-api` or
|
|
139
|
+
`@sub-tests`.
|
|
140
|
+
- `@temp-key` references work in same-invocation graph workflows such as
|
|
141
|
+
one-shot `epic create` and `epic expand`.
|
|
142
|
+
- `dep add-many` does **not** resolve temp keys from earlier commands. Use real
|
|
143
|
+
persisted IDs there.
|
|
143
144
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
### Compact examples
|
|
146
|
+
|
|
147
|
+
#### One-shot epic creation
|
|
147
148
|
|
|
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
|
|
189
|
-
|
|
190
|
-
1. Mark the task as done:
|
|
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
|
|
149
|
+
Use this when the epic does not exist yet and you already know the tree.
|
|
201
150
|
|
|
202
151
|
```bash
|
|
203
|
-
trekoon
|
|
204
|
-
|
|
205
|
-
|
|
152
|
+
trekoon --toon epic create \
|
|
153
|
+
--title "Batch command rollout" \
|
|
154
|
+
--description "Ship linked planning in one transaction" \
|
|
155
|
+
--task "task-api|Design API|Define compact grammar|todo" \
|
|
156
|
+
--task "task-cli|Wire CLI|Hook parser and output|todo" \
|
|
157
|
+
--subtask "@task-api|sub-tests|Write tests|Cover parser cases|todo" \
|
|
158
|
+
--dep "@task-cli|@task-api"
|
|
206
159
|
```
|
|
207
160
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
## 4) Load existing work first
|
|
161
|
+
#### Expand an existing epic
|
|
211
162
|
|
|
212
|
-
|
|
163
|
+
Use this when the epic already exists and the new batch needs internal links.
|
|
213
164
|
|
|
214
165
|
```bash
|
|
215
|
-
trekoon epic
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
166
|
+
trekoon --toon epic expand <epic-id> \
|
|
167
|
+
--task "task-docs|Document workflow|Write operator guide|todo" \
|
|
168
|
+
--subtask "@task-docs|sub-examples|Add examples|Show canonical flows|todo" \
|
|
169
|
+
--dep "@sub-examples|@task-docs"
|
|
219
170
|
```
|
|
220
171
|
|
|
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:
|
|
172
|
+
#### Create sibling tasks or subtasks
|
|
227
173
|
|
|
228
174
|
```bash
|
|
229
|
-
trekoon task
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
```
|
|
175
|
+
trekoon --toon task create-many --epic <epic-id> \
|
|
176
|
+
--task "seed-api|Design API|Define grammar|todo" \
|
|
177
|
+
--task "seed-cli|Wire CLI|Hook output|todo"
|
|
233
178
|
|
|
234
|
-
|
|
235
|
-
-
|
|
236
|
-
-
|
|
237
|
-
|
|
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
|
|
179
|
+
trekoon --toon subtask create-many <task-id> \
|
|
180
|
+
--subtask "seed-tests|Write tests|Cover happy path|todo" \
|
|
181
|
+
--subtask "seed-docs|Document flow|Add notes|todo"
|
|
182
|
+
```
|
|
244
183
|
|
|
245
|
-
|
|
184
|
+
#### Add dependencies after records already exist
|
|
246
185
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
-
|
|
251
|
-
|
|
186
|
+
```bash
|
|
187
|
+
trekoon --toon dep add-many \
|
|
188
|
+
--dep "<task-b>|<task-a>" \
|
|
189
|
+
--dep "<subtask-c>|<task-b>"
|
|
190
|
+
```
|
|
252
191
|
|
|
253
|
-
|
|
192
|
+
## Update policy: prefer append-based progress logging
|
|
254
193
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
| `list` | `table` (default), `compact` |
|
|
258
|
-
| `show` | `table` (default), `compact`, `tree`, `detail` |
|
|
194
|
+
Use descriptions as the durable work log. For progress updates, append instead
|
|
195
|
+
of rewriting full descriptions.
|
|
259
196
|
|
|
260
|
-
|
|
197
|
+
### Preferred patterns
|
|
261
198
|
|
|
262
199
|
```bash
|
|
263
|
-
trekoon
|
|
264
|
-
trekoon task
|
|
265
|
-
trekoon
|
|
200
|
+
trekoon --toon task update <task-id> --append "Started implementation" --status in_progress
|
|
201
|
+
trekoon --toon task update <task-id> --append "Completed implementation and checks" --status done
|
|
202
|
+
trekoon --toon task update <task-id> --append "Blocked by <reason>" --status blocked
|
|
266
203
|
```
|
|
267
204
|
|
|
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.
|
|
205
|
+
### Bulk update rules
|
|
272
206
|
|
|
273
|
-
|
|
207
|
+
- Bulk update is available for `epic update`, `task update`, and
|
|
208
|
+
`subtask update`.
|
|
209
|
+
- Bulk mode uses `--ids <csv>` or `--all`.
|
|
210
|
+
- Bulk mode supports only `--append` and/or `--status`.
|
|
211
|
+
- Do not pass a positional ID in bulk mode.
|
|
212
|
+
- `--append` and `--description` are mutually exclusive.
|
|
213
|
+
- Prefer `--ids` for narrow, explicit updates.
|
|
214
|
+
- Use `--all` only for clear maintenance sweeps or when the user explicitly wants
|
|
215
|
+
a broad update.
|
|
274
216
|
|
|
275
|
-
|
|
217
|
+
Examples:
|
|
276
218
|
|
|
277
219
|
```bash
|
|
278
|
-
trekoon
|
|
279
|
-
trekoon
|
|
280
|
-
trekoon subtask update <subtask-id> --title "..." --description "..." --status in_progress --toon
|
|
220
|
+
trekoon --toon task update --ids id1,id2 --append "Waiting on release" --status blocked
|
|
221
|
+
trekoon --toon epic update --ids epic1,epic2 --append "Sprint planning refreshed" --status in_progress
|
|
281
222
|
```
|
|
282
223
|
|
|
283
|
-
|
|
224
|
+
## Search and replace policy
|
|
284
225
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
trekoon task update --ids id1,id2 --append "..." --status in_progress --toon
|
|
226
|
+
Use scoped search before manual tree reads when you need to locate repeated
|
|
227
|
+
paths, labels, owners, or migration targets.
|
|
288
228
|
|
|
289
|
-
|
|
290
|
-
trekoon epic update --ids id1,id2 --append "..." --status in_progress --toon
|
|
291
|
-
```
|
|
229
|
+
### Scope choice
|
|
292
230
|
|
|
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`.
|
|
231
|
+
Prefer the narrowest valid root:
|
|
297
232
|
|
|
298
|
-
|
|
233
|
+
1. `subtask search` or `subtask replace`
|
|
234
|
+
2. `task search` or `task replace`
|
|
235
|
+
3. `epic search` or `epic replace`
|
|
299
236
|
|
|
300
|
-
|
|
301
|
-
locate or migrate repeated text inside one issue tree.
|
|
237
|
+
Scope behavior:
|
|
302
238
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
trekoon subtask search <subtask-id> "path/to/somewhere" --toon
|
|
239
|
+
- `subtask` scope scans only that subtask.
|
|
240
|
+
- `task` scope scans the task plus descendant subtasks.
|
|
241
|
+
- `epic` scope scans the epic plus descendant tasks and subtasks.
|
|
307
242
|
|
|
308
|
-
|
|
309
|
-
|
|
243
|
+
### Safe replace workflow
|
|
244
|
+
|
|
245
|
+
1. Search first.
|
|
246
|
+
2. Preview replace.
|
|
247
|
+
3. Apply only after preview matches the intended scope.
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
trekoon --toon epic search <epic-id> "path/to/somewhere"
|
|
251
|
+
trekoon --toon epic replace <epic-id> --search "path/to/somewhere" --replace "path/to/new-path"
|
|
252
|
+
trekoon --toon epic replace <epic-id> --search "path/to/somewhere" --replace "path/to/new-path" --apply
|
|
310
253
|
```
|
|
311
254
|
|
|
312
255
|
Guardrails:
|
|
313
256
|
|
|
314
|
-
- Use
|
|
315
|
-
-
|
|
316
|
-
|
|
317
|
-
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
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
|
-
```
|
|
257
|
+
- Use literal, explicit search text.
|
|
258
|
+
- Narrow fields when useful: `--fields title`, `--fields description`, or
|
|
259
|
+
`--fields title,description`.
|
|
260
|
+
- Do not jump straight to `--apply`.
|
|
261
|
+
- Prefer scoped search/replace over manually reading a whole tree and editing
|
|
262
|
+
many records one by one.
|
|
263
|
+
|
|
264
|
+
## Setup and fallback
|
|
347
265
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
summary: { matchedEntities, matchedFields, totalMatches, mode }
|
|
356
|
-
metadata:
|
|
357
|
-
contractVersion: 1.0.0
|
|
358
|
-
requestId: req-<id>
|
|
266
|
+
If Trekoon is unavailable or storage diagnostics require repair:
|
|
267
|
+
|
|
268
|
+
```bash
|
|
269
|
+
trekoon --toon init
|
|
270
|
+
trekoon --toon sync status
|
|
271
|
+
trekoon --toon quickstart
|
|
272
|
+
trekoon --toon help sync
|
|
359
273
|
```
|
|
360
274
|
|
|
361
|
-
|
|
275
|
+
Rules:
|
|
362
276
|
|
|
363
|
-
-
|
|
364
|
-
|
|
365
|
-
-
|
|
366
|
-
|
|
367
|
-
-
|
|
368
|
-
|
|
369
|
-
to `"apply"`.
|
|
277
|
+
- Re-bootstrap first, then re-read diagnostics.
|
|
278
|
+
- Stop if `recoveryRequired` stays true or diagnostics report storage mismatch.
|
|
279
|
+
- Do not continue with task selection after missing shared storage or broken
|
|
280
|
+
bootstrap.
|
|
281
|
+
- Do not commit `.trekoon/trekoon.db`; remove the tracked DB and keep
|
|
282
|
+
`.trekoon` ignored instead.
|
|
370
283
|
|
|
371
|
-
|
|
284
|
+
Use `quickstart` for the canonical execution loop. Use help when you need exact
|
|
285
|
+
syntax.
|
|
372
286
|
|
|
373
|
-
|
|
374
|
-
2. In the target repository/worktree, initialize tracker state:
|
|
287
|
+
## Sync reminders
|
|
375
288
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
289
|
+
Same-branch sync is a no-op: `sync pull --from main` while on `main` produces
|
|
290
|
+
zero conflicts and simply advances the cursor. `sync status` returns `behind=0`
|
|
291
|
+
on the source branch. No action is needed.
|
|
379
292
|
|
|
380
|
-
|
|
381
|
-
get more information.
|
|
293
|
+
Cross-branch sync matters before merging a feature branch back:
|
|
382
294
|
|
|
383
|
-
|
|
295
|
+
- Before merge, pull tracker events from the base branch:
|
|
384
296
|
|
|
385
|
-
|
|
297
|
+
```bash
|
|
298
|
+
trekoon --toon sync pull --from main
|
|
299
|
+
```
|
|
386
300
|
|
|
387
|
-
-
|
|
388
|
-
|
|
301
|
+
- If conflicts exist, inspect and resolve them explicitly:
|
|
302
|
+
|
|
303
|
+
```bash
|
|
304
|
+
trekoon --toon sync conflicts list
|
|
305
|
+
trekoon --toon sync conflicts show <conflict-id>
|
|
306
|
+
trekoon --toon sync resolve <conflict-id> --use ours
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
## Worktree diagnostics and destructive scope
|
|
310
|
+
|
|
311
|
+
- Inspect machine-readable storage fields when debugging worktrees:
|
|
312
|
+
`storageMode`, `repoCommonDir`, `worktreeRoot`, `sharedStorageRoot`, and
|
|
313
|
+
`databaseFile`.
|
|
314
|
+
- `sharedStorageRoot` is the repo-scoped source of truth for `.trekoon` in git
|
|
315
|
+
worktrees.
|
|
316
|
+
- If `trekoon wipe --yes --toon` is explicitly requested, warn that it deletes
|
|
317
|
+
shared storage for the entire repository and every linked worktree.
|
|
318
|
+
- Wipe is destructive recovery only; it is never the right fix for a tracked DB
|
|
319
|
+
or gitignore mistake.
|
|
320
|
+
|
|
321
|
+
Trekoon stores local state in `.trekoon/trekoon.db`. In git repos and
|
|
322
|
+
worktrees, storage resolves from the shared repository root rather than each
|
|
323
|
+
worktree independently.
|