# Fix: Bare CLI User-Agent receives the markdown twin

> Web-audit fix skill for the `markdown-cli-ua` check (Content for agents, MAY).

## Goal

Serve the markdown twin to shell HTTP clients that state no content-type preference.

## Fix

Sniff the request User-Agent and serve the markdown twin to bare shell clients (`curl`, `wget`,
and language HTTP libraries) that send `Accept: */*` or no `Accept` at all. A scripted `curl
https://your.site/` should get the raw markdown source, not the HTML shell, so pipelines parse
content instead of scraping chrome. Return the same twin you already expose to
`Accept: text/markdown`, keyed on the User-Agent this time.

## Resources

- [RFC 7763 (text/markdown)](https://www.rfc-editor.org/rfc/rfc7763)
- [RFC 9110 (User-Agent)](https://www.rfc-editor.org/rfc/rfc9110#name-user-agent)

## Copy-paste prompt

Paste this into your coding agent. [Your audit](https://anc.dev/audit) adds what it observed for this check:

```text
Goal: Serve the markdown twin to shell HTTP clients that state no content-type preference
Fix: Sniff the request User-Agent and serve the markdown twin to bare shell clients (`curl`, `wget`, and language HTTP libraries) that send `Accept: */*` or no `Accept` at all. A scripted `curl https://your.site/` should get the raw markdown source, not the HTML shell, so pipelines parse content instead of scraping chrome. Return the same twin you already expose to `Accept: text/markdown`, keyed on the User-Agent this time.
Skill: https://anc.dev/fix/markdown-cli-ua
Docs: https://www.rfc-editor.org/rfc/rfc7763, https://www.rfc-editor.org/rfc/rfc9110#name-user-agent
```

## Verify

Re-run the audit at [https://anc.dev/audit](https://anc.dev/audit) or call the `audit_website` MCP tool; the `markdown-cli-ua` check should report `pass`.
