AI coding tools have dramatically accelerated how fast diffs get written, yet unverified speed brings subtle bugs and mid-session context collapse. To add structural guardrails ahead of code generation, Google open-sourced the Elephant-Goldfish Model (EGM) plugin under the Apache 2.0 license.

Splitting Long-Horizon Elephants from Stateless Goldfish

EGM separates AI sessions into two strict roles: Elephant and Goldfish. The Elephant is a long-lived session holding overarching architectural vision and project memory under a strict No Code rule - focusing exclusively on spec design and capturing subtle trade-offs without writing implementation code.

The Goldfish, by contrast, is a stateless session with zero shared conversation history. Because it does not inherit the Elephant’s sunk-cost context or blind spots, the Goldfish acts as an independent critic hunting for gaps and edge cases in the written design doc.

Three-Stage Adversarial Review Inside Antigravity

Built to automate this workflow inside Antigravity, the open-source EGM plugin runs across three stages:

  1. egm-brainstorm: Loads system context to explore trade-offs and assumptions with the developer without touching application code.
  2. egm-draft: Produces a structured Markdown design spec covering problem statement, technical plan, alternatives considered, and exact target file paths.
  3. egm-review: Spawns stateless Goldfish sessions to run the adversarial Goldfish Protocol.

The Goldfish Protocol runs three distinct checks: a Comprehension Check where a fresh Goldfish restates the spec to expose ambiguity, an Antagonistic Review where multiple Goldfish personas attack logical flaws, and an Implementation Readiness Check verifying that file paths and function signatures are concrete enough to code against.

From Internal Google Workflow to Apache 2.0 Open Source

Originally used daily by Google engineers shipping production code, the EGM plugin packages custom Markdown rules and subagent personas under Apache 2.0 - shifting developers out of line-by-line prompt micromanagement and into architectural review.

Summary

  • Splits AI sessions into a long-horizon, no-code Elephant architect and stateless Goldfish critics to eliminate context bias.
  • Runs specs through a three-part Goldfish Protocol: Comprehension Check, Antagonistic Review, and Implementation Readiness Check.
  • Open-sourced from Google’s internal production workflow under Apache 2.0 with ready-to-run support for environments like Antigravity.