AGENTS.md Generator (Root + Nested, Portable)
Goal
Maintain small, high-signal AGENTS.md files:
- Root AGENTS.md — purpose of repository, navigation, universal toolchain, canonical commands, links to docs and skills.
- Nested AGENTS.md — module/package purpose, local commands, module references.
Use progressive disclosure: keep AGENTS.md concise; push details to docs or skills.
Skill location (agent-specific)
- Do NOT assume
.agents/ or any fixed directory exists.
- Skills may live:
- inside the repository (embedded),
- or in an external/global skill library (external).
- If referencing local skills, first detect an existing skill root already used by the project.
- If no local skill directory exists — reference skills by name only (external).
- Never create hidden agent directories just to store skills.
When to run
Run this skill when:
- AGENTS.md is missing, bloated, contradictory, or outdated.
- A new package/service/module appears.
- Repository structure changes (monorepo growth or split).
- Teams want consistent agent context across diverse stacks.
Workflow (Deterministic)
1. Discover repository shape
- Identify repository root (git root if available).
- Detect language/tool markers:
package.json, pnpm-workspace.yaml
go.mod, go.work
pyproject.toml
Cargo.toml
pubspec.yaml
pom.xml, build.gradle
- Locate
docs/, README.md, existing AGENTS.md.
2. Detect module boundaries
Create nested AGENTS.md if directory:
- Contains independent build/package manifest
- OR represents deployable/service unit (
apps/, services/, packages/)
- AND differs in stack/toolchain from parent scope
3. Generate/Update Root AGENTS.md
Constraints:
- Ideal size: ≤ 60 lines
- Must include:
- One-sentence repository purpose
- Primary toolchain/package manager
- Canonical commands (if non-standard)
- Links to docs
- Instruction to read nested AGENTS.md when inside modules
- Optional skill references (adaptive: local or external)
4. Generate/Update Nested AGENTS.md
Constraints:
- Ideal size: ≤ 40 lines
- Must include:
- One-sentence module purpose
- Module-specific commands
- Local documentation references
- Optional skill references (adaptive)
5. Progressive Disclosure Rules
- Do not embed style guides, CI policies, or architecture details.
- Prefer links to:
docs/STYLE_GUIDE.md
docs/ARCHITECTURE.md
- external or local skills
- Avoid “always/never” rules unless critical for correctness/security.
6. Safety / Correctness Gates
- Never invent commands.
- Infer commands from:
- package scripts
- Makefile
- CI configuration
- README
- If uncertain → write:
“Known commands: see ”
- Preserve critical warnings (security, secrets, deployment).
Output Contract
Create or update only:
<repo_root>/AGENTS.md
<module_dir>/AGENTS.md
Do not create agent configuration folders.
Skill Referencing Strategy
When adding skill references inside AGENTS.md:
If local skill directory detected
See: <detected-skill-root>/<skill-name>/SKILL.md
If no local directory exists
Skill: agents-md-generator (external)
Never assume filesystem paths.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: agents-md-generator-53description: Create or update minimal AGENTS.md files in the repository root and nested module directories using progressive disclosure. Works across heterogeneous projects without assuming any fixed agent folder structure. Use when this capability is needed.4---56# AGENTS.md Generator (Root + Nested, Portable)78## Goal9Maintain small, high-signal AGENTS.md files:1011- Root AGENTS.md — purpose of repository, navigation, universal toolchain, canonical commands, links to docs and skills.12- Nested AGENTS.md — module/package purpose, local commands, module references.1314Use **progressive disclosure**: keep AGENTS.md concise; push details to docs or skills.1516---1718## Skill location (agent-specific)19- **Do NOT assume `.agents/` or any fixed directory exists.**20- Skills may live:21 - inside the repository (embedded),22 - or in an external/global skill library (external).23- If referencing local skills, first detect an existing skill root already used by the project.24- If no local skill directory exists — **reference skills by name only (external)**.25- **Never create hidden agent directories** just to store skills.2627---2829## When to run30Run this skill when:3132- AGENTS.md is missing, bloated, contradictory, or outdated.33- A new package/service/module appears.34- Repository structure changes (monorepo growth or split).35- Teams want consistent agent context across diverse stacks.3637---3839## Workflow (Deterministic)4041### 1. Discover repository shape42- Identify repository root (git root if available).43- Detect language/tool markers:44 - `package.json`, `pnpm-workspace.yaml`45 - `go.mod`, `go.work`46 - `pyproject.toml`47 - `Cargo.toml`48 - `pubspec.yaml`49 - `pom.xml`, `build.gradle`50- Locate `docs/`, `README.md`, existing `AGENTS.md`.5152---5354### 2. Detect module boundaries55Create nested AGENTS.md if directory:5657- Contains independent build/package manifest58- OR represents deployable/service unit (`apps/`, `services/`, `packages/`)59- AND differs in stack/toolchain from parent scope6061---6263### 3. Generate/Update Root AGENTS.md64Constraints:6566- Ideal size: ≤ 60 lines67- Must include:68 - One-sentence repository purpose69 - Primary toolchain/package manager70 - Canonical commands (if non-standard)71 - Links to docs72 - Instruction to read nested AGENTS.md when inside modules73 - Optional skill references (adaptive: local or external)7475---7677### 4. Generate/Update Nested AGENTS.md78Constraints:7980- Ideal size: ≤ 40 lines81- Must include:82 - One-sentence module purpose83 - Module-specific commands84 - Local documentation references85 - Optional skill references (adaptive)8687---8889### 5. Progressive Disclosure Rules90- Do not embed style guides, CI policies, or architecture details.91- Prefer links to:92 - `docs/STYLE_GUIDE.md`93 - `docs/ARCHITECTURE.md`94 - external or local skills95- Avoid “always/never” rules unless critical for correctness/security.9697---9899### 6. Safety / Correctness Gates100- Never invent commands.101- Infer commands from:102 - package scripts103 - Makefile104 - CI configuration105 - README106- If uncertain → write:107 “Known commands: see <file>”108- Preserve critical warnings (security, secrets, deployment).109110---111112## Output Contract113Create or update only:114115- `<repo_root>/AGENTS.md`116- `<module_dir>/AGENTS.md`117118**Do not create agent configuration folders.**119120---121122## Skill Referencing Strategy123124When adding skill references inside AGENTS.md:1251261. **If local skill directory detected**127 ```128 See: <detected-skill-root>/<skill-name>/SKILL.md129 ```1301312. **If no local directory exists**132 ```133 Skill: agents-md-generator (external)134 ```135136Never assume filesystem paths.137138---139> Converted and distributed by [TomeVault](https://tomevault.io/claim/madteacher) — claim your Tome and manage your conversions.140<!-- tomevault:4.0:skill_md:2026-04-11 -->