@cleocode/skills 2026.5.114 → 2026.5.120

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.114",
3
+ "version": "2026.5.120",
4
4
  "description": "CLEO skill definitions - bundled with CLEO monorepo",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -2,8 +2,8 @@
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.2.0
6
- lastReviewed: 2026-05-23
5
+ version: 2.3.0
6
+ lastReviewed: 2026-05-24
7
7
  stability: stable
8
8
  ---
9
9
 
@@ -198,3 +198,60 @@ If you see `E_PATH_TRAVERSAL`, `E_FILE_ERROR: Cannot read file`, or
198
198
  build that ships the T10389 fix-pack (closes T10353 + T10354 + T10294
199
199
  + T10365). Suppress the routing log with `CLEO_QUIET=1` for clean
200
200
  stderr in automation.
201
+
202
+ ---
203
+
204
+ ## CLI Output Contract (ADR-086 / Epic T9927 / E9 of Saga T9855)
205
+
206
+ `cleo` stdout is now **envelope-only**. NEVER pipe `cleo` output through
207
+ `tail`/`jq`/`python` — every common shape has a first-class flag.
208
+
209
+ | Need | Flag | Example |
210
+ |------|------|---------|
211
+ | Scalar extract (no jq) | `--field <jsonpointer>` | `cleo add 'X' --acceptance "..." --field /data/task/id` |
212
+ | ID-only pipeline | `--output id` | `cleo list --parent EPIC --output id \| while read c; do …; done` |
213
+ | Affected count | `--output count` | `cleo list --parent EPIC --status pending --output count` |
214
+ | TSV (no header) | `--output table` | `cleo list --parent EPIC --output table` |
215
+ | Silent (exit code only) | `--output silent` | `cleo update T123 --status done --output silent` |
216
+ | 1-line per record | `--summary` | `cleo list --parent EPIC --summary` |
217
+ | Suppress stderr noise | `--quiet` | `id=$(cleo add 'X' --acceptance "..." --quiet --field /data/task/id)` |
218
+ | Full record (legacy) | `--full` | `cleo show T123 --full` |
219
+
220
+ ### Defaults
221
+
222
+ - **Read ops** (`show`, `list`, `find`) — return the full LAFS envelope.
223
+ - **Mutate ops** (`add`, `add-batch`, `update`, `complete`) — return a
224
+ minimal envelope `{success, data: {count, ids[]}}` (T9931). Use `--full`
225
+ to opt back into the full record set.
226
+ - **stdout** carries exactly ONE LAFS envelope terminated by a single
227
+ newline. Sub-step logs/progress/warnings route through Pino → stderr.
228
+ This is regression-locked by CI gates `lint-stdout-discipline` (T10135)
229
+ and `lint-stdout-write-allowlist` (T9924).
230
+
231
+ ### Canonical agent patterns
232
+
233
+ ```bash
234
+ # Scalar extract — no jq needed.
235
+ id=$(cleo add 'Title' --type task --parent T9927 --acceptance "..." \
236
+ --field /data/task/id)
237
+
238
+ # ID-only pipeline — no JSON parsing.
239
+ cleo list --parent T9927 --output id | while read child; do
240
+ cleo verify "$child" --gate qaPassed --evidence "tool:lint;tool:typecheck"
241
+ done
242
+
243
+ # Count-only check.
244
+ remaining=$(cleo list --parent T9927 --status pending --output count)
245
+
246
+ # Fully clean pipeline — stdout has IDs, stderr is empty unless error.
247
+ cleo add-batch --file /tmp/batch.json --parent T9927 --quiet --output id
248
+ ```
249
+
250
+ ### Anti-patterns (REJECTED — these are CLI bugs if they appear post-E9)
251
+
252
+ - ❌ `cleo show T123 | tail -1 | jq -r .data.task.id` → use `--field /data/task/id`
253
+ - ❌ `cleo list --parent E1 | jq -r '.data.tasks[].id'` → use `--output id`
254
+ - ❌ `cleo show T123 | python3 -c 'import json,sys; …'` → use `--field`
255
+ - ❌ `cleo add 'X' 2>&1 | grep -oE 'T[0-9]+'` → use `--field /data/task/id`
256
+
257
+ Full contract + RFC 2119 invariants: `cleo docs fetch adr-086-cli-output-contract-e9`.
@@ -1,13 +1,13 @@
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.12.0
4
+ version: 3.14.0
5
5
  tier: 3
6
6
  core: false
7
7
  category: specialist
8
8
  protocol: null
9
9
  metadata:
10
- version: 3.12.0
10
+ version: 3.14.0
11
11
  lastReviewed: 2026-05-24
