Skip to content

Working with AI

Shavin gives your AI agent three things: the rules, a way to look up the real API instead of guessing, and checks that catch what it gets wrong. It works with any agent that supports MCP, such as Claude Code, Cursor and VS Code.

Why agents need more than a prompt

Agents follow design rules well early in a conversation and drift as it grows: invented props, palette colours, spacing by eye. Pasting the rules again does not scale. Shavin moves the rules to the moment they are needed: the agent asks the MCP server for a component's props before writing it, validates the code after, and the main lookup and check tools end their results with a short hint about what to call next. Shavin code is also short, so files cost fewer tokens to read and more of the conversation stays on your task.

  1. 01

    Look up

    get_components and get_tokens return the real props and token names.

  2. 02

    Plan

    For pages, plan_page picks a composition for each section.

  3. 03

    Write

    The agent writes the code from what it looked up.

  4. 04

    Check

    validate_code and audit_source find problems; autofix_code fixes the mechanical ones.

  5. 05

    Live audit

    get_live_audit reads problems from the page running in the browser.

Repeats for every change, so long conversations get the same checks as short ones.

What an agent does on each change when the Shavin MCP server is connected.

→ get_components({ name: "Button" })
variants: variant=[solid*/soft/outline/ghost], tone=[brand*/danger], size=[sm/md*/lg]
props: asChild?:boolean; truncate?:boolean=true; iconLeft?:ReactNode; iconRight?:ReactNode

The first draft used a palette grey, a raw hex and a literal radius.

→ validate_code({ code })
FAIL (2 violations): [hex=[#635BFF] -> USE bg-*/text-*]; [tailwind-colors=[text-gray-500] -> USE bg-surface, text-fg, border-hairline]
AUTOFIX (1): Replaced literal rounded-xl with rounded-[var(--radius-panel)]

After the agent switched to color="subtle" and the default brand Button.

→ validate_code({ code })
PASS: token pure; component variants/props valid.

A real exchange: the agent looks up Button, writes a pricing card, and validation catches two mistakes before they ship.

What your agent gets

Rules

SHAVIN.md holds your project's design brief: site type, brand, density, radius. AGENTS.md and CLAUDE.md tell the agent how to work. 9 skills in .agents/skills/ cover apps, web pages, layout compositions, motion and review.

Lookups

get_components returns a component's real props and variants, get_tokens the token names, get_block_template a starting block, and plan_page a section-by-section plan for a page.

Checks

validate_code checks a snippet, audit_source checks files, autofix_code fixes what it can, check_page compares a page with its plan, and get_live_audit reads problems from the page running in your browser.

All 32 tools are listed in MCP setup.

Set it up

npx @shavin/cli init does all of this and asks before installing the agent packages. To add it to a project that already has Shavin:

npm install -D @shavin/mcp @shavin/skills
npx @shavin/skills

The second command copies the skills into .agents/skills/. Then register the MCP server with your agent; see MCP setup.

Pick the workflow by task

TaskTools, in order
Landing page, pricing, editorial pageplan_page → build each section → check_page
App screen, dashboard, settingsget_skill("shavin-app") → get_components for the shell, tables and forms
One block or componentget_block_template → get_components → validate_code
Scroll-driven motionFinish the static page, then get_skill("layout-choreography")
Review existing UIaudit_source → autofix_code → get_skill("visual-compositor")

You don't need to name the tools. Ask for the result ("build a pricing page for our three plans") and the agent picks the workflow from AGENTS.md and CLAUDE.md.

Agents without MCP

Generate a compact brief of your project's design system and paste it into the chat:

npx @shavin/cli context

It also saves the brief to .shavin/prompts/context-latest.md. Point the agent at .agents/skills/core-rules.md, and run npx shavin-lint-tokens on its output.

What to expect

  • Agents still make mistakes. With Shavin they make fewer, and the checks find most of the rest.
  • Passing the checks is not a design review. Look at the page at phone, tablet and desktop widths before you ship.
Configure Theme
Theme
Brand Color
Custom
Gray Family
Appearance
Radius
Scaling
Panel Style
Heading Font
Body Font