Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/misonl/ling/web-gamesnpx skills add MisonL/Ling --skill web-gamesgit clone --depth 1 https://github.com/MisonL/LingWhat 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 | $0.00022 | $0.00979 |
| Opus 5 | $0.00011 | $0.00490 |
| Sonnet 5 | $0.00004 | $0.00196 |
| Haiku 4.5 | $0.00002 | $0.00098 |
Grade A, and why
web-games scanned grade A with 0 findings 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 2d 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
Web 浏览器游戏开发
框架选择与浏览器特定原则。
1. 框架选择
决策树
什么类型的游戏?
|
+-- 2D 游戏
| +-- 完整的游戏引擎功能? -> Phaser
| +-- 原始渲染能力? -> PixiJS
|
+-- 3D 游戏
| +-- 完整引擎(物理、XR)? -> Babylon.js
| +-- 渲染聚焦? -> Three.js
|
+-- 混合 / Canvas
+-- 自定义 -> Raw Canvas/WebGL
对比(2025)
| 框架 | 类型 | 最适合 |
|---|---|---|
| Phaser 4 | 2D | 完整游戏功能 |
| PixiJS 8 | 2D | 渲染、UI |
| Three.js | 3D | 可视化、轻量级 |
| Babylon.js 7 | 3D | 完整引擎、XR |
2. WebGPU 采用
浏览器支持(2025)
| 浏览器 | 支持 |
|---|---|
| Chrome | [OK] 自 v113 起 |
| Edge | [OK] 自 v113 起 |
| Firefox | [OK] 自 v131 起 |
| Safari | [OK] 自 18.0 起 |
| 总计 | ~73% 全球 |
决策
- 新项目:使用 WebGPU,并提供 WebGL 回退
- 遗留支持:从 WebGL 开始
- 特性检测:检查
navigator.gpu
3. 性能原则
浏览器限制
| 限制 | 策略 |
|---|---|
| 无本地文件访问 | 资产打包、CDN |
| 标签页节流 | 隐藏时暂停 |
| 移动数据限制 | 压缩资产 |
| 音频自动播放 | 需要用户交互 |
优化优先级
- 资产压缩 - KTX2、Draco、WebP
- 懒加载 - 按需加载
- 对象池 - 避免 GC
- 绘制调用合批 - 减少状态变更
- Web Workers - 卸载繁重计算
4. 资产策略
压缩格式
| 类型 | 格式 |
|---|---|
| 纹理 | KTX2 + Basis Universal |
| 音频 | WebM/Opus(回退:MP3) |
| 3D 模型 | glTF + Draco/Meshopt |
加载策略
| 阶段 | 加载 |
|---|---|
| 启动 | 核心资产,<2MB |
| 游戏过程 | 按需流式传输 |
| 后台 | 预取下一关 |
5. 游戏的 PWA
优势
- 离线游玩
- 安装到主屏幕
- 全屏模式
- 推送通知
要求
- Service worker 用于缓存
- Web app manifest
- HTTPS
6. 音频处理
浏览器要求
- 音频上下文需要用户交互
- 在首次点击/轻触时创建 AudioContext
- 如果挂起则恢复上下文
最佳实践
- 使用 Web Audio API
- 池化音频源
- 预加载常用声音
- 使用 WebM/Opus 压缩
7. 反模式
| [FAIL] 禁止 | [OK] 推荐 |
|---|---|
| 一次性加载所有资产 | 渐进式加载 |
| 忽略标签页可见性 | 隐藏时暂停 |
| 阻塞在音频加载上 | 懒加载音频 |
| 跳过压缩 | 压缩一切 |
| 假设快速连接 | 处理慢速网络 |
记住: 浏览器是最易访问的平台。尊重它的限制。
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.
- 2d ago First seen · 151 lines · 22 tokens per session scan A a7466cf8c643
web-games is a skill published in the GitHub repository MisonL/Ling (9 stars, last pushed 5mo ago), licensed MIT. It adds 22 tokens to every session and 979 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
particles
Use this skill when creating particle effects in Phaser 4. Covers ParticleEmitter, emission zones, death zones, particle properties, textures, gravity wells, and particle movement. Triggers on: particles, emitter, particle effect, explosion, fire, smoke.
web-games
Web browser game development principles. Framework selection, WebGPU, optimization, PWA.
develop-web-game
Use when Codex is building or iterating on a web game (HTML/JS) and needs a reliable development + testing loop: implement small changes, run a Playwright-based test script with short input bursts and intentional pauses, inspect screenshots/text, and review console errors with rendergametotext.
gameobject-component-destroy
Destroy one or more Components from a target GameObject. Missing (null) components are skipped — they cannot be destroyed. Use 'gameobject-find' and 'gameobject-component-get' to identify the components first.
ship-web-games
Package, deploy, and verify a playable Three.js or web game. Use for release builds, asset delivery, private/public deployment, production smoke tests, browser proof, release notes, rollback readiness, and cleanup of temporary QA resources.
unity
Compile, test, and drive Unity for this repo's C# packages (unity/core, jint, quickjs, clearscript) and the two Unity projects (tests/, kitchen-sink/). Use when a change touches C# under unity/, when Unity test results are needed, when a rendering snapshot has to be checked or regenerated, or when the app has to be…