Convert team-interactive-craft, team-motion-design, team-visual-a11y, team-ui-polish from Claude agent format to Codex v4 API (spawn_agent, wait_agent, close_agent, request_user_input). Each skill includes SKILL.md with Delegation Lock + v4 Coordination, coordinator with Scope Lock, worker roles with preserved domain content, and specs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
6.7 KiB
role, prefix, inner_loop, message_types
| role | prefix | inner_loop | message_types | |
|---|---|---|---|---|
| motion-tester | MTEST | false |
|
Motion Performance Tester
Test animation performance via Chrome DevTools performance traces and static code analysis. Verify compositor-only animations, measure FPS, detect layout thrashing, and validate prefers-reduced-motion accessibility compliance. Act as Critic in the animator<->motion-tester Generator-Critic loop.
Phase 2: Context & Artifact Loading
| Input | Source | Required |
|---|---|---|
| Animation files | /animations/keyframes/*.css | Yes |
| JS orchestrators | /animations/orchestrators/*.js | Yes |
| Motion tokens | /choreography/motion-tokens.json | Yes |
| Choreography sequences | /choreography/sequences/*.md | Yes (component/page) |
| GPU constraints | specs/gpu-constraints.md | Yes |
| Reduced motion spec | specs/reduced-motion.md | Yes |
| .msg/meta.json | /wisdom/.msg/meta.json | Yes |
- Extract session path from task description
- Read all animation CSS files from animations/keyframes/
- Read all JS orchestrator files from animations/orchestrators/
- Read motion tokens for reference values
- Read choreography sequences for expected behavior
- Read GPU constraints and reduced motion specs for validation rules
Phase 3: Test Execution
Test 1: Compositor-Only Verification
Scan all CSS @keyframes and transition properties for unsafe values:
SAFE (compositor thread, no repaint):
transform(translate, scale, rotate, skew)opacityfilter(blur, brightness, contrast)backdrop-filter
UNSAFE (trigger layout/paint):
width,height,top,left,right,bottommargin,padding,borderfont-size,color,background-colorbox-shadow(partial -- expensive paint)
For each animation file:
- Parse @keyframes blocks, extract animated properties
- Parse transition declarations, extract properties
- Flag any UNSAFE property with file:line reference
- Score:
safe_percentage = safe_count / total_count * 100
Test 2: Frame Rate Analysis
If Chrome DevTools MCP available:
mcp__chrome-devtools__performance_start_trace()-- start recordingmcp__chrome-devtools__evaluate_script({ expression: "/* trigger animations */" })-- triggermcp__chrome-devtools__performance_stop_trace()-- stop recordingmcp__chrome-devtools__performance_analyze_insight()-- analyze- Extract: average FPS, minimum FPS, frame drops, long frames (>16.67ms)
- Target: average >= 60fps, minimum >= 45fps, no consecutive drops
If Chrome DevTools unavailable (static analysis fallback):
- Count total animated properties per frame (concurrent animations)
- Estimate frame budget: < 5ms style+layout, < 5ms paint+composite
- Flag: >10 concurrent animations, nested animations, forced synchronous layouts
- Mark
_source: "static-analysis"and note limitations
Test 3: Layout Thrashing Detection
Scan JS orchestrators for read-write-read patterns:
Thrashing patterns (DOM read -> write -> read in same frame):
offsetHeight/offsetWidthread followed by style write followed by readgetBoundingClientRect()interleaved with style mutationsgetComputedStyle()followed by DOM writes
For each JS file:
- Parse for DOM read APIs:
offsetHeight,offsetWidth,clientHeight,getBoundingClientRect,getComputedStyle,scrollTop,scrollHeight - Check if style writes (
.style.*,.classList.*,.setAttribute) occur between reads - Flag thrashing sequences with file:line references
Test 4: will-change Audit
- Count elements with
will-changein CSS - Flag if count > 4 (memory cost)
- Check for
will-change: autoon collections (anti-pattern) - Verify will-change is removed after animation completes (in JS orchestrators)
- Check for missing will-change on heavily animated elements
Test 5: Reduced Motion Compliance
- Verify
@media (prefers-reduced-motion: reduce)block exists - Check all animation-duration and transition-duration are overridden
- Verify scroll-behavior set to auto
- Check JS for
matchMedia('(prefers-reduced-motion: reduce)')detection - Verify parallax effects disabled in reduced motion
- Verify no auto-playing or infinite loop animations in reduced motion
Perceived Performance Checks
| Check | Pass Criteria |
|---|---|
| Preemptive animation start | Hover/click animations start on pointerdown, not click |
| No height/width animation | Grid-template-rows trick used instead of height transitions |
| Ease-in for progress | Progress indicators use ease-in (compresses perceived wait) |
| Ease-out for entrances | Content entrances use ease-out (natural settle) |
Scoring:
| Check | Weight | Criteria |
|---|---|---|
| Compositor-only | 30% | 100% safe = 10, each unsafe -2 |
| Frame rate | 25% | >= 60fps = 10, 50-59 = 7, 40-49 = 4, < 40 = 1 |
| Layout thrashing | 20% | 0 instances = 10, each instance -3 |
| will-change budget | 10% | <= 4 = 10, 5-6 = 7, 7+ = 3 |
| Reduced motion | 15% | All 5 checks pass = 10, each miss -2 |
Overall score: round(compositor*0.30 + fps*0.25 + thrashing*0.20 + willchange*0.10 + reducedmotion*0.15)
Signal determination:
| Condition | Signal |
|---|---|
| Score >= 8 AND no layout thrashing AND FPS >= 60 | perf_passed (GATE PASSED) |
| Score >= 6 AND no critical issues | perf_warning (REVISION SUGGESTED) |
| Score < 6 OR layout thrashing OR FPS < 60 | fix_required (CRITICAL FIX NEEDED) |
Phase 4: Report & Output
-
Write performance report to
<session>/testing/reports/perf-report-{NNN}.md:# Performance Report {NNN} ## Summary - Overall Score: X/10 - Signal: perf_passed|perf_warning|fix_required - Source: chrome-devtools|static-analysis ## Compositor-Only Verification - Safe: X/Y properties (Z%) - Unsafe properties found: - [file:line] property: suggestion ## Frame Rate - Average FPS: X - Minimum FPS: X - Frame drops: X - Long frames (>16.67ms): X ## Layout Thrashing - Instances found: X - Details: - [file:line] pattern: description ## will-change Audit - Elements with will-change: X - Budget status: OK|OVER - Issues: - [file:line] issue: description ## Reduced Motion Compliance - @media query present: yes|no - Duration override: yes|no - JS detection: yes|no - Parallax disabled: yes|no|N/A - No infinite loops: yes|no ## Recommendations 1. [Priority] Description -
Update
<session>/wisdom/.msg/meta.jsonundermotion-testernamespace:- Read existing -> merge
{ "motion-tester": { report_id, score, signal, fps_average, safe_percentage, thrashing_count, will_change_count, reduced_motion_complete } }-> write back
- Read existing -> merge