{"record":{"id":"f2a4adbbe8fe3d88","repo":"stablyai/orca","slug":"verify-skills-cli-runtime-skills-get-topic-re","errorCode":null,"errorMessage":"[verify-skills-cli-runtime] skills get ${topic} returned the wrong guide","messagePattern":"\\[verify-skills-cli-runtime\\] skills get (.+?) returned the wrong guide","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"config/scripts/verify-skills-cli-runtime.cjs","lineNumber":188,"sourceCode":"    throw new Error(`[verify-skills-cli-runtime] ${label} emitted invalid JSON:\\n${output}`)\n  }\n}\n\nfunction verifySkillsCliRuntime(outDir, artifactRoot = dirname(outDir), options = {}) {\n  const absoluteOutDir = resolve(outDir)\n  const closure = collectRuntimeClosure(absoluteOutDir, resolve(artifactRoot))\n  if (options.executeCommands === false) {\n    return { closureFiles: closure.length, commands: 0 }\n  }\n  const list = parseJson('skills list', runCli(absoluteOutDir, ['skills', 'list', '--json']))\n  const topicNames = new Set(list.topics?.map((topic) => topic.name))\n  for (const topic of ['orca-cli', 'computer-use']) {\n    if (!topicNames.has(topic)) {\n      throw new Error(`[verify-skills-cli-runtime] skills list omitted ${topic}`)\n    }\n    const guide = runCli(absoluteOutDir, ['skills', 'get', topic])\n    if (!guide.includes(`name: ${topic}`)) {\n      throw new Error(`[verify-skills-cli-runtime] skills get ${topic} returned the wrong guide`)\n    }\n  }\n\n  const install = parseJson(\n    'skills install --dry-run',\n    runCli(absoluteOutDir, [\n      'skills',\n      'install',\n      '--skill',\n      'orca-cli',\n      '--agent',\n      'codex',\n      '--dry-run',\n      '--json'\n    ])\n  )\n  const update = parseJson(\n    'skills update --dry-run',","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/verify-skills-cli-runtime.cjs#L170-L206","documentation":"Thrown by verifySkillsCliRuntime() when skills get <topic> returns a guide whose body does not contain the string 'name: <topic>'. The script runs skills get <topic> (no --json) and checks guide.includes(`name: ${topic}`). This validates that the guide output is for the correct topic and not a stub, empty string, or wrong-topic response.","triggerScenarios":"runCli(outDir, ['skills', 'get', topic]) returns a guide string that does not contain the literal 'name: orca-cli' or 'name: computer-use'. Caused by: the guide format changing (e.g. 'name: ' prefix removed), the guide being empty, the wrong topic's guide being returned, or frontmatter using a different key.","commonSituations":"A guide template change that reformats the name line (e.g. '## orca-cli' instead of 'name: orca-cli'); a bug where skills get ignores its argument and always returns a default guide; the guide file missing its name field in frontmatter after an edit.","solutions":["Run skills get orca-cli and verify the output contains a line matching 'name: orca-cli' (exact format).","If the guide format was intentionally changed, update the includes() check to match the new format.","If the wrong guide is returned, debug the skills get argument parsing — confirm the topic name reaches the guide loader.","If the guide is empty, check that the topic's guide file exists and is readable in the build output."],"exampleFix":"// before: guide format changed to markdown heading\n// guide = '## orca-cli\\n...'\nif (!guide.includes(`name: ${topic}`)) { throw ... }\n\n// after: check the new heading format\nif (!guide.includes(`## ${topic}`) && !guide.includes(`name: ${topic}`)) { throw ... }","handlingStrategy":"validation","validationCode":"function validateGuide(guide, topic) {\n  const markers = [`name: ${topic}`, `## ${topic}`, `# ${topic}`]\n  if (!markers.some((m) => guide.includes(m))) {\n    throw new Error(`Guide for ${topic} does not contain any expected name marker`)\n  }\n}","typeGuard":"function isNonEmptyGuide(value) {\n  return typeof value === 'string' && value.trim().length > 0\n}","tryCatchPattern":"try {\n  const guide = runCli(outDir, ['skills', 'get', topic])\n  if (!isNonEmptyGuide(guide)) {\n    throw new Error(`skills get ${topic} returned empty guide`)\n  }\n  validateGuide(guide, topic)\n} catch (err) {\n  console.error(`Guide validation failed for ${topic}:`, err.message)\n  throw err\n}","preventionTips":["When changing the guide format, update the includes() marker check in the same commit.","Add a snapshot test for the skills get output format.","Ensure the guide loader validates the topic argument before returning content."],"tags":["ci","skills-cli","guide-format","verification"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}