@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
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Regression test for ct-spec-writer/SKILL.md (T9643 / Epic T9629 / Saga T9625).
|
|
3
|
+
*
|
|
4
|
+
* Pins the SDK-first spec contract: specs MUST be created via
|
|
5
|
+
* `cleo docs add --type spec --slug <name>` so they auto-attach to the
|
|
6
|
+
* parent task and are retrievable by slug. The Output Location section
|
|
7
|
+
* may still mention `docs/specs/{{SPEC_NAME}}.md` as the published path,
|
|
8
|
+
* but the canonical write surface is the SDK.
|
|
9
|
+
*
|
|
10
|
+
* @task T9643
|
|
11
|
+
* @epic T9629
|
|
12
|
+
* @saga T9625
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { readFileSync } from 'node:fs';
|
|
16
|
+
import { dirname, join, resolve } from 'node:path';
|
|
17
|
+
import { fileURLToPath } from 'node:url';
|
|
18
|
+
import { describe, expect, it } from 'vitest';
|
|
19
|
+
|
|
20
|
+
const thisFile = fileURLToPath(import.meta.url);
|
|
21
|
+
const skillRoot = resolve(dirname(thisFile), '..');
|
|
22
|
+
const skillPath = join(skillRoot, 'SKILL.md');
|
|
23
|
+
const skillContent = readFileSync(skillPath, 'utf-8');
|
|
24
|
+
|
|
25
|
+
describe('ct-spec-writer SKILL.md — SDK-first contract (T9643)', () => {
|
|
26
|
+
it('teaches `cleo docs add --type spec` as the canonical write path', () => {
|
|
27
|
+
expect(skillContent).toMatch(/cleo docs add[\s\S]+--type spec/);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('shows `--slug` as the kebab-case retrieval handle', () => {
|
|
31
|
+
expect(skillContent).toContain('--slug');
|
|
32
|
+
expect(skillContent).toMatch(/kebab-case/);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('attaches the spec to a parent task via the owner ID', () => {
|
|
36
|
+
// Owner ID example must use a T### prefix to demonstrate task linkage
|
|
37
|
+
expect(skillContent).toMatch(/cleo docs add\s+T\d+\s/);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('shows `cleo docs publish --for ... --to docs/specs/...` for git publication', () => {
|
|
41
|
+
expect(skillContent).toMatch(/cleo docs publish[\s\S]+--for[\s\S]+--to[\s\S]+docs\/specs/);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('shows `cleo docs fetch <slug>` for downstream retrieval', () => {
|
|
45
|
+
expect(skillContent).toContain('cleo docs fetch');
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('shows `cleo docs list --type spec` for sibling spec discovery', () => {
|
|
49
|
+
expect(skillContent).toMatch(/cleo docs list[\s\S]+--type spec/);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('marks the old direct-filesystem write as deprecated with a migration note', () => {
|
|
53
|
+
expect(skillContent).toContain('Deprecated: Direct filesystem write');
|
|
54
|
+
expect(skillContent).toMatch(/cleo docs (add|sync)/);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it('references E_SLUG_TAKEN for collision handling', () => {
|
|
58
|
+
expect(skillContent).toContain('E_SLUG_TAKEN');
|
|
59
|
+
});
|
|
60
|
+
});
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# Anti-Patterns
|
|
2
|
+
|
|
3
|
+
Common failure modes when writing CLEO specs. Each pattern degrades the
|
|
4
|
+
spec from a testable contract into prose. Detection cues and remediations
|
|
5
|
+
are listed; many of these were caught in past `ct-validator` reports and
|
|
6
|
+
in council reviews on previously-shipped specs.
|
|
7
|
+
|
|
8
|
+
## 1. The Ambiguous MUST
|
|
9
|
+
|
|
10
|
+
**Symptom.** A requirement uses MUST but the failure condition cannot be
|
|
11
|
+
mechanically determined.
|
|
12
|
+
|
|
13
|
+
**Example (bad)**
|
|
14
|
+
|
|
15
|
+
> **REQ-005**: The system MUST handle errors gracefully.
|
|
16
|
+
|
|
17
|
+
**Detection cue.** Words like "gracefully", "appropriately", "reasonably",
|
|
18
|
+
"properly", "sensibly" appear in the requirement body.
|
|
19
|
+
|
|
20
|
+
**Remediation.** Replace fuzzy adverbs with measurable conditions.
|
|
21
|
+
|
|
22
|
+
> **REQ-005**: The system MUST return an LAFS envelope with
|
|
23
|
+
> `success: false` and `error.code` matching one of the registered
|
|
24
|
+
> error codes (see `packages/contracts/src/errors.ts`) on any failure
|
|
25
|
+
> reaching the command dispatcher.
|
|
26
|
+
|
|
27
|
+
## 2. The Tautological Requirement
|
|
28
|
+
|
|
29
|
+
**Symptom.** The requirement restates the function's name.
|
|
30
|
+
|
|
31
|
+
**Example (bad)**
|
|
32
|
+
|
|
33
|
+
> **REQ-003**: The `validate()` function MUST validate the input.
|
|
34
|
+
|
|
35
|
+
**Detection cue.** The requirement body's main verb matches the
|
|
36
|
+
subject's name without adding constraint.
|
|
37
|
+
|
|
38
|
+
**Remediation.** State the contract — what defines successful validation,
|
|
39
|
+
what the function returns on failure, what side effects it has.
|
|
40
|
+
|
|
41
|
+
> **REQ-003**: The `validate()` function MUST return `{ ok: true }` if
|
|
42
|
+
> the input matches the schema, or `{ ok: false, errors: [...] }`
|
|
43
|
+
> containing one entry per violation otherwise. It MUST NOT mutate
|
|
44
|
+
> the input.
|
|
45
|
+
|
|
46
|
+
## 3. The Compound Requirement
|
|
47
|
+
|
|
48
|
+
**Symptom.** A single REQ asserts multiple independent constraints joined
|
|
49
|
+
by "and" or commas.
|
|
50
|
+
|
|
51
|
+
**Example (bad)**
|
|
52
|
+
|
|
53
|
+
> **REQ-009**: The release pipeline MUST run lint, MUST run tests, MUST
|
|
54
|
+
> generate a changelog, AND MUST push the tag.
|
|
55
|
+
|
|
56
|
+
**Detection cue.** Multiple MUST/MUST NOT/SHOULD phrases in one REQ; or
|
|
57
|
+
"and" connecting verb phrases.
|
|
58
|
+
|
|
59
|
+
**Remediation.** Split into atomic REQs so each can be tested
|
|
60
|
+
independently and traced individually.
|
|
61
|
+
|
|
62
|
+
> **REQ-009**: The release pipeline MUST run lint.
|
|
63
|
+
> **REQ-010**: The release pipeline MUST run tests after lint passes.
|
|
64
|
+
> **REQ-011**: The release pipeline MUST generate a changelog.
|
|
65
|
+
> **REQ-012**: The release pipeline MUST push the tag only after all
|
|
66
|
+
> prior REQs in this sequence have passed.
|
|
67
|
+
|
|
68
|
+
## 4. The Implementation Detail Spec
|
|
69
|
+
|
|
70
|
+
**Symptom.** The spec dictates HOW the implementation should work, not
|
|
71
|
+
WHAT it must achieve.
|
|
72
|
+
|
|
73
|
+
**Example (bad)**
|
|
74
|
+
|
|
75
|
+
> **REQ-014**: The cache MUST be implemented using a Map<string, Buffer>
|
|
76
|
+
> with LRU eviction.
|
|
77
|
+
|
|
78
|
+
**Detection cue.** Concrete data structures, library names, or algorithm
|
|
79
|
+
choices appear in MUST clauses.
|
|
80
|
+
|
|
81
|
+
**Remediation.** State the observable contract; let implementations
|
|
82
|
+
choose the structure.
|
|
83
|
+
|
|
84
|
+
> **REQ-014**: The cache MUST support O(1) lookup by string key.
|
|
85
|
+
> **REQ-015**: The cache MUST evict the least-recently-used entry when
|
|
86
|
+
> capacity is exceeded.
|
|
87
|
+
|
|
88
|
+
## 5. The Untestable SHOULD
|
|
89
|
+
|
|
90
|
+
**Symptom.** SHOULD is used to mean "MAY" or to defer the test problem.
|
|
91
|
+
|
|
92
|
+
**Example (bad)**
|
|
93
|
+
|
|
94
|
+
> **REQ-017**: The orchestrator SHOULD be efficient.
|
|
95
|
+
|
|
96
|
+
**Detection cue.** SHOULD without a measurable cap, threshold, or
|
|
97
|
+
comparison.
|
|
98
|
+
|
|
99
|
+
**Remediation.** Either make it testable, or downgrade to MAY.
|
|
100
|
+
|
|
101
|
+
> **REQ-017**: The orchestrator SHOULD complete a 5-task wave dispatch
|
|
102
|
+
> within 2 seconds on the reference hardware (T9396).
|
|
103
|
+
> [— OR —]
|
|
104
|
+
> **REQ-017**: The orchestrator MAY parallelize wave dispatch.
|
|
105
|
+
|
|
106
|
+
## 6. The Forgotten Edge Case
|
|
107
|
+
|
|
108
|
+
**Symptom.** The happy-path requirement is stated, but failure modes
|
|
109
|
+
(timeouts, partial completion, concurrent invocation) are unspecified.
|
|
110
|
+
|
|
111
|
+
**Detection cue.** No requirement mentions error codes, retries,
|
|
112
|
+
timeouts, or concurrent semantics — yet the implementation will face
|
|
113
|
+
all of these.
|
|
114
|
+
|
|
115
|
+
**Remediation.** For every operation, add at minimum:
|
|
116
|
+
|
|
117
|
+
- Timeout behavior (REQ: "after N seconds without progress, MUST return
|
|
118
|
+
E_TIMEOUT")
|
|
119
|
+
- Concurrent invocation (REQ: "MUST serialize concurrent calls per
|
|
120
|
+
resource ID")
|
|
121
|
+
- Partial state (REQ: "on failure mid-operation, MUST roll back to
|
|
122
|
+
pre-call state OR persist a recovery record")
|
|
123
|
+
|
|
124
|
+
## 7. The Spec Without Conformance
|
|
125
|
+
|
|
126
|
+
**Symptom.** The spec has 20 REQs but no `## Compliance` section.
|
|
127
|
+
|
|
128
|
+
**Detection cue.** Last section heading is not `## Compliance`.
|
|
129
|
+
|
|
130
|
+
**Remediation.** Add the section. Without it, `ct-validator` cannot
|
|
131
|
+
produce pass/fail reports, and implementations cannot self-attest. A
|
|
132
|
+
spec without a compliance criteria block is unfinished.
|
|
133
|
+
|
|
134
|
+
## 8. The Stealth Decision
|
|
135
|
+
|
|
136
|
+
**Symptom.** The spec contains a phrase like "we chose X over Y for
|
|
137
|
+
reasons A, B, C" — but that decision was not recorded in any ADR.
|
|
138
|
+
|
|
139
|
+
**Detection cue.** Spec body explains *why* a choice was made, instead
|
|
140
|
+
of *what* the requirement is.
|
|
141
|
+
|
|
142
|
+
**Remediation.** Pull the decision into a proper ADR. Reference the ADR
|
|
143
|
+
from the REQ's source column. The spec body asserts the requirement
|
|
144
|
+
flatly; the rationale lives in the ADR.
|
|
145
|
+
|
|
146
|
+
## 9. The Drift-Prone Cross-Reference
|
|
147
|
+
|
|
148
|
+
**Symptom.** A REQ cross-references another section by prose ("as
|
|
149
|
+
discussed in the previous section") or by page number.
|
|
150
|
+
|
|
151
|
+
**Detection cue.** No `REQ-NNN` token in cross-references.
|
|
152
|
+
|
|
153
|
+
**Remediation.** Always reference by stable identifier — `REQ-001`,
|
|
154
|
+
`CON-007`, `§3.2`, `ADR-065`. Prose references rot when sections
|
|
155
|
+
reorder.
|
|
156
|
+
|
|
157
|
+
## 10. The Version Hostage
|
|
158
|
+
|
|
159
|
+
**Symptom.** The spec hard-codes the version of a dependency or the
|
|
160
|
+
specific commit of an ADR that motivated it.
|
|
161
|
+
|
|
162
|
+
**Example (bad)**
|
|
163
|
+
|
|
164
|
+
> **REQ-021**: The pipeline MUST use drizzle-orm@1.0.0-beta.
|
|
165
|
+
|
|
166
|
+
**Detection cue.** Pinned version in a requirement body.
|
|
167
|
+
|
|
168
|
+
**Remediation.** Pin only the behavior; pin the version in the
|
|
169
|
+
implementation's manifest. If a specific version is genuinely required,
|
|
170
|
+
state the constraint as a range.
|
|
171
|
+
|
|
172
|
+
> **REQ-021**: The pipeline MUST use a Drizzle ORM release that
|
|
173
|
+
> supports `defineRelations` (introduced in v1.0.0-beta or later).
|
|
174
|
+
|
|
175
|
+
This preserves the spec across patch upgrades that do not change
|
|
176
|
+
contracts.
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# RFC 2119 Language
|
|
2
|
+
|
|
3
|
+
The skill MUST use RFC 2119 keywords correctly. This reference defines each
|
|
4
|
+
keyword precisely, gives positive and negative examples, and lists the
|
|
5
|
+
common misuses that downstream test writers and validators catch most
|
|
6
|
+
often. A spec is only as testable as its language is unambiguous.
|
|
7
|
+
|
|
8
|
+
## The Five Keywords
|
|
9
|
+
|
|
10
|
+
| Keyword | Synonyms | Precise meaning |
|
|
11
|
+
|---------|----------|-----------------|
|
|
12
|
+
| **MUST** | REQUIRED, SHALL | Absolute requirement. Non-compliance is a defect. |
|
|
13
|
+
| **MUST NOT** | SHALL NOT | Absolute prohibition. Non-compliance is a defect. |
|
|
14
|
+
| **SHOULD** | RECOMMENDED | Recommended; non-compliance requires recorded rationale. |
|
|
15
|
+
| **SHOULD NOT** | NOT RECOMMENDED | Discouraged; non-compliance requires recorded rationale. |
|
|
16
|
+
| **MAY** | OPTIONAL | Truly optional; compliance and non-compliance are both fine. |
|
|
17
|
+
|
|
18
|
+
These keywords are case-sensitive in their normative meaning. Use UPPERCASE
|
|
19
|
+
when carrying RFC 2119 weight; lowercase ("must", "should") is prose and
|
|
20
|
+
does not bind implementations.
|
|
21
|
+
|
|
22
|
+
## The Mandatory Header
|
|
23
|
+
|
|
24
|
+
Every CLEO specification MUST open with the IETF boilerplate, exactly:
|
|
25
|
+
|
|
26
|
+
```markdown
|
|
27
|
+
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
|
|
28
|
+
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
|
|
29
|
+
document are to be interpreted as described in RFC 2119.
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
If the boilerplate is missing, the document is a guide, not a spec.
|
|
33
|
+
Downstream tooling — `ct-validator`, the IVT loop, the consensus voter —
|
|
34
|
+
will not enforce normative weight on un-boilerplated documents.
|
|
35
|
+
|
|
36
|
+
## Positive Examples
|
|
37
|
+
|
|
38
|
+
**Absolute requirement (MUST)**
|
|
39
|
+
|
|
40
|
+
> **REQ-007**: The release-ship command MUST cut the release branch from
|
|
41
|
+
> the tip of `main` after passing all quality gates.
|
|
42
|
+
|
|
43
|
+
This is testable: the test reads the branch's merge-base; if it is not
|
|
44
|
+
the `main`-tip-at-cut-time, the test fails.
|
|
45
|
+
|
|
46
|
+
**Conditional requirement (MUST + when-clause)**
|
|
47
|
+
|
|
48
|
+
> **REQ-008**: When `release.branchModel` is `feat-to-main`, the
|
|
49
|
+
> release pipeline MUST refuse direct pushes to `main`.
|
|
50
|
+
|
|
51
|
+
This is testable: with the config set, attempt a direct push; assert
|
|
52
|
+
rejection.
|
|
53
|
+
|
|
54
|
+
**Recommendation (SHOULD)**
|
|
55
|
+
|
|
56
|
+
> **REQ-012**: The orchestrator SHOULD batch parallel-safe tasks into
|
|
57
|
+
> waves rather than serializing them.
|
|
58
|
+
|
|
59
|
+
Compliant if waves exist; if serialization happens for a documented
|
|
60
|
+
reason (e.g. a dependency the auto-detector missed) the implementation
|
|
61
|
+
remains compliant — but the rationale MUST be recorded.
|
|
62
|
+
|
|
63
|
+
**Truly optional (MAY)**
|
|
64
|
+
|
|
65
|
+
> **REQ-019**: Implementations MAY cache the resolved skill manifest
|
|
66
|
+
> for the duration of a single orchestration session.
|
|
67
|
+
|
|
68
|
+
No conformance pressure either way. Caching and re-fetching are both
|
|
69
|
+
valid implementations.
|
|
70
|
+
|
|
71
|
+
## Negative Examples (Anti-Spec Language)
|
|
72
|
+
|
|
73
|
+
These phrasings look normative but are not. Replace each before the spec
|
|
74
|
+
ships.
|
|
75
|
+
|
|
76
|
+
| Anti-pattern | Why it fails | Replacement |
|
|
77
|
+
|--------------|--------------|-------------|
|
|
78
|
+
| "The system needs to validate input" | "Needs to" is aspirational, not binding | "The system MUST validate input" |
|
|
79
|
+
| "It is recommended that you encrypt at rest" | "It is recommended" is passive prose | "Implementations SHOULD encrypt at rest" |
|
|
80
|
+
| "We will use HTTPS" | First-person future tense is a plan, not a requirement | "All transports MUST use HTTPS" |
|
|
81
|
+
| "Should ideally be idempotent" | "Ideally" weakens SHOULD into nothing | "MUST be idempotent" or "SHOULD be idempotent" |
|
|
82
|
+
| "Try to keep payloads under 1MB" | "Try to" is unmeasurable | "Payloads SHOULD NOT exceed 1MB" |
|
|
83
|
+
| "Cannot exceed 100 requests/minute" | "Cannot" is descriptive, not normative | "MUST NOT exceed 100 requests/minute" |
|
|
84
|
+
|
|
85
|
+
## When to Pick Which Keyword
|
|
86
|
+
|
|
87
|
+
Use this decision rubric:
|
|
88
|
+
|
|
89
|
+
1. **Will an implementation that violates this rule fail user expectations
|
|
90
|
+
or break interoperability?**
|
|
91
|
+
- Yes → MUST / MUST NOT
|
|
92
|
+
- Maybe → continue
|
|
93
|
+
2. **Is there a legitimate operating environment where violating this rule
|
|
94
|
+
is the right call?**
|
|
95
|
+
- Yes → SHOULD / SHOULD NOT
|
|
96
|
+
- No → revisit step 1
|
|
97
|
+
3. **Is the behavior genuinely a choice with no preferred direction?**
|
|
98
|
+
- Yes → MAY
|
|
99
|
+
- No → revisit steps 1-2
|
|
100
|
+
|
|
101
|
+
If you cannot decide between MUST and SHOULD, the requirement is probably
|
|
102
|
+
under-specified — sharpen the failure condition first, then re-evaluate.
|
|
103
|
+
|
|
104
|
+
## Cross-Reference Patterns
|
|
105
|
+
|
|
106
|
+
When one requirement depends on another, link them explicitly so the test
|
|
107
|
+
matrix can build the dependency graph.
|
|
108
|
+
|
|
109
|
+
```markdown
|
|
110
|
+
**REQ-021**: The skill MUST emit a `pipeline_manifest` entry per
|
|
111
|
+
**REQ-008** before completing the task.
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Avoid prose-cross-references ("as mentioned above") — they cannot be
|
|
115
|
+
machine-extracted. Use the `REQ-NNN` token.
|
|
116
|
+
|
|
117
|
+
## Compliance Statements
|
|
118
|
+
|
|
119
|
+
Every spec MUST close with a `## Compliance` section that enumerates the
|
|
120
|
+
conditions under which an implementation is conformant.
|
|
121
|
+
|
|
122
|
+
```markdown
|
|
123
|
+
## Compliance
|
|
124
|
+
|
|
125
|
+
An implementation is **conformant** if and only if:
|
|
126
|
+
|
|
127
|
+
1. All MUST and MUST NOT requirements (REQ-001 through REQ-007) hold.
|
|
128
|
+
2. Each SHOULD or SHOULD NOT requirement either holds OR is accompanied
|
|
129
|
+
by a recorded rationale in the implementation's `decisions` table.
|
|
130
|
+
3. MAY requirements are reported in the implementation's capability
|
|
131
|
+
manifest if applicable.
|
|
132
|
+
|
|
133
|
+
Non-conformant implementations SHOULD provide a remediation plan with
|
|
134
|
+
target conformance date.
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
This section is what `ct-validator` reads when producing the validation
|
|
138
|
+
report — without it, validation cannot proceed.
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
# Spec Templates
|
|
2
|
+
|
|
3
|
+
Templates for the spec types that CLEO produces most frequently. Each
|
|
4
|
+
template includes the canonical sections, required cross-references, and
|
|
5
|
+
the conformance criteria block that `ct-validator` reads downstream.
|
|
6
|
+
|
|
7
|
+
## Protocol Specification
|
|
8
|
+
|
|
9
|
+
For inter-component or inter-process contracts. Examples: the
|
|
10
|
+
`cleo-subagent` protocol, the `pipeline_manifest` schema, the LAFS
|
|
11
|
+
envelope contract.
|
|
12
|
+
|
|
13
|
+
```markdown
|
|
14
|
+
# {Protocol Name} Specification v{X.Y.Z}
|
|
15
|
+
|
|
16
|
+
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
|
|
17
|
+
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
|
|
18
|
+
document are to be interpreted as described in RFC 2119.
|
|
19
|
+
|
|
20
|
+
**Status**: draft | proposed | accepted | deprecated
|
|
21
|
+
**Supersedes**: (none) | {ADR-XXX} | {Spec-Name v{X.Y.Z-1}}
|
|
22
|
+
**Related ADRs**: ADR-XXX, ADR-YYY
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Abstract
|
|
27
|
+
|
|
28
|
+
{One paragraph: what this protocol governs and why it exists.}
|
|
29
|
+
|
|
30
|
+
## Definitions
|
|
31
|
+
|
|
32
|
+
| Term | Definition |
|
|
33
|
+
|------|------------|
|
|
34
|
+
| {term} | {precise definition; avoid synonyms} |
|
|
35
|
+
|
|
36
|
+
## Roles
|
|
37
|
+
|
|
38
|
+
- **{Role A}**: {responsibilities}
|
|
39
|
+
- **{Role B}**: {responsibilities}
|
|
40
|
+
|
|
41
|
+
## Message Types / Operations
|
|
42
|
+
|
|
43
|
+
### {Operation 1}
|
|
44
|
+
|
|
45
|
+
**REQ-001**: {what MUST happen}.
|
|
46
|
+
- Inputs: {field list with types}
|
|
47
|
+
- Outputs: {field list with types}
|
|
48
|
+
- Errors: {error code enumeration}
|
|
49
|
+
|
|
50
|
+
### {Operation 2}
|
|
51
|
+
...
|
|
52
|
+
|
|
53
|
+
## State Machine (if applicable)
|
|
54
|
+
|
|
55
|
+
| State | Transitions | Triggers |
|
|
56
|
+
|-------|-------------|----------|
|
|
57
|
+
| init | → ready | start() |
|
|
58
|
+
| ready | → running, → cancelled | run(), cancel() |
|
|
59
|
+
| running | → done, → failed | (auto) |
|
|
60
|
+
|
|
61
|
+
## Security Considerations
|
|
62
|
+
|
|
63
|
+
{What can go wrong; threat model.}
|
|
64
|
+
|
|
65
|
+
## Compliance
|
|
66
|
+
|
|
67
|
+
An implementation is conformant if {enumerated conditions}.
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## API Specification
|
|
71
|
+
|
|
72
|
+
For HTTP, gRPC, or CLI-level interfaces.
|
|
73
|
+
|
|
74
|
+
```markdown
|
|
75
|
+
# {API Name} Specification v{X.Y.Z}
|
|
76
|
+
|
|
77
|
+
{RFC 2119 boilerplate}
|
|
78
|
+
|
|
79
|
+
## Overview
|
|
80
|
+
|
|
81
|
+
{One paragraph.}
|
|
82
|
+
|
|
83
|
+
## Endpoints / Commands
|
|
84
|
+
|
|
85
|
+
### `{METHOD} /path` or `cleo {verb} {noun}`
|
|
86
|
+
|
|
87
|
+
**REQ-001**: The endpoint MUST return 2xx on success, 4xx on client
|
|
88
|
+
error, 5xx on server error.
|
|
89
|
+
|
|
90
|
+
**Request schema**:
|
|
91
|
+
```json
|
|
92
|
+
{ "field": "type", "field2": "type" }
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Response schema (success)**:
|
|
96
|
+
```json
|
|
97
|
+
{ "result": "type" }
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Errors**:
|
|
101
|
+
| Code | Meaning | When |
|
|
102
|
+
|------|---------|------|
|
|
103
|
+
| E_NOT_FOUND | Resource missing | {trigger} |
|
|
104
|
+
| E_VALIDATION | Bad input | {trigger} |
|
|
105
|
+
|
|
106
|
+
**REQ-002**: The endpoint SHOULD complete within {N}ms p95.
|
|
107
|
+
|
|
108
|
+
## Authentication
|
|
109
|
+
|
|
110
|
+
{Required headers, scopes, etc.}
|
|
111
|
+
|
|
112
|
+
## Versioning
|
|
113
|
+
|
|
114
|
+
{How breaking changes are communicated.}
|
|
115
|
+
|
|
116
|
+
## Compliance
|
|
117
|
+
|
|
118
|
+
{Conditions.}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Architecture Document
|
|
122
|
+
|
|
123
|
+
For high-level structural decisions that do not fit the ADR (single
|
|
124
|
+
decision) shape but need normative weight. The ADR records the decision;
|
|
125
|
+
the architecture document specifies the resulting structure.
|
|
126
|
+
|
|
127
|
+
```markdown
|
|
128
|
+
# {System Name} Architecture v{X.Y.Z}
|
|
129
|
+
|
|
130
|
+
{RFC 2119 boilerplate}
|
|
131
|
+
|
|
132
|
+
## Context
|
|
133
|
+
|
|
134
|
+
{Why this system exists; what problem it solves.}
|
|
135
|
+
|
|
136
|
+
## Constraints
|
|
137
|
+
|
|
138
|
+
| ID | Constraint | Source |
|
|
139
|
+
|----|------------|--------|
|
|
140
|
+
| CON-001 | All DB opens go through openCleoDb() | ADR-D003 |
|
|
141
|
+
| CON-002 | No raw new DatabaseSync() outside chokepoint | ADR-D003 |
|
|
142
|
+
|
|
143
|
+
## Components
|
|
144
|
+
|
|
145
|
+
### {Component A}
|
|
146
|
+
- **Responsibility**: {one sentence}
|
|
147
|
+
- **Inputs**: {what it consumes}
|
|
148
|
+
- **Outputs**: {what it produces}
|
|
149
|
+
- **Constraints**: CON-XXX, CON-YYY
|
|
150
|
+
|
|
151
|
+
### {Component B}
|
|
152
|
+
...
|
|
153
|
+
|
|
154
|
+
## Dependencies
|
|
155
|
+
|
|
156
|
+
```mermaid
|
|
157
|
+
graph LR
|
|
158
|
+
A[Component A] --> B[Component B]
|
|
159
|
+
B --> C[Component C]
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Cross-cutting Concerns
|
|
163
|
+
|
|
164
|
+
- **Observability**: {logging, metrics, tracing requirements}
|
|
165
|
+
- **Security**: {authn, authz, secrets handling}
|
|
166
|
+
- **Resilience**: {failure modes, recovery}
|
|
167
|
+
|
|
168
|
+
## Compliance
|
|
169
|
+
|
|
170
|
+
{Conditions.}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## Requirements Document (small/targeted)
|
|
174
|
+
|
|
175
|
+
For a single feature where a full protocol spec is overkill but a
|
|
176
|
+
testable contract is needed.
|
|
177
|
+
|
|
178
|
+
```markdown
|
|
179
|
+
# {Feature Name} Requirements v{X.Y.Z}
|
|
180
|
+
|
|
181
|
+
{RFC 2119 boilerplate}
|
|
182
|
+
|
|
183
|
+
## Scope
|
|
184
|
+
|
|
185
|
+
{What's in; what's out.}
|
|
186
|
+
|
|
187
|
+
## Requirements
|
|
188
|
+
|
|
189
|
+
**REQ-001**: {requirement}
|
|
190
|
+
- Rationale: {why}
|
|
191
|
+
- Verification: {how to test}
|
|
192
|
+
|
|
193
|
+
**REQ-002**: {requirement}
|
|
194
|
+
- Rationale: {why}
|
|
195
|
+
- Verification: {how to test}
|
|
196
|
+
|
|
197
|
+
## Constraints
|
|
198
|
+
|
|
199
|
+
{CON-XXX list if relevant.}
|
|
200
|
+
|
|
201
|
+
## Open Questions
|
|
202
|
+
|
|
203
|
+
{Anything not yet resolved — these block acceptance.}
|
|
204
|
+
|
|
205
|
+
## Compliance
|
|
206
|
+
|
|
207
|
+
{Conditions.}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## Naming Conventions
|
|
211
|
+
|
|
212
|
+
| Type | Filename pattern | Location |
|
|
213
|
+
|------|------------------|----------|
|
|
214
|
+
| Protocol spec | `<name>-protocol-v<x>.md` | `docs/specs/protocols/` |
|
|
215
|
+
| API spec | `<name>-api-v<x>.md` | `docs/specs/apis/` |
|
|
216
|
+
| Architecture | `<name>-architecture-v<x>.md` | `docs/architecture/` |
|
|
217
|
+
| Requirements | `<name>-requirements.md` | `docs/specs/requirements/` |
|
|
218
|
+
| ADR | `ADR-NNN-<short-slug>.md` | `.cleo/adrs/` |
|
|
219
|
+
|
|
220
|
+
When in doubt: protocol vs requirements — a protocol governs a contract
|
|
221
|
+
between two parties; requirements govern behavior of a single party.
|
|
222
|
+
|
|
223
|
+
## Versioning Rules
|
|
224
|
+
|
|
225
|
+
| Bump | Trigger |
|
|
226
|
+
|------|---------|
|
|
227
|
+
| Patch (`X.Y.Z+1`) | Clarification, typo fix, no semantic change |
|
|
228
|
+
| Minor (`X.Y+1.0`) | Added requirement (additive) |
|
|
229
|
+
| Major (`X+1.0.0`) | Changed or removed requirement (breaking) |
|
|
230
|
+
|
|
231
|
+
A major bump REQUIRES a corresponding deprecation period for the prior
|
|
232
|
+
major version. State the period in `## Status` (e.g., "v2.x deprecated
|
|
233
|
+
2026-Q3, removed 2026-Q4").
|