EGM Bootstrap (Repo README Contract Generator)
Walks a repository subtree and auto-generates or updates per-directory README contracts documenting Interface, Invariants, and Side Effects.
Dev & CodingAdvanced★ 22,749⑂ 1,676AI score 7/10Last updated: Nov 24, 2026
What it does
- Performs level-by-level BFS discovery from a given
path, skipping hidden dirs,node_modules,dist, test-only folders, and anything matched by.gitignore/.egmignore. - Writes
README.md(or a customtarget_filenamesuch asEGM.md) using two templates: Peanuts for leaf code packages and Hay blueprint indexes for parent directories. - Uses read-only
goldfish-explorersub-agents that read files in ~1,500-line chunks and must cite[file:symbol_or_flag]for every claim, cutting down hallucinated documentation. - Detects the build ecosystem (
package.json,Cargo.toml,go.mod,*.csproj,Makefile,BUILD) and records the correct verification command, including strict Bazel target syntax. - Scales via adaptive depth partitioning with at most 5 parallel sub-orchestrators, and pauses for explicit approval when more than 15 subdirectories are found.
- Finishes with a mandatory re-read of every generated contract to validate Markdown, relative links, and citations; optionally chains into a drift report.
- Never writes source code and never runs git commits.
Who it's for
- Engineers inheriting a large, under-documented repo or monorepo.
- Platform/architecture owners who want consistent interface, invariant, and side-effect contracts per package.
- Teams building an agent-readable documentation layer so AI tools navigate the codebase more reliably.
Example uses
services/holds 20+ packages with no READMEs — after you approve the >15-directory safety gate, up to five workers document subtrees in parallel.- You want to keep handwritten READMEs intact — pass
target_filename="EGM.md"so contracts land in a separate file. - After a refactor, rerun it: existing contracts are read first, merged with fresh scout findings, and valid developer notes are preserved.
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/google/elephant-goldfish-model/HEAD/skills/egm-bootstrap/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on AI Skill Mart. Copy the skills/egm-bootstrap folder from the GitHub repo google/elephant-goldfish-model into my ~/.claude/skills/google-egm-bootstrap/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/google/elephant-goldfish-model.git && mkdir -p ~/.claude/skills && cp -r elephant-goldfish-model/skills/egm-bootstrap ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal and move to your working directory.
- Clone the repository:
git clone https://github.com/google/elephant-goldfish-model.git - Copy the skill into place:
mkdir -p ~/.claude/skills && cp -r elephant-goldfish-model/skills/egm-bootstrap ~/.claude/skills/ - The skill references
references/templates.md,references/worker-return.schema.json, and the plugin-levelresources/,docs/, andagents/folders — install the full EGM plugin or keep the complete clone so those paths resolve. - Restart Claude Code and confirm
egm-bootstrapappears in your skills list (model invocation is disabled, so you must call it explicitly). - Invoke it with a target path, e.g. "Run egm-bootstrap with path=./services and target_filename=EGM.md".
- Commit or branch first — the run can create or modify many documentation files, and a clean baseline makes the diff easy to review.
View source on GitHub ↗License: Apache-2.0