12
12
  stability: stable
13
13
  dependencies:
@@ -78,6 +78,51 @@ materializing through `cleo docs add` + (optionally) `cleo docs publish`.
78
78
 
79
79
  ---
80
80
 
81
+ ## Decision: update vs supersede vs create (T10168 · Saga T9855 / E12)
82
+
83
+ Before adding a new doc, ALWAYS ask: is this **a new doc**, **a change to an existing doc**, or **a replacement for an existing doc**?
84
+
85
+ ```
86
+ ┌─────────────────────────────────────────────────────────────────────┐
87
+ │ Question │ Verb │
88
+ ├─────────────────────────────────────────────────────────────────────┤
89
+ │ Same idea, fixing/extending content? │ cleo docs update <slug> │
90
+ │ → typo in ADR-076 │ (T10161 — in-place patch) │
91
+ │ → adding a clarifying paragraph │ │
92
+ │ → refreshing a stale section │ │
93
+ │ │
94
+ │ Replacing the whole canonical model? │ cleo docs supersede │
95
+ │ → "saga model v2" replaces v1 │ <old> <new> (T10162) │
96
+ │ → ADR-080 replaces ADR-073 │ (lifecycle flip + lineage)│
97
+ │ → new architecture supplants old │ │
98
+ │ │
99
+ │ Genuinely new idea? │ cleo docs find --similar │
100
+ │ → drafting a new spec │ <slug> FIRST (T10163) │
101
+ │ → fresh ADR for a new concern │ → if no hit, cleo docs add│
102
+ │ → recording a new investigation │ → if hit, route to update │
103
+ │ │
104
+ │ Tracing the lineage graph? │ cleo docs graph │
105
+ │ → "what does this doc replace?" │ --root <slug> (T10164) │
106
+ │ → "what tasks reference this ADR?" │ │
107
+ └─────────────────────────────────────────────────────────────────────┘
108
+ ```
109
+
110
+ ### Examples
111
+
112
+ - **"Fix a typo in ADR-076 saga-first-class"** → `cleo docs update adr-076-saga-first-class --body /tmp/fixed.md --message "fix typo in §2"`. NOT a new doc. NOT a supersession. Just patch in place; T10161 squashes patches within a 5-minute window so consecutive typo fixes don't bloat the audit log.
113
+
114
+ - **"Replace the entire saga-orchestration model with v2"** → `cleo docs add T9999 v2.md --type adr --slug adr-080-saga-orchestration-v2` followed by `cleo docs supersede adr-073-above-epic-naming adr-080-saga-orchestration-v2 --reason "v2 canonicalizes the SG- prefix + 4-tier hierarchy"`. Both rows survive in the attachments table; readers see `lifecycle_status=superseded` on v1 and `supersedes=adr-073` on v2.
115
+
116
+ - **"Drafting a new spec for the BRAIN recovery pipeline"** → FIRST run `cleo docs find --similar brain-recovery` (T10163). If similarity > 0.85 against an existing draft, ROUTE the request into `cleo docs update` instead — the existing draft is the canonical surface. If no near-match, proceed with `cleo docs add T#### draft.md --type spec --slug spec-brain-recovery-pipeline`.
117
+
118
+ - **"Auditing the supersession chain for ADR-039"** → `cleo docs graph --root adr-039-lafs-envelope-unification --depth 3`. Returns a DocProvenanceGraph envelope (T10166 contract) with nodes + edges, optionally `--format dot` for graphviz visualization.
119
+
120
+ ### Anti-patterns (INSTANT REJECTION)
121
+
122
+ - ❌ Calling `cleo docs add` with a slug that's only a typo-distance away from an existing doc — the auto-warn (T10167) fires `W_SLUG_SIMILAR`; respect it and route to `cleo docs update` instead of bypassing with `--allow-similar`.
123
+ - ❌ Editing a `.cleo/adrs/*.md` file directly with `Write` — bypasses the SSoT writer; T10366 `WriterRegistry` is the chokepoint and the docs SSoT will reconcile auto-emit drift.
124
+ - ❌ Creating a new doc when an existing one needs updating — bloats the attachments table and breaks lineage. The decision tree above resolves this — when in doubt, run `cleo docs find --similar <proposed-slug>` first.
125
+
81
126
  ## Through SDK (preferred)
82
127
 
83
128
  Documentation work flows through the docs SSoT in three steps —
@@ -147,11 +192,12 @@ invoking `attachmentStore.put({ slug })`. The allocator:
147
192
 
148
193
  The `attachmentStore.put` chokepoint enforces this via a runtime assert
