extension-dev-guide

Category: Development & Coding | Uploader: JitsusamaJitsusama | Downloads: 0 | Version: v1.0(Latest)

How to develop Pi extensions. Discovery workflow for TUI components, available APIs, composition patterns and common mistakes. Use when building or modifying extensions. --- # Pi Extension Development ## Discovery Workflow Before building any UI, follow this sequence: 1. **Read Pi's TUI docs** for patterns and available components. The main Pi documentation is listed in the system prompt under "Pi documentation" — read `docs/tui.md` from there. Follow links to related docs as needed. 2. **Read the type declarations** for the specific component you need. The `@mariozechner/pi-tui` package's `dist/index.d.ts` and `dist/components/*.d.ts` files show the exact API surface. 3. **Read the higher-level components** exported by `@mariozechner/pi-coding-agent` in its `dist/modes/interactive/components/index.d.ts`. 4. **Check this project's `lib/ui/`** for existing abstractions built on top of Pi's primitives. The barrel at `lib/ui/index.ts` shows the public surface. Don't duplicate what's already there. 5. **Browse Pi's examples** for working implementations. The examples directory is listed in the system prompt. ## Architecture: Extensions vs Library Extensions and library code serve different roles. See AGENTS.md's "Integration Architecture" section for the full pattern. The short version: - **`lib/`** holds domain logic: API clients, authentication, renderers, types and UI components. This is reusable code that other Pi packages can import. - **`extensions/`** holds Pi-specific wiring: tool registration, `renderCall`/`renderResult`, slash commands, confirmation gates, session state and lifecycle. When building an integration, the extension should be a thin consumer of its library. Caching belongs in the extension; the library stays stateless. When building a guardian or workflow, shared logic goes in `lib/internal/`. See AGENTS.md for the full guidelines on public vs internal code. ## What's Available (Orientation Only; Verify Against Source) **From `@mariozechner/pi-tui`

Changelog: Source: GitHub https://github.com/Jitsusama/agentic-harness.pi

Directory Structure

Current level: tree/main/.pi/skills/extension-dev-guide/

  • 📄 README.md 651 B
  • 📄 SKILL.md 7.2 KB

SKILL.md

Login to download/like/favorite ❤ 5 | ★ 0
Comments 0

Please login before commenting.

Loading comments...