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.

templatesdocument-critique.md

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

Document Critique Template

Use this template when the playground helps review and critique documents: SKILL.md files, READMEs, specs, proposals, or any text that needs structured feedback with approve/reject/comment workflow.

Layout

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

Key components

Document panel (left)

  • Display full document with line numbers
  • Highlight lines with suggestions using a colored left border
  • Color-code by status: pending (amber), approved (green), rejected (red with opacity)
  • Click a suggestion card to scroll to the relevant line

Suggestions panel (right)

  • Filter tabs: All / Pending / Approved / Rejected
  • Stats in header showing counts for each status
  • Each suggestion card shows:
    • Line reference (e.g., "Line 3" or "Lines 17-24")
    • The suggestion text
    • Action buttons: Approve / Reject / Comment (or Reset if already decided)
    • Optional textarea for user comments

Prompt output (bottom)

  • Generates a prompt only from approved suggestions and user comments
  • Groups by: Approved Improvements, Additional Feedback, Rejected (for context)
  • Copy button with "Copied!" feedback

State structure

const suggestions = [
  {
    id: 1,
    lineRef: "Line 3",
    targetText: "description: Creates interactive...",
    suggestion: "The description is too long. Consider shortening.",
    category: "clarity",  // clarity, completeness, performance, accessibility, ux
    status: "pending",    // pending, approved, rejected
    userComment: ""
  },
  // ... more suggestions
];

let state = {
  suggestions: [...],
  activeFilter: "all",
  activeSuggestionId: null
};

Suggestion matching to lines

Match suggestions to document lines by parsing the lineRef:

const suggestion = state.suggestions.find(s => {
  const match = s.lineRef.match(/Line[s]?\s*(\d+)/);
  if (match) {
    const targetLine = parseInt(match[1]);
    return Math.abs(targetLine - lineNum) <= 2; // fuzzy match nearby lines
  }
  return false;
});

Document rendering

Handle markdown-style formatting inline:

// Skip ``` lines, wrap content in code-block-wrapper
if (line.startsWith('```')) {
  inCodeBlock = !inCodeBlock;
  // Open or close wrapper div
}

// Headers
if (line.startsWith('# ')) renderedLine = `<h1>...</h1>`;
if (line.startsWith('## ')) renderedLine = `<h2>...</h2>`;

// Inline formatting (outside code blocks)
renderedLine = renderedLine.replace(/`([^`]+)`/g, '<code>$1</code>');
renderedLine = renderedLine.replace(/\*\*([^*]+)\*\*/g, '<strong>$1</strong>');

Prompt output generation

Only include actionable items:

function updatePrompt() {
  const approved = state.suggestions.filter(s => s.status === 'approved');
  const withComments = state.suggestions.filter(s => s.userComment?.trim());

  if (approved.length === 0 && withComments.length === 0) {
    // Show placeholder
    return;
  }

  let prompt = 'Please update [DOCUMENT] with the following changes:\n\n';

  if (approved.length > 0) {
    prompt += '## Approved Improvements\n\n';
    for (const s of approved) {
      prompt += `**${s.lineRef}:** ${s.suggestion}`;
      if (s.userComment?.trim()) {
        prompt += `\n  → User note: ${s.userComment.trim()}`;
      }
      prompt += '\n\n';
    }
  }

  // Additional feedback from non-approved items with comments
  // Rejected items listed for context only
}

Styling highlights

.doc-line.has-suggestion {
  border-left: 3px solid #bf8700;  /* amber for pending */
  background: rgba(191, 135, 0, 0.08);
}

.doc-line.approved {
  border-left-color: #1a7f37;  /* green */
  background: rgba(26, 127, 55, 0.08);
}

.doc-line.rejected {
  border-left-color: #cf222e;  /* red */
  background: rgba(207, 34, 46, 0.08);
  opacity: 0.6;
}

Pre-populating suggestions

When building a critique playground for a specific document:

  1. Read the document content
  2. Analyze and generate suggestions with:
    • Specific line references
    • Clear, actionable suggestion text
    • Category tags (clarity, completeness, performance, accessibility, ux)
  3. Embed both the document content and suggestions array in the HTML

Example use cases

  • SKILL.md review (skill definition quality, completeness, clarity)
  • README critique (documentation quality, missing sections, unclear explanations)
  • Spec review (requirements clarity, missing edge cases, ambiguity)
  • Proposal feedback (structure, argumentation, missing context)
  • Code comment review (docstring quality, inline comment usefulness)

Source: SKILL.md on GitHub

No alerts16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    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.

  • Socket16d

    No alerts

  • Snyk16d

    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.