BjornMelin/dev-skills / plugins/web-motion/skills/web-waapi
web-waapi
VerifiedUse this skill for Browser Web Animations API: Element.animate(), Animation, KeyframeEffect, playback control, generated keyframes, cancel/finish, commitStyles, and cleanup. Trigger on Element.animate, WAAPI, Web Animations API, KeyframeEffect, Animation object, commitStyles. Do not use for near-miss tasks outside these boundaries; route to adjacent motion or platform skills when they own the implementation.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 4.4 KB |
| agents/openai.yaml | config | 340 B |
| assets/examples/web-waapi-starter.ts | script | 330 B |
| assets/templates/web-waapi-audit-report.md | markdown | 626 B |
| assets/templates/web-waapi-review-checklist.md | markdown | 1.4 KB |
| evals/evals.json | config | 4.0 KB |
| evals/trigger-queries.json | config | 4.0 KB |
| references/docs-mdn-web-animations-api.md | markdown | 7.2 KB |
| references/index.md | markdown | 546 B |
| references/keyframe-effect-options.md | markdown | 1.6 KB |
| references/playback-testing.md | markdown | 1.6 KB |
| references/promise-events-and-cancellation.md | markdown | 2.5 KB |
| references/provenance.json | config | 1.9 KB |
| references/source-ledger.md | markdown | 1.4 KB |
| references/testing-with-getanimations.md | markdown | 2.4 KB |
| references/waapi-lifecycle.md | markdown | 1.5 KB |
| scripts/audit.mjsexecutable | script | 28.8 KB |
references/promise-events-and-cancellation.md
View on GitHub# Animation promises, events, and cancellation
Skill: web-waapi
Checked at: 2026-06-04
## When To Load
- Read when WAAPI code awaits `finished`, reacts to `finish`/`cancel`, or coordinates interruption.
## Source Anchors
- https://developer.mozilla.org/docs/Web/API/Web_Animations_API/Using_the_Web_Animations_API
- https://developer.mozilla.org/docs/Web/API/Animation/commitStyles
## Reference Notes
- WAAPI animations have lifecycle state. Treat `finished` promises, event listeners, cancellation, and route/component teardown as first-class control flow.
- A cancelled animation and a finished animation are different outcomes; cleanup and final styles should reflect that distinction.
- Avoid dangling promises that update UI after the owner unmounts.
## Focused Checks
- Test cancel, finish, reverse, rapid restart, and unmount.
- Check that event listeners are removed or tied to the owner lifecycle.
## Failure Modes
- Awaiting `animation.finished` without handling cancellation.
- Calling `commitStyles()` after a cancelled animation without verifying desired final state.
## Operating Guidance
Browser Web Animations API: Element.animate(), Animation, KeyframeEffect, playback control, generated keyframes, cancel/finish, commitStyles, and cleanup.
### Decision Boundaries
- Use CSS for simple state transitions.
- Use Motion/GSAP when framework state or timelines dominate.
- Use WAAPI when code needs an Animation object, seeking, cancellation, or generated keyframes.
### Workflow Details
1. Check browser support and local fallback policy.
2. Create keyframes/options with explicit duration, fill, easing, and composite behavior.
3. Own animation cancellation and finish behavior.
4. Verify rapid interruptions, route unmount, reduced motion, and commitStyles usage.
### Gotchas
- commitStyles persists computed styles and should be followed by cancel when appropriate.
- fill: forwards can retain stacking/style side effects.
- Multiple animations on the same property need composite/replace intent.
## Validation Notes
- Inspect installed package versions and local architecture before applying examples.
- Prefer the bundled `scripts/audit.mjs doctor --root <repo> --format json` command when setup is unclear.
- Use `scripts/audit.mjs scan --root <repo> --format markdown` for repeatable static findings, then manually verify every finding against current code.
- Close with repo-specific checks and user-visible runtime proof when this skill affects a rendered surface.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |