@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,179 @@
|
|
|
1
|
+
# Evidence and Gates
|
|
2
|
+
|
|
3
|
+
ADR-051 requires every `cleo complete <TASK_ID>` to be backed by
|
|
4
|
+
programmatic evidence. The executor MUST attach evidence atoms to each
|
|
5
|
+
gate before completing; the verify step re-validates them against git,
|
|
6
|
+
the filesystem, and the toolchain. This reference defines atom shapes,
|
|
7
|
+
canonical names, and the failure modes most often hit.
|
|
8
|
+
|
|
9
|
+
## The Gate Set
|
|
10
|
+
|
|
11
|
+
Every task carries six standard gates. Optional gates may be added per
|
|
12
|
+
task; the standard set is non-negotiable.
|
|
13
|
+
|
|
14
|
+
| Gate | Meaning | Evidence kind |
|
|
15
|
+
|------|---------|---------------|
|
|
16
|
+
| implemented | Code change exists | `commit:<sha>` + `files:<list>` |
|
|
17
|
+
| testsPassed | Tests green | `tool:test` or `test-run:<json>` |
|
|
18
|
+
| qaPassed | Lint + typecheck clean | `tool:lint` + `tool:typecheck` |
|
|
19
|
+
| documented | Docs updated | `files:<docs-paths>` |
|
|
20
|
+
| securityPassed | Security scan or waiver | `tool:security-scan` or `note:<rationale>` |
|
|
21
|
+
| cleanupDone | Branch/cleanup summary | `note:<text>` |
|
|
22
|
+
|
|
23
|
+
Decision-only tasks (no code change; the deliverable is a recorded BRAIN
|
|
24
|
+
decision) use a distinct `implemented` atom shape:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
cleo verify T### --gate implemented \
|
|
28
|
+
--evidence "decision:D-arch-001;files:docs/research-note.md"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
This shape eliminates the `CLEO_OWNER_OVERRIDE` path on decision-only
|
|
32
|
+
completion (per T1875).
|
|
33
|
+
|
|
34
|
+
## Atom Kinds
|
|
35
|
+
|
|
36
|
+
### `commit:<sha>`
|
|
37
|
+
|
|
38
|
+
The git commit SHA where the work landed. Re-validated for reachability
|
|
39
|
+
from HEAD at complete time. The SHA MUST be a full or short SHA that
|
|
40
|
+
`git rev-parse` resolves.
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
cleo verify T### --gate implemented \
|
|
44
|
+
--evidence "commit:b8e723d78;files:packages/skills/.../references/triggers.md"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
If the worktree's branch has been merged to main since the commit, the
|
|
48
|
+
atom still resolves. If the commit was rebased away, validation fails
|
|
49
|
+
with `E_EVIDENCE_STALE` — re-attach the new SHA.
|
|
50
|
+
|
|
51
|
+
### `files:<comma-list>`
|
|
52
|
+
|
|
53
|
+
Paths affected by the work. Re-validated by sha256 against the on-disk
|
|
54
|
+
file at complete time. If the file's contents change between verify
|
|
55
|
+
and complete (e.g. a later edit drifts the hash), validation fails with
|
|
56
|
+
`E_EVIDENCE_STALE`.
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
--evidence "files:packages/cleo/src/commands/release-plan.ts,packages/cleo/__tests__/release-plan.test.ts"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Use forward slashes; absolute or repo-relative paths both work.
|
|
63
|
+
|
|
64
|
+
### `tool:<name>`
|
|
65
|
+
|
|
66
|
+
Canonical tool name. CLEO resolves to the project's actual command via
|
|
67
|
+
`.cleo/project-context.json` (`testing.command`, `build.command`) with
|
|
68
|
+
per-`primaryType` fallbacks. Canonical names:
|
|
69
|
+
|
|
70
|
+
| Canonical | Resolves to (Node) | Fallback |
|
|
71
|
+
|-----------|-------------------|----------|
|
|
72
|
+
| `test` | `pnpm run test` | `cargo test`, `pytest`, `go test` |
|
|
73
|
+
| `build` | `pnpm run build` | `cargo build`, etc. |
|
|
74
|
+
| `lint` | biome / eslint | clippy, ruff |
|
|
75
|
+
| `typecheck` | `tsc -b` | mypy |
|
|
76
|
+
| `audit` | `pnpm audit` | `cargo audit` |
|
|
77
|
+
| `security-scan` | varies | varies |
|
|
78
|
+
|
|
79
|
+
Legacy aliases still work: `pnpm-test`, `tsc`, `biome`, `cargo-test`,
|
|
80
|
+
`pytest` all map to canonical names.
|
|
81
|
+
|
|
82
|
+
### `test-run:<json-path>`
|
|
83
|
+
|
|
84
|
+
Path to a vitest JSON output file. Re-validated by hash. Preferred for
|
|
85
|
+
sharing test evidence across sibling tasks in the same wave.
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
pnpm vitest run --reporter=json --outputFile=/tmp/vitest-out.json
|
|
89
|
+
cleo verify T### --gate testsPassed --evidence "test-run:/tmp/vitest-out.json"
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### `decision:<decision-id>`
|
|
93
|
+
|
|
94
|
+
A BRAIN decision ID (e.g., `D-arch-001`) or an `AGT-*` provenance ID.
|
|
95
|
+
Validated by lookup against the brain.db; status MUST be `proposed` or
|
|
96
|
+
`accepted`. Used for decision-only tasks where the deliverable is the
|
|
97
|
+
decision itself, not code.
|
|
98
|
+
|
|
99
|
+
### `note:<text>`
|
|
100
|
+
|
|
101
|
+
Free-form rationale. Always permitted; used when no programmatic atom
|
|
102
|
+
applies. Notes appear in the audit log but do not gate validation —
|
|
103
|
+
they document, they do not prove. Reserve for `cleanupDone`,
|
|
104
|
+
`securityPassed` waivers, and rare edge cases.
|
|
105
|
+
|
|
106
|
+
## The Ritual
|
|
107
|
+
|
|
108
|
+
The full per-task ritual, in order:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
# 1. Implement and verify locally
|
|
112
|
+
pnpm biome check --write .
|
|
113
|
+
pnpm run build && pnpm run typecheck
|
|
114
|
+
pnpm run test
|
|
115
|
+
git add -p && git commit -m "feat(T###): <slug>"
|
|
116
|
+
|
|
117
|
+
# 2. Capture evidence for each gate (commit SHA from step 1)
|
|
118
|
+
SHA=$(git rev-parse HEAD)
|
|
119
|
+
FILES=$(git diff-tree --no-commit-id --name-only -r HEAD | paste -sd,)
|
|
120
|
+
|
|
121
|
+
cleo verify T### --gate implemented --evidence "commit:$SHA;files:$FILES"
|
|
122
|
+
cleo verify T### --gate testsPassed --evidence "tool:test"
|
|
123
|
+
cleo verify T### --gate qaPassed --evidence "tool:lint;tool:typecheck"
|
|
124
|
+
cleo verify T### --gate documented --evidence "files:docs/path/to/note.md"
|
|
125
|
+
cleo verify T### --gate securityPassed --evidence "note:no network surface"
|
|
126
|
+
cleo verify T### --gate cleanupDone --evidence "note:branch task/T### ready for merge"
|
|
127
|
+
|
|
128
|
+
# 3. Complete (CLEO re-validates everything)
|
|
129
|
+
cleo complete T###
|
|
130
|
+
|
|
131
|
+
# 4. Record learning
|
|
132
|
+
cleo memory observe "..." --title "..."
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Common Failure Modes
|
|
136
|
+
|
|
137
|
+
| Exit | Code | Cause | Fix |
|
|
138
|
+
|------|------|-------|-----|
|
|
139
|
+
| — | `E_EVIDENCE_MISSING` | Ran `verify --all` without `--evidence` | Re-run per-gate with atoms |
|
|
140
|
+
| — | `E_EVIDENCE_INSUFFICIENT` | Gate atom kind doesn't match required | See gate-atom table above |
|
|
141
|
+
| — | `E_EVIDENCE_TESTS_FAILED` | `tool:test` exit non-zero | Fix failing tests first |
|
|
142
|
+
| — | `E_EVIDENCE_TOOL_FAILED` | Lint/typecheck/etc exit non-zero | Fix source and re-run |
|
|
143
|
+
| — | `E_EVIDENCE_STALE` | Files or commit changed after verify | Re-verify before complete |
|
|
144
|
+
| — | `E_EVIDENCE_INVALID_DECISION` | Decision ID not found in BRAIN | Use `cleo memory decision-find` |
|
|
145
|
+
| — | `E_FLAG_REMOVED` | Tried `cleo complete --force` | `--force` removed per ADR-051 |
|
|
146
|
+
|
|
147
|
+
## Cache Behavior
|
|
148
|
+
|
|
149
|
+
Tool-evidence results are cached under `.cleo/cache/evidence/<key>.json`,
|
|
150
|
+
keyed on (canonical, cmd, args, HEAD, dirty-tree fingerprint). Parallel
|
|
151
|
+
verifies against identical state coalesce to one execution via a per-key
|
|
152
|
+
lock. Cross-worktree parallelism is bounded by a machine-wide per-tool
|
|
153
|
+
semaphore at `~/.local/share/cleo/locks/tool-<canonical>/`.
|
|
154
|
+
|
|
155
|
+
Tune with `CLEO_TOOL_CONCURRENCY_<TOOL>=<n>` (`0` disables). For most
|
|
156
|
+
worker agents this is set-and-forget; the orchestrator handles tuning.
|
|
157
|
+
|
|
158
|
+
## The Emergency Override
|
|
159
|
+
|
|
160
|
+
In rare incident-response scenarios, the override exists:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
CLEO_OWNER_OVERRIDE=1 \
|
|
164
|
+
CLEO_OWNER_OVERRIDE_REASON="incident 1234 hotfix" \
|
|
165
|
+
cleo verify T### --all --evidence "note:owner-approved"
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
The override appends to `.cleo/audit/force-bypass.jsonl`. Use only when
|
|
169
|
+
the owner has explicitly authorized — never as a routine shortcut to
|
|
170
|
+
skip gates.
|
|
171
|
+
|
|
172
|
+
## What NOT to Do
|
|
173
|
+
|
|
174
|
+
- ❌ Run `cleo complete` without verifying tests actually ran
|
|
175
|
+
- ❌ Run `cleo verify --all` without `--evidence` (REJECTED post-ADR-051)
|
|
176
|
+
- ❌ Use `cleo complete --force` (REMOVED post-ADR-051)
|
|
177
|
+
- ❌ Skip `cleo memory observe` on non-trivial tasks
|
|
178
|
+
- ❌ Self-attest without programmatic proof
|
|
179
|
+
- ❌ Modify files between `verify` and `complete` (caught by staleness check)
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# Implementation Patterns
|
|
2
|
+
|
|
3
|
+
Canonical patterns for executing CLEO tasks. The executor sits at the
|
|
4
|
+
leaf of the orchestrator's pipeline — its job is to take a fully-resolved
|
|
5
|
+
task spec and produce concrete deliverables that pass acceptance criteria.
|
|
6
|
+
This reference codifies the patterns that succeed most consistently.
|
|
7
|
+
|
|
8
|
+
## Read-Before-Write (Mandatory)
|
|
9
|
+
|
|
10
|
+
The repository CLAUDE.md and AGENTS.md make this non-negotiable for CLEO:
|
|
11
|
+
"Read first — understand existing code, patterns, and contracts before
|
|
12
|
+
writing." For the executor, this means a concrete sequence.
|
|
13
|
+
|
|
14
|
+
1. `cleo show <TASK_ID>` — full task body, including hidden acceptance
|
|
15
|
+
criteria, gate config, and prior manifest summaries.
|
|
16
|
+
2. `cleo memory find "<topic-keyword>"` — prior decisions on the same
|
|
17
|
+
surface area. The BRAIN may already have answers.
|
|
18
|
+
3. `Grep` for the symbol or feature name in the target package. Most
|
|
19
|
+
"new" features have a related ancestor that should be extended, not
|
|
20
|
+
rewritten.
|
|
21
|
+
4. `gitnexus_impact({target: "<symbol>"})` — blast radius before any
|
|
22
|
+
edit. HIGH/CRITICAL warnings MUST be reported to the orchestrator
|
|
23
|
+
before proceeding.
|
|
24
|
+
|
|
25
|
+
Skipping any of these steps produces churn the reviewer will flag.
|
|
26
|
+
|
|
27
|
+
## Smallest-Change Principle
|
|
28
|
+
|
|
29
|
+
Match the existing pattern even when you could "improve" it in passing.
|
|
30
|
+
The contract on the executor is to ship the acceptance criteria — not
|
|
31
|
+
to refactor adjacent code. If the existing pattern is genuinely broken,
|
|
32
|
+
file a separate task; do not entangle a fix with the requested feature.
|
|
33
|
+
|
|
34
|
+
```text
|
|
35
|
+
GOOD: feat(T1234): add wave-rollup verb
|
|
36
|
+
packages/cleo/src/commands/orchestrate/wave-rollup.ts (new file)
|
|
37
|
+
|
|
38
|
+
BAD: feat(T1234): add wave-rollup verb + clean up unrelated handler
|
|
39
|
+
packages/cleo/src/commands/orchestrate/wave-rollup.ts (new file)
|
|
40
|
+
packages/cleo/src/commands/orchestrate/spawn.ts (drive-by refactor)
|
|
41
|
+
packages/cleo/src/dispatch.ts (rename in pass)
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The drive-by changes belong in their own task with their own acceptance
|
|
45
|
+
criteria. Reviewers cannot meaningfully approve a mixed-purpose diff.
|
|
46
|
+
|
|
47
|
+
## File-Placement Patterns
|
|
48
|
+
|
|
49
|
+
Package boundaries are enforced — see AGENTS.md "Package-Boundary Check".
|
|
50
|
+
Use this table when introducing new modules.
|
|
51
|
+
|
|
52
|
+
| Concern | Package | Why |
|
|
53
|
+
|---------|---------|-----|
|
|
54
|
+
| Runtime primitive, domain logic, store, memory | `packages/core/` | SDK; provider-neutral |
|
|
55
|
+
| CLI command handler, dispatch wiring | `packages/cleo/` | CLI surface only |
|
|
56
|
+
| Shared type, envelope, operation, error | `packages/contracts/` | Cross-package contract |
|
|
57
|
+
| Harness adapter, Pi runtime, claude-code adapter | `packages/cleo-os/` | Harness layer |
|
|
58
|
+
| Studio frontend (SvelteKit) | `packages/studio/` | UI |
|
|
59
|
+
| LAFS envelope spec or validator | `packages/lafs/` | Envelope ground truth |
|
|
60
|
+
| .cant DSL or parser | `packages/cant/` | DSL |
|
|
61
|
+
| Agent manifest packaging | `packages/caamp/` | Packaging |
|
|
62
|
+
|
|
63
|
+
When in doubt: state runtime concerns go in `core`; CLI handlers stay
|
|
64
|
+
thin and call into `core`. The repo has previously had to do T1015-style
|
|
65
|
+
relocation epics — avoid creating the next one.
|
|
66
|
+
|
|
67
|
+
## ESM Import Patterns
|
|
68
|
+
|
|
69
|
+
The repository uses ESM with `.js` extensions on import paths (TypeScript
|
|
70
|
+
strict, kebab-case files). The lint will fail any drift.
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
// CORRECT
|
|
74
|
+
import { openCleoDb } from "../store/open-cleo-db.js";
|
|
75
|
+
import type { TaskEnvelope } from "@cleocode/contracts";
|
|
76
|
+
|
|
77
|
+
// WRONG — no .js suffix
|
|
78
|
+
import { openCleoDb } from "../store/open-cleo-db";
|
|
79
|
+
|
|
80
|
+
// WRONG — CommonJS
|
|
81
|
+
const { openCleoDb } = require("../store/open-cleo-db");
|
|
82
|
+
|
|
83
|
+
// WRONG — no relative-path crossing of package boundary
|
|
84
|
+
import { something } from "../../../other-package/src/foo.js";
|
|
85
|
+
// (use a workspace import: import { something } from "@cleocode/other-package")
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Test-First When Possible
|
|
89
|
+
|
|
90
|
+
For new behavior in `packages/core/` or `packages/contracts/`, write the
|
|
91
|
+
test before the implementation. The test file lives alongside the source
|
|
92
|
+
under `__tests__/`.
|
|
93
|
+
|
|
94
|
+
```text
|
|
95
|
+
packages/core/src/store/open-cleo-db.ts
|
|
96
|
+
packages/core/src/store/__tests__/open-cleo-db.test.ts
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
For CLI changes where the behavior is integration-heavy (touches the
|
|
100
|
+
dispatcher, the worktree, the store), prefer an end-to-end test in
|
|
101
|
+
`packages/cleo/__tests__/<verb>.test.ts` that exercises the verb via
|
|
102
|
+
`runMain()` rather than a unit test of an internal helper.
|
|
103
|
+
|
|
104
|
+
## Error Handling Pattern
|
|
105
|
+
|
|
106
|
+
The repository contracts an LAFS envelope `{ success, data?, error?, meta }`
|
|
107
|
+
for every command output. Internal helpers throw typed errors; the
|
|
108
|
+
dispatcher converts to envelope at the boundary.
|
|
109
|
+
|
|
110
|
+
```typescript
|
|
111
|
+
// Internal: throw typed error
|
|
112
|
+
import { TaskNotFoundError } from "@cleocode/contracts";
|
|
113
|
+
if (!task) throw new TaskNotFoundError(taskId);
|
|
114
|
+
|
|
115
|
+
// Boundary: catch and wrap
|
|
116
|
+
try {
|
|
117
|
+
const data = await handler(input);
|
|
118
|
+
return { success: true, data, meta: makeMeta() };
|
|
119
|
+
} catch (err) {
|
|
120
|
+
return formatError(err, makeMeta());
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Do not introduce `catch (err: unknown)` — the AGENTS.md type-safety rules
|
|
125
|
+
ban it. Use the contract's error types and let TypeScript narrow.
|
|
126
|
+
|
|
127
|
+
## Quality Gate Sequence
|
|
128
|
+
|
|
129
|
+
Run these IN ORDER before completing. The contract is in AGENTS.md;
|
|
130
|
+
shortening this sequence has caused two patch-release hotfixes (v2026.4.67,
|
|
131
|
+
v2026.4.69) in past sessions.
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
pnpm biome check --write . # 1. format + lint
|
|
135
|
+
pnpm run build # 2. build (includes typecheck via tsc -b)
|
|
136
|
+
pnpm run typecheck # 3. typecheck — strict TS project refs
|
|
137
|
+
pnpm run test # 4. test (zero new failures)
|
|
138
|
+
git diff --stat HEAD # 5. verify scope matches intent
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Note: `pnpm run build` (esbuild) does NOT run the strict TS project-reference
|
|
142
|
+
typecheck. Always run `pnpm run typecheck` separately before tagging or
|
|
143
|
+
marking complete. This was learned the hard way via L-3 in
|
|
144
|
+
`feedback_typecheck_vs_build.md`.
|
|
145
|
+
|
|
146
|
+
## Worktree Discipline
|
|
147
|
+
|
|
148
|
+
All executor work happens inside the worktree at the path provided in the
|
|
149
|
+
spawn prompt's `## Worktree Setup` section. Operations to AVOID:
|
|
150
|
+
|
|
151
|
+
- `git checkout <other-branch>` — the worktree's branch is sticky.
|
|
152
|
+
- `git reset --hard origin/main` — destroys in-flight commits from other
|
|
153
|
+
worktree-spawn agents (caught in T9354 session: cost 3 PRs of recovery
|
|
154
|
+
via reflog cherry-pick).
|
|
155
|
+
- Editing files outside the worktree path — the git shim will block
|
|
156
|
+
most forbidden operations but the policy boundary is the worktree.
|
|
157
|
+
|
|
158
|
+
When done, the orchestrator integrates via `git merge --no-ff task/<id>`
|
|
159
|
+
per ADR-062 — preserving commit SHAs and task↔commit traceability. The
|
|
160
|
+
executor never touches `main` directly.
|
|
@@ -249,3 +249,12 @@ This skill binds to the **validation** LOOM lifecycle stage. Governing ADRs:
|
|
|
249
249
|
- [ADR-023 — protocol validation dispatch](../../../../.cleo/adrs/ADR-023-protocol-validation-dispatch.md) — defines the protocol-validation routing layer that dispatches to this skill.
|
|
250
250
|
|
|
251
251
|
LOOM coverage matrix: [docs/skills/loom-coverage-matrix.md](../../../../docs/skills/loom-coverage-matrix.md).
|
|
252
|
+
|
|
253
|
+
## See references/
|
|
254
|
+
|
|
255
|
+
Progressive disclosure — load on demand only:
|
|
256
|
+
|
|
257
|
+
- `references/validation-modes.md` — schema/code/document/protocol modes, selection rubric, composition
|
|
258
|
+
- `references/schema-checking.md` — engine selection, draft selection, pitfalls, bulk validation
|
|
259
|
+
- `references/compliance-reports.md` — canonical scaffold, status calculus, severity, ct-ivt-looper integration
|
|
260
|
+
- `references/anti-patterns.md` — twelve validation failure modes with detection and remediation
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
# Anti-Patterns
|
|
2
|
+
|
|
3
|
+
Common failure modes when running validation tasks. These degrade the
|
|
4
|
+
report's usefulness, break downstream consumers, or mask defects. Avoid
|
|
5
|
+
them by following the detection cue and the remediation.
|
|
6
|
+
|
|
7
|
+
## 1. The Short-Circuit Validator
|
|
8
|
+
|
|
9
|
+
**Symptom.** Validator stops on the first failure and reports only that
|
|
10
|
+
one. The report claims "FAIL" but lists only one issue when there are
|
|
11
|
+
several.
|
|
12
|
+
|
|
13
|
+
**Detection cue.** Issue count is exactly 1 but the underlying tool
|
|
14
|
+
(biome, tsc, jsonschema) has multi-issue output.
|
|
15
|
+
|
|
16
|
+
**Root cause.** Engine was run without `--all-errors` (AJV),
|
|
17
|
+
`--exhaustive`, or equivalent. Or a try/catch wrapped the validation
|
|
18
|
+
and bailed on first throw.
|
|
19
|
+
|
|
20
|
+
**Fix.** Always pass the all-errors flag. For Zod, use `safeParse` and
|
|
21
|
+
collect every issue from `result.error.issues`. For TypeScript, use
|
|
22
|
+
`tsc -b --pretty false` and capture every line.
|
|
23
|
+
|
|
24
|
+
## 2. The Soft Pass
|
|
25
|
+
|
|
26
|
+
**Symptom.** Report status is `PASS` but the target has known
|
|
27
|
+
unaddressed warnings.
|
|
28
|
+
|
|
29
|
+
**Detection cue.** Findings table contains entries; status is PASS.
|
|
30
|
+
|
|
31
|
+
**Root cause.** Status calculus violation — PASS requires zero
|
|
32
|
+
critical AND ≤2 warnings (per `compliance-reports.md`). Warnings
|
|
33
|
+
above threshold demote to PARTIAL.
|
|
34
|
+
|
|
35
|
+
**Fix.** Apply the status calculus mechanically. PASS only when the
|
|
36
|
+
table is empty (or warnings ≤2). When in doubt, demote.
|
|
37
|
+
|
|
38
|
+
## 3. The Unreproducible Report
|
|
39
|
+
|
|
40
|
+
**Symptom.** Six weeks later, someone tries to re-validate the same
|
|
41
|
+
target. The report's claims cannot be verified.
|
|
42
|
+
|
|
43
|
+
**Detection cue.** Report has no `## Trace` section or the Trace lists
|
|
44
|
+
no reproducer command.
|
|
45
|
+
|
|
46
|
+
**Root cause.** Reporter forgot to record the command sequence and
|
|
47
|
+
tool versions used.
|
|
48
|
+
|
|
49
|
+
**Fix.** Always include the reproducer. The Trace section is mandatory
|
|
50
|
+
per the canonical scaffold.
|
|
51
|
+
|
|
52
|
+
```markdown
|
|
53
|
+
## Trace
|
|
54
|
+
|
|
55
|
+
- Target: packages/cleo/src/release.ts (at 5608f75cd)
|
|
56
|
+
- Tooling: biome@2.4.11, tsc@5.6.0, pnpm@9.x
|
|
57
|
+
- Reproducer:
|
|
58
|
+
pnpm biome check packages/cleo/src/release.ts && \
|
|
59
|
+
pnpm exec tsc -b packages/cleo --pretty false
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## 4. The Mode Confusion
|
|
63
|
+
|
|
64
|
+
**Symptom.** A Document-mode report applies Code-mode rules, or
|
|
65
|
+
vice-versa.
|
|
66
|
+
|
|
67
|
+
**Detection cue.** Findings about TypeScript strictness in a spec
|
|
68
|
+
review; findings about RFC 2119 in a code lint.
|
|
69
|
+
|
|
70
|
+
**Root cause.** Mode was not made explicit at the start; the validator
|
|
71
|
+
defaulted to its strongest familiarity.
|
|
72
|
+
|
|
73
|
+
**Fix.** Declare mode in the report header. The spawn prompt or task
|
|
74
|
+
body MUST set it; if absent, ask the orchestrator to clarify before
|
|
75
|
+
proceeding.
|
|
76
|
+
|
|
77
|
+
## 5. The Missing Severity
|
|
78
|
+
|
|
79
|
+
**Symptom.** Findings listed but consumer cannot prioritize.
|
|
80
|
+
|
|
81
|
+
**Detection cue.** Findings without `Critical | Warning | Suggestion`
|
|
82
|
+
classification.
|
|
83
|
+
|
|
84
|
+
**Root cause.** Reporter treated all findings as equal.
|
|
85
|
+
|
|
86
|
+
**Fix.** Every finding MUST carry severity. When unclear, apply the
|
|
87
|
+
"blocks ship?" test: yes → Critical; no → Warning; "nice to have" →
|
|
88
|
+
Suggestion.
|
|
89
|
+
|
|
90
|
+
## 6. The Vague Remediation
|
|
91
|
+
|
|
92
|
+
**Symptom.** Issue says "fix this". Reader does not know how.
|
|
93
|
+
|
|
94
|
+
**Detection cue.** `Fix:` line is missing or contains only "see above"
|
|
95
|
+
/ "obvious from context" / "fix the issue".
|
|
96
|
+
|
|
97
|
+
**Root cause.** Reporter ran out of energy by the time they got to
|
|
98
|
+
the fix column.
|
|
99
|
+
|
|
100
|
+
**Fix.** Every finding has a concrete fix step. If the fix requires
|
|
101
|
+
discussion (architectural change), state that — but specifically:
|
|
102
|
+
"file a task to redesign the credential rotation flow; reference
|
|
103
|
+
ADR-XX-NEW once it lands".
|
|
104
|
+
|
|
105
|
+
## 7. The Phantom Test
|
|
106
|
+
|
|
107
|
+
**Symptom.** Protocol mode report claims REQ-NNN is verified by
|
|
108
|
+
`test/foo.test.ts::case-name`. The test does not exist.
|
|
109
|
+
|
|
110
|
+
**Detection cue.** Reproducer command fails with "no such test".
|
|
111
|
+
|
|
112
|
+
**Root cause.** Reporter copied the spec's traceability matrix without
|
|
113
|
+
re-checking that the named tests still exist (or ever existed).
|
|
114
|
+
|
|
115
|
+
**Fix.** Re-run each verification command from the traceability
|
|
116
|
+
matrix during validation. Flag REQs whose verification fails to
|
|
117
|
+
resolve as Critical findings — the spec drifted from the implementation.
|
|
118
|
+
|
|
119
|
+
## 8. The Single-File Tunnel
|
|
120
|
+
|
|
121
|
+
**Symptom.** Code-mode validation runs only on the file that was
|
|
122
|
+
explicitly named. Misses related files that share the violation.
|
|
123
|
+
|
|
124
|
+
**Detection cue.** Report has findings in `release.ts` only; the
|
|
125
|
+
same issue exists in 5 sibling files that were not checked.
|
|
126
|
+
|
|
127
|
+
**Root cause.** Reporter took the task literally instead of the
|
|
128
|
+
useful scope.
|
|
129
|
+
|
|
130
|
+
**Fix.** Apply the validation to all related files when feasible —
|
|
131
|
+
"the diff" usually means "all files touched by the task branch", not
|
|
132
|
+
"only the one file the orchestrator mentioned".
|
|
133
|
+
|
|
134
|
+
## 9. The Stale Schema
|
|
135
|
+
|
|
136
|
+
**Symptom.** Schema-mode validation passes but downstream consumers
|
|
137
|
+
still reject the data.
|
|
138
|
+
|
|
139
|
+
**Detection cue.** Schema version pinned in the report does not match
|
|
140
|
+
the producer's contract.
|
|
141
|
+
|
|
142
|
+
**Root cause.** Schema was updated upstream; validator used a cached
|
|
143
|
+
or pinned older version.
|
|
144
|
+
|
|
145
|
+
**Fix.** Always resolve the schema fresh from the contract source
|
|
146
|
+
(`@cleocode/contracts`). Pin the consumer/producer relationship in
|
|
147
|
+
the schema's `$id` and `version` fields and check both.
|
|
148
|
+
|
|
149
|
+
## 10. The Disposable Sidecar
|
|
150
|
+
|
|
151
|
+
**Symptom.** JSON sidecar emitted, but it has different findings than
|
|
152
|
+
the markdown report.
|
|
153
|
+
|
|
154
|
+
**Detection cue.** `diff <(md-extract-findings report.md)
|
|
155
|
+
<(jq '.findings' report.json)` shows mismatched data.
|
|
156
|
+
|
|
157
|
+
**Root cause.** Reporter wrote the markdown manually and the JSON
|
|
158
|
+
separately; they drifted.
|
|
159
|
+
|
|
160
|
+
**Fix.** Generate one from the other. Write the structured data first
|
|
161
|
+
(JSON), then render the markdown from it. A `--render-md` flag on the
|
|
162
|
+
report generator enforces this.
|
|
163
|
+
|
|
164
|
+
## 11. The Unsourced Rule
|
|
165
|
+
|
|
166
|
+
**Symptom.** A finding cites a rule that does not exist in any visible
|
|
167
|
+
standard.
|
|
168
|
+
|
|
169
|
+
**Detection cue.** Rule reference is prose ("naming should be
|
|
170
|
+
consistent") rather than a stable identifier ("AGENTS.md §Package
|
|
171
|
+
Boundary").
|
|
172
|
+
|
|
173
|
+
**Root cause.** Reporter applied a personal preference and labeled
|
|
174
|
+
it as a rule.
|
|
175
|
+
|
|
176
|
+
**Fix.** Every rule citation MUST link to a stable source:
|
|
177
|
+
`AGENTS.md §X`, `ADR-NNN`, `biome.json#rules.style.Y`. If the
|
|
178
|
+
preference is real but unwritten, the report SHOULD propose adding
|
|
179
|
+
it to the standard (file a task) rather than enforcing it silently.
|
|
180
|
+
|
|
181
|
+
## 12. The Pre-Empty Report
|
|
182
|
+
|
|
183
|
+
**Symptom.** Validator runs against an empty or absent target, reports
|
|
184
|
+
`PASS`.
|
|
185
|
+
|
|
186
|
+
**Detection cue.** Target file is empty or does not exist; report says
|
|
187
|
+
"100% compliance".
|
|
188
|
+
|
|
189
|
+
**Root cause.** Engine returned zero violations because there was
|
|
190
|
+
nothing to violate.
|
|
191
|
+
|
|
192
|
+
**Fix.** Always sanity-check the target exists and has content before
|
|
193
|
+
running validation. Empty/missing target is itself a Critical finding —
|
|
194
|
+
not a clean pass.
|