@cleocode/skills 2026.4.72 → 2026.4.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Regression tests for CLEO-INJECTION.md content (T778).
|
|
3
|
+
*
|
|
4
|
+
* Asserts that the CLEO protocol template file contains required content
|
|
5
|
+
* and uses correct command forms, protecting against accidental simplification
|
|
6
|
+
* or command-form drift.
|
|
7
|
+
*
|
|
8
|
+
* Checks:
|
|
9
|
+
* - Contains `cleo memory observe` (not bare `cleo observe`)
|
|
10
|
+
* - Contains `cleo orchestrate start` in Session Start section
|
|
11
|
+
* - Contains "Memory Protocol (JIT)" H2 section
|
|
12
|
+
* - Contains "Escalation" H2 section
|
|
13
|
+
* - At least 6 distinct `cleo <verb>` command patterns
|
|
14
|
+
*
|
|
15
|
+
* @task T778
|
|
16
|
+
* @injectable-file /home/keatonhoskins/.local/share/cleo/templates/CLEO-INJECTION.md
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { readFileSync } from 'node:fs';
|
|
20
|
+
import { resolve } from 'node:path';
|
|
21
|
+
import { describe, expect, it } from 'vitest';
|
|
22
|
+
|
|
23
|
+
// ---------------------------------------------------------------------------
|
|
24
|
+
// Setup
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
|
|
27
|
+
/** Absolute path to CLEO-INJECTION.md template file */
|
|
28
|
+
const injectionPath = resolve(
|
|
29
|
+
'/home/keatonhoskins/.local/share/cleo/templates/CLEO-INJECTION.md'
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
/** Read once — all assertions operate on this string */
|
|
33
|
+
const injectionContent = readFileSync(injectionPath, 'utf-8');
|
|
34
|
+
|
|
35
|
+
// ---------------------------------------------------------------------------
|
|
36
|
+
// Required section markers
|
|
37
|
+
// ---------------------------------------------------------------------------
|
|
38
|
+
|
|
39
|
+
describe('CLEO-INJECTION.md — required section markers', () => {
|
|
40
|
+
it('contains "Memory Protocol (JIT)" H2 section', () => {
|
|
41
|
+
expect(injectionContent).toMatch(/^## Memory Protocol \(JIT\)/m);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('contains "Escalation" H2 section', () => {
|
|
45
|
+
expect(injectionContent).toMatch(/^## Escalation/m);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('contains "Session Start" H2 section', () => {
|
|
49
|
+
expect(injectionContent).toMatch(/^## Session Start/m);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('contains "Work Loop" H2 section', () => {
|
|
53
|
+
expect(injectionContent).toMatch(/^## Work Loop/m);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('contains "Task Discovery" H2 section', () => {
|
|
57
|
+
expect(injectionContent).toMatch(/^## Task Discovery/m);
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
// ---------------------------------------------------------------------------
|
|
62
|
+
// Command correctness
|
|
63
|
+
// ---------------------------------------------------------------------------
|
|
64
|
+
|
|
65
|
+
describe('CLEO-INJECTION.md — command correctness', () => {
|
|
66
|
+
it('contains "cleo memory observe" (not bare "cleo observe")', () => {
|
|
67
|
+
// Must contain the correct form
|
|
68
|
+
expect(injectionContent).toContain('cleo memory observe');
|
|
69
|
+
|
|
70
|
+
// The bare `cleo observe` form should NOT appear as an active command
|
|
71
|
+
// (it may appear historically in comments, but check context)
|
|
72
|
+
const lines = injectionContent.split('\n');
|
|
73
|
+
const bareObserveInstructions = lines.filter((line) => {
|
|
74
|
+
// Skip table rows and markdown formatting
|
|
75
|
+
if (/^\s*\|/.test(line)) return false;
|
|
76
|
+
if (line.trim().startsWith('-')) return false;
|
|
77
|
+
// Check for bare `cleo observe` in code examples or instructions
|
|
78
|
+
return (
|
|
79
|
+
/\bcleo observe\b/.test(line) &&
|
|
80
|
+
!line.includes('cleo memory observe')
|
|
81
|
+
);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
// Should be zero or only in legacy/comment context
|
|
85
|
+
expect(bareObserveInstructions).toHaveLength(0);
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it('contains "cleo orchestrate start" in documentation', () => {
|
|
89
|
+
expect(injectionContent).toMatch(/cleo orchestrate start/);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it('contains "cleo session status" command', () => {
|
|
93
|
+
expect(injectionContent).toContain('cleo session status');
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it('contains "cleo show" command', () => {
|
|
97
|
+
expect(injectionContent).toContain('cleo show');
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
it('contains "cleo find" command', () => {
|
|
101
|
+
expect(injectionContent).toContain('cleo find');
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
// ---------------------------------------------------------------------------
|
|
106
|
+
// Command diversity — at least 6 distinct cleo <verb> patterns
|
|
107
|
+
// ---------------------------------------------------------------------------
|
|
108
|
+
|
|
109
|
+
describe('CLEO-INJECTION.md — command diversity', () => {
|
|
110
|
+
it('contains at least 6 distinct "cleo <verb>" command patterns', () => {
|
|
111
|
+
// Extract all `cleo <word>` patterns (first word after cleo)
|
|
112
|
+
const verbs = new Set<string>();
|
|
113
|
+
const pattern = /\bcleo\s+([a-z][a-z0-9-]*)/g;
|
|
114
|
+
let match: RegExpExecArray | null;
|
|
115
|
+
|
|
116
|
+
// eslint-disable-next-line no-cond-assign
|
|
117
|
+
while ((match = pattern.exec(injectionContent)) !== null) {
|
|
118
|
+
verbs.add(match[1]);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// List them for debugging if needed
|
|
122
|
+
const verbsArray = Array.from(verbs).sort();
|
|
123
|
+
expect(verbs.size).toBeGreaterThanOrEqual(6);
|
|
124
|
+
expect(verbsArray).toContain('session');
|
|
125
|
+
expect(verbsArray).toContain('show');
|
|
126
|
+
expect(verbsArray).toContain('find');
|
|
127
|
+
expect(verbsArray).toContain('memory');
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
// ---------------------------------------------------------------------------
|
|
132
|
+
// Content completeness
|
|
133
|
+
// ---------------------------------------------------------------------------
|
|
134
|
+
|
|
135
|
+
describe('CLEO-INJECTION.md — content completeness', () => {
|
|
136
|
+
it('references Protocol version in header', () => {
|
|
137
|
+
expect(injectionContent).toMatch(/Version:\s*[\d.]+/);
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
it('contains error handling section', () => {
|
|
141
|
+
expect(injectionContent).toMatch(/## Error Handling/);
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
it('contains Rules section', () => {
|
|
145
|
+
expect(injectionContent).toMatch(/## Rules/);
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
it('mentions worktree or isolation pattern', () => {
|
|
149
|
+
// The protocol should reference some form of process isolation
|
|
150
|
+
expect(injectionContent).toMatch(
|
|
151
|
+
/worktree|isolation|scope|namespace|context|dedicated/i
|
|
152
|
+
);
|
|
153
|
+
});
|
|
154
|
+
});
|