Restore reduced-motion animation guidance (#540)

* Restore reduced-motion build guidance

Restores the accessibility requirement and verification step to the animation playbook, with a regression test that keeps it on the build path.

Implemented and validated with OpenAI Codex assistance under standing maintainer authorization.

* Harden reduced-motion guidance regression

Normalizes CRLF input and accepts either reduced-motion spelling so the contract stays portable and intent-focused.

Implemented and validated with OpenAI Codex assistance under standing maintainer authorization.

* Anchor skill reference test to its module

Resolve the repository fixture path from the test module so the regression test is independent of the caller's working directory.

This change was prepared with AI assistance under maintainer authorization.

* Clarify reduced-motion guidance

Replace the double negative in the canonical animation guidance and keep the source contract aligned with the clearer wording.

This change was prepared with AI assistance under maintainer authorization.
This commit is contained in:
Paul Bakaus
2026-08-08 15:49:43 -07:00
committed by GitHub
parent f254e7685d
commit fc05472a20
3 changed files with 24 additions and 0 deletions
+1
View File
@@ -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',
+3
View File
@@ -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.
+20
View File
@@ -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);
});
});