跳到正文
cccskills
免费在 GitHub 公开

master-playbook

Choose text, native components, or a custom interactive answer for understanding, comparing, and making tools.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md4.6 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Open Generative UI response playbook

Answer the task directly. Use text for a short answer, writing, or code; A2UI Table for basic tabular answers; generateSandboxedUi for charts, diagrams and custom interaction. Follow Jev’s renderer and visualization decision. Native rendering is not evidence of live data.

  • Understand: show relationships or mechanisms, with a meaningful variable or stepper.
  • Compare: make criteria and assumptions visible; use a table for simple cases, editable weights or filters only when they help a decision.
  • Make a tool: deliver working controls, validated calculations, outputs, and reset.

There is no mandatory acknowledgement/plan/build/narrate sequence. plan_visualization is optional. Multiple distinct sections are welcome when needed; avoid duplicate builds after a successful "UI generated" result. Add prose only when it helps. A refinement uses the current request and explicit selections; no cross-call patch or expression-append API is provided.

Data and assumptions

Label user data, retrieved sources, calculated results, and illustrative values. The query_data tool returns all rows of bundled sample db.csv, without filtering. It is not a live database and is unnecessary for unrelated charts. Never invent current weather, prices, or business data. Ask for essential missing inputs or provide clearly labeled sample assumptions. Show units and calculation assumptions inside the UI. Do not create credential forms or claim external actions succeeded.

Tool contract

For generateSandboxedUi, emit these parameters in this EXACT order:

  1. initialHeight — estimated finished height.
  2. placeholderMessages — 2-4 short progress messages.
  3. css — all styles. The placeholder remains until css is complete; keep the css parameter lean.
  4. html — readable body markup, no style blocks or monolithic scripts.
  5. jsFunctions — named behavior functions.
  6. jsExpressions — small synchronous invocations.

The sandbox has no same-origin access: no localStorage, sessionStorage, cookies, IndexedDB, or same-origin fetch. No parent DOM access. Theme variables, form styles, and SVG color classes are pre-injected. An importmap supports three, gsap, d3, and chart.js. jsFunctions and jsExpressions are classic scripts: top-level await is invalid. Dynamic imports belong inside an async function; catch failures. The advanced skill covers libraries and responsive rendering.

Functional and accessible answers

Use semantic headings, labels connected to inputs, keyboard-operable buttons, visible focus, and readable text. Let layouts wrap at phone widths; use responsive SVG viewBox or canvas containers. Keep content readable during streaming before JavaScript arrives. Respect reduced motion and provide pause/reset for animation.

Validate number inputs with valueAsNumber, Number.isFinite, and domain bounds. Reject blanks and zero divisors; never display NaN/Infinity or a stale result as a valid answer. Format units and precision. Reset controls and results consistently. Sorting should preserve the current filter. Every enabled control must do real work. Use textContent for untrusted data, not HTML string interpolation.

Follow-up bridge

Local controls run in JavaScript. User-clicked follow-ups can ask the agent for reasoning through Websandbox.connection.remote.sendPrompt. Include current values in the request; label the button as an action that sends a message. Never send on load, timers, or ordinary input changes. Do not send secrets.

html parameter:

<button id="explain" type="button" onclick="askAboutSelection(this)">
  Ask about this scenario
</button>
<p id="followup-status" role="status"></p>

jsFunctions parameter (replace scenario text with the validated current selection):

async function askAboutSelection(button) {
  const status = document.getElementById("followup-status");
  button.disabled = true;
  status.textContent = "Sending question…";
  try {
    await Websandbox.connection.remote.sendPrompt({
      text: "Explain the assumptions behind the scenario shown above.",
    });
    status.textContent = "Question sent.";
  } catch (error) {
    status.textContent =
      "Could not send. Please try again or type your question in chat.";
  } finally {
    button.disabled = false;
  }
}

External links use Websandbox.connection.remote.openLink({ url }) with HTTPS. Do not use the standalone MCP renderer's global postMessage helpers in this host.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Build responsive, accessible calculators, comparisons, charts, and simulations with the sandbox contract.

中文简介正在准备中。当前显示原文说明。

CopilotKit/OpenIntelligentUI34742026年10月14日 更新

Generating rich inline SVG diagrams to visually explain systems, processes, architectures, and abstract concepts.

中文简介正在准备中。当前显示原文说明。

CopilotKit/OpenIntelligentUI34742026年10月14日 更新

查看 CopilotKit 的全部技能

报告此技能的问题