AFDocs logo

AFDocs

CI npm

Test your documentation site against the [Agent-Friendly Documentation Spec](https://agentdocsspec.com/spec/web/). AFDocs runs checks across 7 categories to measure how well AI coding agents can discover, navigate, and consume your docs. Powering [Agent Score](https://buildwithfern.com/agent-score) by Fern. > **Status: Early development (0.x)** > Check IDs, CLI flags, and output formats may change between minor versions. > Implements [spec v0.6.0](https://agentdocsspec.com/spec/web/) (2026-09-13). ## Quick start ```bash npx afdocs check https://docs.example.com --format scorecard ``` ``` Agent-Friendly Docs Scorecard ============================== Overall Score: 72 / 100 (C) Category Scores: Content Discoverability 72 / 100 (C) Markdown Availability 60 / 100 (C) Page Size and Truncation Risk 45 / 100 (D) ... Interaction Diagnostics: [!] Markdown support is undiscoverable Your site serves markdown at .md URLs, but agents have no way to discover this. ... Check Results: Content Discoverability PASS llms-txt-exists llms.txt found at /llms.txt WARN llms-txt-size llms.txt is 65,000 characters Fix: If it grows further, split into nested llms.txt files ... FAIL llms-txt-directive-html No directive detected in HTML of any tested page Fix: Add a visually-hidden element near the top of each page ... ``` ## Install ```bash npm install -g afdocs ``` Or as a dev dependency for CI: ```bash npm install -D afdocs ``` Requires Node.js 22 or later. ## Documentation Full documentation is available at **[afdocs.dev](https://afdocs.dev)**: - [Understand Your Score](https://afdocs.dev/what-is-agent-score) — what the score means and how it's calculated - [Improve Your Score](https://afdocs.dev/improve-your-score) — prioritized fix guide - [Checks Reference](https://afdocs.dev/checks/) — all 28 checks with fix suggestions - [CLI Reference](https://afdocs.dev/reference/cli) — flags, output formats, sampling strategies - [CI Integration](https://afdocs.dev/ci-integration) — vitest helpers for your pipeline - [Programmatic API](https://afdocs.dev/reference/programmatic-api) — TypeScript API for custom tooling ## Powered by AFDocs Hosted scoring services from Fern, Mintlify, Document360, and Documentation.ai, the CNCF's CLOMonitor, and several open-source tools run AFDocs under the hood. The full list, the listing criteria, and a badge are at [afdocs.dev/powered-by](https://afdocs.dev/powered-by). ## Responsible use AFDocs makes HTTP requests to the sites it checks. It enforces delays between requests (200ms default), caps concurrent connections, and honors `Retry-After` headers. ## License MIT