---|---------|
| @mariozechner/pi-coding-agent | ExtensionAPI, ExtensionContext, Theme, event types, tool utilities, DynamicBorder, BorderedLoader, CustomEditor, highlightCode |
| @sinclair/typebox | Type.Object, Type.String, Type.Number, Type.Optional, Type.Boolean, Type.Array |
| @mariozechner/pi-ai | StringEnum (required for string enums), Type re-export |
| @mariozechner/pi-tui | Text, Box, Container, Spacer, Markdown, SelectList, Input, matchesKey, Key, truncateToWidth, visibleWidth |
| Node.js built-ins | node:fs, node:path, node:child_process, etc. |
Building a new extension:
- "Create an extension", "build a tool", "I want to add a command" →
workflows/create-extension.md
Adding capabilities to an existing extension:
- "Add a tool to my extension", "add event hook", "add custom rendering" →
workflows/add-capability.md
Debugging an extension:
- "My extension doesn't work", "tool not showing up", "event not firing" →
workflows/debug-extension.md
If user intent is clear from context, skip the question and go directly to the workflow.
Core architecture: extension-lifecycle.md, events-reference.md
API surface: extensionapi-reference.md, extensioncontext-reference.md
Capabilities: custom-tools.md, custom-commands.md, custom-ui.md, custom-rendering.md
Patterns: state-management.md, system-prompt-modification.md, compaction-session-control.md
Infrastructure: model-provider-management.md, remote-execution-overrides.md, packaging-distribution.md, mode-behavior.md
Gotchas: key-rules-gotchas.md
1---2name: create-gsd-extension3description: Create, debug, and iterate on GSD extensions (TypeScript modules that add tools, commands, event hooks, custom UI, and providers to GSD). Use when asked to build an extension, add a tool the LLM can call, register a slash command, hook into GSD events, create custom TUI components, or modify GSD behavior. Triggers on "create extension", "build extension", "add a tool", "register command", "hook into gsd", "custom tool", "gsd plugin", "gsd extension".4---5---|---------|6| `@mariozechner/pi-coding-agent` | `ExtensionAPI`, `ExtensionContext`, `Theme`, event types, tool utilities, `DynamicBorder`, `BorderedLoader`, `CustomEditor`, `highlightCode` |7| `@sinclair/typebox` | `Type.Object`, `Type.String`, `Type.Number`, `Type.Optional`, `Type.Boolean`, `Type.Array` |8| `@mariozechner/pi-ai` | `StringEnum` (required for string enums), `Type` re-export |9| `@mariozechner/pi-tui` | `Text`, `Box`, `Container`, `Spacer`, `Markdown`, `SelectList`, `Input`, `matchesKey`, `Key`, `truncateToWidth`, `visibleWidth` |10| Node.js built-ins | `node:fs`, `node:path`, `node:child_process`, etc. |1112</essential_principles>1314<routing>15Based on user intent, route to the appropriate workflow:1617**Building a new extension:**18- "Create an extension", "build a tool", "I want to add a command" → `workflows/create-extension.md`1920**Adding capabilities to an existing extension:**21- "Add a tool to my extension", "add event hook", "add custom rendering" → `workflows/add-capability.md`2223**Debugging an extension:**24- "My extension doesn't work", "tool not showing up", "event not firing" → `workflows/debug-extension.md`2526**If user intent is clear from context, skip the question and go directly to the workflow.**27</routing>2829<reference_index>30All domain knowledge in `references/`:3132**Core architecture:** extension-lifecycle.md, events-reference.md33**API surface:** extensionapi-reference.md, extensioncontext-reference.md34**Capabilities:** custom-tools.md, custom-commands.md, custom-ui.md, custom-rendering.md35**Patterns:** state-management.md, system-prompt-modification.md, compaction-session-control.md36**Infrastructure:** model-provider-management.md, remote-execution-overrides.md, packaging-distribution.md, mode-behavior.md37**Gotchas:** key-rules-gotchas.md38</reference_index>3940<workflows_index>41| Workflow | Purpose |42|----------|---------|43| create-extension.md | Build a new extension from scratch |44| add-capability.md | Add tools, commands, hooks, UI to an existing extension |45| debug-extension.md | Diagnose and fix extension issues |46</workflows_index>4748<success_criteria>49Extension is complete when:50- TypeScript compiles without errors (jiti handles this at runtime)51- Extension loads on GSD startup or `/reload` without errors52- Tools appear in the LLM's system prompt and are callable53- Commands respond to `/command` input54- Event hooks fire at the expected lifecycle points55- Custom UI renders correctly within terminal width56- State persists correctly across session restarts (if stateful)57- Output is truncated to safe limits (if tools produce variable output)58</success_criteria>