149
194
  (`SlugNotReservedByAllocatorError`) when `CLEO_STRICT_SLUG_ALLOCATOR=1`
150
- is set. Strict mode becomes default once `cleo changeset add` (T10388)
151
- finishes wiring through the allocator. `cleo docs add` LIVE as of T10386:
152
- the dispatch layer (`packages/cleo/src/dispatch/domains/docs.ts:add`)
153
- calls `reserveSlug(type, slug)` BEFORE `attachmentStore.put`. Collisions
154
- surface the uniform envelope:
195
+ is set. Strict mode becomes default in the next release after both
196
+ writers are wired. **BOTH writers are LIVE on the allocator as of T10388**:
197
+ `cleo docs add` (T10386 — `packages/cleo/src/dispatch/domains/docs.ts:add`)
198
+ and `cleo changeset add` (T10388 `packages/core/src/changesets/writer.ts:writeChangesetEntry`)
199
+ both call `reserveSlug(kind, slug)` BEFORE any filesystem or DB mutation.
200
+ Collisions surface the uniform envelope:
155
201
 
156
202
  ```json
157
203
  {
@@ -167,10 +213,10 @@ surface the uniform envelope:
167
213
  }
168
214
  ```
169
215
 
170
- `details.aliases` retains the legacy `E_SLUG_TAKEN` code for ONE release of
171
- back-compat downstream consumers grepping for the old code can still match
172
- via the alias array. Removed after T-E1.3 (T10388) lands `cleo changeset add`
173
- on the same chokepoint.
216
+ `details.aliases` retains the legacy `E_SLUG_TAKEN` (docs-add path) /
217
+ `E_SSOT_WRITE_FAILED` (changeset-add path) codes for ONE release of
218
+ back-compat downstream consumers grepping for the old codes can still match
219
+ via the alias array. Removed after E2 (T10290 — DocKind writer dedup) lands.
174
220
 
175
221
  Slugs share a GLOBAL namespace across all DocKinds — `reserveSlug('changeset',
176
222
  'foo')` followed by `reserveSlug('research', 'foo')` collides. The decision
@@ -484,6 +530,46 @@ observation pollutes the FTS index. Use `cleo memory backfill-docs` (AC4
484
530
  of T9976) only to repair attachments that pre-date the auto-emit feature
485
531
  or were written outside the SSoT.
486
532
 
533
+ #### System-managed exemptions (T10368)
534
+
535
+ Not every `.md` write inside `packages/core/src/**` is a DocKind authoring
536
+ path. Release composers, RCASD migration tooling, nexus wiki generators, and
537
+ the publish-mirror copier all emit Markdown bytes from inside `core/` but
538
+ SHOULD NOT route through `WriterRegistry.write` — they are deterministic
539
+ derived artifacts, not user-authored canonical documents.
540
+
541
+ These legitimate bypasses live in `SYSTEM_MANAGED_ENTRIES` inside
542
+ `writer-registry.ts`. Every entry cites an ADR pointer:
543
+
544
+ ```ts
545
+ WriterRegistry.listSystemManaged();
546
+ // → [
547
+ // { id: 'release.plan-json', adrRef: 'ADR-028 ...' },
548
+ // { id: 'release.changelog', adrRef: 'ADR-028 §2.5 ...' },
549
+ // { id: 'lifecycle.rcasd-migration', adrRef: 'ADR-076 ...' },
550
+ // { id: 'lifecycle.stage-artifact', adrRef: 'ADR-076 ...' },
551
+ // { id: 'sessions.handoff-markdown', adrRef: 'ADR-076 ...' },
552
+ // { id: 'nexus.wiki-overview', adrRef: 'ADR-076 ...' },
553
+ // { id: 'docs.publish-mirror', adrRef: 'ADR-076 ...' },
554
+ // ]
555
+
556
+ // Path-based exemption lookup — used by the writer-audit test + T10369 lint:
557
+ const hit = WriterRegistry.isSystemManaged('.cleo/release/v2026.5.103.plan.json');
558
+ // → { id: 'release.plan-json', kind: null, adrRef: 'ADR-028 ...', ... }
559
+ ```
560
+
561
+ When adding a NEW `.md` writer inside `packages/core/src/**`, you MUST
562
+ either:
563
+
564
+ 1. Route through `WriterRegistry.write({kind, slug, payload})` (the
565
+ canonical path for DocKind authoring), OR
566
+ 2. Append a new entry to `SYSTEM_MANAGED_ENTRIES` with an ADR pointer
567
+ ratifying the bypass.
568
+
569
+ The `writer-audit.test.ts` regression test fails when a new `.md` writer
570
+ appears without either path. T10369 (next in the epic) promotes this from a
571
+ unit test to a full CI lint gate.
572
+
487
573
  ### Slug similarity warn (T10361 · closes T10167)
