Playground

作者 anthropicsb78ac49cdc6b无许可证37K 个星标收录于 2026年10月8日更新于 2026年10月8日仓库今天更新

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.

AI 生成的概览

构建自包含的交互式 HTML 演练场,包含控件、实时预览和可复制的提示词输出。

功能
指导智能体生成一个自包含的单一 HTML 文件:一侧是交互控件,另一侧是实时预览,底部是自然语言提示词输出和复制按钮。技能提供六个模板,分别覆盖视觉设计决策、数据与查询构建、概念图、文档评审、差异审查和代码库架构。技能还规定了核心要求,例如内联 CSS 与 JS、预览即时更新、合理的默认值与预设、深色主题,以及状态管理和提示词输出的写法。
适用场景
当用户要求为某个主题制作交互式演练场、浏览器或可视化工具时使用,尤其适合输入空间庞大、偏视觉或偏结构、难以用纯文本表达的场景。
运行要求
仅为说明性内容,不附带脚本。智能体需写出 HTML 文件,技能要求执行 shell 命令 open .html 以在默认浏览器中打开。模板为 templates/ 下可供模型读取的 Markdown 文件。生成的文件不得使用外部依赖。

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.

javascript
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

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

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

来源与署名

来源:anthropics/claude-plugins-official位于plugins/playground/skills/playground提交b78ac49

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架

更多来自 anthropics/claude-plugins-official 的技能

Skill Development

anthropics

精选

指导创建 Claude Code 插件技能,涵盖结构、描述、渐进式披露与验证。

AI & Agents37K今天更新

Plugin Structure

anthropics

精选

指导 Claude Code 插件的结构、清单与组件布局。

AI & Agents37K今天更新

Project Artifact

anthropics

精选

Generate and publish a project status artifact — an opinionated, tabbed status page for a project too big for one update (overview & success criteria, the workstream sequence, next steps, plus background, plan, risks & open questions, and decisions/FAQ when they earn a tab) — published with the built-in Artifact tool to a default-private claude.ai page the user can share with teammates. Use when a piece of work spans several workstreams and you want a shareable overview kept current. Each artifact is backed by a small per-project config in the plugin data dir, so refreshing it re-gathers live state, redeploys the same URL, and reports only the delta. For software projects whose workstreams are PRs, also read swe.md (the X.Y PR-numbering convention; pulling PR state with gh/git; a per-PR detail block). Needs the built-in Artifact tool (claude.ai login). Not for single-PR changes or public docs.

待分类37K今天更新

Command Development

anthropics

精选

指导创建 Claude Code 斜杠命令,涵盖结构、YAML frontmatter、参数与插件功能。

AI & Agents37K今天更新

M5 Onboard

anthropics

精选

通过 USB 检测 M5Stack ESP32 开发板,刷写 UIFlow 2.0 固件并安装 MicroPython 应用包。

DevOps & Cloud37K今天更新

Cardputer Buddy

anthropics

精选

指导迭代 Cardputer-Adv 的 MicroPython 应用包:添加应用、通过 USB 串口推送文件、查看日志并运行 REPL 命令。

Software Development37K今天更新