@cleocode/skills 2026.5.84 → 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/ct-adr-recorder/SKILL.md +74 -0
- package/skills/ct-adr-recorder/__tests__/skill-adr-recorder.test.ts +65 -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-research-agent/SKILL.md +9 -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 +71 -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 +10 -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 +9 -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 +46 -8
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
# Anti-Patterns
|
|
2
|
+
|
|
3
|
+
Failure modes specific to documentation coordination. Each is detectable
|
|
4
|
+
during the documentor's workflow and has a concrete remediation. Several
|
|
5
|
+
have been observed in past CLEO sessions and are recorded in BRAIN.
|
|
6
|
+
|
|
7
|
+
## 1. The Phantom Documentation
|
|
8
|
+
|
|
9
|
+
**Symptom.** Manifest reports "documentation complete" but no file
|
|
10
|
+
exists at the claimed path.
|
|
11
|
+
|
|
12
|
+
**Detection cue.** `cat <claimed-path>` returns "no such file". Or
|
|
13
|
+
`git log --follow <claimed-path>` returns nothing.
|
|
14
|
+
|
|
15
|
+
**Root cause.** The documentor described work it didn't actually
|
|
16
|
+
delegate. Common when the orchestrator stuffed a doc task into a
|
|
17
|
+
larger PR and the documentor coordinator didn't get triggered.
|
|
18
|
+
|
|
19
|
+
**Fix.** After every chain, the documentor MUST verify the file
|
|
20
|
+
exists and contains the claimed content. Use `Read` to confirm before
|
|
21
|
+
appending the manifest entry.
|
|
22
|
+
|
|
23
|
+
## 2. The Duplicate Page
|
|
24
|
+
|
|
25
|
+
**Symptom.** Two pages cover the same topic with similar but
|
|
26
|
+
non-identical content. Readers find one or the other depending on
|
|
27
|
+
search keywords; updates land on one and not the other.
|
|
28
|
+
|
|
29
|
+
**Detection cue.** Glob + grep during Discovery turns up a prior
|
|
30
|
+
page on the same topic; documentor proceeded to create a new one
|
|
31
|
+
anyway.
|
|
32
|
+
|
|
33
|
+
**Root cause.** Skipped Discovery, or treated "I prefer this path
|
|
34
|
+
name" as justification to duplicate.
|
|
35
|
+
|
|
36
|
+
**Fix.** When prior coverage exists, UPDATE it. The MAINTAIN, DON'T
|
|
37
|
+
DUPLICATE rule is in SKILL.md for this reason. Add a section to the
|
|
38
|
+
existing page; do not create a sibling.
|
|
39
|
+
|
|
40
|
+
## 3. The Stale Library Citation
|
|
41
|
+
|
|
42
|
+
**Symptom.** A how-to or reference cites a library API that has been
|
|
43
|
+
renamed, deprecated, or removed.
|
|
44
|
+
|
|
45
|
+
**Detection cue.** `ct-docs-lookup` was NOT invoked for the topic.
|
|
46
|
+
|
|
47
|
+
**Root cause.** Documentor coordinator skipped lookup because "I know
|
|
48
|
+
the API" or assumed training data was current.
|
|
49
|
+
|
|
50
|
+
**Fix.** Always invoke `ct-docs-lookup` when documenting external
|
|
51
|
+
library behavior. Training data is stale by definition — Context7 is
|
|
52
|
+
the current source.
|
|
53
|
+
|
|
54
|
+
## 4. The Type Confusion
|
|
55
|
+
|
|
56
|
+
**Symptom.** Document uses tutorial framing for what should be a
|
|
57
|
+
reference, or vice versa. Reader confused.
|
|
58
|
+
|
|
59
|
+
**Detection cue.** A "how-to" doc spends 5 paragraphs explaining
|
|
60
|
+
concepts before any imperative step. Or a "reference" doc reads
|
|
61
|
+
like a narrative.
|
|
62
|
+
|
|
63
|
+
**Root cause.** Skipped Classification; documentor didn't pick a type
|
|
64
|
+
up front.
|
|
65
|
+
|
|
66
|
+
**Fix.** Always assign the Diátaxis type (or CLEO-native type) before
|
|
67
|
+
invoking write. The type determines the template; the template
|
|
68
|
+
prevents drift.
|
|
69
|
+
|
|
70
|
+
## 5. The Infinite Review Loop
|
|
71
|
+
|
|
72
|
+
**Symptom.** Review keeps finding issues; write keeps fixing; review
|
|
73
|
+
keeps finding new issues. The loop never converges.
|
|
74
|
+
|
|
75
|
+
**Detection cue.** Iteration count exceeds 3.
|
|
76
|
+
|
|
77
|
+
**Root cause.** Either (a) the topic is mis-scoped (the audience is
|
|
78
|
+
unclear, the type is wrong), or (b) the style guide and the writer's
|
|
79
|
+
defaults conflict.
|
|
80
|
+
|
|
81
|
+
**Fix.** After 3 iterations, escalate to HITL with:
|
|
82
|
+
- Original input
|
|
83
|
+
- Each draft
|
|
84
|
+
- Each review's findings
|
|
85
|
+
- The pattern across iterations (e.g., "review keeps flagging tone,
|
|
86
|
+
write keeps producing the same tone")
|
|
87
|
+
|
|
88
|
+
HITL can override or re-scope. Don't burn tokens on convergence the
|
|
89
|
+
loop won't reach.
|
|
90
|
+
|
|
91
|
+
## 6. The Orphan Cross-Reference
|
|
92
|
+
|
|
93
|
+
**Symptom.** Updated doc links to a page that no longer exists, or to
|
|
94
|
+
a section that was renamed.
|
|
95
|
+
|
|
96
|
+
**Detection cue.** `markdown-link-check` flags the link as broken.
|
|
97
|
+
Or the index/TOC contains entries for files that have been deleted.
|
|
98
|
+
|
|
99
|
+
**Root cause.** Documentor consolidated content but didn't update
|
|
100
|
+
inbound references.
|
|
101
|
+
|
|
102
|
+
**Fix.** When consolidating or moving content:
|
|
103
|
+
1. Find all inbound links: `grep -r "<old-path>" docs/`
|
|
104
|
+
2. Update each link or add a redirect
|
|
105
|
+
3. Add a deprecation notice at the old path that explains the move
|
|
106
|
+
4. Only delete the old path after a deprecation period
|
|
107
|
+
|
|
108
|
+
## 7. The Voice Drift
|
|
109
|
+
|
|
110
|
+
**Symptom.** Same doc switches between "you", "we", "the user", and
|
|
111
|
+
"people" within a few paragraphs.
|
|
112
|
+
|
|
113
|
+
**Detection cue.** Grep for pronouns in the new file; count occurrences
|
|
114
|
+
of each voice marker.
|
|
115
|
+
|
|
116
|
+
**Root cause.** Either write produced inconsistent voice, OR the doc
|
|
117
|
+
was assembled from multiple sources without normalization.
|
|
118
|
+
|
|
119
|
+
**Fix.** CLEO style is "you" (second person) for how-tos and tutorials;
|
|
120
|
+
"CLEO" (third person) for explanations and references. Apply
|
|
121
|
+
consistently. Pass the choice explicitly to ct-docs-write as input.
|
|
122
|
+
|
|
123
|
+
## 8. The Forbidden Word Sneak-In
|
|
124
|
+
|
|
125
|
+
**Symptom.** Doc ships with "easy", "simple", "just", "obviously",
|
|
126
|
+
or other forbidden phrases.
|
|
127
|
+
|
|
128
|
+
**Detection cue.** Review didn't catch it. Grep for the forbidden
|
|
129
|
+
list in the new file.
|
|
130
|
+
|
|
131
|
+
**Root cause.** Review's rule list drifted from the canonical style
|
|
132
|
+
guide. Or the words appeared inside a code block (where review may
|
|
133
|
+
skip).
|
|
134
|
+
|
|
135
|
+
**Fix.** Run grep yourself before completing:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
for word in easy simple just obviously "click here" "read more here"; do
|
|
139
|
+
grep -n "$word" <new-file> && echo "FAIL: $word"
|
|
140
|
+
done
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
If review missed something, also file a task to sync the rule list.
|
|
144
|
+
|
|
145
|
+
## 9. The Imperative Confusion
|
|
146
|
+
|
|
147
|
+
**Symptom.** A tutorial uses "you can", "you might", "the user can",
|
|
148
|
+
when the contract is "the reader DOES this step now".
|
|
149
|
+
|
|
150
|
+
**Detection cue.** Modal verbs (can, might, would) appear in tutorial
|
|
151
|
+
step bodies.
|
|
152
|
+
|
|
153
|
+
**Root cause.** Writer hedged when the doc required imperatives.
|
|
154
|
+
|
|
155
|
+
**Fix.** Tutorials and how-tos use imperative voice — "Run the
|
|
156
|
+
command", "Open the file", "Set the value". Pass that constraint
|
|
157
|
+
explicitly to ct-docs-write.
|
|
158
|
+
|
|
159
|
+
## 10. The Lost Manifest
|
|
160
|
+
|
|
161
|
+
**Symptom.** Documentation work shipped but the orchestrator's rollup
|
|
162
|
+
shows no manifest entry. Subsequent agents redo the same work.
|
|
163
|
+
|
|
164
|
+
**Detection cue.** `cleo find <topic>` returns no manifest entries
|
|
165
|
+
for the documentation work. The doc file exists but the manifest
|
|
166
|
+
doesn't link to it.
|
|
167
|
+
|
|
168
|
+
**Root cause.** Documentor skipped the manifest append step (or one
|
|
169
|
+
of the children appended in a wrong format).
|
|
170
|
+
|
|
171
|
+
**Fix.** The manifest append is mandatory. The documentor — not its
|
|
172
|
+
children — owns the entry. Run:
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
cleo manifest append <(cat <<EOF
|
|
176
|
+
{"id":"docs-<topic>-<date>", "file":"<path>", "title":"...", ...}
|
|
177
|
+
EOF
|
|
178
|
+
)
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
After append, verify with:
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
cleo find "<topic>" | head -3
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
The new entry should appear.
|
|
188
|
+
|
|
189
|
+
## 11. The Audience Whiplash
|
|
190
|
+
|
|
191
|
+
**Symptom.** Doc switches audience mid-page — opens for end-users,
|
|
192
|
+
shifts into maintainer-level detail, returns to end-user framing.
|
|
193
|
+
Readers from neither group are well-served.
|
|
194
|
+
|
|
195
|
+
**Detection cue.** Page mixes "people who use CLEO" framing with
|
|
196
|
+
"contributors to CLEO" framing.
|
|
197
|
+
|
|
198
|
+
**Root cause.** Documentor didn't pin audience in Classification.
|
|
199
|
+
|
|
200
|
+
**Fix.** One audience per page. If both audiences need coverage, split
|
|
201
|
+
into two pages — `guide.md` for end-users and `internals.md` for
|
|
202
|
+
contributors — and cross-link.
|
|
203
|
+
|
|
204
|
+
## 12. The Skipped Pre-PR Pass
|
|
205
|
+
|
|
206
|
+
**Symptom.** PR opens with documentation; reviewer finds style
|
|
207
|
+
violations the local review didn't catch.
|
|
208
|
+
|
|
209
|
+
**Detection cue.** PR comments contain style-guide flags.
|
|
210
|
+
|
|
211
|
+
**Root cause.** Documentor ran review on the draft, but not on the
|
|
212
|
+
PR diff. Integration introduced drift (rebase fixups, merge prose).
|
|
213
|
+
|
|
214
|
+
**Fix.** Always run `ct-docs-review --mode=pr` on the PR's diff
|
|
215
|
+
before requesting merge. Catches drift that slipped through during
|
|
216
|
+
integration.
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
# Chain Orchestration
|
|
2
|
+
|
|
3
|
+
`ct-documentor` is a coordinator skill — it does not produce documentation
|
|
4
|
+
directly. Its job is to orchestrate three child skills (`ct-docs-lookup`,
|
|
5
|
+
`ct-docs-write`, `ct-docs-review`) in the right sequence with the right
|
|
6
|
+
inputs. This reference defines when to invoke each child, what to pass,
|
|
7
|
+
and how to handle returns.
|
|
8
|
+
|
|
9
|
+
## The Three Children
|
|
10
|
+
|
|
11
|
+
| Child | Purpose | Owns |
|
|
12
|
+
|-------|---------|------|
|
|
13
|
+
| `ct-docs-lookup` | Library/framework API lookup via Context7 | Current external docs |
|
|
14
|
+
| `ct-docs-write` | Drafts content following CLEO style guide | New content |
|
|
15
|
+
| `ct-docs-review` | Reviews against style guide; supports PR mode | Quality validation |
|
|
16
|
+
|
|
17
|
+
A complete documentation task usually invokes write + review. Lookup is
|
|
18
|
+
optional — only when the doc must cite a library's actual current API.
|
|
19
|
+
|
|
20
|
+
## Decision Sequence
|
|
21
|
+
|
|
22
|
+
For every documentation task, run this sequence before invoking any child.
|
|
23
|
+
|
|
24
|
+
```text
|
|
25
|
+
1. DISCOVERY
|
|
26
|
+
- Glob: docs/**/*.md to map the existing tree
|
|
27
|
+
- Grep: <topic-keywords> across docs/ to find prior coverage
|
|
28
|
+
- Decision: is there already a canonical location for this content?
|
|
29
|
+
|
|
30
|
+
2. CLASSIFICATION
|
|
31
|
+
- Type: tutorial | how-to | reference | explanation (Diátaxis grid)
|
|
32
|
+
- Audience: end-user | agent | maintainer
|
|
33
|
+
- Lifecycle: new file | update existing | consolidate scattered
|
|
34
|
+
|
|
35
|
+
3. CHAIN
|
|
36
|
+
- If type touches library APIs → ct-docs-lookup first
|
|
37
|
+
- Always → ct-docs-write
|
|
38
|
+
- Always → ct-docs-review
|
|
39
|
+
|
|
40
|
+
4. REPORT
|
|
41
|
+
- Manifest entry with "Files NOT Created (Avoided Duplication)" section
|
|
42
|
+
- Cross-references updated
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The Discovery step is mandatory. Skipping it produces duplicate
|
|
46
|
+
documentation — the dominant failure mode of past documentation tasks.
|
|
47
|
+
|
|
48
|
+
## Invoking ct-docs-lookup
|
|
49
|
+
|
|
50
|
+
Use when the task touches a specific library, framework, or external
|
|
51
|
+
API. Pass the library name, the user's actual question (full sentence,
|
|
52
|
+
not a single word), and any version qualifier.
|
|
53
|
+
|
|
54
|
+
**Invoke when:**
|
|
55
|
+
|
|
56
|
+
- Documenting a setup or migration that depends on a specific
|
|
57
|
+
framework version.
|
|
58
|
+
- Writing reference docs that cite a library's exported API.
|
|
59
|
+
- Answering "how do I X with library Y" in a guide.
|
|
60
|
+
|
|
61
|
+
**Do NOT invoke when:**
|
|
62
|
+
|
|
63
|
+
- The doc describes CLEO's own internal architecture (use BRAIN + code
|
|
64
|
+
reading, not external lookup).
|
|
65
|
+
- The user asks a conceptual question that does not name a library.
|
|
66
|
+
|
|
67
|
+
**Input shape:**
|
|
68
|
+
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"library": "Next.js",
|
|
72
|
+
"version": "15",
|
|
73
|
+
"query": "how do I configure middleware to inject auth headers"
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**Return.** Documentation excerpts with citations. Do not paste blindly —
|
|
78
|
+
synthesize into the doc body, citing the library version.
|
|
79
|
+
|
|
80
|
+
## Invoking ct-docs-write
|
|
81
|
+
|
|
82
|
+
The write child owns content production. Its frontmatter (under
|
|
83
|
+
`packages/skills/skills/ct-docs-write/SKILL.md`) describes the style
|
|
84
|
+
guide it enforces. Always invoke for any new or updated content.
|
|
85
|
+
|
|
86
|
+
**Input shape:**
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"file_path": "docs/guides/auth-setup.md",
|
|
91
|
+
"content_topic": "configure SAML before adding users",
|
|
92
|
+
"audience": "end-user",
|
|
93
|
+
"type": "how-to",
|
|
94
|
+
"outline": [
|
|
95
|
+
"Why SAML must precede user addition",
|
|
96
|
+
"Step-by-step config",
|
|
97
|
+
"Common errors and fixes"
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
The outline guides the writer — without it, the draft tends to drift
|
|
103
|
+
into tutorial mode when reference was needed (and vice versa).
|
|
104
|
+
|
|
105
|
+
**Return.** A drafted markdown file. The documentor does not edit it
|
|
106
|
+
directly — the next step is review.
|
|
107
|
+
|
|
108
|
+
## Invoking ct-docs-review
|
|
109
|
+
|
|
110
|
+
The review child owns quality validation. It checks against the CLEO
|
|
111
|
+
style guide and is the gate before the documentation task can complete.
|
|
112
|
+
|
|
113
|
+
**Input shape:**
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"file_path": "docs/guides/auth-setup.md",
|
|
118
|
+
"mode": "local"
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
For PR-mode review (when reviewing a GitHub PR rather than a local
|
|
123
|
+
file):
|
|
124
|
+
|
|
125
|
+
```json
|
|
126
|
+
{
|
|
127
|
+
"pr_url": "https://github.com/kryptobaseddev/cleocode/pull/315",
|
|
128
|
+
"mode": "pr"
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
**Return.** A numbered list of issues with line refs and suggested
|
|
133
|
+
fixes. If the issue count is 0, the doc passes. If non-zero, the
|
|
134
|
+
documentor MUST loop — pass the issues back to `ct-docs-write` for
|
|
135
|
+
revision, then re-review.
|
|
136
|
+
|
|
137
|
+
## The Review Loop
|
|
138
|
+
|
|
139
|
+
The contract is: documentation does not ship with open review issues.
|
|
140
|
+
The documentor MUST loop until review returns zero issues OR escalates
|
|
141
|
+
to HITL.
|
|
142
|
+
|
|
143
|
+
```text
|
|
144
|
+
draft = ct-docs-write(input)
|
|
145
|
+
issues = ct-docs-review(draft)
|
|
146
|
+
while issues != [] and iteration < 3:
|
|
147
|
+
draft = ct-docs-write(input + issues)
|
|
148
|
+
issues = ct-docs-review(draft)
|
|
149
|
+
if issues != []:
|
|
150
|
+
escalate_to_HITL("3 review iterations did not converge")
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Three iterations is the convergence budget. If review keeps finding
|
|
154
|
+
issues, the task is mis-scoped (audience confusion, style guide
|
|
155
|
+
conflict with content) — escalate rather than burning more tokens.
|
|
156
|
+
|
|
157
|
+
## Cross-Skill Output Conventions
|
|
158
|
+
|
|
159
|
+
All three children return to the documentor. The documentor aggregates
|
|
160
|
+
into ONE manifest entry. Children do NOT each append their own — that
|
|
161
|
+
would inflate the manifest.
|
|
162
|
+
|
|
163
|
+
```json
|
|
164
|
+
{
|
|
165
|
+
"id": "docs-auth-setup-2026-05-19",
|
|
166
|
+
"file": "2026-05-19_docs-auth-setup.md",
|
|
167
|
+
"title": "Documentation Update: SAML Setup Guide",
|
|
168
|
+
"status": "complete",
|
|
169
|
+
"agent_type": "documentation",
|
|
170
|
+
"topics": ["documentation", "auth", "saml"],
|
|
171
|
+
"key_findings": [
|
|
172
|
+
"Created docs/guides/auth-setup.md (how-to, end-user audience)",
|
|
173
|
+
"Cited Next.js 15 middleware API via ct-docs-lookup",
|
|
174
|
+
"Review converged in 2 iterations (8 issues → 3 → 0)",
|
|
175
|
+
"Updated docs/index.md to reference new guide"
|
|
176
|
+
],
|
|
177
|
+
"actionable": false,
|
|
178
|
+
"needs_followup": [],
|
|
179
|
+
"linked_tasks": ["{{TASK_ID}}"]
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
The `key_findings` MUST report the iteration count and the chain that
|
|
184
|
+
ran. This lets the orchestrator confirm the contract was honored.
|
|
185
|
+
|
|
186
|
+
## Failure Modes
|
|
187
|
+
|
|
188
|
+
| Symptom | Cause | Fix |
|
|
189
|
+
|---------|-------|-----|
|
|
190
|
+
| Doc duplicates existing content | Skipped Discovery | Always Glob + Grep before write |
|
|
191
|
+
| Doc cites stale API | Skipped ct-docs-lookup | Invoke lookup for any library API claim |
|
|
192
|
+
| Doc fails review repeatedly | Audience or type mismatch | Re-classify; pass corrected to write |
|
|
193
|
+
| Review iteration count >3 | Mis-scoped task | Escalate to HITL with summary |
|
|
194
|
+
| Manifest missing iteration data | Children appended their own entries | Children MUST return to documentor; one entry only |
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
# Doc Types and Templates
|
|
2
|
+
|
|
3
|
+
CLEO documentation follows the Diátaxis grid (tutorial, how-to,
|
|
4
|
+
reference, explanation) plus three CLEO-native types (ADR,
|
|
5
|
+
agent-output, skill). Each type has a distinct shape — using the
|
|
6
|
+
wrong template confuses the reader. This reference defines each
|
|
7
|
+
type's purpose, audience, and skeleton.
|
|
8
|
+
|
|
9
|
+
## Diátaxis Grid
|
|
10
|
+
|
|
11
|
+
| Type | Purpose | When user is | Cognitive mode |
|
|
12
|
+
|------|---------|--------------|----------------|
|
|
13
|
+
| Tutorial | Learning by doing | New, exploring | Acquisition |
|
|
14
|
+
| How-to | Solving a problem | Working, blocked | Application |
|
|
15
|
+
| Reference | Looking up details | Working, knows what | Lookup |
|
|
16
|
+
| Explanation | Understanding | Reflecting, curious | Cognition |
|
|
17
|
+
|
|
18
|
+
The four types are NOT interchangeable. A how-to written as a tutorial
|
|
19
|
+
is too slow for working users; a reference written as explanation
|
|
20
|
+
hides the lookup data behind prose. Identify the type up front.
|
|
21
|
+
|
|
22
|
+
## Tutorial Template
|
|
23
|
+
|
|
24
|
+
```markdown
|
|
25
|
+
# {Tutorial Title}: Build a {thing} with {tech}
|
|
26
|
+
|
|
27
|
+
This tutorial walks you through building {thing} from scratch using
|
|
28
|
+
{tech}. By the end, you'll have a working {thing} and understand
|
|
29
|
+
{key concepts}.
|
|
30
|
+
|
|
31
|
+
## What you'll build
|
|
32
|
+
|
|
33
|
+
{Screenshot or output of finished thing}
|
|
34
|
+
|
|
35
|
+
## Prerequisites
|
|
36
|
+
|
|
37
|
+
- {Required tool / knowledge}
|
|
38
|
+
- {Required tool / knowledge}
|
|
39
|
+
|
|
40
|
+
## Step 1: {action verb + noun}
|
|
41
|
+
|
|
42
|
+
{1-3 sentences setting up the step.}
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
{exact command}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
You should see {expected output}.
|
|
49
|
+
|
|
50
|
+
## Step 2: ...
|
|
51
|
+
|
|
52
|
+
...
|
|
53
|
+
|
|
54
|
+
## What you learned
|
|
55
|
+
|
|
56
|
+
- {concept 1}
|
|
57
|
+
- {concept 2}
|
|
58
|
+
|
|
59
|
+
## Next steps
|
|
60
|
+
|
|
61
|
+
- See [{how-to}](../how-to/...) to do {related task}.
|
|
62
|
+
- See [{reference}](../reference/...) for the full {API} surface.
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Tutorials are linear. They never branch. They never ask the reader
|
|
66
|
+
to choose. Every step results in observable progress.
|
|
67
|
+
|
|
68
|
+
## How-to Template
|
|
69
|
+
|
|
70
|
+
```markdown
|
|
71
|
+
# How to {accomplish task}
|
|
72
|
+
|
|
73
|
+
When you need to {accomplish task}, follow these steps.
|
|
74
|
+
|
|
75
|
+
## Prerequisites
|
|
76
|
+
|
|
77
|
+
- {Required state / config}
|
|
78
|
+
|
|
79
|
+
## Steps
|
|
80
|
+
|
|
81
|
+
1. {Action verb + noun}.
|
|
82
|
+
```bash
|
|
83
|
+
{exact command}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
2. {Action verb + noun}.
|
|
87
|
+
|
|
88
|
+
3. {Action verb + noun}.
|
|
89
|
+
|
|
90
|
+
## Verify
|
|
91
|
+
|
|
92
|
+
Check that {observable outcome}.
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
{verification command}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Troubleshooting
|
|
99
|
+
|
|
100
|
+
- **{Symptom}**: {Cause + fix}
|
|
101
|
+
- **{Symptom}**: {Cause + fix}
|
|
102
|
+
|
|
103
|
+
## Related
|
|
104
|
+
|
|
105
|
+
- [{Reference page}]
|
|
106
|
+
- [{Similar how-to}]
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
How-tos assume the reader knows the basics. They do not explain why —
|
|
110
|
+
they instruct.
|
|
111
|
+
|
|
112
|
+
## Reference Template
|
|
113
|
+
|
|
114
|
+
```markdown
|
|
115
|
+
# {API/command/feature} Reference
|
|
116
|
+
|
|
117
|
+
{One-sentence definition.}
|
|
118
|
+
|
|
119
|
+
## Synopsis
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
{command-syntax} [OPTIONS] <ARGS>
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Arguments
|
|
126
|
+
|
|
127
|
+
| Argument | Type | Description |
|
|
128
|
+
|----------|------|-------------|
|
|
129
|
+
| `<arg1>` | string | {what it is} |
|
|
130
|
+
| `<arg2>` | number | {what it is} |
|
|
131
|
+
|
|
132
|
+
## Options
|
|
133
|
+
|
|
134
|
+
| Option | Default | Description |
|
|
135
|
+
|--------|---------|-------------|
|
|
136
|
+
| `--flag` | false | {effect} |
|
|
137
|
+
| `--opt <v>` | (none) | {effect} |
|
|
138
|
+
|
|
139
|
+
## Output
|
|
140
|
+
|
|
141
|
+
```json
|
|
142
|
+
{ "schema": "..." }
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Errors
|
|
146
|
+
|
|
147
|
+
| Exit | Code | Cause |
|
|
148
|
+
|------|------|-------|
|
|
149
|
+
| 0 | — | Success |
|
|
150
|
+
| 1 | E_VALIDATION | Bad input |
|
|
151
|
+
|
|
152
|
+
## Examples
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
{example 1}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
{example 2}
|
|
160
|
+
```
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
References are dense and exhaustive. They do not include narrative.
|
|
164
|
+
Tables are preferred over prose.
|
|
165
|
+
|
|
166
|
+
## Explanation Template
|
|
167
|
+
|
|
168
|
+
```markdown
|
|
169
|
+
# {Concept or System Name}: Why {it matters}
|
|
170
|
+
|
|
171
|
+
## Context
|
|
172
|
+
|
|
173
|
+
{Why this exists; what problem it solves.}
|
|
174
|
+
|
|
175
|
+
## Mental model
|
|
176
|
+
|
|
177
|
+
{2-3 paragraphs framing the concept.}
|
|
178
|
+
|
|
179
|
+
```mermaid
|
|
180
|
+
{diagram if useful}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## How it works
|
|
184
|
+
|
|
185
|
+
{Walk through the structure.}
|
|
186
|
+
|
|
187
|
+
## Trade-offs
|
|
188
|
+
|
|
189
|
+
- **{trade-off 1}**: {what gives, what gains}
|
|
190
|
+
- **{trade-off 2}**: {what gives, what gains}
|
|
191
|
+
|
|
192
|
+
## Comparisons
|
|
193
|
+
|
|
194
|
+
| Alternative | Why we didn't pick it |
|
|
195
|
+
|-------------|-----------------------|
|
|
196
|
+
| {Alt A} | {reason} |
|
|
197
|
+
| {Alt B} | {reason} |
|
|
198
|
+
|
|
199
|
+
## Related
|
|
200
|
+
|
|
201
|
+
- [{ADR-NNN}]: the decision record
|
|
202
|
+
- [{Reference}]: the surface
|
|
203
|
+
- [{How-to}]: practical recipe
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Explanations are essays. They have a thesis. They argue.
|
|
207
|
+
|
|
208
|
+
## CLEO-Native: ADR
|
|
209
|
+
|
|
210
|
+
Architecture Decision Record. Lives in `.cleo/adrs/`. Strictly templated.
|
|
211
|
+
|
|
212
|
+
```markdown
|
|
213
|
+
# ADR-NNN: {Short title}
|
|
214
|
+
|
|
215
|
+
**Status**: proposed | accepted | superseded | deprecated
|
|
216
|
+
**Date**: YYYY-MM-DD
|
|
217
|
+
**Decider(s)**: {names or "council vote ID"}
|
|
218
|
+
**Supersedes**: {ADR-MMM} or "(none)"
|
|
219
|
+
**Superseded by**: {ADR-PPP} or "(none)"
|
|
220
|
+
|
|
221
|
+
## Context
|
|
222
|
+
|
|
223
|
+
{Why this decision is needed now.}
|
|
224
|
+
|
|
225
|
+
## Decision
|
|
226
|
+
|
|
227
|
+
We will {state the decision}.
|
|
228
|
+
|
|
229
|
+
## Alternatives Considered
|
|
230
|
+
|
|
231
|
+
1. **{Alt A}**: {description, why rejected}
|
|
232
|
+
2. **{Alt B}**: {description, why rejected}
|
|
233
|
+
|
|
234
|
+
## Consequences
|
|
235
|
+
|
|
236
|
+
- **Positive**: {what improves}
|
|
237
|
+
- **Negative**: {what costs}
|
|
238
|
+
- **Neutral**: {what changes without strong direction}
|
|
239
|
+
|
|
240
|
+
## Implementation Notes
|
|
241
|
+
|
|
242
|
+
{Pointers to follow-up tasks, specs, code.}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
ADRs are immutable once accepted. Changes go in a new ADR that
|
|
246
|
+
supersedes the old one.
|
|
247
|
+
|
|
248
|
+
## CLEO-Native: Agent-Output
|
|
249
|
+
|
|
250
|
+
Outputs of agent work, recorded in `.cleo/agent-outputs/`. Templated
|
|
251
|
+
to support `cleo docs add` registration and rollup.
|
|
252
|
+
|
|
253
|
+
```markdown
|
|
254
|
+
---
|
|
255
|
+
date: YYYY-MM-DD
|
|
256
|
+
agent: <agent-id>
|
|
257
|
+
task: T####
|
|
258
|
+
status: complete | partial | blocked
|
|
259
|
+
topics: [topic1, topic2]
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
# {Output Title}
|
|
263
|
+
|
|
264
|
+
## Summary
|
|
265
|
+
|
|
266
|
+
{2-3 sentences.}
|
|
267
|
+
|
|
268
|
+
## Findings / Deliverables
|
|
269
|
+
|
|
270
|
+
{Body.}
|
|
271
|
+
|
|
272
|
+
## Manifest Entry
|
|
273
|
+
|
|
274
|
+
```json
|
|
275
|
+
{ ... }
|
|
276
|
+
```
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
The frontmatter is mandatory. The CI lint (`agent-outputs-registration`
|
|
280
|
+
job per T1617) rejects any new `.md` in this directory that lacks it
|
|
281
|
+
or that wasn't registered via `cleo docs add` / `cleo memory observe`.
|
|
282
|
+
|
|
283
|
+
## CLEO-Native: Skill
|
|
284
|
+
|
|
285
|
+
Lives in `packages/skills/skills/<name>/SKILL.md`. The ct-skill-creator
|
|
286
|
+
skill is the canonical template — see its references/.
|
|
287
|
+
|
|
288
|
+
## When to Pick Which Type
|
|
289
|
+
|
|
290
|
+
| Question | Type |
|
|
291
|
+
|----------|------|
|
|
292
|
+
| "How do I do X?" — and the reader is learning | Tutorial |
|
|
293
|
+
| "How do I do X?" — and the reader is working | How-to |
|
|
294
|
+
| "What does X do?" / "What's the syntax?" | Reference |
|
|
295
|
+
| "Why does X work this way?" | Explanation |
|
|
296
|
+
| "Why did we pick X over Y?" | ADR |
|
|
297
|
+
| "What did this agent produce?" | Agent-output |
|
|
298
|
+
| "Add a new agent skill" | Skill |
|
|
299
|
+
|
|
300
|
+
When in doubt: pick how-to. It is the type most users want most of the
|
|
301
|
+
time, and the easiest to convert to reference later.
|