@cleocode/skills 2026.5.83 → 2026.5.86
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 +1 -1
- package/skills/_shared/__tests__/lifecycle-protocol-reconcile.test.ts +112 -0
- package/skills/_shared/__tests__/loom-adr-links.test.ts +163 -0
- package/skills/_shared/__tests__/loom-stage-coverage.test.ts +167 -0
- package/skills/ct-adr-recorder/SKILL.md +92 -0
- package/skills/ct-adr-recorder/__tests__/skill-adr-recorder.test.ts +65 -0
- package/skills/ct-consensus-voter/SKILL.md +14 -0
- package/skills/ct-contribution/SKILL.md +80 -0
- package/skills/ct-docs-lookup/SKILL.md +116 -1
- package/skills/ct-docs-lookup/references/ctx7-workflow.md +198 -0
- package/skills/ct-docs-lookup/references/library-id-resolution.md +217 -0
- package/skills/ct-docs-lookup/references/version-specific-docs.md +220 -0
- package/skills/ct-docs-review/SKILL.md +133 -1
- package/skills/ct-docs-review/__tests__/skill-docs-review.test.ts +53 -0
- package/skills/ct-docs-review/references/inline-comment-patterns.md +268 -0
- package/skills/ct-docs-review/references/pr-review-mode.md +270 -0
- package/skills/ct-docs-review/references/style-violations.md +341 -0
- package/skills/ct-docs-write/SKILL.md +157 -1
- package/skills/ct-docs-write/__tests__/skill-docs-write.test.ts +55 -0
- package/skills/ct-docs-write/references/audience-targeting.md +305 -0
- package/skills/ct-docs-write/references/cleo-style-guide.md +234 -0
- package/skills/ct-docs-write/references/markdown-patterns.md +329 -0
- package/skills/ct-documentor/SKILL.md +11 -0
- package/skills/ct-documentor/references/anti-patterns.md +216 -0
- package/skills/ct-documentor/references/chain-orchestration.md +194 -0
- package/skills/ct-documentor/references/doc-types-and-templates.md +301 -0
- package/skills/ct-documentor/references/style-coordination.md +195 -0
- package/skills/ct-epic-architect/SKILL.md +15 -0
- package/skills/ct-ivt-looper/SKILL.md +32 -0
- package/skills/ct-release-orchestrator/SKILL.md +16 -0
- package/skills/ct-research-agent/SKILL.md +24 -0
- package/skills/ct-research-agent/references/anti-patterns.md +154 -0
- package/skills/ct-research-agent/references/citation-and-evidence.md +140 -0
- package/skills/ct-research-agent/references/source-strategy.md +116 -0
- package/skills/ct-research-agent/references/triggers-and-routing.md +93 -0
- package/skills/ct-skill-validator/SKILL.md +19 -0
- package/skills/ct-skill-validator/scripts/check_depth.py +306 -0
- package/skills/ct-spec-writer/SKILL.md +86 -1
- package/skills/ct-spec-writer/__tests__/skill-spec-writer.test.ts +60 -0
- package/skills/ct-spec-writer/references/anti-patterns.md +176 -0
- package/skills/ct-spec-writer/references/rfc2119-language.md +138 -0
- package/skills/ct-spec-writer/references/spec-templates.md +233 -0
- package/skills/ct-spec-writer/references/traceability-matrix.md +145 -0
- package/skills/ct-task-executor/SKILL.md +25 -0
- package/skills/ct-task-executor/references/acceptance-criteria-mapping.md +163 -0
- package/skills/ct-task-executor/references/anti-patterns.md +201 -0
- package/skills/ct-task-executor/references/common-failures.md +193 -0
- package/skills/ct-task-executor/references/evidence-and-gates.md +179 -0
- package/skills/ct-task-executor/references/implementation-patterns.md +160 -0
- package/skills/ct-validator/SKILL.md +44 -0
- package/skills/ct-validator/references/anti-patterns.md +194 -0
- package/skills/ct-validator/references/compliance-reports.md +199 -0
- package/skills/ct-validator/references/schema-checking.md +191 -0
- package/skills/ct-validator/references/validation-modes.md +185 -0
- package/skills/manifest.json +82 -16
|
@@ -105,4 +105,160 @@ Not: "(remember to run X before Y...)" buried in a paragraph.
|
|
|
105
105
|
| take a look at | reference |
|
|
106
106
|
| can't, don't | cannot, do not |
|
|
107
107
|
| **Filter** button | \`Filter\` button |
|
|
108
|
-
| Check out [the docs](link) | Click [here](link) |
|
|
108
|
+
| Check out [the docs](link) | Click [here](link) |
|
|
109
|
+
|
|
110
|
+
## The Three Pillars (Why)
|
|
111
|
+
|
|
112
|
+
CLEO documentation has three principles. Every rule supports one of them.
|
|
113
|
+
|
|
114
|
+
1. **Conversational.** Read aloud — does it sound like you talking? CLEO docs
|
|
115
|
+
use contractions (don't, can't) where many style guides ban them. The
|
|
116
|
+
contractions are deliberate; they make the writing feel like a colleague
|
|
117
|
+
talking, not a corporate press release.
|
|
118
|
+
|
|
119
|
+
2. **Clear.** Lead with what to do; explain after. Headings state the point,
|
|
120
|
+
not just the topic. "Configure release pipeline before first ship" beats
|
|
121
|
+
"Configuration" every time.
|
|
122
|
+
|
|
123
|
+
3. **User-focused.** Say "people" and "companies" — not "users". The user
|
|
124
|
+
construct is for systems; people are the readers. This change is jarring
|
|
125
|
+
the first time, then becomes second nature.
|
|
126
|
+
|
|
127
|
+
## Forbidden Phrases (Most Common Failures)
|
|
128
|
+
|
|
129
|
+
These ship to PR, get caught in review, and create rework. Avoid them up
|
|
130
|
+
front.
|
|
131
|
+
|
|
132
|
+
- "easy" / "simple" / "just" — patronizing; you don't know the reader's context
|
|
133
|
+
- "obviously" / "of course" — same problem
|
|
134
|
+
- "click here" / "read more here" — link text must describe the destination
|
|
135
|
+
- "etc." / "and so on" — be specific, or cut the sentence
|
|
136
|
+
- "we" referring to CLEO — say "CLEO" or "it"
|
|
137
|
+
|
|
138
|
+
## Audience-Matching
|
|
139
|
+
|
|
140
|
+
Match complexity to audience. Mismatch is the biggest style failure.
|
|
141
|
+
|
|
142
|
+
| Audience | Tone | Code examples | Depth |
|
|
143
|
+
|----------|------|---------------|-------|
|
|
144
|
+
| End-user | Conversational, second-person | Realistic, copy-paste | Low |
|
|
145
|
+
| Agent (LLM) | Dense, structured | Schemas, JSON | Medium |
|
|
146
|
+
| Maintainer | Technical, third-person | Code with internals | High |
|
|
147
|
+
|
|
148
|
+
Declare the audience in frontmatter — `audience: end-user | agent | maintainer`
|
|
149
|
+
— so reviewers can apply the right rubric.
|
|
150
|
+
|
|
151
|
+
## Through SDK (preferred)
|
|
152
|
+
|
|
153
|
+
CLEO docs are first-class records in the docs SSoT — not loose markdown files.
|
|
154
|
+
Always write through `cleo docs add` so the doc gets a slug, a type, an owner,
|
|
155
|
+
and a content-addressed blob that downstream consumers can fetch by slug.
|
|
156
|
+
|
|
157
|
+
### Write a draft attached to a task
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
cleo docs add T1234 docs/drafts/saml-setup.md \
|
|
161
|
+
--type note \
|
|
162
|
+
--slug saml-setup-draft \
|
|
163
|
+
--desc "Conversational SAML setup walkthrough — pre-review"
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
- `--type` MUST be one of `spec | adr | research | handoff | note | llm-readme`.
|
|
167
|
+
For user-facing prose use `note`; for end-user docs use `note` or `spec`
|
|
168
|
+
depending on whether the doc carries REQ-XXX requirements.
|
|
169
|
+
- `--slug` is the human-friendly handle for retrieval. Use kebab-case. If the
|
|
170
|
+
slug is already taken the CLI returns `E_SLUG_TAKEN` with 3 alternatives —
|
|
171
|
+
pick one rather than overwriting silently.
|
|
172
|
+
- The owner ID (`T1234` above) auto-classifies the attachment by prefix:
|
|
173
|
+
`T###` → task, `ses_*` → session, `O-*` → observation.
|
|
174
|
+
|
|
175
|
+
### Publish to a git-tracked path (when the doc must live on disk)
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
cleo docs publish --for T1234 --to docs/saml-setup.md
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Atomic tmp-then-rename. The published file ships in the next commit; the
|
|
182
|
+
SSoT blob remains canonical and continues to track future versions.
|
|
183
|
+
|
|
184
|
+
### Fetch the doc back by slug
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
cleo docs fetch saml-setup-draft # latest version
|
|
188
|
+
cleo docs versions --for T1234 # list every SHA version
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Slug-based fetch is the contract used by reviewers, downstream skills, and
|
|
192
|
+
the docs graph — never grep the filesystem for the file you just wrote.
|
|
193
|
+
|
|
194
|
+
### List docs by type
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
cleo docs list --type note --project # every note in this project
|
|
198
|
+
cleo docs list --task T1234 # everything attached to a task
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Deprecated: Direct filesystem
|
|
202
|
+
|
|
203
|
+
The legacy "write straight to `docs/` and commit" pattern is deprecated.
|
|
204
|
+
The drift between the working file and the docs SSoT is real: published
|
|
205
|
+
files go stale, types are inferred ad-hoc from path, and slug-based
|
|
206
|
+
retrieval becomes impossible. Migrate to `cleo docs add --type X --slug Y`
|
|
207
|
+
for every new doc — and use `cleo docs sync --from <path> --for <ownerId>`
|
|
208
|
+
to back-fill existing on-disk files into the SSoT.
|
|
209
|
+
|
|
210
|
+
## Output Location
|
|
211
|
+
|
|
212
|
+
Documentation blobs live in the docs SSoT; published copies on disk go in
|
|
213
|
+
`docs/` for end-user and maintainer content. Agent-facing protocol docs
|
|
214
|
+
(skill references, agent-outputs) go in
|
|
215
|
+
`packages/skills/skills/<name>/references/` or `.cleo/agent-outputs/`.
|
|
216
|
+
Never mix audiences in one location.
|
|
217
|
+
|
|
218
|
+
## When to Update Instead of Create
|
|
219
|
+
|
|
220
|
+
The MAINTAIN, DON'T DUPLICATE rule from ct-documentor applies here too.
|
|
221
|
+
Before creating any new file:
|
|
222
|
+
|
|
223
|
+
1. Run `Glob: docs/**/*.md` and `Grep: <topic-keywords> path=docs/` to find
|
|
224
|
+
prior coverage.
|
|
225
|
+
2. If a prior page exists, UPDATE that page. Add a section if needed.
|
|
226
|
+
3. If multiple prior pages cover the topic in fragments, propose a
|
|
227
|
+
consolidation to the documentor coordinator before writing.
|
|
228
|
+
4. Only create a new file when no existing location fits.
|
|
229
|
+
|
|
230
|
+
The cost of duplicate documentation is paid by every future reader —
|
|
231
|
+
they find one page or the other depending on search keywords, and the
|
|
232
|
+
two versions inevitably drift.
|
|
233
|
+
|
|
234
|
+
## Final-Pass Checklist
|
|
235
|
+
|
|
236
|
+
Before declaring the draft done:
|
|
237
|
+
|
|
238
|
+
- [ ] All code blocks have explicit language tags (`bash`, `typescript`, not `ts`).
|
|
239
|
+
- [ ] All links have descriptive text (no "here", "this").
|
|
240
|
+
- [ ] All headings state the point in sentence case.
|
|
241
|
+
- [ ] All "users" replaced with "people" or "companies".
|
|
242
|
+
- [ ] Contractions present (don't, can't, won't).
|
|
243
|
+
- [ ] No "easy", "simple", "just", "obviously" anywhere (including code comments).
|
|
244
|
+
- [ ] Frontmatter title and H1 match.
|
|
245
|
+
- [ ] Audience declared in frontmatter.
|
|
246
|
+
- [ ] Final newline at end of file.
|
|
247
|
+
|
|
248
|
+
Run grep for the forbidden phrases before completing:
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
for word in easy simple just obviously "click here" "read more"; do
|
|
252
|
+
grep -in "$word" <new-file>
|
|
253
|
+
done
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## See references/
|
|
259
|
+
|
|
260
|
+
Progressive disclosure — load on demand only:
|
|
261
|
+
|
|
262
|
+
- `references/cleo-style-guide.md` — the three pillars, forbidden phrases, format conventions, hidden drift
|
|
263
|
+
- `references/markdown-patterns.md` — code-block / table / list / link / callout patterns with positive/negative examples
|
|
264
|
+
- `references/audience-targeting.md` — end-user / agent / maintainer profiles, mixed-audience pitfalls, re-targeting
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Regression test for ct-docs-write/SKILL.md (T9641 / Epic T9629 / Saga T9625).
|
|
3
|
+
*
|
|
4
|
+
* Pins the SDK-first writing contract: every new doc MUST flow through
|
|
5
|
+
* `cleo docs add --type X --slug Y` rather than direct filesystem writes.
|
|
6
|
+
* If a future edit drops the SDK section, this test breaks the build so
|
|
7
|
+
* the writing protocol can't silently regress to the deprecated pattern.
|
|
8
|
+
*
|
|
9
|
+
* @task T9641
|
|
10
|
+
* @epic T9629
|
|
11
|
+
* @saga T9625
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { readFileSync } from 'node:fs';
|
|
15
|
+
import { dirname, join, resolve } from 'node:path';
|
|
16
|
+
import { fileURLToPath } from 'node:url';
|
|
17
|
+
import { describe, expect, it } from 'vitest';
|
|
18
|
+
|
|
19
|
+
const thisFile = fileURLToPath(import.meta.url);
|
|
20
|
+
const skillRoot = resolve(dirname(thisFile), '..');
|
|
21
|
+
const skillPath = join(skillRoot, 'SKILL.md');
|
|
22
|
+
const skillContent = readFileSync(skillPath, 'utf-8');
|
|
23
|
+
|
|
24
|
+
describe('ct-docs-write SKILL.md — SDK-first contract (T9641)', () => {
|
|
25
|
+
it('teaches `cleo docs add` as the canonical write path', () => {
|
|
26
|
+
expect(skillContent).toContain('cleo docs add');
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('mentions the closed-set --type taxonomy', () => {
|
|
30
|
+
expect(skillContent).toMatch(/spec\s*\|\s*adr\s*\|\s*research\s*\|\s*handoff\s*\|\s*note\s*\|\s*llm-readme/);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('shows --slug as the human-friendly retrieval handle', () => {
|
|
34
|
+
expect(skillContent).toContain('--slug');
|
|
35
|
+
expect(skillContent).toContain('kebab-case');
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('shows `cleo docs publish --for ... --to ...` for git-tracked publication', () => {
|
|
39
|
+
expect(skillContent).toMatch(/cleo docs publish\s+--for[\s\S]+--to/);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('shows `cleo docs fetch` for slug-based retrieval', () => {
|
|
43
|
+
expect(skillContent).toContain('cleo docs fetch');
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('marks the old direct-filesystem path as deprecated with a migration note', () => {
|
|
47
|
+
expect(skillContent).toContain('Deprecated: Direct filesystem');
|
|
48
|
+
// Migration must point at the SDK
|
|
49
|
+
expect(skillContent).toMatch(/cleo docs (add|sync)/);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('references E_SLUG_TAKEN so callers know how to handle collisions', () => {
|
|
53
|
+
expect(skillContent).toContain('E_SLUG_TAKEN');
|
|
54
|
+
});
|
|
55
|
+
});
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
# Audience Targeting
|
|
2
|
+
|
|
3
|
+
CLEO docs serve three audiences with very different needs. Writing
|
|
4
|
+
without identifying the audience produces docs that satisfy none.
|
|
5
|
+
This reference defines each audience's profile and how to tune the
|
|
6
|
+
draft to fit.
|
|
7
|
+
|
|
8
|
+
## Three Audiences
|
|
9
|
+
|
|
10
|
+
| Audience | Profile | Reading goal |
|
|
11
|
+
|----------|---------|--------------|
|
|
12
|
+
| End-user | Uses CLEO to ship their own software | "Help me do this thing now" |
|
|
13
|
+
| Agent | LLM consuming the doc as context | "Give me the structure I need" |
|
|
14
|
+
| Maintainer | Contributes to CLEO itself | "Show me how this works internally" |
|
|
15
|
+
|
|
16
|
+
Identifying the audience is the first step in any documentation task.
|
|
17
|
+
The downstream choices — tone, depth, examples, structure — all flow
|
|
18
|
+
from this single decision.
|
|
19
|
+
|
|
20
|
+
## End-User Audience
|
|
21
|
+
|
|
22
|
+
The end-user has installed CLEO and wants to use it. They are a
|
|
23
|
+
developer or a tech-comfortable team lead. They are working — not
|
|
24
|
+
exploring.
|
|
25
|
+
|
|
26
|
+
### Tone
|
|
27
|
+
|
|
28
|
+
Conversational, practical, second-person.
|
|
29
|
+
|
|
30
|
+
```markdown
|
|
31
|
+
You can run the release pipeline manually with `cleo release ship`.
|
|
32
|
+
Just kidding — never use "just". Run it with `cleo release ship`,
|
|
33
|
+
and CLEO walks through the gates one by one.
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Depth
|
|
37
|
+
|
|
38
|
+
Show the action; show the outcome; show the recovery if it fails.
|
|
39
|
+
Do not explain why unless the why directly affects behavior.
|
|
40
|
+
|
|
41
|
+
```markdown
|
|
42
|
+
GOOD (end-user):
|
|
43
|
+
Run `cleo release ship 2026.5.82 --epic T9567`.
|
|
44
|
+
|
|
45
|
+
You see:
|
|
46
|
+
- The 12 release steps run in order.
|
|
47
|
+
- CI status streams in real-time.
|
|
48
|
+
- On success, the tag is pushed and the PR merges.
|
|
49
|
+
|
|
50
|
+
If a step fails, CLEO stops and prints the failing gate. Fix the issue
|
|
51
|
+
and re-run.
|
|
52
|
+
|
|
53
|
+
BAD (end-user, too deep):
|
|
54
|
+
The `cleo release ship` command dispatches through `dispatch.ts`,
|
|
55
|
+
loading the `release` handler from the registry built at module
|
|
56
|
+
init. The handler then constructs a release plan using the 12-stage
|
|
57
|
+
state machine defined in `packages/cleo/src/commands/release/...`
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Examples
|
|
61
|
+
|
|
62
|
+
Realistic. Copy-paste-able. With expected output.
|
|
63
|
+
|
|
64
|
+
```markdown
|
|
65
|
+
GOOD:
|
|
66
|
+
```bash
|
|
67
|
+
$ cleo show T9567
|
|
68
|
+
T9567 — E-SKILLS-DEPTH-BACKFILL
|
|
69
|
+
Status: pending
|
|
70
|
+
Acceptance:
|
|
71
|
+
1. Each of 6+ stub skills gains references/ with min 3 docs each
|
|
72
|
+
...
|
|
73
|
+
```
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Structure
|
|
77
|
+
|
|
78
|
+
How-to or tutorial template. The reader scans for steps; give them
|
|
79
|
+
steps.
|
|
80
|
+
|
|
81
|
+
## Agent Audience
|
|
82
|
+
|
|
83
|
+
The agent is an LLM — Claude, GPT, a CLEO subagent. It consumes the
|
|
84
|
+
doc as context for completing a task. Its needs are very different
|
|
85
|
+
from the human's.
|
|
86
|
+
|
|
87
|
+
### Tone
|
|
88
|
+
|
|
89
|
+
Dense, structured, declarative. Bullet points and tables over prose.
|
|
90
|
+
|
|
91
|
+
```markdown
|
|
92
|
+
GOOD (agent):
|
|
93
|
+
Worker contract:
|
|
94
|
+
1. cd to worktree path (provided in spawn prompt)
|
|
95
|
+
2. read task with `cleo show <ID>`
|
|
96
|
+
3. implement; commit on task branch
|
|
97
|
+
4. verify each gate with `cleo verify --gate X --evidence Y`
|
|
98
|
+
5. complete with `cleo complete <ID>`
|
|
99
|
+
6. observe learning with `cleo memory observe`
|
|
100
|
+
|
|
101
|
+
BAD (agent, too narrative):
|
|
102
|
+
When the worker starts up, it first navigates to the worktree the
|
|
103
|
+
orchestrator created. This is important because all subsequent
|
|
104
|
+
operations need to happen inside the worktree's boundary. After
|
|
105
|
+
arrival, the worker reads the task it was assigned...
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Depth
|
|
109
|
+
|
|
110
|
+
Maximum useful. The agent can absorb dense reference material; it
|
|
111
|
+
prefers structured data to prose framing.
|
|
112
|
+
|
|
113
|
+
### Examples
|
|
114
|
+
|
|
115
|
+
Schemas, JSON, command sequences. Show the data shape directly.
|
|
116
|
+
|
|
117
|
+
```markdown
|
|
118
|
+
Manifest entry shape:
|
|
119
|
+
|
|
120
|
+
```json
|
|
121
|
+
{
|
|
122
|
+
"id": "<topic>-<date>",
|
|
123
|
+
"file": "<filename>",
|
|
124
|
+
"title": "<title>",
|
|
125
|
+
"status": "complete" | "partial" | "blocked",
|
|
126
|
+
"agent_type": "research" | "spec" | "implementation" | ...,
|
|
127
|
+
"topics": ["<tag>", "<tag>"],
|
|
128
|
+
"key_findings": ["<sentence>", ...],
|
|
129
|
+
"actionable": true | false,
|
|
130
|
+
"needs_followup": ["<task-id>", ...],
|
|
131
|
+
"linked_tasks": ["<epic-id>", "<task-id>"]
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Structure
|
|
137
|
+
|
|
138
|
+
Reference template. Tables. Bullet lists. The agent doesn't need
|
|
139
|
+
warm-up prose.
|
|
140
|
+
|
|
141
|
+
## Maintainer Audience
|
|
142
|
+
|
|
143
|
+
The maintainer is a CLEO contributor — they have read the codebase
|
|
144
|
+
and want to understand or modify the internals. They are exploring
|
|
145
|
+
or making architectural decisions.
|
|
146
|
+
|
|
147
|
+
### Tone
|
|
148
|
+
|
|
149
|
+
Technical, precise, third-person.
|
|
150
|
+
|
|
151
|
+
```markdown
|
|
152
|
+
GOOD (maintainer):
|
|
153
|
+
The release pipeline is implemented as a 12-stage state machine in
|
|
154
|
+
`packages/cleo/src/commands/release/`. Stages are pure functions
|
|
155
|
+
that take a `ReleaseContext` and return either `{ ok: true, ctx }`
|
|
156
|
+
or `{ ok: false, error }`. The dispatcher in `pipeline.ts` runs
|
|
157
|
+
stages in declared order, short-circuiting on failure.
|
|
158
|
+
|
|
159
|
+
BAD (maintainer, too casual):
|
|
160
|
+
Releases work through this cool 12-step thing. Each step is a
|
|
161
|
+
function that either works or doesn't. If a step fails, we stop.
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Depth
|
|
165
|
+
|
|
166
|
+
Maximum. Internal symbols, file paths, design decisions. The reader
|
|
167
|
+
is expected to follow links into the codebase.
|
|
168
|
+
|
|
169
|
+
### Examples
|
|
170
|
+
|
|
171
|
+
Code excerpts with the actual implementation. Reference to ADRs
|
|
172
|
+
and prior discussions.
|
|
173
|
+
|
|
174
|
+
```markdown
|
|
175
|
+
The dispatcher signature is:
|
|
176
|
+
|
|
177
|
+
```typescript
|
|
178
|
+
// packages/cleo/src/commands/release/pipeline.ts
|
|
179
|
+
export async function runPipeline(
|
|
180
|
+
stages: Stage[],
|
|
181
|
+
ctx: ReleaseContext
|
|
182
|
+
): Promise<Result<ReleaseContext, ReleaseError>>;
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
See ADR-065 for the gate-ordering rationale.
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Structure
|
|
189
|
+
|
|
190
|
+
Explanation template often. Mermaid diagrams for flows. Cross-references
|
|
191
|
+
to ADRs.
|
|
192
|
+
|
|
193
|
+
## Mixed-Audience Pitfalls
|
|
194
|
+
|
|
195
|
+
The most common style failure is mixing audiences within a single doc.
|
|
196
|
+
|
|
197
|
+
### Pitfall: End-user doc with maintainer aside
|
|
198
|
+
|
|
199
|
+
```markdown
|
|
200
|
+
BAD:
|
|
201
|
+
Run `cleo release ship`.
|
|
202
|
+
|
|
203
|
+
(Internally, this dispatches through `dispatch.ts` to the release
|
|
204
|
+
handler registered via the registry pattern...)
|
|
205
|
+
|
|
206
|
+
Then check that the PR opens.
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
The aside is for maintainers, not end-users. End-users don't care
|
|
210
|
+
about `dispatch.ts`. Either:
|
|
211
|
+
- Cut the aside.
|
|
212
|
+
- Move it to a separate maintainer doc.
|
|
213
|
+
- Link to it as "for more details, see [release pipeline internals]".
|
|
214
|
+
|
|
215
|
+
### Pitfall: Maintainer doc with consumer hand-holding
|
|
216
|
+
|
|
217
|
+
```markdown
|
|
218
|
+
BAD:
|
|
219
|
+
The release pipeline runs gates in order — that means each step
|
|
220
|
+
happens one after another, like steps on a staircase. (You go up
|
|
221
|
+
one step at a time, right?)
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Maintainer-audience readers know what "in order" means. Patronizing
|
|
225
|
+
them wastes their time.
|
|
226
|
+
|
|
227
|
+
### Pitfall: Agent doc with narrative warm-up
|
|
228
|
+
|
|
229
|
+
```markdown
|
|
230
|
+
BAD (agent doc):
|
|
231
|
+
Welcome to the worker protocol! In this guide, we'll walk through
|
|
232
|
+
the steps you'll follow as a worker. We're excited to have you on
|
|
233
|
+
board. Let's get started!
|
|
234
|
+
|
|
235
|
+
(Then 200 lines of actual protocol.)
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
Agent readers want the protocol immediately. The warm-up is pure
|
|
239
|
+
token waste.
|
|
240
|
+
|
|
241
|
+
## Tagging Audience in Frontmatter
|
|
242
|
+
|
|
243
|
+
Every CLEO doc SHOULD declare its audience in frontmatter:
|
|
244
|
+
|
|
245
|
+
```markdown
|
|
246
|
+
---
|
|
247
|
+
title: How to ship a release
|
|
248
|
+
audience: end-user
|
|
249
|
+
type: how-to
|
|
250
|
+
---
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
The audience tag lets reviewers, future maintainers, and automated
|
|
254
|
+
style checks apply the right rubric. Without it, the reader has to
|
|
255
|
+
infer from tone — and inference is error-prone.
|
|
256
|
+
|
|
257
|
+
## Audience-Specific Conventions
|
|
258
|
+
|
|
259
|
+
| Element | End-user | Agent | Maintainer |
|
|
260
|
+
|---------|----------|-------|------------|
|
|
261
|
+
| Pronoun | "you" | (none — declarative) | "the X", "we" rarely |
|
|
262
|
+
| Verb mood | Imperative | Declarative | Descriptive |
|
|
263
|
+
| Code examples | Realistic, with output | Schemas, JSON | Code excerpts with paths |
|
|
264
|
+
| Internal refs | Avoid | None | Heavy |
|
|
265
|
+
| ADR refs | Rarely | Rarely | Heavy |
|
|
266
|
+
| Diagrams | Sometimes | Rarely | Often (Mermaid) |
|
|
267
|
+
| Warm-up | One sentence | None | Context paragraph |
|
|
268
|
+
|
|
269
|
+
## Re-Targeting
|
|
270
|
+
|
|
271
|
+
When a doc is mis-audienced, the fix is usually structural — not
|
|
272
|
+
tonal. Re-target by:
|
|
273
|
+
|
|
274
|
+
1. Re-classify the audience in frontmatter.
|
|
275
|
+
2. Restructure to the new audience's template.
|
|
276
|
+
3. Strip content that doesn't fit (maintainer details from end-user
|
|
277
|
+
doc; warm-up from agent doc).
|
|
278
|
+
4. Add content that does fit (verification steps for end-user;
|
|
279
|
+
internal links for maintainer).
|
|
280
|
+
|
|
281
|
+
Re-targeting a long doc is sometimes more expensive than splitting it.
|
|
282
|
+
A doc that genuinely serves two audiences should be two docs with
|
|
283
|
+
cross-links — not one doc trying to do both.
|
|
284
|
+
|
|
285
|
+
## Cross-Audience References
|
|
286
|
+
|
|
287
|
+
When a doc primarily serves audience A but the reader from audience B
|
|
288
|
+
might land on it (via search, link, etc.), add a footer pointer:
|
|
289
|
+
|
|
290
|
+
```markdown
|
|
291
|
+
> Are you contributing to CLEO? See the [maintainer's deep dive
|
|
292
|
+
> on release internals](../internals/release-pipeline.md) instead.
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
The pointer respects B's time without polluting A's reading flow.
|
|
296
|
+
|
|
297
|
+
## Self-Check
|
|
298
|
+
|
|
299
|
+
Before declaring a draft done:
|
|
300
|
+
|
|
301
|
+
- [ ] Frontmatter declares the audience.
|
|
302
|
+
- [ ] Tone matches the audience profile.
|
|
303
|
+
- [ ] Depth matches what the audience needs.
|
|
304
|
+
- [ ] No content from a different audience snuck in.
|
|
305
|
+
- [ ] Cross-references to other-audience docs added if relevant.
|