Get the FREE Ultimate OpenClaw Setup Guide →

playground

Scanned
npx machina-cli add skill Kotty2998/claude-plugins-official/playground --openclaw
Files (1)
SKILL.md
3.7 KB

Playground Builder

A playground is a self-contained HTML file with 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 controls, explores visually, then copies the generated prompt back into Claude.

When to use this skill

When the user asks for an interactive playground, explorer, or visual tool for a topic — especially when the input space is large, visual, or structural and hard to express as plain text.

How to use this skill

  1. Identify the playground type from the user's request
  2. Load the matching template from templates/:
    • templates/design-playground.md — Visual design decisions (components, layouts, spacing, color, typography)
    • templates/data-explorer.md — Data and query building (SQL, APIs, pipelines, regex)
    • templates/concept-map.md — Learning and exploration (concept maps, knowledge gaps, scope mapping)
    • templates/document-critique.md — Document review (suggestions with approve/reject/comment workflow)
    • templates/diff-review.md — Code review (git diffs, commits, PRs with line-by-line commenting)
    • templates/code-map.md — Codebase architecture (component relationships, data flow, layer diagrams)
  3. Follow the template to build the playground. If the topic doesn't fit any template cleanly, use the one closest and adapt.
  4. Open in browser. After writing the HTML file, run open <filename>.html to launch it in the user's default browser.

Core requirements (every playground)

  • Single HTML file. Inline all CSS and JS. No external dependencies.
  • Live preview. Updates instantly on every control change. No "Apply" button.
  • Prompt output. Natural language, not a value dump. Only mentions non-default choices. Includes enough context to act on without seeing the playground. Updates live.
  • Copy button. Clipboard copy with brief "Copied!" feedback.
  • Sensible defaults + presets. Looks good on first load. Include 3-5 named presets that snap all controls to a cohesive combination.
  • Dark theme. System font for UI, monospace for code/values. Minimal chrome.

State management pattern

Keep a single state object. Every control writes to it, every render reads from it.

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

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

Prompt output pattern

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(', ')}.`;
}

Common mistakes to avoid

  • Prompt output is just a value dump → write it as a natural instruction
  • Too many controls at once → group by concern, hide advanced in a collapsible section
  • Preview doesn't update instantly → every control change must trigger immediate re-render
  • No defaults or presets → starts empty or broken on load
  • External dependencies → if CDN is down, playground is dead
  • Prompt lacks context → include enough that it's actionable without the playground

Source

git clone https://github.com/Kotty2998/claude-plugins-official/blob/main/plugins/playground/skills/playground/SKILL.mdView on GitHub

Overview

Playgrounds are self-contained HTML files with interactive controls on one side, a live preview on the other, and a prompt output at the bottom. Users adjust controls to explore visually and then copy a natural-language prompt back into Claude. This approach is ideal when the topic benefits from visual exploration or has a large, hard-to-describe input space.

How This Skill Works

A single state object stores all control values. Each control writes to the state and triggers renderPreview and updatePrompt, ensuring live synchronization. The skill selects a matching template from templates/ (design-playground, data-explorer, concept-map, etc.) and follows it to build the playground; the final HTML is opened in the browser for testing.

When to Use It

  • User requests an interactive playground, explorer, or visual tool for a topic.
  • The input space is large, visual, or structural and hard to express as plain text.
  • You need a self-contained, single-file HTML tool with a live preview and copyable prompt.
  • You want 3-5 presets that demonstrate cohesive configurations right away.
  • You want to base the playground on a matching template (design, data explorer, concept map, document critique, diff review, or code map).

Quick Start

  1. Step 1: Identify the playground type from the user's request.
  2. Step 2: Load the matching template from templates/: templates/design-playground.md, templates/data-explorer.md, templates/concept-map.md, templates/document-critique.md, templates/diff-review.md, templates/code-map.md, etc.
  3. Step 3: Open in browser. After writing the HTML file, run open <filename>.html to launch it in your default browser.

Best Practices

  • Inline all CSS and JS in a single HTML file; no external dependencies.
  • Maintain one state object; every control writes to it and calls updateAll().
  • Ensure the live preview updates instantly on every control change.
  • Provide 3-5 named presets to snap controls to cohesive configurations.
  • Write the prompt as natural language and include only non-default values with sufficient context.

Example Use Cases

  • Design playground: tune UI component spacing, color, and typography with live feedback.
  • Data explorer: build queries or pipelines and see resulting data visuals in real time.
  • Concept map: map topics and knowledge gaps with interactive exploration.
  • Document critique: evaluate a document with an approve/reject/comment workflow in the prompt.
  • Code map: visualize codebase architecture and data flow with interactive components.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers