1实现原理 · 为什么它能做到
SKILL.md 是四层知识的入口与路由:原子 rules(rules-index.md 索引 48 个 rules/<name>.md 食谱)→ 多相 scene blueprints(blueprints-index.md 索引 22 个)→ transitions 目录(16 文件)→ techniques.md;再加 12 张运行时 adapter 卡。
All motion knowledge in one skill: **rules** (atomic recipes), **blueprints** (multi-phase scene templates), **transitions** (scene-to-scene), **techniques** (broader motion-design patterns), and **adapters** (per-runtime APIs).
默认创作法=组合原子规则:挑 2-4 条 rules 用一条 paused GSAP timeline 粘合,而不是从蓝图起手——声称更快且代码更少;蓝图仅当场景命中预设计模板时使用。
Pick 2-4 rules from `rules-index.md`, glue them together with a single paused GSAP timeline, done. This is faster and produces less code than starting from a blueprint.
所有配方强约束在 core 的确定性契约之内,并附加动画层特有规则:布局常量预计算(禁 tween 期 getBoundingClientRect——渲染器并行采样会失步)、空间运动只用 GSAP transform 别名。
**Pre-calculated layout constants** — never derive positions from `getBoundingClientRect()` at tween time. Tween-time DOM measurements desync because the renderer samples in parallel; compute coordinates once at composition setup and reuse.
运行时适配层真实存在:七类运行时(GSAP 默认 + Lottie/Three.js/Anime.js/CSS/WAAPI/TypeGPU-WebGPU)各自注册到全局(window.__hfLottie/__hfAnime 等),HyperFrames 一次 seek 全部;adapter 卡给出每运行时在 HyperFrames 内的注册/seek 约定。
Multiple runtimes can coexist in one composition. Each registers its instances on the runtime-specific global so HyperFrames can seek all of them in one pass.
可审计能力由真实脚本支撑:animation-map.mjs 读 window.__timelines 全部 GSAP 时间线、枚举 tween、采样 bbox、算 flags,输出 animation-map.json 供 choreography 审查(dead zones/stagger 一致性/lifecycle 警告)。
Reads every GSAP timeline registered in window.__timelines, enumerates tweens, samples bboxes at N points per tween, computes flags and human-readable summaries. Outputs a single animation-map.json.
依赖引导有安全设计:package-loader.mjs 只装 pinned 包规格、用 --ignore-scripts 禁依赖生命周期脚本、spawn npm 用 argv 数组不拼 shell 字符串、install 行仅展示不执行、引导前 confirmBootstrap 征求同意。
// package-loader — bootstrap optional helper packages only when missing, with // defense-in-depth so a malicious or typo'd dependency can't run on install: // • install runs `npm install --ignore-scripts` — package lifecycle scripts // never execute
2核心能力
3外部依赖
| 类型 | 依赖 |
|---|---|
| package | @hyperframes/producer / @hyperframes/core(animation-map.mjs 运行时依赖;项目优先,缺失才 bootstrap) |
| network | 产物运行期 CDN 库(gsap/three/animejs 经 jsdelivr 进 composition/示例——作品级依赖,渲染浏览器加载) |
| cli | hyperframes CLI(lint/check/snapshot/render,验证动画产出;命令细节在 hyperframes-cli) |
| package | 外部 animate-text skill(24 个具名文本动画效果的实现方) |
4风险提醒 风险提醒:蓝色 · 知晓即可
- 知识量大(48 规则 + 22 蓝图 + 12 适配器),agent 路由错层会读到不匹配的食谱 — 路由表与 tags 缓解;规则卡都标注适用触发条件,但最终选择依赖模型判断。
- 动画地图审计需驱动 headless 浏览器执行 composition inline JS — 与 core/preview 同级:不可信 composition 的执行面,宿主渲染沙箱承担;脚本自身无外发。
- 外部 animate-text 技能为 24 个文本效果的事实源,跨仓库依赖 — adapter 卡仅指引(github.com/pixel-point/animate-text),其质量/安全不在本仓控制范围。
5第二遍独立确认
- [ok] rules-index/blueprints 数量与路由声称一致 — find 实测 rules/ 48 个 md、blueprints/ 22 个 md、examples/ 13 个 html、adapters/ 12 个 md、transitions/ 16 个,与 SKILL.md/rules-index 描述一致。
- [ok] 『7 个运行时适配器』声称(GSAP+Lottie+Three+Anime+CSS+WAAPI+TypeGPU) — adapters/ 目录实测含对应 7 种 + html-in-canvas-patterns + animate-text + gsap 细分 3 卡;TypeGPU 卡存在(WebGPU/WGSL)。
- [ok] package-loader 安全声称(防依赖投毒) — 源码注释与实现复核:pinned spec 断言(assertPinnedPackageSpecs)、--ignore-scripts、argv spawn、display-only installLine、confirmBootstrap 征求同意——逐条命中。
- [discrepancy] animation-map 是否会在无依赖时擅自联网 — 首轮注记偏『项目优先』;复核发现若项目无包且用户同意 bootstrap 会执行 npm install(网络)——非默认路径但确实存在,已在外联 deps/scripts_executed 如实标注并保持 blue(官方包 + consent + --ignore-scripts)。
- [ok] 有无把文档站链接误当外发依赖 — gsap.com/threejs.org/animejs.com 等仅为 adapter 卡内的 API 文档引用(人类阅读),非运行依赖,未列入 external_deps。
6结论
f370d7615a306ee2…b8328f9573