Skip to content

Commit 01ed1b3

Browse files
fix(ci): enforce catalog count integrity (anomalyco#525)
* fix(ci): enforce catalog count integrity * test: harden catalog structure parsing
1 parent ac53fbc commit 01ed1b3

6 files changed

Lines changed: 173 additions & 16 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ jobs:
179179
run: node scripts/ci/validate-rules.js
180180
continue-on-error: false
181181

182+
- name: Validate catalog counts
183+
run: node scripts/ci/catalog.js --text
184+
continue-on-error: false
185+
182186
security:
183187
name: Security Scan
184188
runs-on: ubuntu-latest

‎AGENTS.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Everything Claude Code (ECC) — Agent Instructions
22

3-
This is a **production-ready AI coding plugin** providing 20 specialized agents, 65+ skills, 51 commands, and automated hook workflows for software development.
3+
This is a **production-ready AI coding plugin** providing 21 specialized agents, 102 skills, 52 commands, and automated hook workflows for software development.
44

55
## Core Principles
66

@@ -132,9 +132,9 @@ Troubleshoot failures: check test isolation → verify mocks → fix implementat
132132
## Project Structure
133133

134134
```
135-
agents/ — 20 specialized subagents
136-
skills/ — 65+ workflow skills and domain knowledge
137-
commands/ — 51 slash commands
135+
agents/ — 21 specialized subagents
136+
skills/ — 102 workflow skills and domain knowledge
137+
commands/ — 52 slash commands
138138
hooks/ — Trigger-based automations
139139
rules/ — Always-follow guidelines (common + per-language)
140140
scripts/ — Cross-platform Node.js utilities

‎README.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ For manual install instructions see the README in the `rules/` folder.
188188
/plugin list everything-claude-code@everything-claude-code
189189
```
190190

191-
✨ **That's it!** You now have access to 16 agents, 65 skills, and 40 commands.
191+
✨ **That's it!** You now have access to 21 agents, 102 skills, and 52 commands.
192192

193193
---
194194

@@ -1039,9 +1039,9 @@ The configuration is automatically detected from `.opencode/opencode.json`.
10391039
10401040
| Feature | Claude Code | OpenCode | Status |
10411041
|---------|-------------|----------|--------|
1042-
| Agents | ✅ 16 agents | ✅ 12 agents | **Claude Code leads** |
1043-
| Commands | ✅ 40 commands | ✅ 31 commands | **Claude Code leads** |
1044-
| Skills | ✅ 65 skills | ✅ 37 skills | **Claude Code leads** |
1042+
| Agents | ✅ 21 agents | ✅ 12 agents | **Claude Code leads** |
1043+
| Commands | ✅ 52 commands | ✅ 31 commands | **Claude Code leads** |
1044+
| Skills | ✅ 102 skills | ✅ 37 skills | **Claude Code leads** |
10451045
| Hooks | ✅ 8 event types | ✅ 11 events | **OpenCode has more!** |
10461046
| Rules | ✅ 29 rules | ✅ 13 instructions | **Claude Code leads** |
10471047
| MCP Servers | ✅ 14 servers | ✅ Full | **Full parity** |
@@ -1147,9 +1147,9 @@ ECC is the **first plugin to maximize every major AI coding tool**. Here's how e
11471147
11481148
| Feature | Claude Code | Cursor IDE | Codex CLI | OpenCode |
11491149
|---------|------------|------------|-----------|----------|
1150-
| **Agents** | 16 | Shared (AGENTS.md) | Shared (AGENTS.md) | 12 |
1151-
| **Commands** | 40 | Shared | Instruction-based | 31 |
1152-
| **Skills** | 65 | Shared | 10 (native format) | 37 |
1150+
| **Agents** | 21 | Shared (AGENTS.md) | Shared (AGENTS.md) | 12 |
1151+
| **Commands** | 52 | Shared | Instruction-based | 31 |
1152+
| **Skills** | 102 | Shared | 10 (native format) | 37 |
11531153
| **Hook Events** | 8 types | 15 types | None yet | 11 types |
11541154
| **Hook Scripts** | 20+ scripts | 16 scripts (DRY adapter) | N/A | Plugin hooks |
11551155
| **Rules** | 34 (common + lang) | 34 (YAML frontmatter) | Instruction-based | 13 instructions |

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
"orchestrate:status": "node scripts/orchestration-status.js",
105105
"orchestrate:worker": "bash scripts/orchestrate-codex-worker.sh",
106106
"orchestrate:tmux": "node scripts/orchestrate-worktrees.js",
107-
"test": "node scripts/ci/validate-agents.js && node scripts/ci/validate-commands.js && node scripts/ci/validate-rules.js && node scripts/ci/validate-skills.js && node scripts/ci/validate-hooks.js && node scripts/ci/validate-install-manifests.js && node scripts/ci/validate-no-personal-paths.js && node tests/run-all.js",
107+
"test": "node scripts/ci/validate-agents.js && node scripts/ci/validate-commands.js && node scripts/ci/validate-rules.js && node scripts/ci/validate-skills.js && node scripts/ci/validate-hooks.js && node scripts/ci/validate-install-manifests.js && node scripts/ci/validate-no-personal-paths.js && node scripts/ci/catalog.js --text && node tests/run-all.js",
108108
"coverage": "c8 --all --include=\"scripts/**/*.js\" --check-coverage --lines 80 --functions 80 --branches 80 --statements 80 --reporter=text --reporter=lcov node tests/run-all.js"
109109
},
110110
"dependencies": {

‎scripts/ci/catalog.js‎

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ function parseReadmeExpectations(readmeContent) {
7676
);
7777

7878
const tablePatterns = [
79-
{ category: 'agents', regex: /\|\s*Agents\s*\|\s*✅\s*(\d+)\s+agents\s*\|/i, source: 'README.md comparison table' },
80-
{ category: 'commands', regex: /\|\s*Commands\s*\|\s*✅\s*(\d+)\s+commands\s*\|/i, source: 'README.md comparison table' },
81-
{ category: 'skills', regex: /\|\s*Skills\s*\|\s*✅\s*(\d+)\s+skills\s*\|/i, source: 'README.md comparison table' }
79+
{ category: 'agents', regex: /\|\s*(?:\*\*)?Agents(?:\*\*)?\s*\|\s*✅\s*(\d+)\s+agents\s*\|/i, source: 'README.md comparison table' },
80+
{ category: 'commands', regex: /\|\s*(?:\*\*)?Commands(?:\*\*)?\s*\|\s*✅\s*(\d+)\s+commands\s*\|/i, source: 'README.md comparison table' },
81+
{ category: 'skills', regex: /\|\s*(?:\*\*)?Skills(?:\*\*)?\s*\|\s*✅\s*(\d+)\s+skills\s*\|/i, source: 'README.md comparison table' }
8282
];
8383

8484
for (const pattern of tablePatterns) {
@@ -104,7 +104,7 @@ function parseAgentsDocExpectations(agentsContent) {
104104
throw new Error('AGENTS.md is missing the catalog summary line');
105105
}
106106

107-
return [
107+
const expectations = [
108108
{ category: 'agents', mode: 'exact', expected: Number(summaryMatch[1]), source: 'AGENTS.md summary' },
109109
{
110110
category: 'skills',
@@ -114,6 +114,43 @@ function parseAgentsDocExpectations(agentsContent) {
114114
},
115115
{ category: 'commands', mode: 'exact', expected: Number(summaryMatch[4]), source: 'AGENTS.md summary' }
116116
];
117+
118+
const structurePatterns = [
119+
{
120+
category: 'agents',
121+
mode: 'exact',
122+
regex: /^\s*agents\/\s*[—–-]\s*(\d+)\s+specialized subagents\s*$/im,
123+
source: 'AGENTS.md project structure'
124+
},
125+
{
126+
category: 'skills',
127+
mode: 'minimum',
128+
regex: /^\s*skills\/\s*[—–-]\s*(\d+)(\+)?\s+workflow skills and domain knowledge\s*$/im,
129+
source: 'AGENTS.md project structure'
130+
},
131+
{
132+
category: 'commands',
133+
mode: 'exact',
134+
regex: /^\s*commands\/\s*[—–-]\s*(\d+)\s+slash commands\s*$/im,
135+
source: 'AGENTS.md project structure'
136+
}
137+
];
138+
139+
for (const pattern of structurePatterns) {
140+
const match = agentsContent.match(pattern.regex);
141+
if (!match) {
142+
throw new Error(`${pattern.source} is missing the ${pattern.category} entry`);
143+
}
144+
145+
expectations.push({
146+
category: pattern.category,
147+
mode: pattern.mode === 'minimum' && match[2] ? 'minimum' : pattern.mode,
148+
expected: Number(match[1]),
149+
source: `${pattern.source} (${pattern.category})`
150+
});
151+
}
152+
153+
return expectations;
117154
}
118155

119156
function evaluateExpectations(catalog, expectations) {

‎tests/ci/validators.test.js‎

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,68 @@ function runValidator(validatorName) {
140140
}
141141
}
142142

143+
function runCatalogValidator(overrides = {}) {
144+
const validatorPath = path.join(validatorsDir, 'catalog.js');
145+
let source = fs.readFileSync(validatorPath, 'utf8');
146+
source = source.replace(/^#!.*\n/, '');
147+
source = `process.argv.push('--text');\n${source}`;
148+
149+
const resolvedOverrides = {
150+
ROOT: repoRoot,
151+
README_PATH: path.join(repoRoot, 'README.md'),
152+
AGENTS_PATH: path.join(repoRoot, 'AGENTS.md'),
153+
...overrides,
154+
};
155+
156+
for (const [constant, overridePath] of Object.entries(resolvedOverrides)) {
157+
const dirRegex = new RegExp(`const ${constant} = .*?;`);
158+
source = source.replace(dirRegex, `const ${constant} = ${JSON.stringify(overridePath)};`);
159+
}
160+
161+
try {
162+
const stdout = execFileSync('node', ['-e', source], {
163+
encoding: 'utf8',
164+
stdio: ['pipe', 'pipe', 'pipe'],
165+
timeout: 10000,
166+
});
167+
return { code: 0, stdout, stderr: '' };
168+
} catch (err) {
169+
return {
170+
code: err.status || 1,
171+
stdout: err.stdout || '',
172+
stderr: err.stderr || '',
173+
};
174+
}
175+
}
176+
177+
function writeCatalogFixture(testDir, options = {}) {
178+
const {
179+
readmeCounts = { agents: 1, skills: 1, commands: 1 },
180+
summaryCounts = { agents: 1, skills: 1, commands: 1 },
181+
structureLines = [
182+
'agents/ — 1 specialized subagents',
183+
'skills/ — 1 workflow skills and domain knowledge',
184+
'commands/ — 1 slash commands',
185+
],
186+
} = options;
187+
188+
const readmePath = path.join(testDir, 'README.md');
189+
const agentsPath = path.join(testDir, 'AGENTS.md');
190+
191+
fs.mkdirSync(path.join(testDir, 'agents'), { recursive: true });
192+
fs.mkdirSync(path.join(testDir, 'commands'), { recursive: true });
193+
fs.mkdirSync(path.join(testDir, 'skills', 'demo-skill'), { recursive: true });
194+
195+
fs.writeFileSync(path.join(testDir, 'agents', 'planner.md'), '---\nmodel: sonnet\ntools: Read\n---\n# Planner');
196+
fs.writeFileSync(path.join(testDir, 'commands', 'plan.md'), '---\ndescription: Plan\n---\n# Plan');
197+
fs.writeFileSync(path.join(testDir, 'skills', 'demo-skill', 'SKILL.md'), '---\nname: demo-skill\ndescription: Demo skill\norigin: ECC\n---\n# Demo Skill');
198+
199+
fs.writeFileSync(readmePath, `Access to ${readmeCounts.agents} agents, ${readmeCounts.skills} skills, and ${readmeCounts.commands} commands.\n| Feature | Claude Code | Cursor IDE | Codex CLI | OpenCode |\n|---------|------------|------------|-----------|----------|\n| Agents | ✅ ${readmeCounts.agents} agents | Shared | Shared | 1 |\n| Commands | ✅ ${readmeCounts.commands} commands | Shared | Shared | 1 |\n| Skills | ✅ ${readmeCounts.skills} skills | Shared | Shared | 1 |\n`);
200+
fs.writeFileSync(agentsPath, `This is a **production-ready AI coding plugin** providing ${summaryCounts.agents} specialized agents, ${summaryCounts.skills} skills, ${summaryCounts.commands} commands, and automated hook workflows for software development.\n\n\`\`\`\n${structureLines.join('\n')}\n\`\`\`\n`);
201+
202+
return { readmePath, agentsPath };
203+
}
204+
143205
function runTests() {
144206
console.log('\n=== Testing CI Validators ===\n');
145207

@@ -262,6 +324,60 @@ function runTests() {
262324
assert.ok(result.stdout.includes('Validated'), 'Should output validation count');
263325
})) passed++; else failed++;
264326

327+
// ==========================================
328+
// catalog.js
329+
// ==========================================
330+
console.log('\ncatalog.js:');
331+
332+
if (test('passes on real project catalog counts', () => {
333+
const result = runCatalogValidator();
334+
assert.strictEqual(result.code, 0, `Should pass, got stderr: ${result.stderr}`);
335+
assert.ok(result.stdout.includes('Documentation counts match the repository catalog.'), 'Should report matching counts');
336+
})) passed++; else failed++;
337+
338+
if (test('fails when README and AGENTS catalog counts drift', () => {
339+
const testDir = createTestDir();
340+
const { readmePath, agentsPath } = writeCatalogFixture(testDir, {
341+
readmeCounts: { agents: 99, skills: 99, commands: 99 },
342+
summaryCounts: { agents: 99, skills: 99, commands: 99 },
343+
structureLines: [
344+
'agents/ — 99 specialized subagents',
345+
'skills/ — 99 workflow skills and domain knowledge',
346+
'commands/ — 99 slash commands',
347+
],
348+
});
349+
350+
const result = runCatalogValidator({
351+
ROOT: testDir,
352+
README_PATH: readmePath,
353+
AGENTS_PATH: agentsPath,
354+
});
355+
356+
assert.strictEqual(result.code, 1, 'Should fail when catalog counts drift');
357+
assert.ok((result.stdout + result.stderr).includes('Documentation count mismatches found:'), 'Should report mismatches');
358+
cleanupTestDir(testDir);
359+
})) passed++; else failed++;
360+
361+
if (test('accepts AGENTS project structure entries with varied spacing and dash styles', () => {
362+
const testDir = createTestDir();
363+
const { readmePath, agentsPath } = writeCatalogFixture(testDir, {
364+
structureLines: [
365+
' agents/ - 1 specialized subagents ',
366+
'\tskills/\t–\t1+ workflow skills and domain knowledge\t',
367+
' commands/ — 1 slash commands ',
368+
],
369+
});
370+
371+
const result = runCatalogValidator({
372+
ROOT: testDir,
373+
README_PATH: readmePath,
374+
AGENTS_PATH: agentsPath,
375+
});
376+
377+
assert.strictEqual(result.code, 0, `Should accept formatting variations, got stderr: ${result.stderr}`);
378+
cleanupTestDir(testDir);
379+
})) passed++; else failed++;
380+
265381
if (test('exits 0 when hooks.json does not exist', () => {
266382
const result = runValidatorWithDir('validate-hooks', 'HOOKS_FILE', '/nonexistent/hooks.json');
267383
assert.strictEqual(result.code, 0, 'Should skip when no hooks.json');

0 commit comments

Comments
 (0)