一句话看懂
Elephant‑Goldfish Model(后面简称 EGM)是一套插件,给 AI 编码助手加一道“写代码之前先把设计想清楚”的工序。它把这道工序拆成两个角色:一个记得住项目上下文的起草者,一个完全不知道前面讨论过什么的审查者。两者配合,在代码落地前把需求漂移和设计盲点挖出来。
仓库当前 4687 星,当日新增 1582,Fork 285,Open Issues 53,主语言 Python,License 为 Apache-2.0,创建于 2026 年 9 月 13 日。首个标记发布是 v0.1.0。
它解决什么问题
AI 编码助手写代码很快,但前提往往没谈透。开发者随口说一句“加个 webhook 投递功能”,助手就直接动手写实现,等代码出来才发现重试策略、鉴权方式、失败通知这些细节根本没讨论过。返工比不写代码还费时间。
EGM 把这个过程拆成三步:先用 egm-brainstorm 把需求聊清楚,产出一份概念简报;再用 egm-draft 把简报变成设计草案;最后用 egm-review 找一个没见过前面对话的代理,单独审查这份草案。审查者如果带着之前讨论的记忆,容易跟起草者一起忽略同样的假设。换成一个“没有记忆”的角色重新读草案,更容易挑出没写清楚的地方。
这套流程最终把审查通过的设计文档存进 docs/designs/,作为后续实现唯一依据的规格来源,减少代码和最初想法越写越偏的情况。
核心概念速览
Elephant:大象记忆好,这里指能持有完整项目上下文的角色。它读项目文件、看之前的讨论记录,在这个基础上起草需求简报和设计草案。
Goldfish:金鱼记忆短,这里指零上下文的审查子代理。它拿到草案时不知道任何前置讨论,只能靠草案本身的文字判断逻辑是否完整、假设是否说清楚。这种失忆式审查是刻意设计的,目的是模拟一个真正独立的第三方视角。
Skill:插件体系里每个可以单独调用的能力单元,比如 egm-brainstorm、egm-draft、egm-review,各自对应流程里的一步,在插件市场里单独管理和更新。
架构拆解
代码库按功能分成几块。skills/egm-brainstorm 负责和开发者对话,把零散的需求收敛成一份 concepts_brief.md。skills/egm-draft 读这份简报,产出 design_draft.md,过程中会逐段给出反馈,不是一股脑生成完整文档再扔出来。skills/egm-review 用一个新建的、没有历史记忆的代理,分五个阶段检查草案,包括清晰度、遗漏假设、和现有代码的匹配度等。agents 目录下的各类专家代理文件,定义了审查时具体扮演的角色,比如某个代理专注查安全假设,另一个专注查接口兼容性。
流程走向很直接:简报交给草案环节,草案交给审查环节,审查结果再交给 egm-resolve 去处理。scripts/pack_plugin.py 是构建脚本,把各个 skill 的资源打包进插件运行时目录和 ZIP 包,供 Antigravity、Claude Code、Codex 这些平台加载。
整体上这是一条单向流水线,没有分支逻辑,每一步的输出就是下一步唯一的输入。每个环节职责很窄,出问题时容易定位是哪一步出的偏差。
关键实现走读
看一段 scripts/pack_plugin.py 里的打包函数:
def build(root: Path, target: str, output: Path) -> tuple[Path, Path]:
"""Write a new runtime folder and ZIP; refuse unsafe inputs or overwrites."""
root = root.resolve()
folder = output.resolve() / f"egm-{target}"
archive = folder.with_suffix(".zip")
if any(path.exists() or path.is_symlink() for path in (folder, archive)):
raise ValueError("Output folder or ZIP already exists")
if folder == root or root.is_relative_to(folder):
raise ValueError("Output must not contain the source tree")
这段代码在正式写文件之前,先检查目标文件夹和 ZIP 是否已经存在,也检查目标路径是不是源代码目录本身或者源代码目录的子路径。撞上这几种情况,立刻抛异常,不往下执行。
打包脚本会往磁盘写东西,写之前不检查,容易悄悄覆盖掉已有文件,或者把输出目录套进源码目录里形成循环引用。用 resolve() 把路径都转成绝对路径再比较,避免相对路径或者软链接伪装出的路径绕过检查。
如果少了这段校验,重复执行打包命令可能直接覆盖掉之前的发布包而不报错,或者在输出目录设置不当时把源码目录本身当成输出目标,写出一个包含自身的死循环结构,排查起来会很麻烦。这种校验代码量不大,但决定了这个脚本能不能放心反复跑。
动手上手
先在目标平台装插件,三条路径分别对应 Antigravity、Claude Code、Codex:
agy plugin install https://github.com/google/elephant-goldfish-model
claude plugin marketplace add google/elephant-goldfish-model
claude plugin install egm@egm
codex plugin marketplace add google/elephant-goldfish-model
codex plugin add egm@egm
可验证结果:执行完上面任意一组命令后,对应平台的插件列表里应该能看到 egm,说明安装成功。
装好之后在对话里依次调用三个命令:
/egm-brainstorm Add webhook delivery to this project.
可验证结果:应该得到一份梳理过的需求讨论,最终写出 concepts_brief.md。
/egm-draft
可验证结果:基于上一步的简报生成 design_draft.md,过程中会分段给反馈,不是一次性甩出整份文档。
/egm-review design_draft.md
可验证结果:一个新建的审查代理给出清晰度、实现风险方面的具体意见,这些意见不依赖你和 brainstorm、draft 阶段的历史对话。
应用场景
做一个新功能,比如给现有项目加 webhook 投递,用 brainstorm 把权衡方案聊清楚,再用 draft 把结论变成文档,这是 EGM 最直接的用法。
代码写之前先过一遍审查,让没见过前面讨论的代理检查设计是否完整、是否可实现,这一步可以在团队内部评审之前先做一轮,减少明显遗漏被带到人工评审会上。
README 里特别提到,小而清晰的 bug 修复不建议走这套流程,直接用常规编码方式处理就行,EGM 针对的是需要设计决策的改动。
独立分析
零上下文审查这个设计思路本身是站得住的。人在评审自己参与讨论过的方案时,容易被最初的思路框住,看不出那些讨论里默认成立、但实际没验证过的假设。找一个完全没参与讨论的角色重新读文档,相当于用读者视角替代作者视角,这种方法在写作编辑和代码评审里都有先例,EGM 把它做成了可重复调用的流程,而不是每次都要临时找人帮忙看。
和常规编码流程比,EGM 多出来的成本是时间。三步走完才能开始写代码,对于需求本身已经很清楚的任务,这个流程反而拖慢节奏,这也是 README 建议小修复绕开它的原因。它更适合那些说不清楚具体要什么的任务,流程的价值在厘清需求,不在加速编码。
局限与风险
审查环节要求能创建一个全新的、没有历史记忆的子代理会话,如果所在平台不支持这种隔离的会话机制,审查的零上下文效果就打折扣。
审查给出的意见仍然是 AI 生成的,不能替代实际测试和人工判断,草案通过审查不等于代码实现后就没有问题。
发布说明里提到,针对发布 ZIP 包的宿主校验方式目前还没有最终确定,这部分后续可能还会调整。
结论卡片
适合需要在写代码前做设计决策的工程师或团队,尤其是用 Claude、Codex 这类 AI 编码助手且希望流程留痕的场景。只需要修复明确小 bug 的开发者用不上这套流程,直接改代码更快。建议的使用顺序是先跑 brainstorm 和 draft 出草案,再用 review 走一遍审查,最后把通过的文档存进 docs/designs/ 作为实现依据。
原文地址:tools.wflynn.cn/aitools/git…
关注公众号「YourTools」,每天推送 GitHub 趋势与开源工具速报:
本文由 AI图鉴自动抓取并翻译,版权归原作者所有;如需查看原文请点下方链接。
One word.
Elephant – Goldfish Model (hereinafter EGM) is a set of plugins that add to the AI coding assistant the task of "preliminating design before writing code." It broke the process into two roles: one who remembered the drafter of project context and one who had no idea what had been discussed earlier. The two work together to dig up the demand drift and design blind spots before the code land.
The warehouse currently has 4687 stars, which was added 1582, Fork 285, Open Issues 53, the main language, Python, License, is Apache-2.0, which was created on 13 September 2026. The first tag publish is v. 1.0.
What does it solve?
AI coding assistants write code quickly, but the premise is often not clear. When the code came out, the details of the retry strategy, the mode of assurance, the failure notification were never discussed. It takes more time to return to work than not to write the code.
EGM to break this process down into three steps: first, using egm-brainstorm to clarify needs and produce a concept brief; then using egm-draft to transform the brief into a draft design; and finally, using egm-review to find an agent who has never seen the previous dialogue and to review the draft separately. Reviewers with memories of previous discussions can easily ignore the same assumptions with the drafters. By rereading the draft with a “no memory” role, it would be easier to single out the unwritten.
The process ultimately saves the design documents adopted by the review into docs/designs/ as a source of specifications on which to base subsequent implementation, reducing the number of errors in code and initial thinking.
Core concept snapshot
Elephant: Elephant: The elephant remembers well, here is the role of the complete project context. It reads the project document, looks at the proceedings of the previous discussions and, on this basis, drafts the requirements brief and design.
Goldfish: Goldfish has short memory, here is the examiner agent for zero context. It was not aware of any pre-discussion when it came to the draft, but only the text of the draft itself would determine whether the logic was complete and whether the assumption was clear. This amnesia review was deliberately designed to simulate a truly independent third-party perspective.
Skill: Each capability unit in the plugin system that can be called separately, egm-brainstorm, egm-draft, egm-review, each corresponding step in the process, managed and updated separately in the plugin market.
Structure Dismantling
The code library is divided into several pieces by function. Skills/egm-brainstorm is responsible for dialogue with developers, concepts brief.md. Skills/egm-draft reads the bulletin, with output design draft.md, giving feedback paragraph by paragraph during the process, rather than a complete document generated by the brain. Skills/egm-review, with a new agent with no historical memory, examines drafts in five stages, including clarity, missing assumptions, and matching of existing codes. Various expert proxy documents under the directory define the specific roles played in the review, such as the focus of one agent on safety assumptions and the compatibility of another on interfaces.
The process is straightforward: the brief is presented to the draft, the draft to the review, and the results of the review to the egm-resolve. Scripts/pack plugin.py is the build script that wraps the individual skill resources into the running-time plugin directory and the ZIP package for the Antigravity, Claude Code, Codex platforms.
The whole is a one-way water line, with no branch logic, and the only input per step is next step. Each chain has a narrow mandate, and it is easy to identify where the error is.
Critically achieved reading
See a wrapping function in scripts/pack plugin.py:
def build(root: Path, target: str, output: Path) -> tuple[Path, Path]:
"""Write a new runtime folder and ZIP; refuse unsafe inputs or overwrites."""
root = root.resolve()
folder = output.resolve() / f"egm-{target}"
archive = folder.with_suffix(".zip")
if any(path.exists() or path.is_symlink() for path in (folder, archive)):
raise ValueError("Output folder or ZIP already exists")
if folder == root or root.is_relative_to(folder):
raise ValueError("Output must not contain the source tree")
This code checks if the target folder and ZIP already exist, and whether the target path is the source directory itself or the sub-routine of the source directory, before formalizing the file. We hit them and dropped the anomaly immediately.
Pack your scripts, write to the disk, don't check it, it's easy. Shade. Overwrites an existing file or places an output directory into the source directory to form a circular reference. Use resolve() to convert all paths to absolute paths and then compare, avoiding bypassing the path disguised by relative paths or soft links.
Without this verification, repeated packing orders may directly cover the previous publish package without error, or it will be difficult to sort out the source directory itself as an output target when the output directory is not set. It's a small number of codes, but it's a matter of whether this script can keep running.
Do it.
Plug-in on the target platform, three paths for Antigravity, Claude Code, Codex:
agy plugin install https://github.com/google/elephant-goldfish-model
claude plugin marketplace add google/elephant-goldfish-model
claude plugin install egm@egm
codex plugin marketplace add google/elephant-goldfish-model
codex plugin add egm@egm
Verifiable results: Upon implementation of any set of commands above, egm should be visible in the list of plugins for the corresponding platform, indicating successful installation.
When you're set up, you call three orders in the dialogue:
/egm-brainstorm Add webhook delivery to this project.
Verifiable results: A needs discussion should be prepared, culminating in concepts brief.md.
/egm-draft
Validable results: a summary based on the previous step generates a summary draft.md, which gives feedback in stages, not a single release of the entire document.
/egm-review design_draft.md
Verifiable results: A new review agent gives specific opinions on clarity and achievement of risk, which do not depend on the historical dialogue between you and the Brainstorm, Draft phase.
Apply scene
Make a new feature, such as adding webbook delivery to existing items, using brainstorm to make the trade-off clear, then using draft to turn conclusions into a document, which is EGM's most direct use.
The code writing is preceded by a review to see whether the design of the agent discussed above is complete and achievable, a step that can be followed by a round prior to the internal evaluation of the team, reducing the obvious omissions to be taken to the manual review session.
The README specifically mentions that small and clear bug repair does not recommend this process to be handled directly by a general code, and EGM addresses changes that require design decisions.
Independent analysis
Zcontext reviews the design idea itself. It is easy for people to be drawn from the initial thinking when they evaluate the options they have been involved in, and it is not clear that the assumptions that were implicitly set up in those discussions but were not actually validated. Rereading a document with a completely undiscussed character is tantamount to replacing the author's perspective with a reader's perspective, an approach that has precedent in writing editing and code evaluation, and EGM has made it a process that can be duplicate call rather than looking for help on an ad hoc basis every time.
EGM costs more than normal coding processes. After three steps to start writing the code, the process slows down the pace of the task for which the need itself is clear, which is why README suggested that minor repairs bypass it. It is more appropriate for those missions that say they do not know exactly what to want, and the value of the process is clarifying the needs and not accelerating the coding.
Limitations and risks
The review chain requires the creation of a new sub-agent session with no historical memory, and the zero context effect of the review is reduced if the platform does not support the isolation session mechanism.
The comments given by the review are still AI generated and cannot be a substitute for actual testing and manual judgement, and the draft will not be problematic once it is achieved by reviewing the code.
As mentioned in the publish Note, the host verification of the publish ZIP package is not yet finalized and this part may be adjusted.
Concluding card
It suits engineers or teams who need to make design decisions before writing codes, especially those who use Claude, Codex, such as AI-coding assistants and wish to leave a mark on the process. The process was not used by the developers who had to fix the clearly small bugs and change the code more quickly. The suggested order of use is to run the brainstorm and draft first, then review them with a review, and then save the documents that are passed into docs/designs/ as a basis for realization.
Original address: Tools.wflynn.cn/aitools/git...
Following the WeChat Official Account "YourTools", GitHub's trend and open source tool is sent daily:
Auto-fetched and translated by AI Atlas. All rights belong to the original author.