fix: remove agents field from plugin.json manifest (#1459)

The Claude Code plugin validator rejects the "agents" field entirely.
Remove it from the manifest, schema, and tests. Update schema notes
to document this as a known constraint alongside the hooks field.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Gaurav Dubey
2026-04-18 21:29:11 +05:30
committed by mia
parent 1a50145d39
commit c19fde229a
4 changed files with 23 additions and 120 deletions

View File

@@ -212,37 +212,11 @@ test('claude plugin.json uses published plugin name', () => {
assert.strictEqual(claudePlugin.name, 'everything-claude-code');
});
test('claude plugin.json agents is an array', () => {
assert.ok(Array.isArray(claudePlugin.agents), 'Expected agents to be an array (not a string/directory)');
});
test('claude plugin.json agents uses explicit file paths (not directories)', () => {
for (const agentPath of claudePlugin.agents) {
assertSafeRepoRelativePath(agentPath, 'Agent path');
assert.ok(
agentPath.endsWith('.md'),
`Expected explicit .md file path, got: ${agentPath}`,
);
assert.ok(
!agentPath.endsWith('/'),
`Expected explicit file path, not directory, got: ${agentPath}`,
);
}
});
test('claude plugin.json all agent files exist', () => {
for (const agentRelPath of claudePlugin.agents) {
assertSafeRepoRelativePath(agentRelPath, 'Agent path');
const absolute = path.resolve(repoRoot, agentRelPath);
assert.ok(
absolute === repoRoot || absolute.startsWith(repoRootWithSep),
`Agent path resolves outside repo root: ${agentRelPath}`,
);
assert.ok(
fs.existsSync(absolute),
`Agent file missing: ${agentRelPath}`,
);
}
test('claude plugin.json does NOT have agents field (unsupported by Claude Code validator)', () => {
assert.ok(
!('agents' in claudePlugin),
'agents field must NOT be declared — Claude Code plugin validator rejects it',
);
});
test('claude plugin.json skills is an array', () => {