form-motion

form-motion is a skill for Claude Code, Codex from majiayu000/spellbook. It costs 224 tokens per session (2,943 once invoked), scanned A, original, MIT.

A reference library of ten small interface animations, each with an example, adjustable parts, accessibility guidance, and automated checks. It uses a spring-like motion model so controls can change direction from their current position.

In plain words
What is it for?
Use it for loading buttons, selection indicators, elastic sliders, switches, expanding cards, stacked notifications, command palettes, drag sorting, pointer-following tips, and animated line charts.
Why use it?
It avoids designing common micro-interactions from scratch and gives each animation a stated behavior to check. The checks also cover keyboard and pointer use, reduced motion, narrow mobile layouts, and browser errors.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it for loading buttons, selection indicators, elastic sliders, switches, expanding cards, stacked notifications, command palettes, drag sorting, pointer-following tips, and animated line charts.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/majiayu000/spellbook/form-motion
Install

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.

Any agent
npx skills add majiayu000/spellbook --skill form-motion
Clone the repo
git clone --depth 1 https://github.com/majiayu000/spellbook

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for form-motion

README.md
[![agentmods](https://agentmods.dev/badge/skills/majiayu000/spellbook/form-motion/github.svg)](https://agentmods.dev/skills/majiayu000/spellbook/form-motion)
Your own site
<a href="https://agentmods.dev/skills/majiayu000/spellbook/form-motion"><img src="https://agentmods.dev/badge/skills/majiayu000/spellbook/form-motion/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.

agentmods 80×15 button for form-motion

Your own site · 80×15
<a href="https://agentmods.dev/skills/majiayu000/spellbook/form-motion"><img src="https://agentmods.dev/badge/skills/majiayu000/spellbook/form-motion.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 224 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,943 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00224 $0.02943
Opus 5.5 $0.00090 $0.01177
Sonnet 5.5 $0.00045 $0.00589
Haiku 4.5 $0.00022 $0.00294

Measured 10d ago against content hash 211389a9cc96, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

form-motion 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 10d ago.

The scan reads SKILL.md. This mod also ships 4 executable files (assets/motion.js, scripts/build_samples_md.py, scripts/lib/env.mjs, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/form-motion/SKILL.md · 111 lines

How it starts

The opening of the file, as written. The whole thing — 111 lines — stays where its author put it; the contents beside it link to each section on GitHub.

FORM 动效词典

10 个可操作的界面动效,每个都由一段提示词定义,并配有可以自动跑的验收。用法是先挑出这次需要的样例,然后只读它那一节,照着提示词实现到用户的页面或组件里,最后跑验收。

选样例

ID 用户可能会说 样例
01 按钮自己变成加载和完成 连续形变按钮
02 选中条像软糖一样追过去 液体标签指示器
03 拖到头还能拽一点 弹性音量滑块
04 开关的圆点移动时稍微拉长 柔性开关
05 这张卡自己长出更多内容 原位展开卡片
06 新通知压在前面,旧的往后退 层叠通知
07 打开就能输入搜索并回车 搜索命令面板
08 抓住一行,其他行自然让位 跟手拖动排序
09 提示跟随鼠标但不挡住它 跟随式提示
10 折线自己画出来,悬停解释数据 自绘折线图

一次只取需要的样例,不要把整个词典塞进上下文。

文件

  • references/samples.md:每个样例一节,包括提示词原文、适用场景、可改项、验收标准和测试钩子。
  • assets/motion.js:共用弹簧 FormMotion.Motion,无依赖。
  • assets/reference.html:原作的离线目录页,含 10 个参考实现(mount01…mount10)。?sample=NN 打开对应样例。
  • scripts/verify.mjs:用真实的指针和键盘操作逐条验收。另外查减少动态效果、390 宽手机有没有横向溢出、页面有没有报错。
  • references/catalog.json:结构化原始数据。scripts/build_samples_md.py 用它重新生成 samples.md。

步骤

  1. 定样例和替换项:把用户的话对到上表。对照"可改项",问清或推断要换什么,比如文字、颜色、尺寸、数据、真实的异步任务。运动关系和验收行为保持不变。
  2. 读那一节:在 references/samples.md 里,提示词就是规格。要接进已有项目时,再读 reference.html 里对应的 mountNN 和 Motion 类,拿到准确的运动参考。
  3. 实现:沿用项目原有的技术栈(React 等)。弹簧直接用 motion.js,或者把 Motion 类搬过去。下面的硬规则每个样例都要遵守。
  4. 保留测试钩子:每节末尾列了 data-form、data-part 和 ARIA 钩子,交付物里留着它们,验收脚本靠它们定位元素。
  5. 验收:每个样例放一个独立页面,命名为 NN.html,然后运行 node scripts/verify.mjs <目录>,全部 ✓ 才算完成。不过的项附有实测值,按实测值修。脚本覆盖不到的手感,比如拉伸程度是否好看、文字是否清晰,要自己操作一遍或截图检查。

硬规则(10 个样例共用)

  • 同一个元素做完整个变化:按钮、卡片、指示器都只改自身的尺寸和位置,不能用两个元素交叉淡入淡出来冒充形变。
  • 不用 scale 拉伸带文字的东西:拉伸只改 left/right/width/height;scale 只用于整体的轻微抬升,比如 08 的 1.02,或者 06 的后退层。
  • 打断不跳:重定向时从当前的位置和速度出发(Motion.set 会先采样当前轨迹)。快速连续操作不能跳到上一个终点。
  • 逻辑状态立即更新,画面跟着走:aria-checked、aria-valuenow、列表顺序在触发的当下就变,动画只负责视觉。
  • 直接操作不插值:拖动时位置直接等于指针位置(snap)。松手后才用弹簧,并把拖动速度传进去(set(…, {}, {x: v}))。
  • 按真实尺寸测量目标:用 getBoundingClientRect 测量,适应长短不同的文字和移动端宽度。
  • 减少动态效果:prefers-reduced-motion 下直接到终态。Motion 已经处理了,自写的 CSS 动画要另外关掉。
  • 键盘、触摸和语义:按每节提示词里写明的 role 和 aria 做;触控目标不小于 44px;只在拖柄或滑块区域设置 touch-action: none。
  • 视觉克制:画布用暖灰 #f2f1ed,组件只用黑白;英文用 Geist(离线可回退到系统字体),图标描边 1.7px。只允许轻微超调,不加弹跳、光晕、粒子或界面渐变。用户点名要换风格时,可以套 assets/skins/ 里的皮肤,见下一节;运动规则不变。
  • 演示与接入分开:01 的异步任务、07 的命令执行在演示时用明确的模拟结果;接入时换成真实操作,错误必须看得见、能重试。

Read the full file on GitHub · 111 lines

Files

What ships with it

9 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

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.

  1. 10d ago Changed · +2 lines 211389a9cc96
  2. 27d ago First seen · 109 lines · 224 tokens per session scan A 6cf070057eac

Subscribe to this mod's changes

form-motion is a skill published in the GitHub repository majiayu000/spellbook (301 stars, last pushed 7d ago), licensed MIT. It adds 224 tokens to every session and 2,943 once invoked, about $0.0009 per session on Opus 5.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-11-03.

Related

form-motion compared with skills from other repositories

form-motion next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
form-motionmajiayu000/spellbookSkill3017d agoMITA224Claude Code, Codex
Webdesigndanielmiessler/LifeOSSkill20k11d agoMITA108Claude Code, Codex
lov-maintain-partnerslovstudio/skillsSkill723d agoMITA294Claude Code
web-design-expertfrankxai/claude-skills-librarySkill51todayMITA48Claude Code
design-asset-intakefrankxai/claude-skills-librarySkill51todayMITA80Claude Code
liquid-glassfrankxai/claude-skills-librarySkill51todayMITA122Claude Code, Codex
shader-backdropfrankxai/claude-skills-librarySkill51todayMITA98Claude Code, Codex