The /playground skill — an interactive explainer
Research & Learning · skill explainer

The /playground skill

TL;DR/playground builds self-contained single-file HTML explorers. Three zones: a controls panel (left), a live preview (right), and a natural-language prompt output (bottom) with a copy button. User tweaks controls, preview updates instantly, prompt updates live, user copies it back into Claude. No server, no CDN, zero dependencies. Six templates cover design, data, learning, document review, code diffs, and architecture diagrams.
Every playground has these three zones
Controls
Sliders, toggles, dropdowns, chips, canvas — whatever fits the domain. Every change fires instantly.
Live preview
Renders the result of the current state. Updates on every keypress or drag — no Apply button.
Prompt output
Natural-language instruction. Only non-default choices mentioned. Self-contained — actionable without the playground.
Copy ✓

The loop

The playground exists to bridge the gap between visual exploration and Claude instructions. The loop is:

Adjust controls Preview updates Prompt updates Copy prompt Paste into Claude Repeat

The key insight: the hardest part of complex requests is articulating what you want. The playground handles that articulation for you — you explore visually and it writes the prompt.

A playground isn't a finished product. It's a prompt-generation tool. The output is always a natural-language instruction you send back to Claude to act on.

The 6 templates

Playground picks the closest template automatically based on your request. Each template defines the layout, control types, preview rendering approach, and prompt output format.

design-playground visual design

For visual design decisions: components, layouts, spacing, color, typography, animation, responsive behavior. Controls map directly to CSS properties; the prompt describes the result as a direction to a developer.

+-------------------+----------------------+ | | | | Controls | Live component/ | | grouped by: | layout preview | | • Spacing | (renders in a | | • Color | mock page or | | • Typography | isolated card) | | • Shadow/Border | | | • Interaction | | | +----------------------+ | | Prompt output | | | [ Copy Prompt ] | +-------------------+----------------------+

Control types

DecisionControlExample
Sizes, spacing, radiusSliderborder-radius 0–24px
On/off featuresToggleshow border, hover effect
Choosing from a setDropdownfont-family, easing curve
ColorsH+S+L slidersshadow color, accent hue
Layout structureClickable cardssidebar-left / top-nav / no-nav
Responsive behaviorViewport-width sliderwatch grid reflow at breakpoints

Example prompt output

Written as a direction to a developer, not a spec sheet:

"Update the card to feel soft and elevated: 12px border-radius, 24px horizontal padding, a medium box-shadow (0 4px 12px rgba(0,0,0,0.1)). On hover, lift it with translateY(-1px) and deepen the shadow slightly."

Use cases

button style explorer card component layout builder typography scale color palette generator dashboard density slider modal / dialog designer
data-explorer data & queries

For data queries, APIs, pipelines, and structured config: SQL builders, API designers, regex builders, pipeline visuals, cron schedules. Preview renders syntax-highlighted output or a visual flow diagram.

+-------------------+----------------------+ | | | | Controls | Formatted output | | grouped by: | (syntax-highlighted | | • Source/tables | code, or a | | • Columns/fields | visual diagram) | | • Filters | | | • Grouping | | | • Ordering | | | • Limits | | | +----------------------+ | | Prompt output | | | [ Copy Prompt ] | +-------------------+----------------------+

Control types

DecisionControlExample
Select from available itemsClickable cards / chipstable names, columns, HTTP methods
Add filter / condition rowsAdd button → row of dropdowns + inputWHERE column op value
Join type or aggregationDropdown per rowINNER/LEFT/RIGHT, COUNT/SUM/AVG
Limit / offsetSliderresult count 1–500
OrderingDropdown + ASC/DESC toggleorder by column
On/off featuresToggleinclude header, show descriptions

Preview rendering

Syntax-highlighted output using <span> tags with color classes for keywords, table names, strings. Or a horizontal/vertical flow diagram with arrow connectors for pipeline-style playgrounds.

Example prompt output

"Write a SQL query that joins orders to users on user_id, filters for orders after 2024-01-01 with total > $50, groups by user, and returns the top 10 users by order count."

Use cases

SQL query builder API endpoint designer data pipeline regex builder with live highlight cron schedule builder GraphQL query builder
concept-map learning & exploration

Canvas-based learning and knowledge maps. The visual IS the control — users drag nodes, draw connections, mark knowledge levels. Different from other templates: there's no separate controls panel, the canvas is the interaction.

+--------------------------------------+ | Canvas (draggable nodes, edges) | | with tooltip on hover | +-------------------------+------------+ | | | | Sidebar: | Prompt | | • Knowledge levels | output | | • Connection types | | | • Node list | [Copy] | | • Actions | | +-------------------------+------------+

