{"record":{"id":"3dfcda2ed85eac09","repo":"ruvnet/ruflo","slug":"unknown-built-in-skill-skillname","errorCode":null,"errorMessage":"Unknown built-in skill: ${skillName}","messagePattern":"Unknown built-in skill: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/codex/src/generators/skill-md.ts","lineNumber":182,"sourceCode":"        }\n        const payloadPath = relative.split(path.sep).join('/');\n        payload[payloadPath] = await readFile(absolute, 'utf8');\n      }\n    }\n  }\n\n  await visit(root);\n  return payload;\n}\n\n/**\n * Read one canonical built-in tree from the package payload.\n */\nexport async function generateBuiltInSkill(\n  skillName: string,\n): Promise<{ skillMd: string; scripts: Record<string, string>; references: Record<string, string> }> {\n  if (!BUILT_IN_SKILL_NAMES.includes(skillName as BuiltInSkill)) {\n    throw new Error(`Unknown built-in skill: ${skillName}`);\n  }\n\n  const skillRoot = path.join(BUILT_IN_SKILLS_ROOT, skillName);\n  let skillMd: string;\n  try {\n    skillMd = await readFile(path.join(skillRoot, 'SKILL.md'), 'utf8');\n  } catch (error) {\n    if ((error as NodeJS.ErrnoException).code === 'ENOENT') {\n      throw new Error(`Built-in skill payload missing: ${skillName}/SKILL.md`);\n    }\n    throw error;\n  }\n\n  const result = {\n    skillMd,\n    scripts: await readPayloadTree(path.join(skillRoot, 'scripts')),\n    references: await readPayloadTree(path.join(skillRoot, 'references')),\n  };","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/codex/src/generators/skill-md.ts#L164-L200","documentation":"generateBuiltInSkill(name) reads one of the packaged .agents/skills trees as the canonical definition. Only six names are accepted: swarm-orchestration, memory-management, sparc-methodology, security-audit, performance-analysis, github-automation. Any other string — a typo, different casing, a custom name, or a skill that exists only in another version — fails validation before any file is read.","triggerScenarios":"Calling generateBuiltInSkill('security-audits') (typo), 'Security-Audit' (casing), or any custom skill name; calling it with a name valid in a different @claude-flow/codex version whose BUILT_IN_SKILL_NAMES list differs.","commonSituations":"User- or CLI-supplied skill names passed through unvalidated; upgrading or downgrading the package where the built-in list changed; confusing custom skills (generated with generateSkillMd) with built-in payload skills.","solutions":["Pass one of the six exported names exactly: swarm-orchestration, memory-management, sparc-methodology, security-audit, performance-analysis, github-automation","Import BUILT_IN_SKILL_NAMES from the package and validate or offer them for selection instead of hardcoding name strings","For anything not on the list, render a custom skill with generateSkillMd(options) instead of generateBuiltInSkill"],"exampleFix":"// before\nconst payload = await generateBuiltInSkill('security-audits'); // typo\n\n// after\nconst payload = await generateBuiltInSkill('security-audit');\n// or, for a custom skill:\nconst md = await generateSkillMd({ name: 'security-audits', description: '...' });","handlingStrategy":"type-guard","validationCode":"import { BUILT_IN_SKILL_NAMES } from '@claude-flow/codex';\nconst builtIn = new Set<string>(BUILT_IN_SKILL_NAMES);\nfunction assertBuiltInSkill(name: string): void {\n  if (!builtIn.has(name)) {\n    throw new Error(`unknown built-in skill ${name}; valid: ${[...builtIn].join(', ')}`);\n  }\n}","typeGuard":"import { BUILT_IN_SKILL_NAMES, type BuiltInSkill } from '@claude-flow/codex';\nconst builtIn = new Set<string>(BUILT_IN_SKILL_NAMES);\nfunction isBuiltInSkill(name: string): name is BuiltInSkill {\n  return typeof name === 'string' && builtIn.has(name);\n}","tryCatchPattern":null,"preventionTips":["Never accept free-text skill names from users for built-ins — offer the exported list","Import BUILT_IN_SKILL_NAMES instead of duplicating the name list at call sites","Route custom names to generateSkillMd so the two code paths cannot be confused"],"tags":["skills","generator","invalid-argument","validation"],"backgroundTag":"invalid-enum-value","analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}