Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,36 @@
const fs = require('fs');
const path = require('path');

const ALLOWED_NATIVE_SUBAGENTS = new Set([
'aiox-analyst',
'aiox-architect',
'aiox-data-engineer',
'aiox-dev',
'aiox-devops',
'aiox-pm',
'aiox-po',
'aiox-qa',
'aiox-sm',
'aiox-ux',
]);
Comment thread
coderabbitai[bot] marked this conversation as resolved.

const ALLOWED_CLAUDE_COMMAND_ENTRIES = new Set([
'AIOX',
'greet.md',
'synapse',
]);

const ALLOWED_CLAUDE_SKILL_ENTRIES = new Set([
'AIOX',
'architect-first',
'checklist-runner',
'coderabbit-review',
'mcp-builder',
'skill-creator',
'synapse',
'tech-search',
]);

function parseArgs(argv = process.argv.slice(2)) {
const args = new Set(argv);
return {
Expand Down Expand Up @@ -33,13 +63,25 @@ function listClaudeAgentSkillIds(skillsAgentsDir) {
.sort();
}

function listTopLevelNames(dirPath) {
if (!fs.existsSync(dirPath)) return [];
return fs.readdirSync(dirPath, { withFileTypes: true })
.filter((entry) => entry.isDirectory() || entry.isFile())
.map((entry) => entry.name)
.sort();
}

function validateClaudeIntegration(options = {}) {
const projectRoot = options.projectRoot || process.cwd();
const rulesFile = options.rulesFile || path.join(projectRoot, '.claude', 'CLAUDE.md');
const commandsRoot = options.commandsRoot || path.join(projectRoot, '.claude', 'commands');
const skillsRoot = options.skillsRoot || path.join(projectRoot, '.claude', 'skills');
const agentMemoryRoot = options.agentMemoryRoot || path.join(projectRoot, '.claude', 'agent-memory');
const agentsDir = options.agentsDir || path.join(projectRoot, '.claude', 'commands', 'AIOX', 'agents');
const skillsAgentsDir =
options.skillsAgentsDir || path.join(projectRoot, '.claude', 'skills', 'AIOX', 'agents');
const hooksDir = options.hooksDir || path.join(projectRoot, '.claude', 'hooks');
const nativeAgentsDir = options.nativeAgentsDir || path.join(projectRoot, '.claude', 'agents');
const sourceAgentsDir =
options.sourceAgentsDir || path.join(projectRoot, '.aiox-core', 'development', 'agents');

Expand All @@ -62,6 +104,35 @@ function validateClaudeIntegration(options = {}) {
const sourceAgents = listMarkdownBasenames(sourceAgentsDir);
const commandAgents = listMarkdownBasenames(agentsDir);
const skillAgents = listClaudeAgentSkillIds(skillsAgentsDir);
const nativeAgents = listMarkdownBasenames(nativeAgentsDir);
const disallowedNativeAgents = nativeAgents.filter((agentId) => !ALLOWED_NATIVE_SUBAGENTS.has(agentId));
const commandEntries = listTopLevelNames(commandsRoot);
const skillEntries = listTopLevelNames(skillsRoot);
const agentMemoryEntries = listTopLevelNames(agentMemoryRoot);
const disallowedCommandEntries = commandEntries.filter((entry) => !ALLOWED_CLAUDE_COMMAND_ENTRIES.has(entry));
const disallowedSkillEntries = skillEntries.filter((entry) => !ALLOWED_CLAUDE_SKILL_ENTRIES.has(entry));
const disallowedAgentMemoryEntries = agentMemoryEntries.filter((entry) => !entry.startsWith('aiox-'));

if (disallowedNativeAgents.length > 0) {
errors.push(
`Disallowed Claude native subagent(s) in .claude/agents: ${disallowedNativeAgents.join(', ')}`,
);
}
if (disallowedCommandEntries.length > 0) {
errors.push(
`Disallowed Claude command namespace(s) in .claude/commands: ${disallowedCommandEntries.join(', ')}`,
);
}
if (disallowedSkillEntries.length > 0) {
errors.push(
`Disallowed Claude skill artifact(s) in .claude/skills: ${disallowedSkillEntries.join(', ')}`,
);
}
if (disallowedAgentMemoryEntries.length > 0) {
errors.push(
`Disallowed Claude agent memory namespace(s) in .claude/agent-memory: ${disallowedAgentMemoryEntries.join(', ')}`,
);
}

if (sourceAgents.length > 0 && skillAgents.length !== sourceAgents.length) {
errors.push(`Claude agent skill count differs from source (${skillAgents.length}/${sourceAgents.length})`);
Expand Down Expand Up @@ -99,6 +170,10 @@ function validateClaudeIntegration(options = {}) {
sourceAgents: sourceAgents.length,
claudeCommands: commandAgents.length,
claudeSkills: skillAgents.length,
claudeNativeAgents: nativeAgents.length,
claudeCommandNamespaces: commandEntries.length,
claudeSkillArtifacts: skillEntries.length,
claudeAgentMemoryNamespaces: agentMemoryEntries.length,
},
};
}
Expand Down Expand Up @@ -150,4 +225,8 @@ module.exports = {
countMarkdownFiles,
listMarkdownBasenames,
listClaudeAgentSkillIds,
listTopLevelNames,
ALLOWED_NATIVE_SUBAGENTS,
ALLOWED_CLAUDE_COMMAND_ENTRIES,
ALLOWED_CLAUDE_SKILL_ENTRIES,
};
6 changes: 3 additions & 3 deletions .aiox-core/install-manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# - File types for categorization
#
version: 5.2.9
generated_at: "2026-05-21T01:42:24.351Z"
generated_at: "2026-05-21T13:48:41.292Z"
generator: scripts/generate-install-manifest.js
file_count: 1129
files:
Expand Down Expand Up @@ -3481,9 +3481,9 @@ files:
type: script
size: 14900
- path: infrastructure/scripts/validate-claude-integration.js
hash: sha256:0174d5e5e38eb8aa5aaa0a44d87f0f8dda623a24f318855c1e50e9d04f7596d6
hash: sha256:e9d6776b9af9e9233e50aa7664eef7c67937af0ebabca1a3aa26c518debf8178
type: script
size: 4774
size: 7621
- path: infrastructure/scripts/validate-codex-integration.js
hash: sha256:0f45a49898528d708ef17871bf6abae4f60483ef8520ce30a9bd4f5e507c585f
type: script
Expand Down
57 changes: 0 additions & 57 deletions .claude/agent-memory/oalanicolas/MEMORY.md

This file was deleted.

58 changes: 0 additions & 58 deletions .claude/agent-memory/pedro-valerio/MEMORY.md

This file was deleted.

59 changes: 0 additions & 59 deletions .claude/agent-memory/sop-extractor/MEMORY.md

This file was deleted.

61 changes: 0 additions & 61 deletions .claude/agent-memory/squad/MEMORY.md

This file was deleted.

Loading
Loading