pi-extension-authoring
Pi extension authoring
Ground every answer in pi-mono/ files below.
Grounding
pi-mono/packages/coding-agent/docs/extensions.md— capabilities, lifecycle, patterns.pi-mono/packages/coding-agent/examples/extensions/README.md— runnable examples index.pi-mono/packages/coding-agent/src/core/resource-loader.ts—extendResources()appends paths viamergePathsafter existinglastSkillPaths(late paths lose name collisions to earlier ones unless names differ).pi-mono/packages/coding-agent/src/core/agent-session.ts— extension commands vs queued prompts; skill expansion hooks.pi-mono/packages/coding-agent/docs/tui.md— extension TUI component integration with@mariozechner/pi-tui:Componentrendering contract, overlay patterns, input handling in extension context.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
More from romiluz13/pi-agent-skills
pi-customization
Pi coding agent customization — Themes, Keybindings, Prompt Templates, System Prompt overrides, and Settings. Use when configuring or modifying the visual appearance, UI colors, keyboard shortcuts, prompt templates, or the default system prompt behavior of the pi terminal agent. Use for "custom theme pi", "change keybindings", "modify system prompt", "SYSTEM.md", "APPEND_SYSTEM.md", "settings.json", "keybindings.json", "prompt template", even if pi-cli-workspace is already active.
26pi-package-authoring
Pi packages — npm/git distribution of extensions, skills, prompts, themes via keywords pi-package and package.json pi manifest; pi install paths and security expectations. Use when shipping or consuming pi-package, adding pi.skills entries, or explaining install vs project-local -l. Use for "publish pi skills on npm", "pi install", "pi-package.json", even without naming this skill.
25pi-cli-workspace
Pi terminal agent workspace — install, /commands, sessions, compaction, settings.json, AGENTS.md, skill discovery, precedence, session JSONL, /tree, providers/auth, models.json, credential resolution, platform setup, editor (@file, Tab, images, !bash), message queue (steering, follow-up), built-in tools (read/bash/edit/write/grep/find/ls, --tools, --no-tools), print mode (-p, piped stdin), SYSTEM.md/APPEND_SYSTEM.md, CLI flags (-c, -r, --session, --fork, --no-session), @files args, resource flags (--no-extensions, --no-skills), model shorthand (provider/id, name:thinking), all slash commands, env vars, philosophy (no MCP/sub-agents/plan-mode by design). Use for pi config, skills, sessions, compaction, providers, models, tmux, Termux, Windows, tools, modes, system prompt, message queue, or "does pi support X".
24pi-rpc-sdk
Pi headless RPC JSONL over stdin/stdout, strict LF framing, --mode json event streaming, and Node SDK alternatives (AgentSession). Use when integrating pi --mode rpc, pi --mode json, writing a client that speaks the protocol, reading JSON event streams, or choosing RPC vs in-process SDK. Use for "pi rpc client", "JSONL framing", "readline rpc", "--mode json", "json events", "embed pi without subprocess", "createAgentSession", "AgentSessionRuntime", "ModelRegistry", "embed pi", "SDK factory", even if the user only pasted JSON lines.
24