Engineering
agents-md-generator avatar

agents-md-generator

Generate hierarchical, token-efficient AGENTS.md files for AI coding agents to provide repository-wide context and project-specific guidelines.

Introduction

The AGENTS.md Generator is an essential engineering tool designed to structure codebase knowledge for AI-assisted development. By creating a lightweight, hierarchical documentation system, it ensures that coding agents receive the most relevant context without overwhelming their token window. It targets technical leads and developers who need to set up AI-friendly project documentation that follows the 'nearest-wins' hierarchy, ensuring agents always access the most pertinent project standards, patterns, and JIT (Just-In-Time) indexing instructions.

  • Automatically analyzes repository structure, identifying monorepo workspaces, tech stacks, and critical directories.

  • Generates a root AGENTS.md file focusing on universal conventions, security protocols, and high-level project snapshots.

  • Produces sub-folder specific AGENTS.md files containing granular patterns, naming conventions, and code examples ('DO/DON'T').

  • Implements JIT indexing using command-line tools like ripgrep and find to guide agents to relevant code without embedding full source files.

  • Supports specialized templates for design systems, backend API services, database layers, and testing suites.

  • Input: User trigger words like 'create AGENTS.md', 'generate agents', or 'AI documentation setup'.

  • Output: A structured markdown hierarchy consisting of a summary analysis, a lightweight root configuration, and detailed module-level documentation files.

  • Best Practices: Keep root files under 200 lines to preserve token efficiency. Always link sub-files to the root and use absolute path examples for code patterns.

  • Constraints: The skill is optimized for structured project trees (e.g., Turborepo, pnpm workspaces). Ensure that 'Pre-PR' command sections are kept as single, copy-pasteable shell commands for maximum operational speed.

  • Target Use Cases: Onboarding new AI coding agents to an existing repo, enforcing strict architectural patterns across team environments, and reducing hallucination by providing grounded, command-based documentation.

Repository Stats

Stars
21
Forks
2
Open Issues
0
Language
JavaScript
Default Branch
main
Sync Status
Idle
Last Synced
May 3, 2026, 04:36 AM
View on GitHub