Using the WAT Framework: Writing Sanity MCP Workflows That Make Claude Consistent and Reliable
Last updated: 15.03.2026
Using the WAT Framework: Writing Sanity MCP Workflows That Make Claude Consistent and Reliable
Audio Narration

The text explains why open-ended AI instructions like “write a blog post about TypeScript” lead to inconsistent results. Because models are probabilistic, they vary structure, miss fields, and overlook edge cases, which is problematic for repetitive, structured tasks such as publishing to a CMS. To solve this, it introduces the WAT framework: Workflows, Agents, Tools. Workflows are plain-language markdown SOPs that encode domain knowledge and specify steps. Agents (Claude) handle reasoning and decisions. Tools are deterministic scripts or APIs, like the Sanity MCP, that execute actions. This separation narrows the decision space and keeps behavior consistent across sessions. A concrete example is the draft_blog_post workflow, which fetches authors and categories from Sanity, requires outline approval, and strictly defines document shape and constraints, including a 5000-byte body limit. Workflows evolve through a self-improvement loop: each failure adds new rules and edge cases. To get started, you document repeatable tasks, inputs, tools, steps, and edge cases, store them in .claude/wat/workflows/, and reuse them for faster, cheaper, and more reliable AI-assisted work.
The Problem With Asking AI to "Just Figure It Out"
When you give Claude an open-ended task like "write a blog post about TypeScript," you get a different result every time. The structure varies. Fields get missed. Edge cases are ignored. That's not a bug — it's the nature of probabilistic reasoning. Without constraints, the model explores a wide solution space. For repetitive, structured tasks like publishing content to a CMS, that's a liability.
What the WAT Framework Is
WAT stands for Workflows, Agents, Tools. It's a three-layer architecture that separates concerns: Workflows are plain-language markdown SOPs that define what needs to happen and how. Agents — Claude — handle reasoning, sequencing, and decision-making. Tools are deterministic scripts or APIs (like the Sanity MCP) that do the actual execution. Each layer does what it does best. The workflow encodes your domain knowledge. Claude handles judgment calls. The tools handle the mechanics.
Why Workflows Make AI Better
A workflow narrows the decision space. Instead of reasoning from scratch each time, Claude follows a defined path: collect inputs, fetch context, draft an outline, get approval, write content, create the document. Every step is explicit. Edge cases are handled in advance. The result is consistent, repeatable behavior — more like a reliable colleague following a process than a creative generalist making it up as they go. If each step is 90% accurate and you have five steps, an improvised chain lands at 59% success. A workflow keeps you close to 90% at every step.
Building a Sanity MCP Workflow
The draft_blog_post workflow is a practical example. It starts by fetching authors and categories from Sanity via GROQ so references are always valid. It requires outline approval before writing — a quality gate that prevents wasted effort. The document shape is specified exactly: the Portable Text body structure, SEO fields, what not to set (autoSummary is generated on publish). Discovered constraints get documented too, like the 5000-byte body limit imposed by the audio narration pipeline.
The Self-Improvement Loop
Workflows are not static. When you hit a slug conflict, you add a rule: append -draft. When you discover the body size limit, you document it and add a trimming instruction. Each failure makes the workflow stronger. Over time it accumulates hard-won knowledge about your specific setup — knowledge that would otherwise live only in your head or get rediscovered every session.
Getting Started With Your Own Workflows
A good workflow starts with a repeatable task you find yourself explaining more than once. Write down the inputs, the steps, which tools to call, and the expected output. Add an edge cases table as you encounter them. Store it in .claude/wat/workflows/ and reference it by name when you start a task. The payoff compounds: every session that follows the workflow is faster, more consistent, and cheaper than one that improvises from scratch.

6 Claude Power Prompts That Change How You Build
Most people use Claude as a smarter search engine, but it can be a disciplined collaborator if you structure your prompts. The article outlines six patterns to unlock this mode. First, launch subagents to split work: one checks brand tone, another reviews code, a third drafts copy, each operating independently to avoid context bleed. Second, write a spec before coding, clarifying purpose, scope, and key decisions while changes are still cheap. Third, have Claude interview you first to surface hidden assumptions, co-create a spec, and get approval before implementation. Fourth, define how success will be verified upfront, then actually run that check afterward, especially for sensitive systems like payments or auth. Fifth, convert productive sessions into a reusable SKILL.md, including gotchas so lessons persist beyond the chat. Sixth, once a workflow is proven through manual runs, automate it via scripts, cron jobs, or CI. All six follow a meta-pattern: plan → build → verify → learn → automate, shifting you from just prompting Claude to designing how it works with you.
Read post
How I Used My Own Blog to Research My Presentation About It
The author needed a fast way to collect 14 blog posts for a presentation without manually copy-pasting from the browser. Fortunately, the blog already exposed each post as clean markdown at /md/posts/[slug], originally built for AI tools. This endpoint strips away HTML, navigation, and cookie banners, returning only the core content, which the author then fed into Claude for rapid reading and summarisation. Before working with individual posts, the author used /llms.txt, a structured, machine-readable index of the site similar to robots.txt but designed for AI discovery. Claude used this index to understand the site’s structure and locate relevant posts. For the presentation itself, the author used Slidev, a markdown-based slide tool, allowing Claude to generate and refine slides directly in markdown. The experience highlighted a “meta” benefit: infrastructure built for AI and other developers ended up being most useful to the author, demonstrating that investing in AI-friendly content formats can pay off immediately for the site owner.
Read post