Skip to content
Design preview: examples use a local mock server.

The design preview

What exists today, what the API adds on top of it, and why the docs come before the service.

The Watership Check API doesn’t run anywhere yet. This page says what’s real, what’s designed, and why the documentation came first.

What already exists

The API is a thin layer over parts of Watership that already work:

  • The check engine. A JavaScript module with no dependencies that runs the mechanical checks of the Watership Vale package, read from that package’s checks.json. It takes text, returns findings with rule ids, levels, and positions, and runs in Node.js or a browser. Every finding example in these docs is the engine’s real output, generated from it when the docs are built.
  • The MCP server. A Model Context Protocol server that gives AI tools the same checks, plus rule lookup and search. It runs the engine in a worker thread with a time limit, and it enforces the limits this API keeps: 100,000 characters of text, 500 findings per check, 5 seconds per check, and 120 requests a minute.
  • The guides and their data. The style guide, the UX writing guide, the slop guard, the terminology list, and the voices are written, and each exports its rules or entries as JSON. The rule, term, and voice examples in the spec come from those exports.

What the API adds

The engine is a library, and the MCP server speaks a protocol built for AI clients. Neither suits a CI job, an editor plugin, or a content management system that wants to send text over HTTP and get structured findings back. The API is that HTTP interface:

Engine or MCP serverAPI
engine.check(text, { format, minLevel })POST /v1/checks with format and min_level
The check_text toolPOST /v1/checks, with findings as a flat list instead of grouped by level
The search_rules toolGET /v1/rules?q=...
Rule data in each guide’s rules.jsonGET /v1/rules and GET /v1/rules/{rule_id}
The terminology list’s terms.jsonGET /v1/terms and GET /v1/terms/{term_id}
The voices’ voices.jsonGET /v1/voices and GET /v1/voices/{voice_id}

Some things stay out. The MCP server’s review_draft tool assembles a review brief for an AI tool to complete. That depends on judgment, so it has no place in an API that promises the same findings for the same text.

Why the docs come first

Writing the documentation before the service is a way to design the API. A tutorial shows whether the first request is easy to make. An errors page shows whether every failure has a clear next step. A task page for CI shows whether the response has what a pipeline needs, like a count of errors that survives truncation. Problems found in a draft spec cost an edit. Problems found after release cost a version.

The spec at /openapi.yaml is the single source for the reference pages, the mock server, and the request examples. It’s linted on every build with a strict ruleset, and the build fails on any problem, including an em dash in a description.

What the mock can and can’t show

The mock server validates every request against the spec and answers with the spec’s examples. It shows the shape of every request and response, every error, and every header. It can’t show behavior that depends on the text: it responds with the same findings whatever you send. Run the mock server lists the gaps and how to work around them.

On this page