Interaction model

DecisionControlExample
Knowledge level per nodeClick-to-cycle in sidebarKnow → Fuzzy → Unknown
Connection typeSelector before drawing edgecalls, depends on, contains, reads from
Node arrangementDrag on canvasspatial layout reflects mental model
Which nodes to includeToggle per nodehide/show concepts
Auto-layoutButtonForce-directed spring simulation
For codebases, pre-populate with 15–20 real nodes (file paths + short descriptions) and 20–30 pre-drawn edges based on actual imports/calls. Default all knowledge levels to "Fuzzy" — let the user adjust upward from there.

Example prompt output

"I'm learning React. I already understand: useState, useEffect. I'm fuzzy on: useContext, useReducer. I have no idea about: useMemo, useCallback. Explain the fuzzy and unknown hooks, focusing on these relationships: useReducer → dispatch → state, useContext → Provider → Consumer. Build on what I already know."

Use cases

codebase architecture map framework learning system design task decomposition API surface map
document-critique doc review

Review and critique documents with an approve/reject/comment workflow. Left panel shows the document with line-level highlights; right panel shows filterable suggestions. Only approved items make it into the prompt.

+---------------------------+--------------------+ | | | | Document content | Suggestions panel | | with line numbers | (filterable list) | | and suggestion | • Approve | | highlighting | • Reject | | | • Comment | | | | +---------------------------+--------------------+ | Prompt output (approved + commented items) | | [ Copy Prompt ] | +------------------------------------------------+

Color coding

StateLeft border colorBackground
PendingAmber #bf8700rgba(191,135,0,0.08)
ApprovedGreen #1a7f37rgba(26,127,55,0.08)
RejectedRed #cf222ergba(207,34,46,0.08) + opacity 0.6

Pre-populating for a specific doc

When building a critique playground for your document: read the doc → analyze and generate suggestions with specific line references + category tags (clarity, completeness, performance, accessibility, ux) → embed both the doc content and suggestions array in the HTML.

Use cases

SKILL.md review README critique spec review proposal feedback code comment review
diff-review git diffs

Review git diffs with interactive line-level commenting. Click any diff line to open a textarea, save a comment, and see a 💬 badge appear. The prompt output formats all comments as structured code review feedback with file:line references.

+-------------------+----------------------------------+ | | | | Commit Header: | Diff Content | | • Hash | (files with hunks) | | • Message | with line numbers | | • Author/Date | and +/- indicators | | | | +-------------------+----------------------------------+ | Prompt Output Panel (fixed bottom-right) | | [ Copy All ] | | Shows all comments formatted for prompt | +------------------------------------------------------+

Line type styling

TypeBackgroundPrefix
contexttransparent  (space)
addition#dafbe1 (light) / rgba(46,160,67,0.15) (dark)+
deletion#ffebe9 (light) / rgba(248,81,73,0.15) (dark)-
hunk header#ddf4ff (light)@@

Pre-populating with a real commit

Run git show <commit> --format="%H%n%s%n%an%n%ad" -p and paste the output when requesting the playground. Claude parses it into the diffData structure automatically.

Use cases

git commit review PR review before/after refactoring merge conflict annotation security audit
code-map architecture

SVG architecture diagrams with click-to-comment on any node. Supports layer visibility filtering, connection type filtering, view presets, and zoom controls. Comments accumulate in the sidebar and build a targeted prompt about specific components.

+-------------------+----------------------------------+ | | | | 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 | | +-------------------+----------------------------------+

Connection types

TypeColorStyleUse for
data-flowBlue #3b82f6SolidRequest/response, data passing
tool-callGreen #10b981Dashed (6,3)Function calls, API invocations
eventRed #ef4444Short dash (4,4)Async events, pub/sub
skill-invokeOrange #f97316Long dash (8,4)Plugin / skill activation
dependencyGray #6b7280DottedImport / require relationships

Layer color palette

LayerNode fill
Client / UI#dbeafe (blue-100)
Server / API#fef3c7 (amber-100)
SDK / Core#f3e8ff (purple-100)
Agent / Logic#dcfce7 (green-100)
Data#fce7f3 (pink-100)

Use cases

microservices map React component tree API architecture agent system data pipeline plugin architecture

Core requirements

Every playground produced by this skill satisfies all of these, regardless of template:

The prompt output pattern

This is the most important part to get right. The prompt output is not a value dump. It's a natural instruction a developer could act on.

Reads like a direction from a designer to a developer:

