AGENTS.md Generation Capability
This skill enables the agent to generate AGENTS.md files that serve as contributor guides for AI agents working on a codebase.
Core Capability
- Function: Analyze repository structure and generate or update a standardized
AGENTS.md document
- Output Format: Markdown file with structured sections
- Character Limit: Dynamic, based on repository LOC (Lines of Code)
- Monorepo Support: Automatically detects monorepo structures and generates hierarchical documentation (Root + Packages)
- Update Support: Refreshes only standard sections in an existing
AGENTS.md, preserving user-defined custom sections
Output Sections
Single Repo / Package Document (5 Sections)
For single repositories or individual packages in a monorepo:
- Overview: 1-2 sentence project description (abstract, no tool/framework lists)
- Folder Structure: Key directories and their contents
- Core Behaviors & Patterns: Cross-cutting patterns traced through full flows — error propagation chains, state lifecycle transitions, cross-boundary wiring mechanisms, resilience/recovery strategies, shared resource management. Discovered via multi-phase analysis: surface idiom detection, then deep tracing across layers.
- Conventions: Naming, code style, API/interface design conventions (callback naming, return value shapes, method responsibility splitting), configuration/registration structure, boundary conventions (error flattening, schema drift absorption, containment rules), component composition patterns.
- Working Agreements: Rules for agent behavior and communication
Monorepo Root Document (3 Sections)
For the root of a monorepo structure:
- Overview: 1-2 sentences describing the monorepo's purpose
- Folder Structure: High-level map of apps, packages, and shared configs
- Working Agreements: Common working agreements applicable to all packages
Operation Modes
Generate vs Update
- Generate: Creates a new
AGENTS.md from scratch (default when no AGENTS.md exists)
- Update: Refreshes standard sections in an existing
AGENTS.md while preserving custom sections. See ./references/update_strategy.md for detailed workflow and section matching rules.
The agent automatically selects the appropriate mode based on whether an AGENTS.md file already exists at the target location.
Generation Modes (Monorepo)
Supports three modes: All (root + all packages, default), Root Only, and Single Package. See ./references/monorepo_strategy.md for detailed strategy and mode selection criteria.
Tools
This skill uses the following read-only tools for repository analysis. See ./references/read_only_commands.md for detailed usage patterns.
tokei: LOC measurement (required)
rg (ripgrep): Content search (preferred)
grep / Select-String: Content search (fallback per OS)
sed -n / Get-Content \| Select-Object: Paginated file reading per OS
tree: Directory structure visualization
find: File and directory discovery (Linux / macOS)
ls, pwd: Basic directory navigation
Domain Knowledge
Scope Boundaries
- Read-Only Analysis: Supports non-destructive commands for repository inspection
- Output Scope: Produces documentation content only; excludes run/test/build/deploy instructions
- Excluded Inputs: Lock files (
pnpm-lock.yaml, package-lock.json, yarn.lock, etc.) are outside analysis scope
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: agents-md-generator3description: Analyze repository structure and generate or update standardized AGENTS.md files that serve as contributor guides for AI agents. Supports both single-repo and monorepo structures. Measures LOC to determine character limits and produces structured documents covering overview, folder structure, patterns, conventions, and working agreements. Update mode refreshes only the standard sections while preserving user-defined custom sections. Use when setting up a new repository, onboarding AI agents to an existing codebase, updating an existing AGENTS.md, or when the user mentions AGENTS.md. Use when this capability is needed.4---56# AGENTS.md Generation Capability78This skill enables the agent to generate `AGENTS.md` files that serve as contributor guides for AI agents working on a codebase.910## Core Capability1112- **Function**: Analyze repository structure and generate or update a standardized `AGENTS.md` document13- **Output Format**: Markdown file with structured sections14- **Character Limit**: Dynamic, based on repository LOC (Lines of Code)15- **Monorepo Support**: Automatically detects monorepo structures and generates hierarchical documentation (Root + Packages)16- **Update Support**: Refreshes only standard sections in an existing `AGENTS.md`, preserving user-defined custom sections1718## Output Sections1920### Single Repo / Package Document (5 Sections)21For single repositories or individual packages in a monorepo:2223- **Overview**: 1-2 sentence project description (abstract, no tool/framework lists)24- **Folder Structure**: Key directories and their contents25- **Core Behaviors & Patterns**: Cross-cutting patterns traced through full flows — error propagation chains, state lifecycle transitions, cross-boundary wiring mechanisms, resilience/recovery strategies, shared resource management. Discovered via multi-phase analysis: surface idiom detection, then deep tracing across layers.26- **Conventions**: Naming, code style, API/interface design conventions (callback naming, return value shapes, method responsibility splitting), configuration/registration structure, boundary conventions (error flattening, schema drift absorption, containment rules), component composition patterns.27- **Working Agreements**: Rules for agent behavior and communication2829### Monorepo Root Document (3 Sections)30For the root of a monorepo structure:3132- **Overview**: 1-2 sentences describing the monorepo's purpose33- **Folder Structure**: High-level map of apps, packages, and shared configs34- **Working Agreements**: Common working agreements applicable to all packages3536## Operation Modes3738### Generate vs Update3940- **Generate**: Creates a new `AGENTS.md` from scratch (default when no `AGENTS.md` exists)41- **Update**: Refreshes standard sections in an existing `AGENTS.md` while preserving custom sections. See [./references/update_strategy.md](./references/update_strategy.md) for detailed workflow and section matching rules.4243The agent automatically selects the appropriate mode based on whether an `AGENTS.md` file already exists at the target location.4445### Generation Modes (Monorepo)4647Supports three modes: **All** (root + all packages, default), **Root Only**, and **Single Package**. See [./references/monorepo_strategy.md](./references/monorepo_strategy.md) for detailed strategy and mode selection criteria.4849## Tools5051This skill uses the following read-only tools for repository analysis. See [./references/read_only_commands.md](./references/read_only_commands.md) for detailed usage patterns.5253- **`tokei`**: LOC measurement (required)54- **`rg` (ripgrep)**: Content search (preferred)55- **`grep` / `Select-String`**: Content search (fallback per OS)56- **`sed -n` / `Get-Content \| Select-Object`**: Paginated file reading per OS57- **`tree`**: Directory structure visualization58- **`find`**: File and directory discovery (Linux / macOS)59- **`ls`, `pwd`**: Basic directory navigation6061## Domain Knowledge6263- **LOC Measurement**: Capability to measure repository size and determine character limits. See [./references/loc_measurement.md](./references/loc_measurement.md)64- **Repository Analysis**: Capability to inspect and understand codebase structure. See [./references/read_only_commands.md](./references/read_only_commands.md)65- **Output Template**: Standardized AGENTS.md structure specification. See [./references/agents_md_template.md](./references/agents_md_template.md)66- **Working Agreements**: Agent behavior rules for generated documents. See [./references/working_agreements.md](./references/working_agreements.md)67- **Monorepo Detection**: Capability to identify monorepo structures. See [./references/monorepo_detection.md](./references/monorepo_detection.md)68- **Monorepo Strategy**: Strategy for generating documentation in monorepos. See [./references/monorepo_strategy.md](./references/monorepo_strategy.md)69- **Update Strategy**: Strategy for updating existing AGENTS.md files with selective section refresh. See [./references/update_strategy.md](./references/update_strategy.md)7071## Scope Boundaries7273- **Read-Only Analysis**: Supports non-destructive commands for repository inspection74- **Output Scope**: Produces documentation content only; excludes run/test/build/deploy instructions75- **Excluded Inputs**: Lock files (`pnpm-lock.yaml`, `package-lock.json`, `yarn.lock`, etc.) are outside analysis scope7677---78> Converted and distributed by [TomeVault](https://tomevault.io/claim/buyoung) — claim your Tome and manage your conversions.79<!-- tomevault:4.0:skill_md:2026-04-11 -->