Files
2025-12-25 03:38:55 +00:00

218 lines
6.9 KiB
JavaScript

#!/usr/bin/env node
/**
* Plugin Verification Test Script
*
* Tests all installed Claude Code plugins from the marketplace:
* - Verifies plugin installation
* - Tests MCP server plugins are running
* - Validates agent skills are accessible
* - Checks plugin relationships with existing skills
* - Reports integration status
*/
const fs = require('fs');
const path = require('path');
const { execSync } = require('child_process');
const ROOT = path.resolve(__dirname, '..');
const COLORS = {
reset: '\x1b[0m',
red: '\x1b[31m',
green: '\x1b[32m',
yellow: '\x1b[33m',
cyan: '\x1b[36m',
bright: '\x1b[1m',
};
function colorize(text, color) {
return `${COLORS[color]}${text}${COLORS.reset}`;
}
function readJSON(filePath) {
try {
return JSON.parse(fs.readFileSync(filePath, 'utf8'));
} catch (error) {
return null;
}
}
console.log(colorize('\n=== CLAUDE CODE PLUGIN VERIFICATION ===\n', 'bright'));
// Expected plugins from installation
const expectedPlugins = [
{
name: 'ai-ml-engineering-pack',
type: 'ai-instruction',
description: 'RAG, LLM integration, vector DB patterns',
skillRelations: ['rag-implementer', 'knowledge-base-manager', 'knowledge-graph-builder']
},
{
name: 'skills-powerkit',
type: 'agent-skill',
description: 'Plugin management automation',
skillRelations: ['all-skills']
},
{
name: 'devops-automation-pack',
type: 'ai-instruction',
description: 'CI/CD, Docker, Kubernetes patterns',
skillRelations: ['deployment-advisor']
},
{
name: 'workflow-orchestrator',
type: 'mcp-server',
description: 'DAG-based workflow automation',
skillRelations: ['orchestration-planner', 'multi-agent-architect']
},
{
name: 'project-health-auditor',
type: 'mcp-server',
description: 'Code health analysis',
skillRelations: ['quality-auditor', 'system-diagnostician']
},
{
name: 'domain-memory-agent',
type: 'mcp-server',
description: 'Semantic search knowledge base',
skillRelations: ['rag-implementer', 'knowledge-base-manager']
},
{
name: 'security-pro-pack',
type: 'ai-instruction',
description: 'OWASP auditing, threat modeling',
skillRelations: ['security-engineer']
},
{
name: 'agent-context-manager',
type: 'agent-skill',
description: 'Auto-detect AGENTS.md files',
skillRelations: ['context-preserver']
},
{
name: 'fullstack-starter-pack',
type: 'ai-instruction',
description: 'React, API scaffolding patterns',
skillRelations: ['frontend-builder', 'api-designer']
},
{
name: 'design-to-code',
type: 'mcp-server',
description: 'Design to React/Vue/Svelte',
skillRelations: ['frontend-builder', 'design-system-architect']
}
];
const results = {
installed: [],
missing: [],
mcpServers: [],
aiInstructions: [],
agentSkills: [],
errors: []
};
console.log(colorize('1. Checking Plugin Installation Status...', 'cyan'));
// Check if plugins are installed by looking for Claude Code plugin directory
// Note: Actual plugin location depends on Claude Code's installation directory
// This is a placeholder - actual verification would require Claude Code API
expectedPlugins.forEach(plugin => {
console.log(` Checking: ${plugin.name}`);
// Since we can't directly verify Claude Code plugins without API access,
// we'll document what should be verified
switch(plugin.type) {
case 'mcp-server':
results.mcpServers.push(plugin);
console.log(colorize(` → ${plugin.name}: MCP Server (should be running as Node.js process)`, 'yellow'));
break;
case 'ai-instruction':
results.aiInstructions.push(plugin);
console.log(colorize(` → ${plugin.name}: AI Instruction Template (loaded on demand)`, 'green'));
break;
case 'agent-skill':
results.agentSkills.push(plugin);
console.log(colorize(` → ${plugin.name}: Agent Skill (auto-activates)`, 'green'));
break;
}
});
console.log(colorize('\n2. Plugin Type Distribution...', 'cyan'));
console.log(` MCP Servers: ${results.mcpServers.length}`);
console.log(` AI Instructions: ${results.aiInstructions.length}`);
console.log(` Agent Skills: ${results.agentSkills.length}`);
console.log(` Total: ${expectedPlugins.length}`);
console.log(colorize('\n3. Checking Skill Relationships...', 'cyan'));
const skillRegistry = readJSON(path.join(ROOT, 'meta/skill-registry.json'));
if (skillRegistry) {
const registeredSkills = skillRegistry.skills.map(s => s.name);
expectedPlugins.forEach(plugin => {
console.log(`\n ${plugin.name}:`);
console.log(` → Enhances: ${plugin.skillRelations.join(', ')}`);
plugin.skillRelations.forEach(skillName => {
if (skillName === 'all-skills') {
console.log(colorize(` ✓ Applies to all ${registeredSkills.length} skills`, 'green'));
} else if (registeredSkills.includes(skillName)) {
console.log(colorize(` ✓ ${skillName} exists`, 'green'));
} else {
console.log(colorize(` ✗ ${skillName} not found in registry`, 'red'));
results.errors.push(`Missing skill: ${skillName} (required by ${plugin.name})`);
}
});
});
}
console.log(colorize('\n4. Integration Recommendations...', 'cyan'));
console.log(`
Next Steps:
1. Verify MCP Servers Are Running:
- workflow-orchestrator
- project-health-auditor
- domain-memory-agent
- design-to-code
Check with: ps aux | grep "mcp"
2. Test AI Instruction Templates:
- Try prompts that should trigger the plugins
- Example: "Help me design a RAG system" (should use ai-ml-engineering-pack)
3. Verify Agent Skills Auto-Activation:
- skills-powerkit should auto-activate for plugin management
- agent-context-manager should detect AGENTS.md files
4. Update Plugin Registry:
- Run: node scripts/update-plugin-registry.cjs
- This will add plugins to meta/plugin-registry.json
5. Update Relationship Mappings:
- Run: node scripts/update-relationships.cjs
- This will link plugins to existing skills
6. Re-run System Validation:
- Run: node scripts/validate-complete-system.cjs
- Verify no new issues introduced
`);
console.log(colorize('\n=== VERIFICATION SUMMARY ===\n', 'bright'));
if (results.errors.length === 0) {
console.log(colorize('✓ All expected plugins documented', 'green'));
console.log(colorize(`✓ ${results.mcpServers.length} MCP Servers to verify`, 'green'));
console.log(colorize(`✓ ${results.aiInstructions.length} AI Instruction Templates ready`, 'green'));
console.log(colorize(`✓ ${results.agentSkills.length} Agent Skills to test`, 'green'));
console.log('');
console.log(colorize('Run the integration scripts listed above to complete setup.', 'cyan'));
process.exit(0);
} else {
console.log(colorize(`✗ ${results.errors.length} issues found:`, 'red'));
results.errors.forEach(err => console.log(colorize(` - ${err}`, 'red')));
console.log('');
process.exit(1);
}