Borrowing it
Nothing to install: this file belongs to asdf17128/bili-webos. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/asdf17128/bili-webos/main/.claude/skills/tv-test/SKILL.mdgit clone --depth 1 https://github.com/asdf17128/bili-webosWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/asdf17128/bili-webos/tv-test)<a href="https://agentmods.dev/skills/asdf17128/bili-webos/tv-test"><img src="https://agentmods.dev/badge/skills/asdf17128/bili-webos/tv-test/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/asdf17128/bili-webos/tv-test"><img src="https://agentmods.dev/badge/skills/asdf17128/bili-webos/tv-test.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00067 | $0.10423 |
| Opus 5.5 | $0.00027 | $0.04169 |
| Sonnet 5.5 | $0.00013 | $0.02085 |
| Haiku 4.5 | $0.00007 | $0.01042 |
Grade A, and why
tv-test scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
- 本机回环就绪探针须绕过代理并要求 HTTP 成功。`curl -s` 收到代理 502 仍退出 0,会把未启动服务当成正常;使用 `--noproxy '*' -f`,不要把连锁失败当产品回归。 How it starts
The opening of the file, as written. The whole thing — 278 lines — stays where its author put it; the contents beside it link to each section on GitHub.
bili_webos 测试与验证
一键管线(发版前必跑)
bash tools/verify.sh # 全链路:语法 → 真Node0.12/8 → 构建 → 部署 → 真机DOM检查
bash tools/verify.sh --no-tv # 只跑本地层(电视不在时)
bash tools/verify.sh --full # 额外跑真机 UI smoke(test-ui.mjs,~3分钟)
五层,逐层 fail-fast:
- syntax — service 全部文件用 acorn 按 ES5 解析(webOS 4.x = Node 0.12.2)
- node8 — docker x86 内分别运行真实 Node 0.12.2 和 8,跑真实 service.js:stub webos-service、驱动 fetch handler 真连 api.bilibili.com、调 getDiagnostics。见
tools/test-node8/ - build — vite 生产构建
- deploy — build.sh 部署 +
tools/launch.mjs重启 app - device — CDP 断言:卡片>5、侧栏存在、0 张裂图,并存截图
验证纪律(血泪教训,违反必翻车)
- 正对照原则:先证明测试方法能复现 bug,再声称修复已验证。
做法:
git checkout <旧commit> -- <文件>→ 部署坏版 → 同一操作复现 bug → 恢复新版 → 同一操作确认消失。边缘滚动 bug 连续两个版本"修好了"都是假的,就是因为没做正对照。 - 失败路径必须测。 诊断页/错误处理类功能,happy path 全绿毫无意义 —— 用 Playwright
route.abort()掐断 API,确认错误文本上屏、进报告。 - 测试结果反常时,先验证测试工具本身。 在页面挂原生事件计数器(
document.addEventListener('mousemove',...,true))再注入 CDP 事件 —— 曾经 CDP 鼠标注入静默失效,把"工具坏了"误判成"产品坏了"浪费了一整轮。 - 交互语义用受信输入管线验证:
npm run dev+ Playwright(page.mouse/page.keyboard走真实 Chromium 输入管线),addInitScript干掉window.webOS强制走 proxy,page.routemock 数据流(mock 端点注意 wbi 路径:**/top/feed/rcmd**)。TV 的 CDPInput.dispatchMouseEvent不可靠,不要依赖它测 hover。
旧设备(webOS 5/6)兼容
- service 层 = Node 8:没有
URL/URLSearchParams/globalThis全局、没有?./??/optional catch binding。new URL要写require('url').URL(曾导致 webOS 5 全部请求失败,#10/#13)。ws必须 v7(v8 要 Node 14)。 - app 层 = Chromium 68(webOS 5)/ 79(webOS 6):vite legacy 插件管语法;要防的是缺失的全局(globalThis 已 polyfill)和新 Web API。
- 官方模拟器:VirtualBox Emulator 只到 webOS 6.0 且 x86-only(Apple Silicon 跑不了);Simulator 只覆盖 webOS 22+。→ 所以用 docker node:8 测 service,这是最接近真机的手段。
- 新增 service 依赖/语法时:
npx acorn --ecma5 --silent <file>快速把关,再跑实际运行时。
真机工具箱(tools/)
| 工具 | 用途 | 坑 |
|---|---|---|
launch.mjs <appId> |
启动/切换 app | 必须 luna-send-pub(公共总线);私有 luna-send 对 prisoner 永远 Permission denied |
wake.mjs |
WoL 唤醒电视 (MAC 14:7f:67:a1:6b:56) | |
drive.mjs "keys" |
遥控按键 + STATE | 从未知焦点开始导航不可靠,先 left,left 回侧栏 |
point.mjs "move:x:y,wheel:d,click" |
指针模拟 + focus/underPointer/match | 注入可能静默失效(见纪律3);端口已改 ephemeral |
eval.mjs "<expr>" |
页内执行 JS | 验证 UI 状态首选(截图对 GPU 层是白的) |
screenshot.mjs |
真机截图 | 视频/GPU合成层截不到 |
test-ui.mjs |
真机 UI smoke 全家桶 | app 须在前台 |
test-e2e.mjs |
API 集成测试 | 需先 node proxy/server.js |
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago Changed · +17 lines 16f908ce14b6
- 15d ago Changed · +93 lines c61e6dc4113e
- 18d ago Changed · +23 lines d614ea300c19
- 23d ago Changed · +63 lines a14f69084cf2
- 2mo ago First seen · 82 lines · 67 tokens per session scan A 0b78a5c6a8ac
tv-test is a skill published in the GitHub repository asdf17128/bili-webos (161 stars, last pushed today), licensed MIT. It adds 67 tokens to every session and 10,423 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
verification-before-completion
A checklist for verifying work before claiming that it is finished, fixed, built, tested, or ready to submit. It requires fresh command output and evidence for each claim.
migrate-to-shoehorn
A testing guide for Shoehorn, a TypeScript library that lets tests provide only the fields they need from a larger data type.
writing-skills
A guide for creating and testing reusable instructions for AI agents, called skills. It applies test-driven development, or TDD—the practice of writing tests before implementation—to instruction documents.
test-driven-development
Test-driven development, or TDD, is a way to build software by writing a test that fails, adding the smallest code that makes it pass, and then cleaning up the code. These instructions require that process for features, bug fixes, refactors, and behavior changes.
tdd
A reference for Test-Driven Development (TDD), a method where you write a failing test, make it pass, and then improve the code. It covers how to write durable tests, where to place them, and which patterns to avoid.
migrate-to-shoehorn
A testing utility that replaces TypeScript's `as` type assertions with Shoehorn helpers for creating partial or intentionally invalid test data.