// Skill Registry — maps logical skill names to skill data files

export interface SkillMapping {
  name: string;
  files: string[];       // filenames in skills/data/
  description: string;
}

export const SKILL_REGISTRY: Record<string, SkillMapping> = {
  analyzer: {
    name: 'analyzer',
    files: ['mcp-api-analyzer.md'],
    description: 'API spec analysis — extract endpoints, auth, rate limits, and generate tool definitions',
  },
  builder: {
    name: 'builder',
    files: ['mcp-server-builder.md', 'mcp-server-development.md'],
    description: 'MCP server code generation from analyzed tool definitions',
  },
  designer: {
    name: 'designer',
    files: ['mcp-app-designer.md', 'mcp-apps-official.md', 'mcp-apps-merged.md'],
    description: 'MCP app UI design — dashboard, data-grid, form, and other patterns',
  },
  tester: {
    name: 'tester',
    files: ['mcp-qa-tester.md'],
    description: 'Multi-layer QA — protocol, static, visual, functional, performance, security',
  },
  deployer: {
    name: 'deployer',
    files: ['mcp-deployment.md'],
    description: 'Deployment orchestration — MCPEngine, npm, Docker, Cloudflare',
  },
  'apps-integration': {
    name: 'apps-integration',
    files: ['mcp-apps-integration.md'],
    description: 'App-to-tool binding and integration wiring',
  },
};

export type SkillName = keyof typeof SKILL_REGISTRY;

export function getSkillFiles(name: SkillName): string[] {
  const mapping = SKILL_REGISTRY[name];
  if (!mapping) throw new Error(`Unknown skill: ${name}`);
  return mapping.files;
}
