experiment-readout
Hypothesis + Metrics + Results + Interpretation + Decision: Turns A/B or product experiments into actionable recommendations.
1How It Works & Mechanism
This skill is not an executable program, but a prompt injected into the local coding-agent CLI: the host takes the body of SKILL.md, prepends a shared site-wide design instruction, appends user content, concatenates them into a single prompt for the logged-in agent, and retrieves the agent's stdout as HTML.
【输入格式】: ${opts.format} 【用户内容】: ${opts.content}
The shared instruction layer (which does not belong to any single skill but sits above every template) anchors the output as a 'self-contained single-file HTML' and explicitly forbids the agent from using filesystem tools such as Write/Edit/Bash, streaming the HTML directly as the conversation body.
- **禁止使用 Write / Edit / MultiEdit / Bash / Create / 任何文件系统工具**。不要把 HTML 写到任何 \`.html\` 文件里。前端直接捕获你的 stdout 文本, 文件落盘由前端负责。
Beyond SKILL.md, there is a 'content-driven quantity' override rule: any page, frame, or card count stated in the template is strictly treated as a reference lower bound, with the actual quantity determined by user content—preventing the agent from compressing user content to match template numbers.
- 模板只定义"可用版面 / 风格 / 配色 / 字体 / 组件库", **不定义** slide / 帧 / 卡片 / section 的数量。
The loading convention is 'one skill = one directory': SKILL.md (YAML frontmatter for the selector + body as template prompt), with optional example.md (sample input) and example.html (ready-to-open preview sample); adding a new template only requires adding a directory without modifying TS code.
* SKILL.md — frontmatter (id, scenario, tags, …) + prompt body * example.md — (optional) sample input content * example.html — (optional) pre-rendered preview, shown inline in the picker
The selection pipeline (CLI side) is a three-stage funnel: strong keyword signals (2 points per matched word, threshold 3) → fallback to tags/scenario scoring → if still uncertain, pass the first 800 characters of user content to a local agent for one-sentence classification.
const CONFIDENCE_THRESHOLD = 3;
The preview pipeline is independent of generation: /api/templates/<id>/preview returns example.html verbatim as text/html to the iframe; the frontend iframe uses sandbox="allow-scripts allow-same-origin".
sandbox="allow-scripts allow-same-origin"
The core of the template is a 'fixed 9-section report skeleton + four-way verdict': forcing any experimental material through the pipeline of Header → Hypothesis → Setup → Result snapshot → Metric table → Interpretation → Decision → Follow-up → Instrumentation notes, ultimately requiring one of Ship / iterate / extend / stop.
【必须输出的结构】 1. Header: 实验名称、owner、日期、实验状态、decision。 2. Hypothesis: 原始假设, 必须改写成可验证句式。 3. Setup: audience、variant、duration、sample size、primary metric、guardrail metrics。 4. Result snapshot: primary metric lift、absolute delta、sample、confidence / caveat。 5. Metric table: Control vs Variant, primary + secondary + guardrail。 6. Interpretation: 解释结果为什么发生, 区分 signal、noise、unknown。 7. Decision: Ship / iterate / extend / stop 四选一, 并给理由。 8. Follow-up experiments: 2-4 个下一步实验, 每个包含 hypothesis、expected impact、effort。 9. Instrumentation notes: 数据缺口、埋点问题、样本偏差。
It explicitly rejects the goal of merely 'displaying data': the intent section anchors its positioning on judgment—what this experiment demonstrates, and whether the next step is to launch, stop, keep running, or redesign.
【意图】这不是普通数据报告、不是 dashboard。目标是回答: "这个实验说明了什么, 我们下一步应该上线、停止、继续跑, 还是重新设计?"
An anti-fabrication clause is written into the template body: only data provided by the user may be used, strictly forbidding fabricated p-values, confidence intervals, or sample sizes.
- 只使用用户提供的数据。不要捏造 p-value、confidence、样本量。
Above-the-fold information hierarchy is strictly specified: there must be a 'large decision badge and primary metric delta', allowing readers to grasp the verdict and primary metric change within 3 seconds.
- 首屏必须有大号 decision badge 和 primary metric delta。
Three mutually exclusive style assets are routed: product-readout (default) / lab-notebook (research, preserving uncertainty) / growth-console (growth, funnels, real-time), with explicit usage conditions and a rule to 'never mix the three'.
根据实验语境选择一种, 不要三种混用:
2Core Capabilities
3External Dependencies
| Kind | Dependency / Endpoint |
|---|---|
| network | Tailwind Play CDN(共享指令强制;示例页与三份资产页均实际引用) |
| network | Google Fonts(Inter / Noto Sans SC,示例页实际引用) |
| package | Chart.js(SKILL.md 允许的可选图表库;示例页未使用) |
4Recommended Governance & Evidence
- SKILL.md: Pure prompt instructions and rule text; no script execution or external impact.
5Second-Pass Verification
- [ok] 运行时机制(loader→assemblePrompt→agent CLI→捕获 stdout) — 重读 next/src/lib/templates/shared.ts / next/src/app/api/convert/route.ts:拼装顺序与 /api/convert 调用点逐字复核,与第一遍一致。
- [ok] 『固定 9 段结构』宣称 — 重读 SKILL.md 结构段,9 段编号与名称与 JSON 引用一致,无夸大。
- [ok] 外部资源条目(tailwind / Google Fonts) — 在 assets/product-readout.html 命中 <script src="https://cdn.tailwindcss.com">、<link href="https://fonts.googleapis.com/css2?family=Inter…">,调用点真实存在。
- [discrepancy] 『assets/ 三风格可选』可执行性 — SKILL.md 指示参考 assets/,但全仓 grep 显示 product-readout.html / lab-notebook.html / growth-console.html 仅被该 SKILL.md 自身引用;loader.ts 的 loadSkillFromDir 只读 SKILL.md / example.md / example.html。结论:生成时模型看不到这三份资产,指令为死引用。
- [ok] 安全面(脚本/网络/凭证/写盘) — 对 skill 目录做 token 扫描(script/fetch/XMLHttpRequest/API key/process.env/child_process/eval/curl/wget/.env/localStorage/download=)零命中;示例页唯一 <script> 是 Tailwind CDN 标签,无自写 JS。
- [ok] meta 元数据(stars / last_push / license) — GitHub API 实查 owner_repo=nexu-io/html-anything:stargazers_count=8827、pushed_at=2026-09-15T03:36:24Z、license.spdx_id=Apache-2.0,与仓库根 LICENSE(Apache License 2.0)一致。
- [unlocatable] 安装量 — 无公开安装量数据源(README/GitHub API 均无),meta.installs 置 null,不硬写。
6Verdict & Scenarios
f9361c33db600ac8…