# Plugin Spec: Design Assay for Claude Code (draft)

The protocol as something you run, not just read. Ships after Assay 001, so it encodes a process that has worked once.

## Shape

A Claude Code plugin with skills for each protocol stage, plus a local MCP server that does the heavy lifting.

```
design-assay-plugin/
  .claude-plugin/plugin.json
  skills/
    assay-target/SKILL.md     Stage 0: build target.json with the user
    assay-genome/SKILL.md     Stage 1: extract or write genome.json from a codebase or Figma
    assay-run/SKILL.md        Stages 2 to 5: generate, render, score, select, loop
    assay-review/SKILL.md     Stage 6: present finalists, log decisions with reasons
    assay-report/SKILL.md     Stage 8: write the case study from summary.json
  .mcp.json                   registers the design-assay MCP server
  server/                     MCP server (TypeScript)
```

## MCP server tools

| Tool | Input | Output |
|---|---|---|
| `genome_validate` | `genome.json` | Errors or ok |
| `variants_generate` | genome, parents, count, mutation settings, seed | Variant JSON files |
| `render_batch` | variant ids, widths, themes | Screenshot and DOM paths |
| `gates_run` | variant ids | Pass or fail per gate |
| `measure_run` | variant ids, function ids | Scores |
| `judge_run` | variant ids, rubric ids, judge models | Median scores plus raw judge output |
| `select` | generation id, keep share, diversity weight | Survivor ids |
| `summary_build` | run id | `summary.json` |

## Model routing

- Variation (mutation, crossover): local inference via Ollama by default. Model configurable, default `qwen3.5`.
- Judged functions: frontier models, configurable, calibrated per `02`.
- All model names and versions are written to the run record.

## Principles

- Every tool writes to the run record. Nothing important lives only in chat.
- Deterministic where possible: same seed and genome give the same variants.
- Works offline for generation, render, gates and measured functions.
- Human review is never skipped by the plugin.

## Distribution

- MIT license.
- Install from the GitHub repo first. Submit to plugin marketplaces once Assay 002 is published.
