You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -7,12 +7,12 @@ Test your documentation site against the [Agent-Friendly Documentation Spec](htt
7
7
8
8
Agents don't use docs like humans. They hit truncation limits, get walls of CSS instead of content, can't follow cross-host redirects, and don't know about quality-of-life improvements like `llms.txt` or `.md` docs pages that would make life swell. Maybe this is because the industry has lacked guidance - until now.
9
9
10
-
afdocs runs 22 checks across 8 categories to evaluate how well your docs serve agent consumers.
10
+
afdocs runs 22 checks across 7 categories to evaluate how well your docs serve agent consumers.
11
11
12
12
> **Status: Early development (0.x)**
13
13
> This project is under active development. Check IDs, CLI flags, and output formats may change between minor versions. Feel free to try it out, but don't build automation against specific output until 1.0.
afdocs includes a scoring module that assigns a 0-100 numerical score to a documentation site's agent-friendliness. The score reflects how well agents can actually use the documentation, not just how many boxes are ticked: checks are weighted by impact, multi-page checks use proportional scoring (3/50 pages failing is different from 48/50), and interaction effects between checks are modeled as coefficients.
139
+
140
+
For a full explanation of how scores are calculated, including check weights, warn coefficients, score caps, and interaction diagnostics, see [How the Agent-Friendly Docs Score Works](SCORING.md).
141
+
142
+
### Scorecard output
143
+
144
+
`--format scorecard` renders the full scorecard: overall score with letter grade, per-category scores, interaction diagnostics (system-level findings that emerge from combinations of check results), and per-check results with fix suggestions.
145
+
146
+
```
147
+
Agent-Friendly Docs Scorecard
148
+
==============================
149
+
150
+
Overall Score: 72 / 100 (C)
151
+
152
+
Category Scores:
153
+
Content Discoverability 72 / 100 (C)
154
+
Markdown Availability 60 / 100 (C)
155
+
Page Size and Truncation Risk 45 / 100 (D)
156
+
...
157
+
158
+
Interaction Diagnostics:
159
+
[!] Markdown support is undiscoverable
160
+
Your site serves markdown at .md URLs, but agents have no way to
161
+
discover this. ...
162
+
163
+
Fix: Add a blockquote directive near the top of each docs page ...
164
+
165
+
Check Results:
166
+
Content Discoverability
167
+
PASS llms-txt-exists llms.txt found at /llms.txt
168
+
WARN llms-txt-size llms.txt is 65,000 characters
169
+
Fix: If it grows further, split into nested llms.txt files ...
170
+
FAIL llms-txt-directive No directive detected on any tested page
171
+
Fix: Add a blockquote near the top of each page ...
console.log(score.resolutions); // { 'llms-txt-directive': 'Add a blockquote near the top...' }
202
+
```
203
+
204
+
`computeScore` takes a `ReportResult` and returns a standalone `ScoreResult`. It does not modify the report. Composition is the consumer's responsibility: the CLI formatters compose them; external consumers call `computeScore()` directly.
205
+
125
206
## Test helpers
126
207
127
208
afdocs includes vitest helpers so you can add agent-friendliness checks to your docs site's CI pipeline. For a ready-to-copy setup with a GitHub Actions workflow, see the [`examples/`](examples/) directory.
0 commit comments