diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 3186376b..68d80fde 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -38,6 +38,5 @@ "./agents/refactor-cleaner.md", "./agents/security-reviewer.md", "./agents/tdd-guide.md" - ], - "hooks": "./hooks/hooks.json" + ] } diff --git a/tests/hooks/hooks.test.js b/tests/hooks/hooks.test.js index e629a267..2ed292ad 100644 --- a/tests/hooks/hooks.test.js +++ b/tests/hooks/hooks.test.js @@ -325,6 +325,22 @@ async function runTests() { } })) passed++; else failed++; + // plugin.json validation + console.log('\nplugin.json Validation:'); + + if (test('plugin.json does NOT have explicit hooks declaration', () => { + // Claude Code automatically loads hooks/hooks.json by convention. + // Explicitly declaring it in plugin.json causes a duplicate detection error. + // See: https://github.com/affaan-m/everything-claude-code/issues/103 + const pluginPath = path.join(__dirname, '..', '..', '.claude-plugin', 'plugin.json'); + const plugin = JSON.parse(fs.readFileSync(pluginPath, 'utf8')); + + assert.ok( + !plugin.hooks, + 'plugin.json should NOT have "hooks" field - Claude Code auto-loads hooks/hooks.json' + ); + })) passed++; else failed++; + // Summary console.log('\n=== Test Results ==='); console.log(`Passed: ${passed}`);