---
title: "Can AI agents find and read your docs site? Get a scorecard (with recommended remedies) in one command"
url: https://www.marlasowards.com/blog/agent-friendly-docs-spec
description: "\"Can agents read your documentation?\" This is the question Dachary Carey asks those of us who operate docs sites. Dachary's Agent-Friendly Documentation Spec defines 28 checks docs sites should pass to serve AI agents well. I put the spec up against my own site by running it through the companion AFDocs tool, which gave me a scorecard on where my site stands and what I can fix. Here's what I learned from the crystal-clear spec and why I think every docs site owner should run AFDocs as part of a CI pipeline."
author: Blog post by Marla Sowards
---

> For an index of every page on this site, see [llms.txt](https://www.marlasowards.com/llms.txt).

# Can AI agents find and read your docs site? Get a scorecard (with recommended remedies) in one command

"Can agents read your documentation?" This is the question Dachary Carey asks those of us who operate docs sites. Dachary's [Agent-Friendly Documentation Spec](https://agentdocsspec.com/) defines 28 checks docs sites should pass to serve AI agents well. I put the spec up against my own site by running it through the companion [AFDocs](https://afdocs.dev/) tool, which gave me a scorecard on where my site stands and what I can fix. Here's what I learned from the crystal-clear spec and why I think every docs site owner should run AFDocs as part of a CI pipeline.

## The spec

Dachary's [research](https://agentdocsspec.com/#background) led to 28 checks that show if a docs site is discoverable and consumable by agents. Here are a few examples.

### Serve an `llms.txt` file

An `llms.txt` file is a Markdown file that acts like a table of contents agents use to find meaningful information throughout a site. It lets agents skip parsing through JavaScript, layout markup, and content that isn't relevant, so responses are faster and better quality. See [MongoDB's `llms.txt`](https://www.mongodb.com/docs/llms.txt) for an example.

The [`llms-txt-exists`](https://agentdocsspec.com/spec/web/content-discoverability/#llms-txt-exists) check looks for an `llms.txt` file stored at or near the root of a docs site. For example:

```text
docs.example.com/llms.txt
example.com/docs/llms.txt
example.com/llms.txt
```

### Format the `llms.txt` file properly

The [`llms-txt-valid`](https://agentdocsspec.com/spec/web/content-discoverability/#llms-txt-valid) check validates that the `llms.txt` file follows the structure defined in the [llmstxt.org](https://llmstxt.org/) proposal. For example:

```markdown
# Title

> Description goes here

Details go here

## Section name

- [Link title](https://link_url): Link details
- [Link title](https://link_url): Link details
- [Link title](https://link_url): Link details

## Optional

- [Link title](https://link_url)
- [Link title](https://link_url)
- [Link title](https://link_url)
```

### Limit the size of the `llms.txt` file

The [`llms-txt-size`](https://agentdocsspec.com/spec/web/content-discoverability/#llms-txt-size) check validates the `llms.txt` file is under 50K characters. If the `llms.txt` file is too long, agents may not read it all.

### Point agents to the `llms.txt` file

Agents need to be told to look for an `llms.txt` file in the first place. The [`llms-txt-directive-html`](https://agentdocsspec.com/spec/web/content-discoverability/#llms-txt-directive-html) and [`llms-txt-directive-md`](https://agentdocsspec.com/spec/web/content-discoverability/#llms-txt-directive-md) checks look in the code of the HTML and Markdown files for agent directives like:

```text
> For the complete documentation index, see docs.example.com/llms.txt.
```

### Serve raw Markdown versions of each page

According to the spec, agents work better with Markdown than HTML because converting HTML to Markdown is lossy and unpredictable. Agents like Claude Code and Cursor even ask websites for Markdown when they fetch a page. The [`markdown-url-support`](https://agentdocsspec.com/spec/web/markdown-availability/#markdown-url-support) check makes sure articles are published as Markdown files with `.md` URL endings alongside the HTML files. For example:

```text
docs.example.com/add-a-file.html
docs.example.com/add-a-file.md
```

### Keep Markdown pages under 50K characters

Agent truncation limits can mean long Markdown pages aren't fully read in a single agent fetch. The [`page-size-markdown`](https://agentdocsspec.com/spec/web/page-size/#page-size-markdown) check recommends no single page is more than 50K.

## The test

I ran the [AFDocs](https://afdocs.dev/) test to get a scorecard on how well my site matched up to the spec. AFDocs couldn't be easier to use. If you have Node.js 22+, no install needed. Just run:

```text
npx afdocs check https://docs.example.com --format scorecard
```

The first time I ran it, AFDocs threw some errors and warnings. For example:

```text
⚠ llms-txt-directive-html: llms.txt directive found in HTML of 1 of 50 sampled pages (49 missing)

  Learn more: https://agentdocsspec.com/spec/web/content-discoverability/#llms-txt-directive-html
```

This is a problem for AI agents that ask for HTML instead of Markdown (like OpenAI Codex and GitHub Copilot). Thanks to the results, I knew I needed to add a directive near the top of the content on each HTML page.

After I fixed that and worked out other issues, I was proud to get this scorecard. Still working toward all A+s!

```text
Overall Score: 98 / 100 (A)

Category Scores:
  Content Discoverability              100 / 100 (A+)
  Markdown Availability                 96 / 100 (A)
  Page Size and Truncation Risk         94 / 100 (A)
  Content Structure                    100 / 100 (A+)
  URL Stability and Redirects          100 / 100 (A+)
  Observability and Content Health      99 / 100 (A)
  Authentication and Access            100 / 100 (A+)
```

## The CI pipeline check

Finally, I [added AFDocs checks in my CI pipeline](https://afdocs.dev/ci-integration) alongside [Vale](https://vale.sh/), [lychee](https://lychee.cli.rs/), and [codespell](https://github.com/codespell-project/codespell). If any single AFDocs check comes back as a failure, the job fails. I need to know immediately if agents will have issues finding and reading site content.

## Next up

Some [cool things are on the agent-friendliness roadmap](https://agentdocsspec.com/spec/#planned), like companion specifications around content composition (factual consistency across pages, structure, and density).

Grateful to Dachary for sharing the spec and AFDocs with the tech writing community! Learn about [Dachary's other work](https://dacharycarey.com/). Let me know if you've run AFDocs on your docs site!