"Update the card to feel soft and elevated: 12px border-radius, 24px horizontal padding, a medium box-shadow (0 4px 12px rgba(0,0,0,0.1)). On hover, lift it with translateY(-1px) and deepen the shadow slightly. Use the Inter font family."

Notice: uses qualitative framing ("soft and elevated"), quantitative specifics only where precise, omits default values (border-color was already correct), includes context to act on alone.

This is what not to produce:

{ borderRadius: 12, padding: 24, shadow: true,
  shadowY: 4, shadowBlur: 12, shadowOpacity: 0.1,
  font: "Inter", hover: true, hoverTranslate: -1,
  color: "#141413", bg: "#ffffff" }

Unusable without the playground. Includes defaults. No qualitative context. Can't be acted on as a Claude prompt.

// Keep a DEFAULTS object — only emit lines that differ
const DEFAULTS = { borderRadius: 4, padding: 16,
                    shadowBlur: 0, font: 'system-ui' };

function updatePrompt() {
  const parts = [];

  // Only mention non-default values
  if (state.borderRadius !== DEFAULTS.borderRadius)
    parts.push(`${state.borderRadius}px border-radius`);

  // Use qualitative language alongside numbers
  if (state.shadowBlur > 16)  parts.push('a pronounced shadow');
  else if (state.shadowBlur > 0) parts.push('a subtle shadow');

  if (state.font !== DEFAULTS.font)
    parts.push(`the ${state.font} font family`);

  // Write as direction, not spec sheet
  prompt.textContent = parts.length
    ? `Update the card to use ${parts.join(', ')}.`
    : '(using all defaults — adjust controls to build a prompt)';
}

State management pattern

Every playground uses a single state object. Every control writes to it. Every render reads from it. No scattered variables.

// Single source of truth
const state = {
  borderRadius: 4,
  padding: 16,
  shadowBlur: 0,
  font: 'system-ui',
  preset: 'default'
};

// One function that does both — called after every control change
function updateAll() {
  renderPreview(); // update the visual
  updatePrompt();  // rebuild the prompt text
}

// Every control calls updateAll() on change
slider.addEventListener('input', () => {
  state.borderRadius = +slider.value;
  updateAll();
});

// Presets snap all controls at once
const PRESETS = {
  minimal:  { borderRadius: 2,  padding: 12, shadowBlur: 0  },
  elevated: { borderRadius: 12, padding: 24, shadowBlur: 12 },
  compact:  { borderRadius: 4,  padding: 8,  shadowBlur: 4  },
};

function applyPreset(name) {
  Object.assign(state, PRESETS[name]);
  syncControlsToState(); // update slider/toggle DOM to match
  updateAll();
}
Always call updateAll() on initial load with defaults — never start with a blank or broken preview. The user should see a polished result before touching anything.

How to trigger /playground

Just describe what you want to explore. Claude picks the template, builds all controls, wires up live preview and prompt output, then opens the file in your browser.

design-playground "Make me a playground for exploring button styles — radius, padding, shadow, hover effects"
data-explorer "Create a SQL query builder playground for my users, orders, and products tables"
concept-map "Build an interactive concept map for learning React hooks — pre-populate with all the main hooks"
diff-review "Make a diff reviewer playground for this commit: [paste git diff output]"
document-critique "Create a playground to critique my README — analyze it and generate suggestions I can approve/reject"
code-map "Build an architecture map playground for my codebase — map out the components and their connections"
For diff-review and code-map, paste real data (git diff output, or a file list with your codebase structure) when triggering — this lets Claude pre-populate with actual content instead of placeholder data.

Common mistakes to avoid

MistakeProblemFix
Prompt is a value dump JSON object of all current state values Write as natural instruction. Only non-defaults. Qualitative framing.
Too many controls at once Overwhelming; user doesn't know where to start Group by concern (spacing / color / typography). Hide advanced options in a collapsible section.
Preview doesn't update instantly Added an "Apply" button or debounce delay Every control change/input event must call updateAll() immediately.
No defaults or presets Starts blank or broken on load Set sensible defaults in state. Call updateAll() on page load. Add 3–5 presets.
External dependencies CDN request, npm package, iframe to external URL Inline everything. If CDN goes down, playground must still work.
Prompt lacks context Output only makes sense while looking at the playground Include entity names, schema context, or qualitative framing so prompt is actionable standalone.
!
The most common failure mode: prompt output as a value dump. Test your playground by covering the controls and reading only the prompt output — if it's not a clear, actionable instruction on its own, rewrite updatePrompt().