{"record":{"id":"762b324b388da14a","repo":"garrytan/gstack","slug":"usage-b-skill-show-name","errorCode":null,"errorMessage":"Usage: $B skill show <name>","messagePattern":"Usage: \\$B skill show <name>","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"browse/src/browser-skill-commands.ts","lineNumber":112,"sourceCode":"  for (const s of skills) {\n    const desc = (s.frontmatter.description ?? '').slice(0, 40);\n    lines.push(\n      [\n        s.name.padEnd(30),\n        s.tier.padEnd(8),\n        s.frontmatter.host.padEnd(28),\n        desc,\n      ].join(' '),\n    );\n  }\n  return lines.join('\\n') + '\\n';\n}\n\n// ─── show ───────────────────────────────────────────────────────\n\nfunction handleShow(args: string[], ctx: SkillCommandContext): string {\n  const name = args[0];\n  if (!name) throw new Error('Usage: $B skill show <name>');\n  const tiers = ctx.tiers ?? defaultTierPaths();\n  const skill = readBrowserSkill(name, tiers);\n  if (!skill) throw new Error(`Skill \"${name}\" not found in any tier.`);\n  return readFile(path.join(skill.dir, 'SKILL.md'));\n}\n\nfunction readFile(p: string): string {\n  return fs.readFileSync(p, 'utf-8');\n}\n\n// ─── run ────────────────────────────────────────────────────────\n\ninterface ParsedRunArgs {\n  passthrough: string[];\n  timeoutSeconds: number;\n}\n\nexport function parseSkillRunArgs(args: string[]): ParsedRunArgs {","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/garrytan/gstack/blob/94993f74012782fd94416dd44b8314f6363a13a4/browse/src/browser-skill-commands.ts#L94-L130","documentation":"Thrown by handleShow when args[0] is falsy — the caller invoked `$B skill show` with no skill name. It is a usage guard so the daemon returns a clean usage string instead of attempting a lookup on an undefined name (which readBrowserSkill would otherwise turn into a misleading 'not found').","triggerScenarios":"handleSkillCommand(['show'], ctx) or handleSkillCommand(['show',''], ctx) — the subcommand resolves to 'show' but args.slice(1) has no non-empty first element. Equivalent to running `$B skill show` from the CLI with nothing after the subcommand.","commonSituations":"Agent or human types the command incompletely; a calling script trims args and passes an empty array; shell quoting eats the argument; programmatic caller forgets to append the name.","solutions":["Re-run with a name: `$B skill show <name>`.","List available skills first with `$B skill list` to copy a valid name.","If calling handleSkillCommand programmatically, ensure args contains the subcommand AND its operand: ['show', 'hn-frontpage']."],"exampleFix":"// before\n$B skill show\n// after\n$B skill show hn-frontpage","handlingStrategy":"validation","validationCode":"function requireSkillNameArg(args: string[], sub: string): string {\n  const name = args[0];\n  if (!name) throw new Error(`Usage: $B skill ${sub} <name>`);\n  return name;\n}\n// before calling handleShow:\nconst name = requireSkillNameArg(rest, 'show');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass args as [subcommand, ...operands] with the operand present.","When calling handleSkillCommand programmatically, build the args array with a literal name slot.","Use `$B skill list` to discover valid names before show/run/test."],"tags":["cli-usage","skill-management","gstack"],"backgroundTag":null,"analyzedSha":"94993f74012782fd94416dd44b8314f6363a13a4","analyzedAt":"2026-08-12T04:06:23.140Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}