garrytan/gstack · error · Error

Cannot edit: no skill for ${host}. Cause: skill does not exi

Error message

Cannot edit: no skill for ${host}.
Cause: skill does not exist in this project or global scope.
Action: $B domain-skill save to create one first.

What it means

Error "Cannot edit: no skill for ${host}. Cause: skill does not exist in this project or global scope. Action: $B domain-skill save to create one first." thrown in garrytan/gstack.

Source

Thrown at browse/src/domain-skill-commands.ts:184

  return [
    `# ${result.row.host} (${result.source} scope, ${result.row.state})`,
    `# version: ${result.row.version}, used: ${result.row.use_count}×, flags: ${result.row.flag_count}`,
    '',
    result.row.body,
  ].join('\n');
}

async function handleEdit(args: string[]): Promise<string> {
  const host = args[0];
  if (!host) {
    throw new Error('Usage: $B domain-skill edit <host>');
  }
  const slug = getCurrentProjectSlug();
  // Read current body to seed the editor
  const list = await listSkills(slug);
  const current = [...list.project, ...list.global].find((r) => r.host === host);
  if (!current) {
    throw new Error(
      `Cannot edit: no skill for ${host}.\n` +
        'Cause: skill does not exist in this project or global scope.\n' +
        'Action: $B domain-skill save to create one first.'
    );
  }
  const editor = process.env.EDITOR || 'vi';
  const tmpFile = path.join(os.tmpdir(), `gstack-domain-skill-${process.pid}-${Date.now()}.md`);
  await fs.writeFile(tmpFile, current.body, 'utf8');
  const result = spawnSync(editor, [tmpFile], { stdio: 'inherit' });
  if (result.status !== 0) {
    await fs.unlink(tmpFile).catch(() => {});
    throw new Error(`Editor exited with status ${result.status}; no changes saved.`);
  }
  const newBody = await fs.readFile(tmpFile, 'utf8');
  await fs.unlink(tmpFile).catch(() => {});
  if (newBody === current.body) {
    return `No changes for ${host}.`;
  }

View on GitHub (pinned to 94993f7401)

When it happens

Trigger: Thrown at browse/src/domain-skill-commands.ts:184 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of garrytan/gstack@94993f7401 (2026-08-12). Data as JSON: /api/errors/3fc2cf68a577976a. Report an issue: GitHub.