@cleocode/skills 2026.5.109 → 2026.5.110

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleocode/skills",
3
- "version": "2026.5.109",
3
+ "version": "2026.5.110",
4
4
  "description": "CLEO skill definitions - bundled with CLEO monorepo",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -2,7 +2,7 @@
2
2
  name: ct-cleo
3
3
  description: CLEO task management protocol - session, task, and workflow guidance. Use when managing tasks, sessions, or multi-agent workflows with the CLEO CLI protocol.
4
4
  metadata:
5
- version: 2.1.0
5
+ version: 2.2.0
6
6
  lastReviewed: 2026-05-23
7
7
  stability: stable
8
8
  ---
@@ -163,3 +163,38 @@ input JSON — `cleo show <epicId>` acceptance criteria → tasks array → `cle
163
163
 
164
164
  - Saga/Epic workflow: `cleo briefing inject --section task-creation`
165
165
  - Single task: `cleo add --type task --parent <id> --acceptance "..." --title "..."`
166
+
167
+ ---
168
+
169
+ ## Worktree-Aware CLI Routing (T10389 / ADR-068 amendment §3.1)
170
+
171
+ Two CLI verbs auto-route their writes back to the canonical project
172
+ root when invoked from inside an agent-spawned worktree:
173
+
174
+ - `cleo docs add <ownerId> <file> --type <kind> --slug <slug>` — the
175
+ blob lands in the MAIN repo's `tasks.db`. The file path is resolved
176
+ against the WORKTREE cwd (not the canonical root) before dispatch,
177
+ so relative paths like `docs/note.md` work as expected from inside
178
+ the worktree.
179
+ - `cleo changeset add --slug <slug> --tasks <ids> --kind <kind> --summary <text>` —
180
+ dual-writes to `<canonical-root>/.changeset/<slug>.md` AND the SSoT
181
+ blob store. The `.changeset/` file lands in the MAIN repo, never
182
+ the worktree.
183
+
184
+ Both verbs detect stray `.cleo/tasks.db` inside the worktree
185
+ (pre-T9803 leak or rogue write) and emit `E_STRAY_WORKTREE_DB` with a
186
+ clear `rm -rf <worktree>/.cleo` remediation BEFORE the deeper DB
187
+ chokepoint guard fires.
188
+
189
+ ```bash
190
+ # from ~/.local/share/cleo/worktrees/<hash>/T10389/
191
+ cleo docs add T10389 ./investigation.md --type research --slug t10389-research
192
+ # stderr: [T10389] routing SSoT write from worktree cwd ... → canonical project root ...
193
+ # row lands in main repo's tasks.db, retrievable via `cleo docs fetch t10389-research`
194
+ ```
195
+
196
+ If you see `E_PATH_TRAVERSAL`, `E_FILE_ERROR: Cannot read file`, or
197
+ `E_WT_DB_ISOLATION_VIOLATION` when calling either verb, update to a
198
+ build that ships the T10389 fix-pack (closes T10353 + T10354 + T10294
199
+ + T10365). Suppress the routing log with `CLEO_QUIET=1` for clean
200
+ stderr in automation.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: ct-docs-write
3
3
  description: This skill should be used when creating, editing, or reviewing documentation files (markdown, MDX, README, guides). Use when the user asks to "write docs", "create documentation", "edit the README", "improve doc clarity", "make docs more readable", "follow the style guide", or "write user-facing content". Applies CLEO's conversational, clear, and user-focused writing style.
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  tier: 3
6
6
  core: false
7
7
  category: composition
@@ -148,6 +148,32 @@ Match complexity to audience. Mismatch is the biggest style failure.
148
148
  Declare the audience in frontmatter — `audience: end-user | agent | maintainer`
149
149
  — so reviewers can apply the right rubric.
150
150
 
151
+ ## Verb Selection — pick the right writer
152
+
153
+ `packages/core/src/docs/writer-registry.ts` is the SSoT for "which CLI verb
154
+ writes which DocKind". Every `BuiltinDocKind` maps to EXACTLY ONE writer —
155
+ the registry rejects multi-writer regressions at build time (T10366 ·
156
+ Saga T10288 / Epic T10290). The decision tree:
157
+
158
+ ```text
159
+ if kind === 'changeset' → cleo changeset add --slug <handle> --kind <bump> --summary "..."
160
+ elif kind === 'llm-readme' → tooling-composed (system-managed; do not author by hand)
161
+ elif kind === 'release-note' → cleo release reconcile (system-managed)
162
+ else → cleo docs add <ownerId> <path> --type <kind> --slug <handle>
163
+ ```
164
+
165
+ `cleo changeset add` is the dedicated dual-write verb for `changeset` —
166
+ the kind's `canonicalHome` is `ssot-first` in `.cleo/canon.yml`, so the
167
+ `.changeset/*.md` file IS part of the contract (it's git-tracked). For
168
+ every other human-authored kind (`adr`, `spec`, `research`, `handoff`,
169
+ `note`, `plan`, `rcasd`) the canonical verb is `cleo docs add --type <kind>`.
170
+
171
+ **Migration rule for examples in this guide:** any example that
172
+ hand-writes `.changeset/*.md`, `.cleo/adrs/*.md`, `.cleo/research/*.md`,
173
+ or `.cleo/agent-outputs/*.md` is OBSOLETE. Update it to use the
174
+ registered verb instead. The CI gate `cleo check canon docs` will fail
175
+ the PR otherwise (T9796).
176
+
151
177
  ## Through SDK (preferred)
152
178
 
153
179
  CLEO docs are first-class records in the docs SSoT — not loose markdown files.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: ct-documentor
3
3
  description: Documentation coordinator with CLEO style guide compliance. Routes every canonical-doc write (spec, adr, research, handoff, note, llm-readme) through the docs SSoT via `cleo docs add` / `cleo docs publish` / `cleo docs fetch` — never raw filesystem writes. Coordinates ct-docs-lookup, ct-docs-write, ct-docs-review, ct-spec-writer, and ct-adr-recorder. Use when creating or updating documentation files, consolidating scattered documentation, or validating documentation against style standards. Triggers on documentation tasks, doc update requests, or style guide compliance checks.
4
- version: 3.2.0
4
+ version: 3.4.0
5
5
  tier: 3
6
6
  core: false
7
7
  category: specialist
@@ -92,7 +92,8 @@ cleo docs add T1234 docs/drafts/feature-x.md \
92
92
  - `--type` MUST be one of `spec | adr | research | handoff | note | llm-readme`.
93
93
  Pick the type by the document's purpose, not its filename.
94
94
  - `--slug` is the human-friendly retrieval handle (kebab-case). If taken the
95
- CLI returns `E_SLUG_TAKEN` with 3 alternatives — pick one, do not overwrite.
95
+ CLI returns `E_SLUG_RESERVED` (legacy alias `E_SLUG_TAKEN`) with 3
96
+ alternatives — pick one, do not overwrite.
96
97
  - The owner ID (`T1234` above) auto-classifies the attachment by prefix:
97
98
  `T###` → task, `ses_*` → session, `O-*` → observation.
98
99
 
@@ -126,6 +127,170 @@ The accepted positional + named surface is enumerated in
126
127
  flag names. Use the `--flag=value` form (`--type=spec`) or
127
128
  `--flag value` (`--type spec`) — both are recognised.
128
129
 
130
+ #### Slug allocation goes through ONE chokepoint (T10392 · Saga T10288)
131
+
132
+ Every code path that writes an attachment with a slug — `cleo docs add`,
133
+ `cleo changeset add`, and any future writer — MUST first call the central
134
+ allocator at `packages/core/src/docs/slug-allocator.ts:reserveSlug` BEFORE
135
+ invoking `attachmentStore.put({ slug })`. The allocator:
136
+
137
+ 1. Normalises the slug to canonical kebab-case (lowercase, trim, single
138
+ hyphens).
139
+ 2. Acquires a per-slug in-process Mutex so concurrent reservations
140
+ serialise.
141
+ 3. Returns `{ ok: false, code: 'E_SLUG_RESERVED', suggestions }` when the
142
+ slug is taken — uniform shape across both writers.
143
+
144
+ The `attachmentStore.put` chokepoint enforces this via a runtime assert
145
+ (`SlugNotReservedByAllocatorError`) when `CLEO_STRICT_SLUG_ALLOCATOR=1`
146
+ is set. Strict mode becomes default once `cleo changeset add` (T10388)
147
+ finishes wiring through the allocator. `cleo docs add` LIVE as of T10386:
148
+ the dispatch layer (`packages/cleo/src/dispatch/domains/docs.ts:add`)
149
+ calls `reserveSlug(type, slug)` BEFORE `attachmentStore.put`. Collisions
150
+ surface the uniform envelope:
151
+
152
+ ```json
153
+ {
154
+ "success": false,
155
+ "error": {
156
+ "code": "E_SLUG_RESERVED",
157
+ "message": "slug 'foo' is already in use in this project",
158
+ "details": {
159
+ "suggestions": ["foo-2", "foo-3", "foo-4"],
160
+ "aliases": ["E_SLUG_TAKEN"]
161
+ }
162
+ }
163
+ }
164
+ ```
165
+
166
+ `details.aliases` retains the legacy `E_SLUG_TAKEN` code for ONE release of
167
+ back-compat — downstream consumers grepping for the old code can still match
168
+ via the alias array. Removed after T-E1.3 (T10388) lands `cleo changeset add`
169
+ on the same chokepoint.
170
+
171
+ Slugs share a GLOBAL namespace across all DocKinds — `reserveSlug('changeset',
172
+ 'foo')` followed by `reserveSlug('research', 'foo')` collides. The decision
173
+ is recorded in **ADR-076 §6 amendment AMD-001** (slug
174
+ `adr-076-canonical-docs-ssot`, T10390 / E1.5). Three-point evidence (human-memorable
175
+ global lookup, DocKind-distinct prefix conventions, backward-compat cost) and
176
+ the full counterfactual analysis live in that amendment. Matches the
177
+ `uniq_attachments_slug` partial UNIQUE INDEX in migration `20260519000001`.
178
+
179
+ When choosing a slug, follow the DocKind prefix conventions in the routing
180
+ matrix above (`adr-NNN-*`, `spec-*`, `research-*`, `t<id>-*` for changesets,
181
+ etc.) — this is what makes cross-kind collisions structurally near-impossible.
182
+
183
+ #### One writer per DocKind — WriterRegistry SSoT (T10366 · Saga T10288 / Epic T10290)
184
+
185
+ `packages/core/src/docs/writer-registry.ts:WriterRegistry` is the SSoT for
186
+ "which CLI verb writes which DocKind". Every `BuiltinDocKind` maps to EXACTLY
187
+ ONE writer descriptor — multi-writer regressions trip the registry at build
188
+ time (the slug-collision class root-cause from T10294).
189
+
190
+ **Decision tree — pick the verb without guessing:**
191
+
192
+ ```text
193
+ if kind === 'changeset' → cleo changeset add
194
+ elif kind === 'llm-readme' → tooling-composed (system-managed)
195
+ elif kind === 'release-note' → cleo release reconcile (system-managed)
196
+ else → cleo docs add --type <kind>
197
+ ```
198
+
199
+ In code:
200
+
201
+ ```ts
202
+ import { WriterRegistry } from '@cleocode/core/internal';
203
+
204
+ const desc = WriterRegistry.for('changeset');
205
+ // → { kind: 'changeset', verb: 'changeset add', dispatchOp: 'changeset.add',
206
+ // coreFn: 'writeChangesetEntry', mode: 'ssot-first',
207
+ // sourcePath: 'packages/core/src/changesets/writer.ts' }
208
+
209
+ // Resolve the verb programmatically — no string-matching in caller code.
210
+ const verb = WriterRegistry.for(kind).verb; // 'docs add' | 'changeset add' | 'system-managed'
211
+ ```
212
+
213
+ Descriptor modes mirror `.cleo/canon.yml`'s `canonicalHome`:
214
+ - `'ssot'` — bytes live in the blob store; published copy is a mirror.
215
+ - `'ssot-first'` — dual-write via a dedicated verb (`changeset` today).
216
+ - `'system-managed'` — tooling-composed (e.g. `llm-readme`, `release-note`).
217
+
218
+ Test parity: every `ssot-first` descriptor MUST match a kind whose
219
+ `canonicalHome: 'ssot-first'` in `.cleo/canon.yml`, and vice versa.
220
+
221
+ **Legitimate bypass — `WriterRegistry.systemManaged` (T10368):** writers
222
+ for `system-managed` kinds (e.g. `generateDocsLlmsTxt`, `composeReleaseNotes`)
223
+ do not go through `cleo docs add` because the bytes are tooling-composed
224
+ rather than human-authored. The registry still names the producer via
225
+ `coreFn`, so drift tooling can follow the breadcrumb from kind →
226
+ core function without an exception list. Do NOT invent NEW `system-managed`
227
+ entries to dodge the docs-add path — every kind authored by a human MUST
228
+ flow through `cleo docs add` or `cleo changeset add`.
229
+
230
+ **Cross-link to the allocator contract:** the registry calls
231
+ {@link reserveSlug} BEFORE the writer delegates. A taken slug returns
232
+ `{ ok: false, code: 'E_SLUG_RESERVED', details: { suggestions } }`
233
+ with the SAME shape both `cleo docs add` and `cleo changeset add` surface
234
+ to callers (closing the T10294 envelope-drift bug). See the
235
+ "Slug allocation goes through ONE chokepoint" section above for the
236
+ allocator contract and the legacy `E_SLUG_TAKEN` alias.
237
+
238
+ T10366 establishes the registry contract; T10367 (docs add) and T10368
239
+ (changeset add) wire the actual writer delegation. Until those land,
240
+ `WriterRegistry.write()` returns `E_NOT_IMPLEMENTED` after consulting the
241
+ allocator — callers should continue invoking the existing writers
242
+ (`cleo docs add` dispatch handler, `writeChangesetEntry`) directly.
243
+
244
+ ### Slug similarity warn (T10361 · closes T10167)
245
+
246
+ `cleo docs add` runs a fuzzy-match check against existing slugs for the
247
+ SAME DocKind at write-time. If the proposed `--slug` is close to an
248
+ existing one (default threshold: normalised Levenshtein score ≥ `0.85`,
249
+ < `1.0`), the CLI surfaces "did you mean: `cleo docs update <slug>`?"
250
+ so an agent does not fork a near-duplicate when an update is the
251
+ intent. Exact (`1.0`) matches fall through to the slug-collision path
252
+ (`E_SLUG_TAKEN`) — they are NOT covered by this check.
253
+
254
+ ```bash
255
+ # Near-duplicate slug — warn mode is the project default.
256
+ $ cleo docs add T123 file.md --slug cant-spec --type spec
257
+ INFO Similar to 'cantspec' (score 0.89) — did you mean: cleo docs update cantspec? Pass --allow-similar to bypass.
258
+ # (write proceeds because mode=warn)
259
+
260
+ # Same input under `mode: block` (configured in .cleo/canon.yml) — exits 6.
261
+ $ cleo docs add T123 file.md --slug cant-spec --type spec
262
+ {
263
+ "success": false,
264
+ "error": {
265
+ "code": 6,
266
+ "codeName": "E_SLUG_SIMILARITY",
267
+ "message": "Similar to 'cantspec' (score 0.89) — did you mean: cleo docs update cantspec? Pass --allow-similar to bypass.",
268
+ "fix": "Use `cleo docs update cantspec` if updating, or pass --allow-similar to add as a new doc.",
269
+ "alternatives": [
270
+ { "action": "update 'cantspec' instead", "command": "cleo docs update cantspec" },
271
+ { "action": "bypass the similarity check", "command": "cleo docs add T123 file.md --slug cant-spec --type spec --allow-similar" }
272
+ ]
273
+ }
274
+ }
275
+
276
+ # Intentional add (true near-twin, not an update) — bypass + audit-log.
277
+ $ cleo docs add T123 file.md --slug cant-spec --type spec --allow-similar
278
+ # appends one JSONL line to .cleo/audit/similar-bypass.jsonl
279
+ ```
280
+
281
+ Project-level overrides live in `.cleo/canon.yml`:
282
+
283
+ ```yaml
284
+ similarity:
285
+ warnThreshold: 0.85 # 0..1 — score above this triggers the hint
286
+ mode: warn # 'warn' (default) | 'block'
287
+ ```
288
+
289
+ `mode: block` is recommended for CI agents — it surfaces the intent
290
+ mismatch as an exit code rather than a silently-printed warning that
291
+ non-TTY callers ignore. The `--allow-similar` flag is ALWAYS the
292
+ escape hatch and ALWAYS logged.
293
+
129
294
  ### Publish to a git-tracked path (when the doc must live on disk)
130
295
 
131
296
  ```bash
@@ -168,6 +333,35 @@ retrieval becomes impossible. Migrate every doc-type write to
168
333
 
169
334
  ---
170
335
 
336
+ ## Worktree-Aware Routing (T10389 / ADR-068 amendment §3.1)
337
+
338
+ When running from an agent-spawned worktree (e.g. under
339
+ `~/.local/share/cleo/worktrees/<hash>/<task>/`), `cleo docs add` and
340
+ `cleo changeset add` automatically route the SSoT write back to the
341
+ canonical project root. The bytes land in the MAIN repo's SSoT — never
342
+ inside the worktree.
343
+
344
+ You can pass file paths relative to the worktree cwd as usual:
345
+
346
+ ```bash
347
+ cd ~/.local/share/cleo/worktrees/<hash>/<task>/
348
+ cleo docs add T10389 docs/note.md --slug t10389-investigation --type note
349
+ # stderr: [T10389] routing SSoT write from worktree cwd <...> → canonical project root <...>
350
+ ```
351
+
352
+ The verbs detect a stray `.cleo/tasks.db` inside the worktree
353
+ (pre-T9803 leak or rogue write) and emit `E_STRAY_WORKTREE_DB` BEFORE
354
+ invoking the DB chokepoint, so the user gets actionable remediation
355
+ (`rm -rf <worktree>/.cleo`) instead of the deeper
356
+ `E_WT_DB_ISOLATION_VIOLATION` exception.
357
+
358
+ Suppress the routing log line with `CLEO_QUIET=1` if you need clean
359
+ stderr in automation. The fix-pack closes T10353 + T10354 + T10294's
360
+ 3-guard collision class (`E_PATH_TRAVERSAL` + `E_FILE_ERROR` +
361
+ `E_WT_DB_ISOLATION_VIOLATION`).
362
+
363
+ ---
364
+
171
365
  ## Core Principle: MAINTAIN, DON'T DUPLICATE
172
366
 
173
367
  ```
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: ct-task-executor
3
3
  description: General implementation task execution for completing assigned CLEO tasks by following instructions and producing concrete deliverables. Handles coding, configuration, documentation work with quality verification against acceptance criteria and progress reporting. Use when executing implementation tasks, completing assigned work, or producing task deliverables. Triggers on implementation tasks, general execution needs, or task completion work.
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  tier: 2
6
6
  core: true
7
7
  category: core
@@ -106,6 +106,28 @@ Context injection for implementation tasks spawned via cleo-subagent. Provides d
106
106
 
107
107
  ---
108
108
 
109
+ ## Worktree-Aware CLI Routing (T10389 / ADR-068 amendment §3.1)
110
+
111
+ When you operate inside an agent-spawned worktree (e.g. under
112
+ `~/.local/share/cleo/worktrees/<hash>/<task>/`), `cleo docs add` and
113
+ `cleo changeset add` automatically route their SSoT writes back to the
114
+ canonical project root. You can pass file paths relative to the
115
+ worktree cwd — the verb pre-resolves them against the worktree before
116
+ dispatching to the canonical-root-anchored sanitizer.
117
+
118
+ Both verbs detect a stray `.cleo/tasks.db` inside the worktree and
119
+ abort with `E_STRAY_WORKTREE_DB` + a clear remediation
120
+ (`rm -rf <worktree>/.cleo`). If you see `E_PATH_TRAVERSAL`,
121
+ `E_FILE_ERROR: Cannot read file`, or `E_WT_DB_ISOLATION_VIOLATION`,
122
+ update to a recent CLEO build that carries the fix-pack closing T10353
123
+ / T10354 / T10294 / T10365.
124
+
125
+ The routing prints a one-line info message to stderr (suppress with
126
+ `CLEO_QUIET=1`):
127
+ `[T10389] routing SSoT write from worktree cwd <cwd> → canonical project root <root>`
128
+
129
+ ---
130
+
109
131
  ## Subagent Protocol
110
132
 
111
133
  @skills/_shared/subagent-protocol-base.md
package/skills.json CHANGED
@@ -5,7 +5,7 @@
5
5
  {
6
6
  "name": "ct-cleo",
7
7
  "description": "CLEO task management protocol - core guidance for session, task, and workflow operations. Provides CLI-based workflow, session protocol, task discovery patterns, RCSD lifecycle overview, error handling, and the Human Render Contract (ADR-077). Load this skill for detailed CLEO protocol guidance.",
8
- "version": "2.1.0",
8
+ "version": "2.2.0",
9
9
  "path": "skills/ct-cleo/SKILL.md",
10
10
  "references": ["skills/ct-cleo/references/session-protocol.md", "skills/ct-cleo/references/loom-lifecycle.md", "skills/ct-cleo/references/anti-patterns.md"],
11
11
  "core": true,
@@ -17,7 +17,7 @@
17
17
  "compatibility": ["claude-code", "gemini-cli", "codex-cli"],
18
18
  "license": "MIT",
19
19
  "metadata": {
20
- "version": "2.1.0",
20
+ "version": "2.2.0",
21
21
  "lastReviewed": "2026-05-23",
22
22
  "stability": "stable"
23
23
  }
@@ -41,7 +41,7 @@
41
41
  {
42
42
  "name": "ct-task-executor",
43
43
  "description": "General implementation task execution for completing assigned CLEO tasks by following instructions and producing concrete deliverables. Handles coding, configuration, documentation work with quality verification against acceptance criteria and progress reporting.",
44
- "version": "2.0.0",
44
+ "version": "2.1.0",
45
45
  "path": "skills/ct-task-executor/SKILL.md",
46
46
  "references": [],
47
47
  "core": true,
@@ -137,7 +137,7 @@
137
137
  {
138
138
  "name": "ct-documentor",
139
139
  "description": "Documentation creation, editing, and review with CLEO style guide compliance. Coordinates specialized skills for lookup, writing, and review.",
140
- "version": "3.0.0",
140
+ "version": "3.4.0",
141
141
  "path": "skills/ct-documentor/SKILL.md",
142
142
  "references": [],
143
143
  "core": false,
@@ -169,7 +169,7 @@
169
169
  {
170
170
  "name": "ct-docs-write",
171
171
  "description": "Documentation writing with CLEO's conversational, clear, user-focused style. Use when creating, editing, or improving documentation files.",
172
- "version": "1.0.0",
172
+ "version": "1.1.0",
173
173
  "path": "skills/ct-docs-write/SKILL.md",
174
174
  "references": [],
175
175
  "core": false,