---
catalog_id: "R-171"
kind: "repo"
domain: "frontend"
domain_label: "前端动效 / Frontend & Motion"
date: "2026-12-03"
title: "199-biotechnologies/motion-dev-animations-skill"
verdict: "渐进披露配JSON校验器，但模板藏布局动画与退场坑"
summary: "面向 Claude Code 的 Motion.dev 动效技能包，采用三层渐进披露架构与 JSON Schema 配置校验脚本组织 React/Next.js 动效模式，但模板源码暴露出布局属性动画、缺少 AnimatePresence 导致退场失效及跨框架示例缺失等断层。"
summary_en: "Progressive-disclosure Motion.dev skill with JSON Schema validator, though TSX templates leak layout height tweens and unguarded exits."
canonical_url: "https://oumuatown.com/repos/199-biotechnologies__motion-dev-animations-skill/"
markdown_url: "https://oumuatown.com/repos/199-biotechnologies__motion-dev-animations-skill.md"
og_image_zh: "https://oumuatown.com/og/zh/R-171.png"
og_image_en: "https://oumuatown.com/og/en/R-171.png"
cite_count: 43
repo: "199-biotechnologies/motion-dev-animations-skill"
github_url: "https://github.com/199-biotechnologies/motion-dev-animations-skill"
commit: "3feedfb"
tags:
  - "agent-skills"
  - "motion-dev"
  - "framer-motion"
  - "react"
  - "json-schema"
  - "web-animation"
github_repos:
  - "https://github.com/199-biotechnologies/motion-dev-animations-skill/tree/3feedfb"
  - "https://github.com/motiondivision/motion/tree/6390e6d"
---

# R-171 · 199-biotechnologies/motion-dev-animations-skill

> **结论 / Verdict**: 渐进披露配JSON校验器，但模板藏布局动画与退场坑
> **EN Summary**: Progressive-disclosure Motion.dev skill with JSON Schema validator, though TSX templates leak layout height tweens and unguarded exits.

## Provenance & Evidence

