mcpField
P
pi-extension-authoring

pi-extension-authoring

github.com/romiluz13Development20110 installsUpdated 28w ago
Repository

About pi-extension-authoring

A guidance skill for authoring extensions for Pi's coding agent, grounded in the pi-mono documentation and source. It covers extension capabilities, resource ordering, TUI integration, and custom providers.

Key features

  1. 01Extension tools, commands, themes, and prompts
  2. 02Skill-path extension and ordering
  3. 03TUI component integration guidance
  4. 04Custom provider registration patterns
  5. 05Documentation- and example-based workflows

Use cases

  1. 01Planning a new Pi extension
  2. 02Explaining skill resource precedence
  3. 03Adding extension UI or a custom provider

MCP support

The skill cautions against assuming MCP support in Pi core; MCP may be added optionally through an extension.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/romiluz13/pi-agent-skills --skill pi-extension-authoring

After installing, type/pi-extension-authoringin Claude Code to confirm it loaded.

Bundled filesreferences/CORPUS.md

Details

From the project README

Pi extension authoring

Ground every answer in pi-mono/ files below.

Grounding

  1. pi-mono/packages/coding-agent/docs/extensions.md — capabilities, lifecycle, patterns.
  2. pi-mono/packages/coding-agent/examples/extensions/README.md — runnable examples index.
  3. pi-mono/packages/coding-agent/src/core/resource-loader.ts — extendResources() appends paths via mergePaths after existing lastSkillPaths (late paths lose name collisions to earlier ones unless names differ).
  4. pi-mono/packages/coding-agent/src/core/agent-session.ts — extension commands vs queued prompts; skill expansion hooks.
  5. pi-mono/packages/coding-agent/docs/tui.md — extension TUI component integration with @mariozechner/pi-tui: Component rendering contract, overlay patterns, input handling in extension context.
  6. pi-mono/packages/coding-agent/docs/custom-provider.md — registerProvider() for proxies, OAuth/SSO, custom APIs, and custom model definitions.

Invariants

  • Extensions can register tools, commands, themes, prompts, and extra skill paths; exact API surface is defined in docs and example modules — start from docs/extensions.md, not memory.
  • Dynamic resource discovery patterns live under pi-mono/packages/coding-agent/examples/extensions/ (e.g. dynamic-resources/ listing in examples README).

Workflows

  • New extension: Read docs/extensions.md, clone the closest examples/extensions/ template, then align with project AGENTS.md if working inside pi-mono.
  • Skills from extensions: Trace extendResources + mergePaths in resource-loader.ts to explain ordering with user/project/package skills.
  • Extension TUI: Read docs/tui.md for the Component rendering contract in extension context; combine with pi-tui skill for library-level APIs.
  • Custom providers via extension: See pi-mono/packages/coding-agent/docs/custom-provider.md for registerProvider() OAuth flows and proxy patterns (grounded in pi-cli-workspace).

Anti-patterns

  • Do not assert MCP support in core; optional via extension (see coding-agent README philosophy).

Comments

Markdown supported