agent-docsCreate documentation optimized for AI agent consumption. Use when writing SKILL.md files, README files, API docs, or any documentation that will be read by LLMs in context windows. Helps structure content for RAG retrieval, token efficiency, and the Hybrid Context Hierarchy.
Install via ClawdBot CLI:
clawdbot install tylervovan/agent-docsWrite documentation that AI agents can efficiently consume. Based on Vercel benchmarks and industry standards (AGENTS.md, llms.txt, CLAUDE.md).
Three-layer architecture for optimal agent performance:
Always in context. 2,000β4,000 tokens max.
# AGENTS.md
> Context: Next.js 16 | Tailwind | Supabase
## π¨ CRITICAL
- NO SECRETS in output
- Use `app/` directory ONLY
## π DOCS INDEX (use read_file)
- Auth: `docs/auth/llms.txt`
- DB: `docs/db/schema.md`
Include:
Fetched on demand. 1Kβ5K token chunks.
Gated by allow-lists. Edge cases only.
Vercel Benchmark (2026):
| Approach | Pass Rate |
|----------|-----------|
| Tool-based retrieval | 53% |
| Retrieval + prompting | 79% |
| Inline AGENTS.md | 100% |
Root cause: Meta-cognitive failure. Agents don't know what they don't knowβthey assume training data is sufficient. Inline docs bypass this entirely.
An 8KB compressed index outperforms a 40KB full dump.
Compress to:
RAG systems split at headers. Each section must be self-contained:
## Database Setup β Chunk boundary
Prerequisites: PostgreSQL 14+
1. Create database...
Rules:
Agents can't autonomously browse. Each link = tool call + latency + potential failure.
| Approach | Token Load | Agent Success |
|----------|------------|---------------|
| Full inline | ~12K | β High |
| Links only | ~2K | β Requires fetching |
| Hybrid | ~4K base | β Best of both |
LLMs have U-shaped attention:
Solution: Put critical rules at TOP of AGENTS.md. Governance first, details later.
Strip everything that isn't essential:
Formats like llms.txt and AGENTS.md mechanically increase SNR.
Machine-readable doc index for agents:
# Project Name
> One-line project description.
## Authentication
- [Setup](docs/auth/setup.md): Environment vars and init
- [Server](docs/auth/server.md): Cookie handling
## Database
- [Schema](docs/db/schema.md): Full Prisma schema
Location: /llms.txt at domain root
Companion: /llms-full.txt β full concatenated docs, HTML stripped
AGENTS.md is part of your codebase. Controlled, version-pinned.
Mitigation: Domain allow-lists, human-in-the-loop for external retrieval.
For detailed guidance on RAG optimization, multi-framework docs, and API templates, see references/advanced-patterns.md.
Generated Mar 1, 2026
A team building AI agents for internal automation uses Agent Docs to structure SKILL.md and README files, ensuring agents efficiently retrieve context from inline AGENTS.md and llms.txt files. This improves pass rates by embedding critical governance and architecture constraints directly in context, reducing reliance on external retrieval.
A company developing APIs consumed by LLM agents applies Agent Docs to create optimized API documentation with compressed indexes and self-contained sections. This enhances RAG retrieval efficiency, minimizing token usage and preventing meta-cognitive failures in agent interactions.
An enterprise uses Agent Docs to document internal tools and workflows for AI agents handling tasks like data processing or reporting. By implementing the Hybrid Context Hierarchy, they ensure security rules and file paths are inline, reducing latency and external dependency risks.
An open-source project adopts Agent Docs to structure its documentation for AI agents that assist with code contributions or issue triaging. This leverages llms.txt standards to provide machine-readable indexes, improving agent success rates in navigating project resources.
Offer a cloud-based platform that automatically generates and optimizes documentation in Agent Docs format for AI agent consumption. Revenue comes from subscription tiers based on usage volume, features like analytics on agent retrieval success, and enterprise support.
Provide consulting services to help organizations integrate Agent Docs into their existing documentation workflows, including training, custom template development, and RAG system optimization. Revenue is generated through project-based fees and ongoing retainer agreements.
Develop and sell tools or plugins for popular documentation frameworks (e.g., Docusaurus, MkDocs) that automate the creation of Agent Docs-compliant content. Revenue streams include one-time purchases, licensing fees, and premium support for advanced features.
π¬ Integration Tip
Start by converting critical governance rules into an inline AGENTS.md file at the top of your documentation, then use llms.txt to create a compressed index for efficient agent retrieval.
Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Clau...
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
Search and analyze your own session logs (older/parent conversations) using jq.
Typed knowledge graph for structured agent memory and composable skills. Use when creating/querying entities (Person, Project, Task, Event, Document), linking related objects, enforcing constraints, planning multi-step actions as graph transformations, or when skills need to share state. Trigger on "remember", "what do I know about", "link X to Y", "show dependencies", entity CRUD, or cross-skill data access.
Ultimate AI agent memory system for Cursor, Claude, ChatGPT & Copilot. WAL protocol + vector search + git-notes + cloud backup. Never lose context again. Vibe-coding ready.
Headless browser automation CLI optimized for AI agents with accessibility tree snapshots and ref-based element selection