omp packages

@tklu/pi-egm0.6.2

Draft specs, review designs, and check implementation drift.

tklu Published 3 days ago Apache-2.0 ~944 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

pi-egm

pi-egm is up to date with Google's upstream EGM v0.2.0 personas as of 2026-12-04.

This is an Elephant–Goldfish Model (EGM) extension for the Pi coding agent, based on Google's upstream EGM project.

Design with an elephant. Review with a goldfish. Develop ideas with your main agent's project context, then have fresh-context reviewer subagents challenge the design before you implement it.

The built-in draft and design-review workflow targets software specifications. For other documents, choose reviewers and standards with /skill:egm-review-loop. Bootstrap and drift reporting apply to software codebases.

Install in Pi

Install the public npm package in Pi:

pi install npm:@tklu/pi-egm

Alternatively, install directly from this repository:

pi install git:github.com/dei03236/pi-egm

Restart Pi after installation. The package supplies both the Pi extension and its EGM skills; no separate subagent extension is required.

Do not load this extension alongside other EGM ports: they may register the same tool and skills.

The package is published publicly on npm as @tklu/pi-egm.

Use in Pi

Your main Pi agent retains the project context and helps you develop a design. The extension's invoke_subagent tool runs Goldfish reviewers in separate, in-memory sessions, without the main conversation history. Reviewers receive their persona, the task, and any supplied context-file paths, which they can inspect using read tools. You decide which findings to address and when a design is ready to implement.

Roles and responsibilities

Role Context Responsibility
Elephant — your main Pi agent Your project, requirements, conversation, and earlier decisions. Explore the problem, develop the design, and draft the specification.
Goldfish — fresh-context reviewers The review task, document, and referenced source material, without the main conversation history. Challenge assumptions, identify unclear requirements, and expose implementation risks.
You The goals and constraints that matter. Resolve trade-offs, choose which findings to address, approve the design, and decide when to implement.

Goldfish reviews require fresh subagent contexts. If Pi cannot create them, stop the review rather than simulate reviewers in the main conversation. Fresh context does not imply filesystem or instruction-file isolation. Reviews supplement tests and human judgment; they do not replace them.

Review existing work

You do not need to brainstorm or draft a new specification first. Review an existing design document or a PR plan saved as Markdown:

/skill:egm-review docs/designs/webhooks.md

Reviewers examine the document and relevant source code. To compare existing documentation with the current implementation instead:

/skill:egm-drift-report docs/designs/

Replace these example paths with your own. You decide whether to update the document or the code.

Choose a workflow

Use each skill when you need it; you do not have to follow the full sequence. Invoke the bundled skills using Pi's /skill: commands:

Skill Purpose
/skill:egm-brainstorm Explore an idea and develop a concept brief.
/skill:egm-draft Turn a brief or notes into a design document.
/skill:egm-review Review a design with fresh-context reviewers.
/skill:egm-resolve Work through review findings and agree on changes.
/skill:egm-review-loop Run a configured group of reviewers for a specific review task, including non-software documents.
/skill:egm-bootstrap Create or update directory README files for an existing codebase.
/skill:egm-lite Fast-track small iterations, specification revisions, refactors, and bug fixes.
/skill:egm-drift-report Compare design documents with the current implementation.

Ordinary reviewer subagents have read-only tools, but the workflows are not entirely read-only: they can create concept briefs, drafts, and review reports. Review-loop can apply approved changes, and bootstrap subagents have file-writing, editing, and shell access.

Try your first design

Open your project in Pi and choose a feature that needs design decisions. For example, webhook delivery raises questions about failed deliveries and duplicate events.

1. Explore the idea

/skill:egm-brainstorm Add webhook delivery to this project.

Discuss requirements and trade-offs with the agent. Fresh reviewers challenge the proposal, and the agent saves the agreed direction in concepts_brief.md.

2. Draft the specification

/skill:egm-draft

The agent turns the brief into design_draft.md, pausing after each section for your feedback in chat.

3. Review the draft

/skill:egm-review design_draft.md

Use the draft path returned by the agent. Fresh reviewers check the design, its clarity, its fit with the code, and its implementation plan. Choose which findings to address, using /skill:egm-resolve when needed. You approve the design before asking the agent to implement it.

See the workflow guide for the full process, including saving approved specifications under docs/designs/.

Small changes with EGM Lite

For a smaller task, use the lightweight workflow instead of drafting a full design document:

/skill:egm-lite Refactor webhook retry handling without changing its behavior.

EGM Lite separates critique, checklist creation, implementation, and fresh-context review. Follow its prompts one phase at a time; implementation requires an explicit exec command or Proceed approval after the checklist or triage phase. It can modify code and specifications, so it is not a read-only review workflow.

Upstream documentation

These guides describe Google's upstream plugin. For Pi installation and command syntax, use the instructions above.

Pi-specific features

  • Self-contained: bundles the extension, subagent runtime integration, personas, and skills. No separate subagent add-on is required; Pi and its host-provided libraries are still required.
  • Current upstream content: bundled personas and skills match upstream EGM v0.2.0, as of 2026-12-04.
  • Permission forwarding: announce child sessions before binding their extensions so permission prompts can be forwarded to the parent session, including nested runs.
  • Cancellation: propagate cancellation to the child session instead of leaving the subagent running independently.
  • Child-session cleanup: await extension shutdown handlers before disposing of a child session, allowing extensions to release timers and other resources.
  • Persona resolution: replace hard-coded aliases and an unsafe filename fallback with a session-local registry. Unknown or ambiguous personas fail explicitly rather than silently running without the intended persona.
  • Role-specific tool access: select synthesizer and bootstrap privileges from the resolved persona's identity, rather than the spelling of the caller-supplied alias. Ordinary reviewers have read-only tools.

Pi integration and safeguards

The extension supplies Pi-specific execution guidance and the resolved package root automatically. It adapts upstream tool instructions to Pi, preserves review and approval gates, and supplies role-specific guidance to child sessions. The bundled Codex and Claude guides remain available for upstream references; their host-specific commands are not Pi commands.

This guidance is included whenever the extension is loaded, but applies only to EGM work. It does not strengthen filesystem or instruction-file isolation, grant additional permissions, or independently verify that reviewers read every required file. A missing or empty docs/pi.md is an installation error: parent prompts report EGM as unavailable, and subagent calls reject before child creation. Repair or reinstall the package; unrelated Pi tasks can continue.

Persona diagnostics

The successful persona initialization is silent. Conflicts, skipped entries, and initialization failures are reported through Pi's UI, never directly to the terminal.

To capture detailed diagnostics (including the initialization summary), set PI_EGM_DEBUG_LOG to a writable log-file path before starting Pi. Events are appended to that file; logging failures are ignored so they cannot interrupt initialization.

Fork history

This project began as an independent fork of @rizkiaprita/egm@0.3.2, addressing Pi subagent integration bugs and updating bundled upstream content. The fixes above describe this fork's changes relative to that original baseline, not the current state of other ports.

Development

The Pi integration lives in index.ts, persona discovery in persona-registry.ts, reviewer definitions in agents/, and workflows in skills/.

The test suite requires Node.js with both TypeScript stripping (--experimental-strip-types) and node:module.registerHooks support. It has been run successfully on Node.js 24.16.0; this is a tested version, not a minimum-version claim.

npm test

Please report fork-specific bugs and submit changes in this repository.

License and attribution

Apache License 2.0. This fork is based on @rizkiaprita/egm@0.3.2 and incorporates selected material from Google's Elephant–Goldfish Model project. Original copyright notices and the license are retained. This is not an officially supported Google product.