|
| 1 | +# Agent readiness: what is done, what is open |
| 2 | + |
| 3 | +This site should be easy for crawlers, language models, and agents to read. It is a |
| 4 | +public personal site; the whole point is to be found and quoted. So the default answer |
| 5 | +to "may I read this?" is yes, and it should be stated out loud rather than left to be |
| 6 | +inferred. |
| 7 | + |
| 8 | +This file records what is in place, what is still open, and why the open items are |
| 9 | +blocked on hosting decisions rather than on writing code. |
| 10 | + |
| 11 | +## Background: two problems, stacked |
| 12 | + |
| 13 | +An agent-readiness scan reported `robots.txt exists but appears invalid (no User-agent |
| 14 | +directive)`. That turned out to be two separate faults sitting on top of each other. |
| 15 | + |
| 16 | +**1. Hugo was never publishing a robots.txt.** `layouts/robots.txt` has been in this |
| 17 | +repo for a long time, but Hugo only renders it when `enableRobotsTXT` is set, and it |
| 18 | +was not. The template was dead code. The `gh-pages` branch contained no `robots.txt` |
| 19 | +at all — confirmed with `git ls-tree origin/gh-pages`. |
| 20 | + |
| 21 | +**2. Cloudflare answered in our place.** With nothing at the origin, the edge served |
| 22 | +its own file: the Content Signals legal preamble and nothing else. Twenty-odd lines of |
| 23 | +comments explaining what content signals mean, followed by no `User-agent` line, no |
| 24 | +`Allow`, no `Disallow`, and no actual signal. Not a valid robots.txt, and not something |
| 25 | +anyone here wrote. Meanwhile Cloudflare's managed bot preferences were blocking AI |
| 26 | +crawlers by a default nobody chose. |
| 27 | + |
| 28 | +Both are now fixed: `enableRobotsTXT: true` in `config.yml`, and Bot Preference Sync |
| 29 | +disabled at the edge so the origin's file is the one that gets served. |
| 30 | + |
| 31 | +The lesson worth keeping: an empty origin is not a neutral origin. Something else will |
| 32 | +fill the gap and speak on your behalf, and what it says may not be what you would have |
| 33 | +said — or even be valid. |
| 34 | + |
| 35 | +## Done (in this repo) |
| 36 | + |
| 37 | +| What | Where | |
| 38 | +| --- | --- | |
| 39 | +| `enableRobotsTXT`, so Hugo actually emits the file | `config.yml` | |
| 40 | +| `robots.txt` — everyone allowed, Content Signals `search=yes, ai-input=yes, ai-train=yes` | `layouts/robots.txt` | |
| 41 | +| Named AI crawler groups repeating the same permissive rules | `layouts/robots.txt` | |
| 42 | +| `llms.txt`, generated from the site's own pages and posts | `config.yml` (`outputFormats.LLMS`) + `layouts/_default/index.llms.txt` | |
| 43 | +| ARD capability manifest | `static/.well-known/ai-catalog.json` | |
| 44 | +| `<link rel="sitemap">` and `<link rel="alternate">` to `llms.txt` | `layouts/partials/extend_head.html` | |
| 45 | + |
| 46 | +Two things worth knowing about how this is wired: |
| 47 | + |
| 48 | +- A crawler that matches one of the named groups in `robots.txt` ignores the wildcard |
| 49 | + group entirely (RFC 9309), which is why the permissive rules are repeated rather |
| 50 | + than inherited. |
| 51 | +- `llms.txt` ranges over `.Site.RegularPages`, so new posts and pages appear in it |
| 52 | + automatically. Nothing to remember on publish. The sitemap was already generated by |
| 53 | + Hugo and was the one thing the scan did not complain about. |
| 54 | + |
| 55 | +## Open: blocked on the hosting setup |
| 56 | + |
| 57 | +These need control over HTTP response headers or DNS. Production publishes to |
| 58 | +`gh-pages` (`.github/workflows/publish-stuff.yml`), and GitHub Pages serves static |
| 59 | +files without letting us set headers. |
| 60 | + |
| 61 | +Note the irony: this repo *already contains* an nginx config and a Dockerfile |
| 62 | +(`nginx/default.conf`), but only for per-PR preview environments. The preview stack can |
| 63 | +set response headers; production cannot. |
| 64 | + |
| 65 | +### 1. `Link` response headers (RFC 8288) |
| 66 | + |
| 67 | +Agents look for discovery hints in headers, not just in HTML. The homepage should send |
| 68 | +something like: |
| 69 | + |
| 70 | +``` |
| 71 | +Link: </llms.txt>; rel="alternate"; type="text/plain", |
| 72 | + </sitemap.xml>; rel="sitemap", |
| 73 | + </.well-known/ai-catalog.json>; rel="service-desc" |
| 74 | +``` |
| 75 | + |
| 76 | +The `<link>` tags in `extend_head.html` are the in-page equivalent and cover agents |
| 77 | +that parse HTML, but header-based checks will not see them. |
| 78 | + |
| 79 | +*Blocked by:* no header control on GitHub Pages. Three lines of `add_header` in |
| 80 | +`nginx/default.conf` the moment production runs that container. |
| 81 | + |
| 82 | +### 2. Markdown for Agents |
| 83 | + |
| 84 | +Requests sending `Accept: text/markdown` should get markdown back, with HTML staying |
| 85 | +the default for browsers. Verified as not happening today. |
| 86 | + |
| 87 | +This site is a particularly silly place to be missing it, because everything in |
| 88 | +`content/` *is already markdown*. We render it to HTML at build time and then have no |
| 89 | +way to hand back the source. Hugo can emit a markdown output format alongside HTML |
| 90 | +without much trouble; what is missing is the content negotiation, which is a server |
| 91 | +concern. |
| 92 | + |
| 93 | +*Blocked by:* a Cloudflare feature on this account, where an origin we run could do the |
| 94 | +negotiation directly against markdown we already have. |
| 95 | + |
| 96 | +### 3. DNS for AI Discovery (DNS-AID) |
| 97 | + |
| 98 | +SVCB/HTTPS records under `_index._agents.koudijs.dev` pointing at the discovery |
| 99 | +documents, with DNSSEC on the zone. |
| 100 | + |
| 101 | +*Blocked by:* nothing expensive — this is DNS and is achievable wherever the zone |
| 102 | +lives. Parked because the spec is still an IETF draft |
| 103 | +(`draft-mozleywilliams-dnsop-dnsaid`) and it is the lowest-value item here. |
| 104 | + |
| 105 | +### 4. Check what the edge blocks |
| 106 | + |
| 107 | +Independently of `robots.txt`: if any managed AI-bot blocking is still active in |
| 108 | +Cloudflare's AI Crawl Control, it overrides our permissive rules at the edge and a |
| 109 | +crawler never reaches the origin to read the welcome. Re-verify after any change to the |
| 110 | +proxy setup. |
| 111 | + |
| 112 | +## Observation: previews are crawlable |
| 113 | + |
| 114 | +`layouts/robots.txt` has a guard meant to serve `Disallow: /` for non-production |
| 115 | +builds. It cannot currently fire: the condition is |
| 116 | +`hugo.IsProduction | or (eq .Site.Params.env "production")`, and `params.env` is |
| 117 | +hardcoded to `production` in `config.yml`, so the production branch always wins. |
| 118 | +Preview builds at `pr<N>.preview.koudijs.dev` therefore serve the permissive rules. |
| 119 | + |
| 120 | +This predates the changes here and the risk is low, since preview URLs are not linked |
| 121 | +from anywhere. Left alone deliberately, because the obvious fix — setting |
| 122 | +`HUGO_PARAMS_env: development` in `preview-image.yml` — would also switch off |
| 123 | +OpenGraph, analytics, and schema.org output in previews, making them a less faithful |
| 124 | +copy of production. If it is worth fixing, the cleaner route is to set |
| 125 | +`HUGO_ENVIRONMENT: development` for previews and drop the `params.env` half of the |
| 126 | +condition, so `hugo.IsProduction` alone decides. |
| 127 | + |
| 128 | +## Not applicable |
| 129 | + |
| 130 | +Several agent-readiness checks assume a site with an API behind it. This is a personal |
| 131 | +site and blog, so these are deliberately absent rather than missing: |
| 132 | + |
| 133 | +- `/.well-known/api-catalog` (RFC 9727) |
| 134 | +- `/.well-known/openid-configuration`, `/.well-known/oauth-authorization-server` |
| 135 | +- `/.well-known/oauth-protected-resource` (RFC 9728) |
| 136 | +- `auth.md` |
| 137 | +- `/.well-known/mcp/server-card.json` |
| 138 | +- `/.well-known/agent-skills/index.json` — no skills to publish |
| 139 | +- WebMCP tools |
| 140 | + |
| 141 | +Publishing empty versions of these would satisfy a checker while pointing agents at |
| 142 | +nothing, which is worse than not publishing them. |
| 143 | + |
| 144 | +## The direction |
| 145 | + |
| 146 | +The intent is to move the public sites onto our own cluster and stop depending on |
| 147 | +GitHub Pages. Cloudflare may stay as a proxy, or go entirely. Either way, once there is |
| 148 | +an origin we control: |
| 149 | + |
| 150 | +- `Link` headers become a few lines of nginx config — in a file this repo already has. |
| 151 | +- Markdown content negotiation becomes part of the build, using markdown that is |
| 152 | + already sitting in `content/`. |
| 153 | +- Nothing about discovery is gated behind someone else's pricing tier, or their default |
| 154 | + opinion about who may read this. |
| 155 | + |
| 156 | +## How to verify |
| 157 | + |
| 158 | +```sh |
| 159 | +curl -sS https://koudijs.dev/robots.txt |
| 160 | +curl -sS https://koudijs.dev/llms.txt |
| 161 | +curl -sS https://koudijs.dev/sitemap.xml |
| 162 | +curl -sS https://koudijs.dev/.well-known/ai-catalog.json | python3 -m json.tool |
| 163 | +curl -sS -D - -o /dev/null https://koudijs.dev/ | grep -i '^link:' |
| 164 | +curl -sS -D - -o /dev/null -H 'Accept: text/markdown' https://koudijs.dev/ | grep -i '^content-type:' |
| 165 | +``` |
| 166 | + |
| 167 | +The last two are the open items: today they return nothing and `text/html`. |
| 168 | + |
| 169 | +Locally, `hugo --minify` writes all of the above into `public/`. To check the preview |
| 170 | +branch of the robots template: `hugo -e development --minify` with |
| 171 | +`HUGO_PARAMS_env=development`. |
0 commit comments