npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

agy-preview

v0.1.1

Published

Open Source Visual Decision Plane & Shotgunning for AI Coding Agents (Google Antigravity, Claude Code, OpenAI Codex, Cursor)

Downloads

78

Readme

🌐 Visual Decision Plane (agy-preview)

License: MIT Coverage: 100% MCP Compatible Agents

Visual Decision Infrastructure & Live Archetype Shotgunning for AI Coding Agents.
Stop letting AI hallucinate CSS in terminal text. Preview 3–4 interactive archetypes in a browser arena, test responsive viewports, extract :root design tokens, and commit code with visual conviction.


⚡ Why agy-preview?

When AI coding agents (Antigravity, Claude Code, Codex, Cursor) design frontend components, they typically guess styling in prose or generate code blindly without human visual confirmation.

Visual Decision Plane (VDP) provides a standardized Model Context Protocol (MCP) tool that bridges terminal agents with a real browser sandbox:

  1. Visual Shotgunning: Agent formulates 3–4 distinct design archetypes (e.g. Minimalist Monochrome, Warm Editorial, Glassmorphic, Neo-Brutalist).
  2. Instant Browser Arena: Agent calls request_visual_decision and holds the execution promise. A local browser arena launches automatically.
  3. Interactive Inspection: Test live hover states, switch dark/light modes, and toggle viewport sizes (Desktop, Tablet, Mobile).
  4. AST Design Token Extraction: Clicking "Select" parses :root CSS variables and returns them to the agent to enforce repo-wide consistency.

🚀 10-Second Quickstart

In any project repository, run:

npx agy-preview init

This single command automatically configures:

  • ✅ Google Antigravity: Registers MCP server in mcp_config.json, adds /visual-shotgun skill and rule.
  • ✅ Claude Code & Desktop: Registers MCP server in .claude.json and updates CLAUDE.md.
  • ✅ Cursor & Codex: Registers MCP server in .cursor/mcp.json and updates .cursorrules.

🎮 Try the Interactive Arena Demo

Want to see how the arena feels before configuring your AI agent? Run:

npx agy-preview demo

This boots the local HTTP & WebSocket server, opens your browser with 3 real design archetypes, and lets you test responsive viewports, dark/light modes, and archetype selection!


🛠 Integration Guides

1. Google Antigravity (AGY)

  1. Run the initializer:
    npx agy-preview init
  2. Reload or restart your Antigravity agent session.
  3. Use the /visual-shotgun slash command or ask:

    "Design a modern SaaS analytics dashboard with 3 distinct archetypes."

  4. Antigravity will invoke the request_visual_decision tool and pause while opening the preview in your browser!

2. Claude Code & Claude Desktop

Claude Code (CLI)

Add the MCP server directly:

claude mcp add agy-preview npx -y agy-preview

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "agy-preview": {
      "command": "npx",
      "args": ["-y", "agy-preview"]
    }
  }
}

3. Cursor & OpenAI Codex

Add to your project's .cursor/mcp.json:

{
  "mcpServers": {
    "agy-preview": {
      "command": "npx",
      "args": ["-y", "agy-preview"]
    }
  }
}

📐 Architecture & Security Model

┌────────────────────────────────────────────────────────┐
│  AI Coding Agent (Antigravity / Claude / Cursor)       │
└───────────────────────────┬────────────────────────────┘
                            │ MCP stdio (JSON-RPC)
┌───────────────────────────▼────────────────────────────┐
│  VDP MCP Engine (agy-preview)                          │
│  - Dynamic Port Scanner (4200..4210)                   │
│  - Native HTTP Asset Server                            │
│  - Bidirectional WebSocket Gateway (15s Heartbeat)     │
└───────────────────────────┬────────────────────────────┘
                            │ http://127.0.0.1:4200
┌───────────────────────────▼────────────────────────────┐
│  Visual Decision Arena (Local Browser)                 │
│  ┌─────────────────┐ ┌─────────────────┐ ┌───────────┐ │
│  │ Iframe Variant A│ │ Iframe Variant B│ │ Variant C │ │
│  │ (Sandboxed CSP) │ │ (Sandboxed CSP) │ │(Sandboxed)│ │
│  └─────────────────┘ └─────────────────┘ └───────────┘ │
│  - Viewport Toggles: Desktop (100%), Tablet (768px),   │
│    Mobile (375px)                                      │
│  - Token Inspector: Extracts :root CSS variables       │
│  - Theme Switcher: Dark / Light background mode        │
└────────────────────────────────────────────────────────┘

🔒 Enterprise Sandboxing

Untrusted code generated by AI is completely isolated:

  • Preview iframes run with sandbox="allow-scripts" (without allow-same-origin).
  • Strict CSP headers (connect-src 'none') prevent malicious network exfiltration or cookie/localStorage theft.
  • Parent arena communicates strictly via origin-validated window.postMessage.

📊 MCP Tool Specification

request_visual_decision

Presents an interactive side-by-side visual preview of multiple UI design variants in a local browser sandbox and waits for user selection.

Input Schema

{
  "prompt": "Description of the UI component to decide",
  "context": "Optional project constraints (e.g. React/Tailwind)",
  "variants": [
    {
      "id": "variant-a",
      "name": "Linear Minimalist",
      "archetype": "minimalist",
      "description": "Monochrome precision, subtle 1px zinc borders",
      "html": "<div class=\"card\">Hello</div>",
      "css": ":root { --primary: #3b82f6; } .card { padding: 16px; }"
    }
  ],
  "timeoutMs": 600000
}

Output Schema

{
  "status": "selected",
  "selectedId": "variant-a",
  "feedback": "Approved. Increase button padding on mobile.",
  "tokens": {
    "colors": { "primary": "#3b82f6" },
    "typography": {},
    "radii": {},
    "cssVariables": ":root {\n  --primary: #3b82f6;\n}"
  },
  "rawHtml": "<div class=\"card\">Hello</div>",
  "rawCss": ":root { --primary: #3b82f6; } .card { padding: 16px; }"
}

🧪 Testing & Verification

agy-preview is engineered with senior software QA standards and maintains 100% strict test coverage across all modules:

# Run tests
npm test

# Run tests with 100% coverage verification
npm run test:coverage
 % Coverage report from v8
-------------------|---------|----------|---------|---------|-------------------
File               | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
-------------------|---------|----------|---------|---------|-------------------
All files          |     100 |      100 |     100 |     100 |                   
 src               |     100 |      100 |     100 |     100 |                   
  cli.ts           |     100 |      100 |     100 |     100 |                   
 src/protocol      |     100 |      100 |     100 |     100 |                   
  validator.ts     |     100 |      100 |     100 |     100 |                   
 src/server        |     100 |      100 |     100 |     100 |                   
  ...r-launcher.ts |     100 |      100 |     100 |     100 |                   
  http-server.ts   |     100 |      100 |     100 |     100 |                   
  mcp-server.ts    |     100 |      100 |     100 |     100 |                   
  port-scanner.ts  |     100 |      100 |     100 |     100 |                   
  ws-gateway.ts    |     100 |      100 |     100 |     100 |                   
 src/tokens        |     100 |      100 |     100 |     100 |                   
  ...-extractor.ts |     100 |      100 |     100 |     100 |                   
-------------------|---------|----------|---------|---------|-------------------

📄 License

MIT © Himanshu & Visual Decision Plane Contributors