mcp eval.instructions.md

Instructions for an evaluation harness that tests how well coding agents build UI components with Storybook and its MCP tools. Storybook is a tool for developing and viewing interface components in isolation.

In plain words
What is it for?
Use it to run single or batch coding-agent evaluations, choose different context modes, execute trials, grade generated interfaces, and produce reports.
Why use it?
It provides a repeatable way to prepare projects, run agent trials, check the results, and compare quality. Checks include building, types, linting, tests, and accessibility.

Instructions file for GitHub Copilot

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/storybookjs/mcp/eval
Clone the repo
git clone --depth 1 https://github.com/storybookjs/mcp

Made for: GitHub Copilot.

Per session 6,476 This file is loaded in full into every session.
When invoked 6,476 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.06476 $0.06476
Opus 5 $0.03238 $0.03238
Sonnet 5 $0.01295 $0.01295
Haiku 4.5 $0.00648 $0.00648

Measured 2d ago against content hash 977f1f97fb4b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mcp eval.instructions.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/instructions/eval.instructions.md · 757 lines

How it starts

The opening of the file, as written. The whole thing — 757 lines — stays where its author put it; the contents beside it link to each section on GitHub.

---
applyTo: 'eval/**'
---

# Copilot Instructions for Storybook MCP Eval Harness

## Project Overview

This is an eval harness for testing AI coding agents' ability to build UI components using Storybook and MCP tools. The harness automates the process of running trials, executing agents with prompts, and grading the results through multiple quality metrics.

**Core Purpose**: Measure how effectively AI agents can use Storybook's MCP tools to build production-quality UI components.

## Architecture

### Harness Flow

1. **Prepare**: Create fresh Vite + React + Storybook project from template
2. **Execute**: Run AI agent (Claude Code CLI) with prompt and optional context
3. **Grade**: Run automated checks (build, typecheck, lint, tests, a11y)
4. **Report**: Generate metrics, save results, optionally upload to Google Sheets

### Key Components

- **CLI Interface**: Two modes:
  - `eval.ts` - Batch eval runner for running multiple trials across variants
  - `advanced-eval.ts` - Single trial runner with interactive CLI
- **Context System**: Five context modes (none, Storybook MCP - Dev, Storybook MCP - Docs, custom MCP server, extra prompts)
- **Agent Abstraction**: Pluggable agent implementations (currently Claude Code CLI)
- **Grading Pipeline**: Parallel execution of multiple quality checks
- **Hooks System**: Lifecycle hooks for custom trial logic
- **Telemetry**: Optional results upload to Google Sheets for tracking

### File Structure

```
eval/
├── eval.ts                          # Batch eval runner (multiple trials)
├── advanced-eval.ts                 # Single trial runner (interactive)
├── types.ts                         # Core types and schemas
├── lib/
│   ├── collect-args.ts              # Interactive CLI argument collection (for advanced-eval)
│   ├── show-help.ts                 # Help text formatting
│   ├── generate-prompt.ts           # Combines prompt parts
│   ├── prepare-trial.ts             # Project template setup
│   ├── teardown-trial.ts            # Trial cleanup (stop dev servers, etc.)
│   ├── storybook-dev-server.ts      # Storybook dev server management
│   ├── agents/
│   │   └── claude-code-cli.ts       # Claude Code CLI agent implementation
│   ├── eval/                        # Batch eval runner logic
│   │   ├── collect-eval-args.ts     # Collect args for batch eval
│   │   ├── run-eval.ts              # Main eval orchestration
│   │   ├── types.ts                 # Eval-specific types
│   │   └── progress-ui.ts           # Progress display
│   └── graders/
│       ├── grade.ts                 # Main grading orchestrator
│       ├── prepare-grading.ts       # Install test dependencies
│       ├── build.ts                 # Vite build check
│       ├── typecheck.ts             # TypeScript checking
│       ├── lint.ts                  # ESLint execution
│       ├── test-stories.ts          # Vitest + a11y testing
│       ├── environment.ts           # Git branch/commit tracking
│       └── save-to-sheets.ts        # Google Sheets upload
├── variant-configs/                 # Variant configs (variants, context combinations)
├── tasks/                           # Task definitions
│   └── {number}-{name}/
│       ├── prompt.md                # Main prompt
│       ├── hooks.ts                 # Optional lifecycle hooks
│       ├── manifests/               # Optional manifest files directory
│       │   ├── components.json      # Component manifest for @storybook/mcp
│       │   └── docs.json            # Optional docs manifest for @storybook/mcp
│       ├── mcp.config.json          # Optional MCP server config
│       ├── *.md                     # Optional additional context
│       ├── pre-grade/               # Optional files to copy before grading
│       ├── {hook-name}/             # Optional hook directories (see Lifecycle Hooks)
│       └── trials/                  # Generated trial runs
└── templates/
    ├── project/                     # Base Vite + React template
    └── grading/                     # Test/lint configs
```

### Context Modes

The harness supports five distinct context types:

1. **No Context** (`--no-context`):
   - Agent uses only built-in tools
   - Tests baseline agent capabilities

2. **Storybook MCP - Dev** (`--context storybook-dev`):
   - Sets up Storybook in the trial project with `@storybook/addon-mcp`
   - Starts a local Storybook dev server
   - Configures the MCP server endpoint (`/mcp`) for the agent
   - Best for testing agents in a live development environment
   - Includes automatic setup and teardown of the dev server

3. **Storybook MCP - Docs** (`--context components.json`):
   - Provides component documentation via `@storybook/mcp` package
   - Uses stdio transport with `packages/mcp/bin.ts`
   - Best for testing agents with library/component documentation
   - This uses the Storybook MCP server, not a custom MCP server

4. **MCP Server** (`--context mcp.config.json` or inline JSON):
   - Custom MCP server configuration (HTTP or stdio)
   - Supports multiple named servers
   - Flexible for testing different MCP tool combinations
   - Use this for fully custom MCP servers; use components.json for Storybook MCP - Docs

5. **Extra Prompts** (`--context extra-prompt-01.md,extra-prompt-02.md`):
   - Appends additional markdown files to main prompt
   - Useful for providing supplementary instructions
   - Keeps main prompt clean while testing variations

## Development Workflow

### Prerequisites

- Node.js 24+ (see root `.nvmrc`)
- pnpm 10.19.0+ (monorepo root enforces this)
- Claude Code CLI: `npm install -g claude-code`

### Running Evaluations

**Batch eval mode (recommended for comparison testing):**
```bash
cd eval
node eval.ts
```

**Single trial mode (interactive):**
```bash
cd eval
node advanced-eval.ts
```

**Non-interactive single trial:**
```bash
node advanced-eval.ts --agent claude-code --context components.json --upload-id batch-1 --no-storybook 100-flight-booking-plain

Read the full file on GitHub · 757 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 757 lines · 6,476 tokens per session scan A 977f1f97fb4b

Subscribe to this mod's changes

mcp eval.instructions.md is an instructions file published in the GitHub repository storybookjs/mcp (270 stars, last pushed yesterday), licensed MIT. It adds 6,476 tokens to every session, about $0.0324 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,345 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

next.js AGENTS.md

Instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens