← Catalog

@sphinxcorp/pi-egm

Pi extension for the Elephant & Goldfish Model (EGM) — an orchestrator-plus-isolated-reviewers design for critical thinking.

Extension

Install

Install with PiG

pig install npm:@sphinxcorp/pi-egm

Install with Pi

pi install npm:@sphinxcorp/pi-egm
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": [
    "./dist/bundle/skills"
  ],
  "extensions": [
    "./dist/index.js"
  ]
}

README

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

pi-egm

Pi package for the Elephant & Goldfish Model (EGM) — a critical-thinking workflow built around an orchestrator that dispatches isolated reviewer personas and synthesizes their findings.

Elephant holds your project context and drafts the specification. Goldfish reviewers examine the draft without the earlier conversation, exposing unstated assumptions and blind spots. You make the architectural trade-offs and approve before implementation.

Ported from the OpenCode V2 plugin google/elephant-goldfish-model, pinned at commit e4747323aab66157812cd3a71755f6447b2803a2.

Status

v1.0 — complete. All 30 v1 requirements shipped and verified.

ComponentCountHow it loads
Agents11pi-subagents manifest → ./dist/bundle/agents
Skills7pi.skills manifest → ./dist/bundle/skills
Commands7registered by the extension via registerCommand
Extension1pi.extensions → ./dist/index.js

Not yet published to npm — DIST-01 is deferred to v1.1. Install from source (below) until then.

Requirements

  • Pi coding agent
  • A subagent tool. Reviewer dispatch is the core value; without it, a review collapses into self-review. pi-subagents is the intended provider.

Install from source

Pi installs a package from a local path directly — no copying into ~/.pi/agent/ and no symlinking. A local package is identified by its resolved absolute path, so this directory is the package.

The manifest points at built paths (./dist/...), so build first:

cd /path/to/pi-egm
npm install
npm run build

Then choose a scope:

# Project-scoped: available only in this repo, written to .pi/settings.json
pi install . -l

# Personal: available in every Pi session, written to ~/.pi/agent/settings.json
pi install .

Project-scoped packages load only after you grant project trust — Pi will prompt on first start. Confirm registration with:

pi list

To remove:

pi remove .

Try it without installing

Load the package for a single invocation, without touching your settings:

npm run build
pi -e .

-e packages are cached under ~/.pi/agent/tmp/extensions/. A local path is not re-fetched, so restart the session (or /reload) after rebuilding.

Develop

npm run build      # tsc → dist/, then copy bundle/ → dist/bundle/
npm run validate   # frontmatter, reference links, forbidden upstream vocabulary
npm test           # registration harness: 7 commands, 7 skills, 11 agents, .env guard
npm run drift      # compare bundle/ against the pinned upstream commit (network)

npm run build must precede any Pi load, because the manifest resolves dist/bundle/*. Stale dist/ is the usual cause of "I edited a skill and nothing changed".

For a faster prose loop, point the manifest at ./bundle/* instead of ./dist/bundle/* and skip the build — but that diverges from what ships, so verify registration with a real build before tagging.

Verify a skill actually loaded

pi -e .
# then in-session:
/skill:egm-review path/to/some-design.md

If the command is absent, check ls dist/bundle/skills — the load path is missing. If the command runs but reviewers never report, the subagent tool is not available in that session.

The .env guard

Reviewer personas are blocked from reading *.env / *.env.* and allowed *.env.example, via a tool_call handler. The harness simulates this with PI_SUBAGENT_CHILD=1, but a real dispatch is the only true test — run a review against a document that references a .env file and confirm the block.

Upstream sync

bundle/ is upstream-owned. Changes flow through the workflow in AGENTS.md: fetch at the pinned commit → compare → apply scripts/rewrites.json → validate → approve → promote. npm run drift fails on divergence in either direction, so a hand-edited bundle file is caught.

Per-skill README.md files are this port's own and are exempt from drift comparison; bundle/resources/README.md is upstream-owned and compared.

Documentation

License

Apache-2.0