488
574
 
489
575
  `cleo docs add` runs a fuzzy-match check against existing slugs for the
@@ -77,6 +77,62 @@ Governance: see **ADR-051** (programmatic gate integrity) which defines the evid
77
77
 
78
78
  ---
79
79
 
80
+ ## Blast-Radius Test Scope (MANDATORY · T9842)
81
+
82
+ When acting as the IVTR Lead in the **Validate** phase (R2), the targeted test
83
+ files named in the task spec are NOT sufficient evidence on their own when the
84
+ Implement phase touched an infrastructure file. Targeted-only test review is
85
+ how cross-package regressions slip past the Lead.
86
+
87
+ ### Precedent — T9814 R2
88
+
89
+ T9814 swapped `BEGIN IMMEDIATE` for SAVEPOINTs in
90
+ `packages/core/src/store/sqlite-data-accessor.ts` to support nested
91
+ transactions for `add-batch`. Every targeted test passed (6/6 add-batch,
92
+ 34/34 add, 9/9 allocate). IVTR Lead R2 approved on the targeted scope. CI
93
+ then surfaced `agent-resolver.test.ts preferTier` failing — the resolver
94
+ depended on the outer `BEGIN IMMEDIATE` semantics that SAVEPOINTs do not
95
+ replicate verbatim. Hotfix commit `baa996d2b` restored the outer-tx case.
96
+ The Lead's targeted-only review missed a regression CI caught seconds later.
97
+
98
+ ### Rule
99
+
100
+ If ANY file in the impl-phase evidence bundle's `filesChanged` matches a
101
+ canonical infrastructure path, the Lead MUST run the full per-package vitest
102
+ suite for every touched package — NOT the targeted files alone.
103
+
104
+ ### Canonical infrastructure paths
105
+
106
+ - `packages/core/src/store/**` — DB chokepoint, transactions, migrations
107
+ - `packages/core/src/orchestration/**` — spawn-prompt, dispatch resolution, IVTR
108
+ - `packages/core/src/dispatch/**` and `packages/cleo/src/dispatch/**` — typed dispatch
109
+ - `packages/contracts/src/**` — cross-package types (every consumer rebuilds)
110
+ - `packages/worktree/src/**` — worktree-create / git-shim integration
111
+ - `packages/core/src/migration/**` — schema bootstrapping
112
+ - any path whose basename contains `transaction`, `pragma`, or `migration`
113
+
114
+ ### Required test commands per touched package
115
+
116
+ ```bash
117
+ pnpm --filter @cleocode/<pkg> run test # for each touched package
118
+ ```
119
+
120
+ Attach the JSON output of each run as evidence
121
+ (`cleo docs add --labels test-output`) and reference the sha256 set in the
122
+ `--next` call. Approving on targeted-only results when infrastructure paths
123
+ are touched is grounds for loop-back with reason `infra-test-scope-violation`.
124
+
125
+ ### Enforcement
126
+
127
+ The IVTR Lead spawn prompt is auto-enriched by `resolvePhasePrompt()` in
128
+ `packages/core/src/lifecycle/ivtr-loop.ts` — when an infrastructure touch is
129
+ detected via `detectInfrastructureTouch()` (`packages/core/src/lifecycle/infra-touch.ts`),
130
+ a `### Blast-Radius Test Scope — MANDATORY (T9842)` block is appended to
131
+ the Validate-phase Lead prompt, listing the touched packages and the exact
132
+ `pnpm --filter` commands the Lead must run.
133
+
134
+ ---
135
+
80
136
  ## Output Format
81
137
 
82
138
  ### Validation Report Structure
package/skills.json CHANGED
@@ -4,8 +4,8 @@
4
4
  "skills": [
5
5
  {
6
6
  "name": "ct-cleo",
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.2.0",
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, the Human Render Contract (ADR-077), and the CLI Output Contract (ADR-086). Load this skill for detailed CLEO protocol guidance.",
8
+ "version": "2.3.0",
9
9
  "path": "skills/ct-cleo/SKILL.md",
10
10
  "references": [
11
11
  "skills/ct-cleo/references/session-protocol.md",
@@ -27,8 +27,8 @@
27
27
  ],
28
28
  "license": "MIT",
29
29
  "metadata": {
30
- "version": "2.2.0",
31
- "lastReviewed": "2026-05-23",
30
+ "version": "2.3.0",
31
+ "lastReviewed": "2026-05-24",
32
32
  "stability": "stable"
33
33
  }
34
34
  },