{"record":{"id":"a0ab6f3b5916b6d4","repo":"garrytan/gstack","slug":"usage-b-domain-skill-edit-host","errorCode":null,"errorMessage":"Usage: $B domain-skill edit <host>","messagePattern":"Usage: \\$B domain-skill edit <host>","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"browse/src/domain-skill-commands.ts","lineNumber":177,"sourceCode":"    );\n  }\n  const slug = getCurrentProjectSlug();\n  const result = await readSkill(host, slug);\n  if (!result) {\n    return `No active skill for ${host}.\\n\\nA quarantined skill may exist; run $B domain-skill list to see all states.`;\n  }\n  return [\n    `# ${result.row.host} (${result.source} scope, ${result.row.state})`,\n    `# version: ${result.row.version}, used: ${result.row.use_count}×, flags: ${result.row.flag_count}`,\n    '',\n    result.row.body,\n  ].join('\\n');\n}\n\nasync function handleEdit(args: string[]): Promise<string> {\n  const host = args[0];\n  if (!host) {\n    throw new Error('Usage: $B domain-skill edit <host>');\n  }\n  const slug = getCurrentProjectSlug();\n  // Read current body to seed the editor\n  const list = await listSkills(slug);\n  const current = [...list.project, ...list.global].find((r) => r.host === host);\n  if (!current) {\n    throw new Error(\n      `Cannot edit: no skill for ${host}.\\n` +\n        'Cause: skill does not exist in this project or global scope.\\n' +\n        'Action: $B domain-skill save to create one first.'\n    );\n  }\n  const editor = process.env.EDITOR || 'vi';\n  const tmpFile = path.join(os.tmpdir(), `gstack-domain-skill-${process.pid}-${Date.now()}.md`);\n  await fs.writeFile(tmpFile, current.body, 'utf8');\n  const result = spawnSync(editor, [tmpFile], { stdio: 'inherit' });\n  if (result.status !== 0) {\n    await fs.unlink(tmpFile).catch(() => {});","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/garrytan/gstack/blob/94993f74012782fd94416dd44b8314f6363a13a4/browse/src/domain-skill-commands.ts#L159-L195","documentation":"Error \"Usage: $B domain-skill edit <host>\" thrown in garrytan/gstack.","triggerScenarios":"Thrown at browse/src/domain-skill-commands.ts:177 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"94993f74012782fd94416dd44b8314f6363a13a4","analyzedAt":"2026-08-12T04:06:23.140Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}