- Primary Repository: https://github.com/199-biotechnologies/motion-dev-animations-skill (@3feedfb)
- Referenced Repository: https://github.com/motiondivision/motion/tree/6390e6d
- Verified Source Citations (#Lxx): 43
- Web Reader: https://oumuatown.com/repos/199-biotechnologies__motion-dev-animations-skill/

# 199-biotechnologies/motion-dev-animations-skill

> 仓库地址：https://github.com/199-biotechnologies/motion-dev-animations-skill · 审计版本：`199-biotechnologies/motion-dev-animations-skill@3feedfb` · 审计日期：2026-12-03
> 来源文章：[关联文章](../articles/2026-12-03-voxyz-huashu-art-motion-and-15-motion-repos.md)

## 定位与解决的真问题

- **核心定位与目标用户**：由 199 Biotechnologies 开源的 Claude Code 动效技能包（MIT 协议，对应 Motion.dev v11+ / 原 Framer Motion），面向需要快速在 React / Next.js 落地入场、滚动视差、手势交互与布局动画的 Web 前端开发者与 Coding Agent。
- **相比常规做法解决的关键痛点**：
  1. **降低 Skill 全量上下文注入消耗**：将主入口 `SKILL.md` 压缩至 ~2,000 tokens（三层加载：元数据触发词 → 决策树与 3 个典型模式 → 按需读取的 `examples/`、`reference/`、`templates/`），附带工程化的触发词/排除词设计说明。
  2. **结构化约束动画参数与可访问性元数据**：引入 JSON Schema（Draft-07）与 Python 校验脚本，对动画类别、弹簧刚度/阻尼边界、帧率、包体积（`<50KB`）及 `prefers-reduced-motion` 配置做声明式校验。

## 技术栈与核心目录结构

- **形式与关键依赖**：Markdown 技能指令 + React/Tailwind TSX 模板（导入 `motion/react`）+ JSON Schema + Python 3 校验脚本（依赖 `jsonschema`）。
- **关键目录树与职责划分**（`199-biotechnologies/motion-dev-animations-skill@3feedfb`）：
  - `SKILL.md`（264 行）：主指令入口，含自然语言触发/排除描述、4 步工作流、ASCII 4 分支模式决策树、API 速查表、3 个内联 JSX 示例及设计原则。
  - `examples/`：`hero-fade-up.md`、`scroll-reveal.md`、`card-hover.md`、`parallax-layers.md`、`magnetic-button.md` 与示例配置 `example-config.json`。
  - `reference/`：`api-reference.md`（526 行 API 速查）与 `spring-physics.md`（390 行弹簧参数与预设）。
  - `templates/`：`nextjs-page.tsx`（283 行全页着陆页模板）与 `component-library.tsx`（409 行 10 个可复用 TSX 动效组件）。
  - `schema/motion-config.schema.json` & `scripts/validate_motion_config.py`：抽象动效配置 JSON 规范与命令行检验工具。
  - 工程过程文档：`RESEARCH_SYNTHESIS.md`、`VALIDATION_V3.md`、`ACTIVATION_TEST.md`、`DEPLOYMENT_STATUS.md`、`SKILL.md.backup`。

## 核心实现源码级剖析（附文件路径与行号）

1. **三层渐进披露与触发/排除路由设计（`SKILL.md#L1-L102`、`VALIDATION_V3.md#L41-L82`、`DEPLOYMENT_STATUS.md#L27-L80`）**：
   - **自然散文式 Metadata 描述**：`SKILL.md#L2-L4` 将 28 个触发词（React/Next.js/Svelte/Astro、`whileHover`/`whileInView`/spring 等）与 4 类显式排除规则（纯 CSS 过渡、无 JS 静态站、Vue `motion-v`、复杂 SVG/Canvas 转交 GSAP）压进单段 `description`，将预加载开销控制在轻量元数据级别（`DEPLOYMENT_STATUS.md#L46-L79`）。
   - **ASCII 模式决策树与少样本对齐**：`SKILL.md#L74-L101` 按 `ENTRANCE / GESTURE / SCROLL / LAYOUT` 四象限直接给出属性名、时长/曲线、弹簧区间与外部示例指针，并仅在主文件保留 `Fade Up` / `Hover Card` / `Scroll Reveal` 3 个 JSX 代码块（`#L192-L220`）对齐输出格式。

2. **声明式动效配置 Schema 与 Python 校验器（`schema/motion-config.schema.json#L1-L203`、`scripts/validate_motion_config.py#L33-L172`、`examples/example-config.json#L1-L33`）**：
   - `motion-config.schema.json#L5-L202` 规定每份配置必须声明 `type`（`entrance|gesture|scroll|layout`）、`component`（正则 `^motion\.(div|button|...|rect)$`，`#L15`）及 `props`，同时卡死弹簧参数区间（`stiffness: 50..1000`、`damping: 5..100`、`mass: 0.1..10`，`#L46-L63`）、`bundleSize <= 51200`（`#L164-L168`）及 `accessibility.reducedMotion` 必填（`#L171-L192`）。
   - `validate_motion_config.py#L58-L92` 先调用 `jsonschema.validate` 做结构性阻断，再执行附加启发式告警：`fps < 60`（`#L67-L68`）、`bundleSize > 51200`（`#L70-L71`）、未启用 `reducedMotion`/`keyboardNav`/`focusVisible`（`#L74-L87`）或 `gpuAccelerated === false`（`#L89-L90`），支持单文件及 `--all <dir>` 批量扫描（`#L105-L143`）。

3. **可复用 React 组件模板与物理参数预设（`templates/component-library.tsx#L1-L409`、`templates/nextjs-page.tsx#L15-L283`、`reference/spring-physics.md#L45-L170`）**：
   - **磁吸按钮与无障碍可及性**：`MagneticButton`（`component-library.tsx#L118-L154`、`examples/magnetic-button.md#L19-L66`）使用 `useMotionValue` + `useSpring(x, {stiffness: 300, damping: 20})` 避开 React 状态重渲染实现指针跟随；`FadeUp`（`#L20-L36`）展示 `useReducedMotion` 条件清空 `initial` 的做法；`HoverCard`（`#L81-L106`）补充了 `whileFocus` 焦点环与 `tabIndex={0}`。
   - **参数量化手册**：`spring-physics.md#L45-L170` 将 `stiffness`（`100..1000`）、`damping`（`10..50+`）、`mass`（`0.5..5`）按场景划分成 `Gentle`/`Snappy`/`Bouncy`/`Slow & Smooth`/`Critically Damped` 五档预设并标注适用组件体积。

## 亮点设计 vs 局限/坑点

- **值得借鉴的设计**：
  - **显式正向触发 + 负向排除词界定边界**：在 `SKILL.md` 顶部用 `"Do NOT use for ..."` 把纯 CSS 过渡、Vue（`motion-v`）与复杂 SVG/Canvas（转交 GSAP）挡在技能激活之外，减少模型误选重型运行时。
  - **将包体积与无障碍指标写入 Schema**：把 `<50KB`、`reducedMotion` 与 `focusVisible` 纳入机器可校验字段而非停留在口号层。
- **局限、隐含假设与潜在坑点（源码实测多处规则与模板脱节）**：
  - **模板源码直接违背自家 GPU 红线且存在退场死代码**：
    - `SKILL.md#L134` 与 `README.md#L129` 严禁动画化 `width`/`height` 触发重排，但 `templates/component-library.tsx#L258-L270` 的 `Accordion` 直接动画 `height: isOpen ? "auto" : 0`；`ToggleSwitch`（`#L351-L353`）动画 `backgroundColor`；`HoverCard`（`#L85-L95`）直接过渡 `boxShadow`。
    - `Modal`（`templates/component-library.tsx#L285-L316`）在 `if (!isOpen) return null` 后定义了 `exit={{ opacity: 0 }}`，但组件内未渲染 `<AnimatePresence>`，调用方若漏包外层 `AnimatePresence` 则退场动画完全无效。
    - `LoadingSpinner`（`#L319-L335`）标注为 `(Spring Animation)` 却配置了 `ease: "linear"`；`StaggeredList`（`#L192-L196`）使用数组下标 `key={i}`。
    - `templates/component-library.tsx` 中 **10 个组件仅 `FadeUp`（`#L21`）接入了 `useReducedMotion`**，其余 9 个组件及整份 `templates/nextjs-page.tsx#L1-L283` 均未实现减弱动态回退（也未使用 `<MotionConfig reducedMotion="user">`）。
  - **多框架支持“文档宣称大于实际内容”**：`SKILL.md#L28,L120-L127` 与 `README.md#L132-L141` 宣称完整支持 Svelte 5+ 与 Astro 4+，但全仓无任何 Svelte 代码示例，Astro 仅用 Vanilla JS `animate` 代指（`examples/hero-fade-up.md#L71-L97`）；同时 `SKILL.md#L170-L173,L179-L180` 列出的 4 份参考文档与 2 份模板在仓库 `reference/`、`templates/` 目录下均不存在。
  - **校验脚本脱节与过程垃圾文件残留**：`validate_motion_config.py` 只验抽象 JSON 文件而不扫描真实 `.tsx` 源码；根目录保留 `SKILL.md.backup` 及 `DEPLOYMENT_STATUS.md`（内含作者硬编码路径 `~/.claude/skills/motion-dev-animations/`），无实际 CI 或测试保障代码一致性，且对 Motion 引擎在离线抓帧中的双时钟/1-frame 测量延迟陷阱只字未提。

## 可复用的模块或设计模式

- **如何迁移到未来项目**：
  1. **切勿直接照搬本仓 `templates/`，应叠加 [`motiondivision/motion`](./motiondivision__motion.md) 的源码认知**：若在 React/Next.js 中使用 Motion.dev，建议以本仓 `useMotionValue` + `useSpring` 磁吸交互与 `SKILL.md` 触发/排除词写法为参考，但务必在项目根挂载 `<MotionConfig reducedMotion="user">`、用 CSS Grid `grid-template-rows: 0fr -> 1fr` 或缩放替掉 `Accordion` 的 `height: auto` 动画，并为 `Modal` 补全 `AnimatePresence`。
  2. **把“元数据 Schema 检查”升级为真实 AST 规则**：编写前端/动效校验器时，不应只校验外挂 JSON 描述文件，而应直接静态扫描 `.tsx` 是否出现 `height/width/top/left` 动画键或未包 `AnimatePresence` 的 `exit` 属性。
- **关联 Pattern**：（由 `synthesizer` 补全）

## Cross-Referenced Specimens

- [A-038 · huashu-art-motion（36+17 风格代码动画引擎）与 15 个动效/视频开源仓生态拆解](https://oumuatown.com/articles/2026-12-03-voxyz-huashu-art-motion-and-15-motion-repos.md) — 36画风9语法配三道物理门禁，15仓串起AI动效生态
- [R-062 · motiondivision/motion](https://oumuatown.com/repos/motiondivision__motion.md) — WAAPI卸载配FLiP投影，离线逐帧踩双时钟陷阱
- [P-034 · 代码艺术风格配方、参数化解说语法与全链路防 AI-Slop 门禁体系（Artistic Style Recipes, Explainer Grammars & Anti-Slop QA）](https://oumuatown.com/patterns/artistic-code-style-recipes-and-explainer-grammars.md) — 材料与时代风格拆解配参数化语法，叠加像素音画硬门禁
