{"record":{"id":"de0ef3252b53a4e8","repo":"paperclipai/paperclip","slug":"skill-reference-is-required","errorCode":null,"errorMessage":"Skill reference is required.","messagePattern":"Skill reference is required\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/src/commands/client/skills.ts","lineNumber":611,"sourceCode":"async function getCatalogSkill(ctx: ResolvedClientContext, catalogRef: string): Promise<CatalogSkill> {\n  const ref = catalogRef.trim();\n  if (!ref) {\n    throw new Error(\"Catalog skill reference is required.\");\n  }\n  const detail = await ctx.api.get<CatalogSkill>(`/api/skills/catalog/ref?ref=${encodeURIComponent(ref)}`);\n  if (!detail) {\n    throw new Error(`Catalog skill not found: ${catalogRef}`);\n  }\n  return detail;\n}\n\nexport function resolveCompanySkillReference(\n  skills: CompanySkillReferenceTarget[],\n  reference: string,\n): CompanySkillReferenceTarget {\n  const trimmed = reference.trim();\n  if (!trimmed) {\n    throw new Error(\"Skill reference is required.\");\n  }\n\n  const byId = skills.find((skill) => skill.id === trimmed);\n  if (byId) return byId;\n\n  const byKey = skills.find((skill) => skill.key === trimmed);\n  if (byKey) return byKey;\n\n  const normalizedSlug = normalizeSkillSlug(trimmed);\n  const bySlug = skills.filter((skill) => skill.slug === normalizedSlug);\n  if (bySlug.length === 1 && bySlug[0]) return bySlug[0];\n  if (bySlug.length > 1) {\n    throw new Error(`Ambiguous skill slug \"${trimmed}\". Use a skill ID or key instead.`);\n  }\n\n  throw new Error(`Skill not found: ${reference}`);\n}\n","sourceCodeStart":593,"sourceCodeEnd":629,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/cli/src/commands/client/skills.ts#L593-L629","documentation":"resolveCompanySkillReference trimmed the reference to an empty string, so company skill resolution has no id, key, or slug to match.","triggerScenarios":"Thrown at cli/src/commands/client/skills.ts:611 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a skill reference (ID, key, or slug)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}