create-gsd-extension

Installation
SKILL.md

<essential_principles>

Extensions are TypeScript modules that hook into GSD's runtime (built on pi). They export a default function receiving ExtensionAPI and use it to subscribe to events, register tools/commands/shortcuts, and interact with the session.

GSD extension paths:

  • Global extensions: ~/.gsd/agent/extensions/*.ts or ~/.gsd/agent/extensions/*/index.ts
  • Project-local extensions: .gsd/extensions/*.ts or .gsd/extensions/*/index.ts

The three primitives:

  1. Events — Listen and react (pi.on("event", handler)). Can block tool calls, modify messages, inject context.
  2. Tools — Give the LLM new abilities (pi.registerTool()). LLM calls them autonomously.
  3. Commands — Give users slash commands (pi.registerCommand()). Users type /mycommand.

Non-negotiable rules:

  • Use StringEnum from @mariozechner/pi-ai for string enum params (NOT Type.Union/Type.Literal — breaks Google's API)
  • Truncate tool output to 50KB / 2000 lines max (use truncateHead/truncateTail from @mariozechner/pi-coding-agent)
  • Store stateful tool state in details for branching support
  • Check signal?.aborted in long-running tool executions
  • Use pi.exec() not child_process for shell commands
Related skills
Installs
4
Repository
gsd-build/gsd-2
GitHub Stars
7.4K
First Seen
Mar 22, 2026