egm-bootstrap
它能做什么
这个技能为代码项目中的文件夹创建并检查 README 文件,使每个部分都有清楚的职责说明。适合使用 Elephant and Goldfish 设计方法的团队。
适用场景
- ✓当项目的文件夹需要编写或更新 README 文件时。
- ✓当你希望每个文件夹的 README 符合 Elephant and Goldfish 格式的时候。
- ✓当你希望有一个汇总其下层各部分的父级 README 的时候。
技能链接
https://github.com/google/elephant-goldfish-model/blob/main/distributions/claude/skills/egm-bootstrap/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请按照 Elephant and Goldfish 格式,为这个项目的每个文件夹添加 README 文件。”
每周 5 个新技能,1 分钟读完。
工作原理
AI 会为每个文件夹启动独立的审阅助手,编写或修正其 README,并将结果汇总到一个父级索引中。这些助手在全新的上下文中工作,因此能发现作者遗漏的假设。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
EGM Peanuts and Hay Bootstrap (egm-bootstrap)
When running in Codex or ChatGPT Work, first read Codex integration.
In Claude Code or Cowork, read ${CLAUDE_PLUGIN_ROOT}/docs/claude.md first.
Overview
This skill automates the creation, correction, formatting, and correctness
verification of Elephant-and-Goldfish Model (EGM) compliant README.md files
across a directory tree. It establishes clear architectural contracts
(interfaces, invariants, and side effects) for both human developers and AI
assistants.
- Peanuts: Leaf-level Component Package READMEs containing specific file contracts.
- Hay: Parent-level Repository Blueprints that roll up child interface contracts into high-altitude indexes.
Delegation
A Goldfish runs in a fresh context with no conversation history. Spawn each
subagent with your harness's subagent tool (Antigravity: invoke_subagent; Claude Code: Agent; Codex: spawn_agent). Each subagent is defined in agents/<file>.md, and its
frontmatter name (for example egm-zoom-out) is the subagent type to request
where your harness registers named subagents. Otherwise spawn a general-purpose
subagent and tell it to read that persona file first. Pass the prompt verbatim
and wait for the report. If your harness cannot nest subagents,
use direct dispatch instead of the synthesizer. See docs/harnesses.md.
If your harness has no subagent tool, run the scout steps inline.
Inputs
path: The target root directory path to bootstrap (Required).is_worker: Internal parameter.trueif executing as a worker Sub-Orchestrator (Optional, default:false).sub_tree_root: Internal parameter. The root path of the assigned subtree partition (Optional).target_filename: Target contract filename to generate or update (Optional, default:"README.md"). Supports alternate blueprint filenames such as"EGM.md"when pre-existing human-maintained READMEs must not be modified.
Execution Constraints (CRITICAL)
- No Code Generation: You are strictly limited to documentation. Do not write or refactor any functional source code.
- VCS Isolation: Do not perform any version control commits (
git commit,git add). All filesystem changes must be written locally using standard file-writing tools. Tracking and submitting is deferred to the human user. - Temporary File Isolation: Parallel workers sharing the workspace must perform all status tracking, check-pointing, and log writing in independent, worker-specific directories outside the project repository workspace.
- Tool Usage (CRITICAL): Use your shell, file-reading, file-writing, and file-editing tools for directory discovery and contract/README
generation. Adhere to clean Markdown formatting directly during generation
(standard headers, tables, and fenced code blocks). If a project markdown
formatter (e.g.
npx prettier --write) is explicitly configured in the repository, it may optionally be invoked. - Subagent Delegation: Spawn sub-orchestrator workers in parallel.
- Mandatory Safety Gate (CRITICAL): If you discover more than 15 subdirectories, you MUST immediately request user approval (using a structured question tool, if your harness has one, or plain chat) before proceeding with full-tree execution or unbounded subagent spawning.
Workflow
Step 0: Ecosystem & Verification Discovery
- Inspect the repository root for package/build manifests:
- Node.js / TypeScript:
package.json->npm test(orpnpm test/yarn test) - Rust:
Cargo.toml->cargo test - Go:
go.mod->go test ./... - Python:
pyproject.toml/pytest.ini/setup.py->pytest - C/C++ / Make:
Makefile->make test - Bazel:
BUILD/BUILD.bazel->bazel test //... - None found:
<test-command>
- Node.js / TypeScript:
- Record as
VerificationCommandto populate generated README contracts.
Step 1: Startup Branching Control
- Check the
is_workerinput parameter. - If
is_workeristrue, jump directly to Step 4: Sub-Orchestrator Worker Flow to process the assignedsub_tree_root. - If
is_workerisfalseor unset, proceed as the Root Orchestrator to Step 2: Incremental Scoping & Safety Gate.
Step 2: Incremental Scoping & Safety Gate (Root Orchestrator)
- **Incremental BFS Discov
常见问题
什么是 Elephant and Goldfish 模型?
这是一种设计方法,将持续运行的主上下文与全新上下文的审阅者配对,以发现隐藏的假设。
它适用于哪些工具?
它为能够启动子智能体的智能体工具编写,例如 Claude Code、Codex 或 Antigravity。
什么是 Peanut 或 Hay 文件?
Peanut 是单个叶子包的 README,Hay 是为其下层各部分建立索引的父级 README。
详情
作者的原始描述
Bootstrap directory README.md files across a repository subtree.
热度
- GitHub 星标
- 10k
- 排名
- #11877
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/2
评论
- …