visualization
Deploy interactive HTML visualizations (quiz, what-if explorer, decision tree, or custom) to a live URL via Cloudflare Workers. Use when the user needs an interactive, clickable visual aid such as choices, buttons, sliders, causal "if this then that" explorers, or step-by-step decision flows. Not for plain charts or static images.
- License 许可
- AGPL-3.0
- 最近更新
- 2026-11-04
- Stars
- ★ 18
- Forks
- 4
01 前言 Front Matter
- name
- visualization
- description
- Deploy interactive HTML visualizations (quiz, what-if explorer, decision tree, or custom) to a live URL via Cloudflare Workers. Use when the user needs an interactive, clickable visual aid such as choices, buttons, sliders, causal "if this then that" explorers, or step-by-step decision flows. Not for plain charts or static images.
02 资源文件 3
- 参考文档templates/causal.html9.8 KB
- 参考文档templates/decision-tree.html7.6 KB
- 参考文档templates/quiz.html9.0 KB
03 SKILL.md 正文
Interactive Visualization
Deploy single-file interactive HTML to a live HTTPS URL using Cloudflare Workers temporary deploy. No account, no login, no server to run. The user taps the link, it opens in Telegram's in-app browser, full interactivity.
When to use
- Quiz / assessment. Choices, instant feedback, score (like ChatGPT interactive widgets)
- What-if explorer. Sliders/selections drive live causal results (like Gemini visualizations: "if X changes, Y becomes…")
- Decision tree. Step-by-step choices leading to leaf outcomes
- Custom. Any self-contained interactive HTML the agent writes from scratch
Two modes
1. Template mode (preferred when a template fits)
Call viz_create with a template type and a config object. The tool injects your config into the template engine and writes a ready-to-deploy HTML file. You never touch HTML directly.
viz_create(template="quiz", config={
title: "...",
description: "...",
questions: [
{ q: "...", options: ["A","B","C","D"], answer: 0, explain: "..." },
...
],
passRatio: 0.7,
passText: "...",
failText: "..."
})
Templates available:
| template | use case | config shape |
|---|---|---|
quiz |
multiple-choice quiz with scoring | {title, description, questions:[{q, options[], answer, explain}], passRatio, passText, failText} |
causal |
sliders/selects drive live outputs | {title, description, inputs:[{id, label, type:"range"|"select", min, max, step, default, unit, options[]}], outputs:[{id, label}], evaluate:"JS function body as string"}, select options can be ["단리","복리"] (strings) or [{v:"a",l:"A"},{v:"b",l:"B"}] (objects). tier in evaluate return must be one of: "good", "warn", "bad", "neutral". |
decision-tree |
branching choices lead to leaf results | {title, description, start, nodes:{id:{type:"question"|"leaf", text, choices:[{label,next}], detail}}} |
causal evaluate: the evaluate field is a string of JS function body. It receives s (a state object mapping each input id to its value) and returns an object that maps each output id to {value, tier, trace}. Example:
evaluate: "const r = Math.min(0.95, 0.3 + s.hours * 0.05); return { retention: {value: Math.round(r*100)+'%', tier: r>0.7?'good':'bad', trace: 'hours=' + s.hours} };"
2. Custom mode
When no template fits, write a complete self-contained HTML file with file_patch:
- Inline all CSS in
<style>, all JS in<script>. - No external resources (no CDN, no fonts, no images via URL).
- Dark theme, mobile-first, touch-friendly (Telegram in-app browser).
- Keep under 5 MiB (Cloudflare Workers static asset limit).
Deploy
After viz_create (or writing custom HTML), deploy with terminal_run:
mkdir -p /tmp/viz-deploy && cp <output-path> /tmp/viz-deploy/index.html
Create wrangler.toml:
name = "viz-<short-hash>"
compatibility_date = "2024-09-01"
[assets]
directory = "."
Deploy:
cd /tmp/viz-deploy && npx wrangler deploy --temporary
Output contains the live URL:
Deployed viz-xxxx triggers https://viz-xxxx.workers.dev
Send that URL to the user in your reply as a clickable link.
Important notes
- 60-minute expiry: unclaimed temporary deployments are deleted after 60 minutes. For conversational visual aids, temporary is exactly right.
- Rate limits: Cloudflare limits how quickly temporary accounts can be created. If you hit a rate limit, wait and retry.
- Account caching: Wrangler caches the temporary account and reuses it for subsequent
--temporarydeploys within the same session. - No login required:
--temporaryexplicitly bypasses all auth. If wrangler says "rerun with --temporary", add the flag. --temporaryerrors if already authenticated: Ifwrangler loginwas previously run,--temporaryreturns an error. In that case just usewrangler deploynormally.
Workflow summary
viz_create(template, config) → terminal_run(wrangler deploy --temporary) → reply with URL
Behavior rules
- Always verify the deploy succeeded. Check wrangler output for the
https://*.workers.devURL before telling the user it's live. - Include the URL in your reply as a clickable link:
[퀴즈 풀러 가기](https://viz-xxxx.workers.dev). - One visualization per deploy. Don't cram multiple unrelated widgets into one HTML file.
- Keep config realistic. Use real content from the conversation, not placeholder text.
- Korean content. If the user's language is
ko, write UI text in Korean. The templates default to Korean UI labels. - Mobile-first. Telegram in-app browser is mobile. Tap targets ≥ 44px, no hover-only interactions, no horizontal scroll.
04 同仓库更多 Skills
xvfb
Linux GUI app automation on a virtual X display. Launch non-browser Linux GUI apps in Docker, see screenshots, and interact by pixel coordinates.
x-twitter
Fetch X/Twitter posts, threads, replies, profiles, and search results via the FxTwitter (FxEmbed) API and mirror domains. Use whenever an x.com or twitter.com link appears, or the user asks about X/Twitter content. Direct scraping of x.com hits login walls and blocks.
todos
The shared todo store for the user's tasks (suggest/approve only) and your own scheduled automations. Use for tasks, reminders, recurring checks, or "tell me when X".
skill-authoring
Create or update agent skills under the user skills directory. Use when a non-trivial, repeatable workflow just succeeded and should be captured for future sessions, or when the user asks to write or fix a skill.
privacy
Privacy tools and alternatives to mainstream services with verified details on licensing, ads, and pricing.
k-school
(한국 사용자 전용) 학교알리미와 컴시간을 이용하여 전국 학교 시간표와 급식을 가져옵니다. 이 스킬에는 브라우저를 이용한 웹 크롤링과 비공식 API 호출 방법 및 컴시간 난독화 우회 방법이 모두 포함되어 있습니다.