# /egm-bootstrap: Write grounded README contracts for an existing codebase

Source: https://trendhub.net/skills/google-elephant-goldfish-model/egm-bootstrap
Skill folder: https://github.com/google/elephant-goldfish-model/tree/main/skills/egm-bootstrap
Pack: Elephant-Goldfish Model (EGM) (https://trendhub.net/skills/google-elephant-goldfish-model)
Works with: Claude Code, Codex CLI, Antigravity CLI

Egm-bootstrap documents a code tree directory by directory without touching source code. Read-only scout subagents extract each package's public interface, invariants and side effects with file and symbol citations, leaf READMEs are written first, parent directories roll up their children, and a final pass re-reads every file to check links, test commands and that nothing was invented.

## When to use it

- A codebase has little or outdated documentation and agents keep misreading its structure.
- You want each package to state its interface and side effects for humans and agents alike.
- You need existing READMEs corrected without losing the notes developers already wrote.

## How it works

1. **Find the test command**: The agent reads build manifests such as package.json, Cargo.toml or go.mod to pick the verification command each README will reference.
2. **Map the tree safely**: It lists directories one level at a time, skips ignored and test-only folders, and asks your approval if more than 15 subdirectories turn up.
3. **Scout each directory**: Read-only scouts read source in chunks and return interface, invariants and side effects with file and symbol citations.
4. **Write bottom-up**: It writes or corrects leaf READMEs first, then parent and root blueprints that index their children, splitting large trees across parallel workers.
5. **Verify everything**: It re-reads every created or changed file to check sections, links and test targets, then offers to run a drift report.

## What it steers the agent away from

- Changing or generating functional source code
- Committing changes to git on your behalf
- Documenting routes, enums or invariants guessed from file names

## What it can touch

Lists and reads repository files, runs shell commands for directory discovery and optionally a configured markdown formatter, spawns parallel subagents, and writes README.md (or another named file such as EGM.md) in each code directory without committing.

## Pairs well with

- `/egm-drift-report`

## Questions

### Will it overwrite READMEs I already have?

No. Existing files are read and corrected in place, keeping developer notes; you can also target a different filename such as EGM.md.

### Does it need subagents?

It uses them for scouts and parallel workers, but if your agent has none it runs the scout steps inline.
