Audit structure and findability

docsbot audit scores a docs set out of 100 and writes a report that explains each score and ends with a fix-first list. Use it to decide where to spend a docs sprint, or to track a docs set over time.

Scores are indicators from fixed rules, not measurements of reader success. The defaults are starting values; change them to match your style guide.

Run an audit

docsbot audit docs -o audit.md
**Score: 62/100** (structure 57, findability 71) across 8 pages.

## Fix first
1. `docs/configure.md:1` Missing required metadata: description _(metadata)_
2. `docs/configure.md:1` how-to page lacks numbered steps _(templates)_
...

Run one part only with docsbot audit structure or docsbot audit findability. Use -f json for a machine-readable report, and --items 0 to list every item instead of the top ten per dimension.

What is scored

Each dimension states its method and weight in the report.

Structure

Dimension Default weight Checks
content-types 1 every page has a recognisable type: tutorial, how-to, reference, explanation, landing
templates 1.5 each type has what its template requires, for example numbered steps in a how-to
titles-headings 1 titles and heading structure
page-shape 1 pages under 100 words or over 3000, sections over 600 words without a subheading
metadata 1.5 required (title, description) and recommended (tags, owner) front matter
duplication 1 pages that overlap heavily
terminology 1 aliases used instead of preferred terms (needs a vocabulary)
navigation 1 pages in the navigation, entries at most 3 levels deep, menus with at most 15 entries
ownership-freshness 0.5 pages with an owner, pages changed in the last 365 days
urls 0.5 URLs that are lower case, use hyphens, have no file extension, are at most 80 characters and 5 segments deep

Findability

Dimension Default weight Checks
click-paths 1.5 pages reachable within 3 clicks of the entry page
search 2 your reader tasks find the right page in the top 3 of a local search
query-log 1 real searches from your site find an answer
discovery-metadata 1 descriptions and other metadata search engines and agents use
cross-linking 1 pages link to related pages

Test search with real reader tasks

Without a tasks file, search is scored with a proxy: each page is searched by its own title. That finds titles that do not distinguish pages, but it is not a real test. Give docsbot the tasks your readers have:

# tasks.yaml
tasks:
  - task: Install on Windows
    queries: [install windows, windows installer]
    expect: [install/windows.md]      # route, file path or URL; any one answers it
  - task: Change the server port
    queries: [server port, change port]
    expect: [reference/config.md, configure.md]

And, if you have one, a log of real searches exported from your site search, as CSV with a query column and an optional count column:

docsbot audit findability docs --tasks tasks.yaml --query-log searches.csv

Search uses a local BM25 index as a stand-in for your site’s search.

Fit the audit to your style guide

audit:
  required_metadata: [title, description, owner]
  recommended_metadata: [tags]
  max_clicks: 3
  stale_days: 180
  templates:                    # replaces the defaults for these content types
    how-to: {steps: true, required_headings: ["prerequisites|before you begin"]}
    reference: {structured: true}
    landing: {min_links: 5}
  weights: {search: 3, urls: 0}
graph:
  content_types:                # when front matter and the heuristics get it wrong
    "reference/**": reference

See audit settings for every key.

Fail a build on a low score

docsbot audit docs --fail-under 70

Exit code 1 means the score is below the threshold.