playground-playground

A Claude Code skill that creates interactive HTML playgrounds. Each one is a self-contained single-file explorer where users adjust visual controls, see a live preview, and copy a generated prompt back into Claude.

Last verified: write-up checked

playground-playground — illustration

What it is

The playground skill builds interactive HTML playgrounds. Each playground is a self-contained HTML file with three parts: interactive controls on one side, a live preview on the other, and a prompt output at the bottom with a copy button. The user adjusts the controls, explores the result visually, and then copies the generated prompt back into Claude. The skill is meant for requests for a playground, explorer, or interactive tool on a topic. It fits best when the input space is large, visual, or structural and hard to express as plain text. To build one, Claude first identifies the playground type from the user's request. It then loads the matching template from templates/. There are six templates: - design-playground, for visual design decisions such as components, layouts, spacing, color, and typography - data-explorer, for data and query building such as SQL, APIs, pipelines, and regex - concept-map, for learning and exploration such as concept maps, knowledge gaps, and scope mapping - document-critique, for document review with an approve/reject/comment workflow - diff-review, for code review of git diffs, commits, and PRs with line-by-line commenting - code-map, for codebase architecture such as component relationships, data flow, and layer diagrams If the topic doesn't fit any template cleanly, Claude uses the closest one and adapts it. After writing the HTML file, Claude runs open <filename>.html to launch it in the user's default browser. Every playground must meet a set of core requirements: - It is a single HTML file with all CSS and JS inlined and no external dependencies. - The live preview updates instantly on every control change, with no "Apply" button. - The prompt output is natural language, not a value dump. It only mentions non-default choices, includes enough context to act on without seeing the playground, and updates live. - A copy button copies to the clipboard and shows brief "Copied!" feedback. - Sensible defaults make it look good on first load, and 3-5 named presets snap all controls to a cohesive combination. - It uses a dark theme, with a system font for the UI, monospace for code and values, and minimal chrome. The skill also prescribes a state management pattern. A single state object holds all configurable values. Every control writes to it, and every render reads from it through an updateAll() function that re-renders the preview and rebuilds the prompt. The prompt output pattern mentions only non-default values and uses qualitative language alongside numbers.

Who it's for

  • Claude Code users who want an interactive visual tool to explore a topic and generate a prompt
  • Designers making visual design decisions about components, layouts, spacing, color, and typography
  • Developers building SQL queries, API calls, pipelines, or regex
  • Learners mapping concepts, knowledge gaps, or scope
  • Reviewers critiquing documents or reviewing git diffs, commits, and PRs
  • Engineers exploring codebase architecture, component relationships, and data flow

Requirements

Requirements

  • A browser to view the generated HTML file (the skill launches it with open <filename>.html)

هاد السكيل بخلّي Claude يعمل playground تفاعلي بملف HTML واحد، فيه كونترولز ومعاينة مباشرة. بتظبط الخيارات وبتشوف النتيجة فوراً، وبعدين بتنسخ البرومبت اللي طلع وبترجعه لـClaude.

Examples

Open the generated playground in the browser

bash
bash
open <filename>.html

What it does: After writing the HTML file, the skill runs this command to launch the playground in the user's default browser.

State management pattern

javascript
javascript
const state = { /* all configurable values */ };

function updateAll() {
  renderPreview(); // update the visual
  updatePrompt();  // rebuild the prompt text
}
// Every control calls updateAll() on change

What it does: A single state object holds all values. Every control change calls updateAll(), which re-renders the preview and rebuilds the prompt.

Prompt output pattern

javascript
javascript
function updatePrompt() {
  const parts = [];

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

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

  prompt.textContent = `Update the card to use ${parts.join(', ')}.`;
}

What it does: Builds a natural-language prompt that mentions only non-default values and uses qualitative descriptions alongside numbers.