← Catalog

@jocax/pi-pi

Meta-agent that builds Pi extensions using parallel domain experts for research

Extension

Install

Install with PiG

pig install npm:@jocax/pi-pi

Install with Pi

pi install npm:@jocax/pi-pi
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "skills": [
    "./skills"
  ],
  "extensions": [
    "./dist/index.js"
  ]
}

README

Written by the package's publisher, shown as published in version 0.2.1 (README.md). PiG does not review it.

@jocax/pi-pi

Meta-agent that builds Pi extensions using parallel domain experts for research — think "Pi building Pi."

What

Pi-Pi turns your pi agent into an orchestrator with a team of 8 domain experts who research in parallel:

  • ext-expert — Extensions SDK: tools, events, commands, rendering, state
  • theme-expert — Themes: 51 color tokens, JSON format, vars, hot reload
  • skill-expert — Skills: SKILL.md standard, multi-file packages, frontmatter
  • config-expert — Settings: providers, models, keybindings, packages
  • tui-expert — TUI: components, widgets, footers, overlays, keyboard input
  • prompt-expert — Prompt templates: argument expansion, commands
  • agent-expert — Agent definitions: personas, teams.yaml, orchestration
  • keybinding-expert — Keyboard shortcuts: registerShortcut(), Key IDs, macOS

Each expert runs as an isolated pi subprocess with read-only tools. The primary agent calls query_experts once with all relevant questions, and all experts research in parallel. Results are aggregated and the primary agent writes the actual code.

Why

Building Pi extensions requires knowledge across multiple domains — extensions API, theme format, skill conventions, configuration, TUI components, etc. Pi-Pi puts a team of specialists at your disposal so you don't need to context-switch between docs. Ask them all at once, get results in parallel, and build faster.

Install

Install the package from npm:

{
  "source": "npm:@jocax/pi-pi"
}

Usage

On startup, Pi-Pi copies its shipped expert definitions to .pi/agents/pi-pi/, loads them, and displays a colored dashboard widget. The system prompt is updated to give the primary agent orchestrator instructions.

Ask Pi-Pi to Build Something

Just describe what you want:

Build me an extension that adds a /todo command with persistent storage

The primary agent will:

  1. Identify which domains are relevant
  2. Call query_experts with parallel queries to all relevant experts
  3. Synthesize the research findings
  4. Write the actual extension files

Commands

CommandDescription
/expertsList all experts with status and query counts
/experts-grid <1-5>Set dashboard widget column count (default: 3)

Expert Dashboard

The expert grid widget shows live status cards for all 8 experts:

  • ○ idle — Expert is ready and waiting
  • ◉ researching — Expert is currently running a query, with elapsed time
  • ✓ done — Expert completed successfully, with elapsed time
  • ✗ error — Expert encountered an error

Each expert has a unique color for easy visual identification.

The custom footer shows:

  • Current model
  • "Pi Pi" branding
  • Active researching count or completed count
  • Context usage bar

Configuration

Expert Locations

DirectoryPurpose
skills/pi-pi-experts/Shipped expert definitions (package source)
.pi/agents/pi-pi/Runtime expert definitions (auto-copied on startup)

Environment Variables

VariablePurpose
AE_PI_PI_PI_FORCE_COPY=trueForce overwrite existing expert files on session start

By default, shipped experts are copied to .pi/agents/pi-pi/ only if they don't already exist. Set AE_PI_PI_PI_FORCE_COPY=true to always overwrite.

Examples

Run the standalone demo (no install required):

pi -e software/packages/pi-pi/examples/basic.ts -p "Build me a simple /hello command extension"

Run the demo

just demo pi-pi

A herdr workspace opens with pi, this extension and a disposable copy of the ext-scaffold sandbox — an empty pi extension for the agent to build out.

StepDo thisWatch
1Let the agent's first task runit calls query_experts with Ext Expert and Tui Expert in parallel; the expert grid shows ✓ Ext Expert 15s · ✓ Tui Expert 15s as each finishes
2Type /expertsevery expert is listed with its status and query count
3Type /experts-grid 2 through /experts-grid 5the dashboard widget's column count changes
4Send the scenario's follow-up promptthe agent asks keybinding-expert before adding the shortcut

Each expert is its own pi process started with --no-extensions; it resolves the demo's model from the models.json the kit writes into the session's pi agent directory, not from the kit's provider extension.

Needs herdr 0.9.3 or newer and one reachable model provider — see demo-kit.

Development

# Type-check
npx tsc --noEmit --skipLibCheck -p software/packages/pi-pi/tsconfig.json

# Run tests
npx vitest run software/packages/pi-pi/tests/

Expert Agent Definitions

Pi-Pi ships with 8 expert definitions. Each expert:

  • Has a YAML frontmatter with name, description, and tools fields
  • Has a system prompt covering their domain expertise
  • Runs with restricted read-only tools: read, grep, find, ls, bash
  • Is spawned as an isolated pi subprocess (--no-session --no-extensions)

You can customize experts by editing the .md files in .pi/agents/pi-pi/ — they won't be overwritten unless you set AE_PI_PI_PI_FORCE_COPY=true.