All skills
anthropics avatar

/playground

@4e459fb

Creates interactive HTML playgrounds — self-contained single-file explorers that let users configure something visually through controls, see a live preview, and copy out a prompt. Use when the user asks to make a playground, explorer, or interactive tool for a topic.

Use this Skill: https://skilld.dev/gh/anthropics/claude-plugins-official/playground

This session only. Nothing lands on disk.

templatescode-map.md

≈1.5k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Code Map Template

Use this template when the playground is about visualizing codebase architecture: component relationships, data flow, layer diagrams, system architecture with interactive commenting for feedback.

Layout

+-------------------+----------------------------------+
|                   |                                  |
|  Controls:        |  SVG Canvas                      |
|  • View presets   |  (nodes + connections)           |
|  • Layer toggles  |  with zoom controls              |
|  • Connection     |                                  |
|    type filters   |  Legend (bottom-left)            |
|                   |                                  |
|  Comments (n):    +----------------------------------+
|  • List of user   |  Prompt output                   |
|    comments with  |  [ Copy Prompt ]                 |
|    delete buttons |                                  |
+-------------------+----------------------------------+

Code map playgrounds use an SVG canvas for the architecture diagram. Users click components to add comments, which become part of the generated prompt. Layer and connection filters let users focus on specific parts of the system.

Control types for code maps

Decision Control Example
System view Preset buttons Full System, Chat Flow, Data Flow, Agent System
Visible layers Checkboxes Client, Server, SDK, Data, External
Connection types Checkboxes with color indicators Data Flow (blue), Tool Calls (green), Events (red)
Component feedback Click-to-comment modal Opens modal with textarea for feedback
Zoom level +/−/reset buttons Scale SVG for detail

Canvas rendering

Use an <svg> element with dynamically generated nodes and paths. Key patterns:

  • Nodes: Rounded rectangles with title and subtitle (file path)
  • Connections: Curved paths (bezier) with arrow markers, styled by type
  • Layer organization: Group nodes by Y-position bands (e.g., y: 30-80 = Client, y: 130-180 = Server)
  • Click-to-comment: Click node → open modal → save comment → node gets visual indicator
  • Filtering: Toggle visibility of nodes by layer, connections by type
const nodes = [
  { id: 'api-client', label: 'API Client', subtitle: 'src/api/client.ts',
    x: 100, y: 50, w: 140, h: 45, layer: 'client', color: '#dbeafe' },
  // ...
];

const connections = [
  { from: 'api-client', to: 'server', type: 'data-flow', label: 'HTTP' },
  { from: 'server', to: 'db', type: 'data-flow' },
  // ...
];

function renderDiagram() {
  const visibleNodes = nodes.filter(n => state.layers[n.layer]);
  // Draw connections first (under nodes), then nodes
  connections.forEach(c => drawConnection(c));
  visibleNodes.forEach(n => drawNode(n));
}

Connection types and styling

Define 3-5 connection types with distinct visual styles:

Type Color Style Use for
data-flow Blue (#3b82f6) Solid line Request/response, data passing
tool-call Green (#10b981) Dashed (6,3) Function calls, API invocations
event Red (#ef4444) Short dash (4,4) Async events, pub/sub
skill-invoke Orange (#f97316) Long dash (8,4) Plugin/skill activation
dependency Gray (#6b7280) Dotted Import/require relationships

Use SVG markers for arrowheads:

<marker id="arrowhead-blue" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
  <polygon points="0 0, 8 3, 0 6" fill="#3b82f6"/>
</marker>

Comment system

The key differentiator for code maps is click-to-comment functionality:

  1. Click node → Open modal with component name, file path, textarea
  2. Save comment → Add to comments list, mark node with visual indicator (colored border)
  3. View comments → Sidebar list with component name, comment preview, delete button
  4. Delete comment → Remove from list, update node visual, regenerate prompt

Comments should include the component context:

state.comments.push({
  id: Date.now(),
  target: node.id,
  targetLabel: node.label,
  targetFile: node.subtitle,
  text: userInput
});

Prompt output for code maps

The prompt combines system context with user comments:

This is the [PROJECT NAME] architecture, focusing on the [visible layers].

Feedback on specific components:

**API Client** (src/api/client.ts):
I want to add retry logic with exponential backoff here.

**Database Manager** (src/db/manager.ts):
Can we add connection pooling? Current implementation creates new connections per request.

**Auth Middleware** (src/middleware/auth.ts):
This should validate JWT tokens and extract user context.

Only include comments the user added. Mention which layers are visible if not showing the full system.

Pre-populating with real data

For a specific codebase, pre-populate with:

  • Nodes: 15-25 key components with real file paths
  • Connections: 20-40 relationships based on actual imports/calls
  • Layers: Logical groupings (UI, API, Business Logic, Data, External)
  • Presets: "Full System", "Frontend Only", "Backend Only", "Data Flow"

Organize nodes in horizontal bands by layer, with consistent spacing.

Layer color palette (light theme)

Layer Node fill Description
Client/UI #dbeafe (blue-100) React components, hooks, pages
Server/API #fef3c7 (amber-100) Express routes, middleware, handlers
SDK/Core #f3e8ff (purple-100) Core libraries, SDK wrappers
Agent/Logic #dcfce7 (green-100) Business logic, agents, processors
Data #fce7f3 (pink-100) Database, cache, storage
External #fbcfe8 (pink-200) Third-party services, APIs

Example topics

  • Codebase architecture explorer (modules, imports, data flow)
  • Microservices map (services, queues, databases, API gateways)
  • React component tree (components, hooks, context, state)
  • API architecture (routes, middleware, controllers, models)
  • Agent system (prompts, tools, skills, subagents)
  • Data pipeline (sources, transforms, sinks, scheduling)
  • Plugin/extension architecture (core, plugins, hooks, events)

Source: SKILL.md on GitHub

No alerts17d5 checks · Risk SAFE
  • Gen Agent Trust Hub17d

    The playground skill enables the creation of interactive HTML tools. It includes security considerations such as indirect prompt injection and command execution, which are integral to its functionality. The skill also employs positive security practices by avoiding external dependencies.

  • Socket17d

    No alerts

  • Snyk17d

    Risk: LOW · No issues

  • Runlayer7mo

    7 files scanned · No issues

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 4e459fb. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 8 months ago
  • playground
  • html
  • interactive
  • visual-builder
  • prompt-generation
  • design-tools
  • data-explorer
  • code-review

README badge

README badge for anthropics/claude-plugins-official/playground

Creates self-contained HTML playgrounds with interactive controls, live preview, and generated prompts that users can copy back to Claude. Includes templates for design decisions, data exploration, concept mapping, document review, code review, and codebase architecture.

Generated from the current SKILL.md.

What is a playground in this context?
A playground is a self-contained single-file HTML explorer where users adjust interactive controls to see live preview updates and generate a copy-able prompt to feed back into Claude.
Can I use external libraries or CDN dependencies?
No. Every playground must be a single HTML file with all CSS and JavaScript inlined. External dependencies make the playground fragile.
Which template should I use if the topic doesn't fit cleanly?
Pick the template closest to your use case and adapt it. The skill provides six templates (design, data explorer, concept map, document critique, diff review, code map) covering most scenarios.
Do I need to include an 'Apply' button for changes to take effect?
No. The preview and prompt must update instantly as the user adjusts controls, without requiring an Apply or Submit action.
What should the prompt output contain?
Natural language instructions that mention only non-default choices and include enough context to be actionable without seeing the playground. It should not be a raw value dump.

Generated from the current SKILL.md. These answers refresh after source changes.