Skip to content

The design language that makes your AI harness better at design.

JavaScript

Restore reduced-motion animation guidance (#540)

Paul Bakausfc05472a20d6
diff --git a/scripts/test-suites.mjs b/scripts/test-suites.mjs
index 4145cfc83..608cea352 100644
--- a/scripts/test-suites.mjs
+++ b/scripts/test-suites.mjs
@@ -68,6 +68,7 @@ export const SUITES = {
'tests/release.test.mjs',
'tests/doctor.test.mjs',
'tests/staleness.test.mjs',
+ 'tests/skill-reference.test.mjs',
'tests/target-args.test.mjs',
'tests/surface-brief.test.mjs',
'tests/template-extensions.test.mjs',
diff --git a/skill/reference/animate.md b/skill/reference/animate.md
index eea0b4781..f80ebd154 100644
--- a/skill/reference/animate.md
+++ b/skill/reference/animate.md
@@ -74,12 +74,15 @@ Keep content visible in the default state so failed scripts do not hide the page
Respect autoplay and sound preferences. Any nonessential loop must stop when offscreen or hidden.
+Every web animation needs a `prefers-reduced-motion` path with an intentional alternative. Remove or reduce spatial movement while preserving opacity, color, and state transitions that carry meaning. Reduced motion means fewer and gentler animations, not disabling all motion; feedback that confirms an action should remain legible.
+
## Verify
- The focal motion is specific to the selected world and surface.
- Every supporting animation explains feedback, state, or relationship.
- Interruption and repeated use behave correctly.
- Desktop, mobile, and keyboard paths remain usable.
+- The `prefers-reduced-motion` path reduces movement without erasing meaningful feedback or state changes.
- Expensive effects stay smooth on the target device.
- Removing an animation would lose meaning or authored character, not merely decoration.
diff --git a/tests/skill-reference.test.mjs b/tests/skill-reference.test.mjs
new file mode 100644
index 000000000..ea1517591
--- /dev/null
+++ b/tests/skill-reference.test.mjs
@@ -0,0 +1,20 @@
+import { describe, it } from 'node:test';
+import assert from 'node:assert/strict';
+import { readFileSync } from 'node:fs';
+import { join } from 'node:path';
+import { fileURLToPath } from 'node:url';
+
+const ROOT = fileURLToPath(new URL('..', import.meta.url));
+
+describe('skill reference authoring contracts', () => {
+ it('keeps reduced-motion guidance on the animation build path', () => {
+ const animate = readFileSync(join(ROOT, 'skill/reference/animate.md'), 'utf-8').replace(/\r\n?/g, '\n');
+ const accessibility = animate.match(/## Accessibility and control\n([\s\S]*?)\n## Verify/)?.[1] ?? '';
+ const verify = animate.match(/## Verify\n([\s\S]*?)(?:\n## |$)/)?.[1] ?? '';
+
+ assert.match(accessibility, /prefers-reduced-motion/);
+ assert.match(accessibility, /intentional alternative/);
+ assert.match(accessibility, /not disabling all motion/);
+ assert.match(verify, /reduced[- ]motion/i);
+ });
+});