@istmx/skills 1.2.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/README.md +38 -20
  2. package/bin/cli.js +50 -24
  3. package/istm-animate/SKILL.md +31 -26
  4. package/istm-animate/core/motion-principles/SKILL.md +284 -0
  5. package/istm-animate/core/motion-principles/references/designers.md +127 -0
  6. package/istm-animate/core/motion-principles/references/easing-guide.md +231 -0
  7. package/istm-animate/core/motion-principles/references/enter-exit-recipes.md +466 -0
  8. package/istm-animate/frameworks/canvas-generative/SKILL.md +325 -0
  9. package/istm-animate/frameworks/canvas-generative/references/algorithms.md +925 -0
  10. package/istm-animate/frameworks/css-native/SKILL.md +319 -0
  11. package/istm-animate/frameworks/css-native/references/modern-css.md +465 -0
  12. package/istm-animate/frameworks/framer-motion/SKILL.md +187 -0
  13. package/istm-animate/frameworks/framer-motion/references/api.md +312 -0
  14. package/istm-animate/frameworks/gsap/SKILL.md +188 -0
  15. package/istm-animate/frameworks/gsap/references/core.md +218 -0
  16. package/istm-animate/frameworks/gsap/references/plugins.md +371 -0
  17. package/istm-animate/frameworks/gsap/references/scrolltrigger.md +325 -0
  18. package/istm-animate/frameworks/gsap/references/timeline.md +218 -0
  19. package/istm-animate/frameworks/threejs-r3f/SKILL.md +243 -0
  20. package/istm-animate/frameworks/threejs-r3f/references/scene-setup.md +392 -0
  21. package/istm-animate/frameworks/threejs-r3f/references/shaders.md +446 -0
  22. package/istm-animate/mobile/android/compose-graphics/SKILL.md +503 -0
  23. package/istm-animate/mobile/android/compose-graphics/references/agsl-recipes.md +356 -0
  24. package/istm-animate/mobile/android/compose-graphics/references/canvas-generative.md +282 -0
  25. package/istm-animate/mobile/android/compose-graphics/references/m3-expressive-deep.md +303 -0
  26. package/istm-animate/mobile/android/compose-motion/SKILL.md +359 -0
  27. package/istm-animate/mobile/android/compose-motion/references/gestures-compose.md +273 -0
  28. package/istm-animate/mobile/android/compose-motion/references/recomposition-and-anim.md +196 -0
  29. package/istm-animate/mobile/android/compose-motion/references/shared-transitions.md +281 -0
  30. package/istm-animate/mobile/android/compose-multiplatform/SKILL.md +311 -0
  31. package/istm-animate/mobile/android/compose-multiplatform/references/cmp-interop.md +288 -0
  32. package/istm-animate/mobile/android/compose-multiplatform/references/cmp-platform-quirks.md +156 -0
  33. package/istm-animate/mobile/apple/swiftui-graphics/SKILL.md +408 -0
  34. package/istm-animate/mobile/apple/swiftui-graphics/references/canvas-swiftui.md +239 -0
  35. package/istm-animate/mobile/apple/swiftui-graphics/references/liquid-glass-deep.md +252 -0
  36. package/istm-animate/mobile/apple/swiftui-graphics/references/metal-recipes.md +382 -0
  37. package/istm-animate/mobile/apple/swiftui-motion/SKILL.md +379 -0
  38. package/istm-animate/mobile/apple/swiftui-motion/references/gestures-swiftui.md +336 -0
  39. package/istm-animate/mobile/apple/swiftui-motion/references/phase-keyframe-deep.md +231 -0
  40. package/istm-animate/mobile/apple/swiftui-motion/references/springs-cheatsheet.md +129 -0
  41. package/istm-animate/references/animate.md +199 -0
  42. package/istm-animate/references/audit.md +115 -0
  43. package/istm-animate/references/design-engineering.md +674 -0
  44. package/istm-animate/references/improve.md +101 -0
  45. package/istm-animate/references/opportunities.md +132 -0
  46. package/istm-animate/references/plan-template.md +73 -0
  47. package/istm-animate/references/recipes.md +324 -0
  48. package/istm-animate/references/review.md +112 -0
  49. package/istm-animate/references/standards.md +187 -0
  50. package/istm-animate/references/vocabulary.md +173 -0
  51. package/istm-awwward-designer/SKILL.md +29 -17
  52. package/istm-design/SKILL.md +31 -59
  53. package/istm-design/core/design-audit/SKILL.md +248 -0
  54. package/istm-design/core/desktop-principles/SKILL.md +363 -0
  55. package/istm-design/core/desktop-principles/references/keyboard-patterns.md +137 -0
  56. package/istm-design/core/desktop-principles/references/multi-window.md +105 -0
  57. package/istm-design/core/mobile-principles/SKILL.md +289 -0
  58. package/istm-design/core/mobile-principles/references/accessibility-mobile.md +175 -0
  59. package/istm-design/core/mobile-principles/references/gestures-deep.md +220 -0
  60. package/istm-design/core/ui-ux-pro-max/SKILL.md +392 -0
  61. package/istm-design/core/ui-ux-pro-max/UPSTREAM.md +23 -0
  62. package/istm-design/core/ui-ux-pro-max/data/app-interface.csv +31 -0
  63. package/istm-design/core/ui-ux-pro-max/data/charts.csv +26 -0
  64. package/istm-design/core/ui-ux-pro-max/data/colors.csv +193 -0
  65. package/istm-design/core/ui-ux-pro-max/data/google-fonts.csv +1924 -0
  66. package/istm-design/core/ui-ux-pro-max/data/icons.csv +106 -0
  67. package/istm-design/core/ui-ux-pro-max/data/landing.csv +35 -0
  68. package/istm-design/core/ui-ux-pro-max/data/motion.csv +17 -0
  69. package/istm-design/core/ui-ux-pro-max/data/products.csv +193 -0
  70. package/istm-design/core/ui-ux-pro-max/data/react-performance.csv +45 -0
  71. package/istm-design/core/ui-ux-pro-max/data/stacks/angular.csv +51 -0
  72. package/istm-design/core/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  73. package/istm-design/core/ui-ux-pro-max/data/stacks/avalonia.csv +57 -0
  74. package/istm-design/core/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  75. package/istm-design/core/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  76. package/istm-design/core/ui-ux-pro-max/data/stacks/javafx.csv +76 -0
  77. package/istm-design/core/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  78. package/istm-design/core/ui-ux-pro-max/data/stacks/laravel.csv +51 -0
  79. package/istm-design/core/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  80. package/istm-design/core/ui-ux-pro-max/data/stacks/nuxt-ui.csv +71 -0
  81. package/istm-design/core/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  82. package/istm-design/core/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  83. package/istm-design/core/ui-ux-pro-max/data/stacks/react.csv +54 -0
  84. package/istm-design/core/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  85. package/istm-design/core/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  86. package/istm-design/core/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  87. package/istm-design/core/ui-ux-pro-max/data/stacks/threejs.csv +54 -0
  88. package/istm-design/core/ui-ux-pro-max/data/stacks/uno.csv +60 -0
  89. package/istm-design/core/ui-ux-pro-max/data/stacks/uwp.csv +56 -0
  90. package/istm-design/core/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  91. package/istm-design/core/ui-ux-pro-max/data/stacks/winui.csv +60 -0
  92. package/istm-design/core/ui-ux-pro-max/data/stacks/wpf.csv +57 -0
  93. package/istm-design/core/ui-ux-pro-max/data/styles.csv +85 -0
  94. package/istm-design/core/ui-ux-pro-max/data/typography.csv +75 -0
  95. package/istm-design/core/ui-ux-pro-max/data/ui-reasoning.csv +162 -0
  96. package/istm-design/core/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  97. package/istm-design/core/ui-ux-pro-max/references/pro-rules.md +109 -0
  98. package/istm-design/core/ui-ux-pro-max/references/quick-reference.md +240 -0
  99. package/istm-design/core/ui-ux-pro-max/scripts/core.py +464 -0
  100. package/istm-design/core/ui-ux-pro-max/scripts/design_system.py +1371 -0
  101. package/istm-design/core/ui-ux-pro-max/scripts/search.py +162 -0
  102. package/istm-design/core/ui-ux-pro-max/scripts/tests/test_core.py +134 -0
  103. package/istm-design/core/ui-ux-pro-max/scripts/validate_data.py +114 -0
  104. package/istm-design/references/apple-design.md +282 -0
  105. package/istm-design/references/generation-guide.md +209 -0
  106. package/istm-design/references/pick-ui-library.md +77 -0
  107. package/istm-design/references/picker.md +197 -0
  108. package/istm-design/references/prototype.md +90 -0
  109. package/istm-design/references/schema.md +366 -0
  110. package/package.json +1 -1
  111. package/RELEASE_v1.2.0.md +0 -40
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: istm-design
3
- allowed-tools: Bash, Read, Grep, Glob, Write, Edit, Agent, AskUserQuestion
4
- description: "The core visual orchestrator for the @istmx/skills framework. Establishes the foundational design tokens (colors, typography, spacing, standard motion) and strictly enforces premium UI aesthetics. Excludes heavy GSAP animation unless explicitly mandated."
3
+ allowed-tools: Bash, Read, Grep, Glob, Write, Edit, Agent, AskUserQuestion, GenerateImage
4
+ description: "The core visual context engine and executor for the @istmx/skills framework. Extends design tokens (colors, typography, spacing, standard motion) and strictly enforces premium UI aesthetics via a 3-Phase dual-mode execution (Structure, Analyze, Generate). Excludes heavy GSAP animation unless explicitly mandated."
5
5
  ---
6
6
 
7
7
  ## Output style (plain words, no dashes, no hyphens)
@@ -12,16 +12,18 @@ Write everything this skill produces, files and messages alike, in plain simple
12
12
 
13
13
  ## What this skill does
14
14
 
15
- The master visual token engine: compiles the design system, enforces typography scaling, and establishes the baseline aesthetic rules for the project.
15
+ The master visual token engine and dual-mode executor. It compiles the design system, enforces typography scaling, reverse-engineers screenshots/URLs into JSON profiles, and physically writes implementation code.
16
16
 
17
- - Token Compilation: Reads the internal legacy design rules (`colors`, `styles`, `typography`, `ux`) and synthesizes them into a cohesive `design.md` blueprint.
18
- - Standard Motion: Defines standard micro-interactions (hover states, simple transitions, loading skeletons). Strictly forbids heavy GSAP scroll-jacking and complex choreographies to keep the baseline application fast and accessible.
19
- - Anti-Slop Enforcement: Explicitly forbids generic AI UI slop (e.g., plain blue buttons, unstyled default fonts, emoji placeholders). Forces the use of curated semantic tokens and professional iconography.
20
-
21
- Does not build system architecture (/istm-architecture owns that), wire complex databases (/istm-system-design owns that), or build heavy marketing animations (/istm-animate and /istm-awwward-designer own that).
22
-
23
- **CRITICAL RULE: NEVER WRITE APPLICATION CODE (HTML/CSS/JS/React).** You are an architect. You ONLY write the blueprint file (`.istm-context/design.md`). If the user asks you to build a page, you must refuse, write the blueprint instead, and instruct the user to run `/develop` to build the code.
17
+ - **Dual-Mode Execution**:
18
+ - **Context Phase (Day Zero)**: Operates as an architect. Uses the extraction engine to generate blueprints (`design.md`, `ui-tokens.md`) in `.istm-context/`. Pauses for the **Discovery Gate** (asks the user to confirm/adjust tokens before saving).
19
+ - **Execution Phase (Day-to-Day)**: Operates as an executor. If asked to "create a landing page", it bypasses blueprint generation, reads `.istm-context/`, asks for preview preferences, and writes the final React/Next.js code directly without needing `/istm-develop`.
20
+ - **The 3-Phase Design Engine**:
21
+ - 1. **Structure**: Surfacing the full schema (System, Style, Effects).
22
+ - 2. **Analyze**: Pulling tokens from reference images or URLs to generate a JSON profile.
23
+ - 3. **Generate**: Applying the profile to write faithful UI implementation code.
24
+ - **Anti-Slop Enforcement**: Explicitly forbids generic AI UI slop (e.g., plain blue buttons, unstyled default fonts, emoji placeholders). Forces the use of curated semantic tokens and professional iconography.
24
25
 
26
+ Does not build system architecture (/istm-architecture owns that) or wire complex databases (/istm-system-design owns that).
25
27
 
26
28
  ## Blueprint file convention
27
29
 
@@ -29,71 +31,41 @@ Durable design context lives in the `.istm-context/` directory. This skill speci
29
31
 
30
32
  - `design.md`: The UX strategy, standard motion logic, and strict UI token dictionary.
31
33
 
32
- **GOLD STANDARD REFERENCE:** When creating a new `design.md`, you MUST read and use the workspace root `/workspaces/laughing-giggle/DESIGN.md` as your structural template. Your output must match its level of detail: including comprehensive YAML frontmatter (colors, typography scaling, rounded corners, spacing, components) followed by deep, philosophical markdown explaining the rules. Do not output a shallow file. Read the root `DESIGN.md` first to understand the required depth.
33
-
34
-
35
- Never overwrite an existing `design.md` without permission; gap-fill conservatively and respect established brand guidelines.
34
+ **GOLD STANDARD REFERENCE:** When creating a new `design.md`, you MUST read and use the workspace root `/workspaces/laughing-giggle/DESIGN.md` as your structural template. Your output must match its level of detail: including comprehensive YAML frontmatter followed by deep philosophical markdown explaining the rules.
36
35
 
37
36
  ## Scope
38
37
 
39
- The `--force-gsap` flag overrides the standard motion rule and allows basic GSAP imports. With no argument, the `Pre-flight` signals below route to Phase 0 (ambiguous), or Phase 1 (greenfield token generation).
38
+ The `--force-gsap` flag overrides the standard motion rule and allows basic GSAP imports. With no argument, the `Pre-flight` signals below route to Phase 0 (ambiguous), Phase 1 (greenfield token generation), or Phase 3 (code execution).
40
39
 
41
40
  ## Acts vs asks
42
41
 
43
- Phase 1 asks aesthetic questions (brand vibe, dark/light mode preference, typography style) via MCQ before generating the design tokens. Phase 2 acts immediately; it scans the repo for existing Tailwind configs, CSS variables, or styled-components and reverse-engineers the design system.
44
-
45
- ## Artifact ownership
46
-
47
- The `design.md` file holds the content. Create it if missing. When writing the design tokens, inject the precise CSS variables, tailwind utility classes, and font stacks. You own the enforcement of these tokens; all UI components generated by implementation agents must strictly use the tokens defined here.
48
-
49
- ## Portability (any OS, any agent)
50
-
51
- - Commands: Use your agent's cross-platform file tools to read `tailwind.config.js` or `index.css` and populate templates.
52
- - If interactive question support (`AskUserQuestion`) is missing, ask any multiple choice question as plain text with the same options.
42
+ In the **Context Phase**, ask aesthetic questions (brand vibe, dark/light mode preference) or ask for a URL/screenshot to reverse-engineer. Always pass the **Discovery Gate** by asking the user to confirm the extracted tokens before saving `design.md`.
43
+ In the **Execution Phase**, act immediately to write the code based on `.istm-context/`.
53
44
 
54
45
  ## Execution
55
46
 
56
- The main thread compiles the design system. It reads the legacy rules in `istm-design/` (`colors/`, `typography/`, etc.) and the user inputs, synthesizing them into the final `design.md`.
47
+ The main thread compiles the design system or writes code.
57
48
 
58
49
  ### `Pre-flight` (main thread does this before anything else)
59
50
 
60
51
  Gather signals to determine the execution path:
61
52
 
62
- 1. Flag check: Was `--force-gsap` provided? → `GSAP_FLAG`.
63
- 2. Context files: Is `design.md` already hydrated in `.istm-context/`? → `DESIGN_EXISTS`.
64
- 3. Source count: Are there existing CSS/Tailwind configs indicating an established design system? → `HAS_STYLES`.
65
-
66
- Pick the phase based on these signals:
67
-
68
- | Condition | Phase |
69
- |---|---|
70
- | `HAS_STYLES` is present | Phase 2 (Reverse-engineer the existing design system). |
71
- | `DESIGN_EXISTS` | Phase 3 (Gap-fill: analyze the prompt against existing design tokens and update only what changed). |
72
- | No flag, no design, no styles (or raw prompt) | Phase 1 (Greenfield: execute Design Interview and generate tokens). |
73
- | No flag, no design, but `HAS_STYLES` | Phase 0 (Ambiguous: ask if they want to override existing styles or document them). |
74
-
75
- ### Route to the selected phase
76
-
77
- - **Step 0 (Mandatory Reading)**: Before suggesting any design or generating files, you MUST recursively read all rule files inside `istm-design/colors/`, `istm-design/styles/`, `istm-design/typography/`, and `istm-design/ux/`. You must understand these massive, rich design rules first.
78
- - Phase 1 (Greenfield Setup): Analyze the user's prompt to extract their exact aesthetic vision. **Do NOT force them to pick from generic styles (e.g., minimal, brutalist, corporate).** If their prompt says "massive fonts and vibrant colors", use the rules from Step 0 to generate a bespoke `design.md` that perfectly captures that unique vibe with strict H1-H6 scaling and custom semantic color variables. Interview the user ONLY if the prompt is completely blank on design direction.
79
- - Phase 2 (Reverse Engineering): Do not interview. Read `tailwind.config.js`, `globals.css`, or equivalent. Reverse-engineer the color palette and typography scale. Hydrate `design.md`.
80
- - Phase 3 (Gap Fill): Read existing `design.md`. Identify missing tokens (e.g., missing success/error states). Update existing blueprints carefully.
81
-
82
- ### Phase 0: Classify (only when `pre-flight` is ambiguous)
53
+ 1. Flag check: Was `--force-gsap` provided?
54
+ 2. Intent check: Did the user ask to "extract", "analyze", "setup design", or did they ask to "build", "create", "design this page"?
55
+ 3. Context files: Is `design.md` already hydrated in `.istm-context/`?
83
56
 
84
- Don't guess. Ask once via your agent's interactive option picker (`AskUserQuestion`), or plain text.
85
- - question: "I see existing CSS styles, but no `design.md` blueprint. How should I proceed?"
86
- - header: "Design state"
87
- - options: 1. `Reverse-Engineer from CSS`, "I will read your styles and generate the design tokens." → Phase 2. 2. `Start Fresh from Prompt`, "I will interview you and overwrite the design system." → Phase 1.
57
+ ### The 3-Phase Engine
88
58
 
89
- ### After all phases
59
+ - **Step 0 (Mandatory Reading)**: Before suggesting any design or generating files, you MUST recursively read all rule files inside `istm-design/colors/`, `istm-design/styles/`, `istm-design/typography/`, `istm-design/ux/`, and `istm-design/references/`.
90
60
 
91
- If no tokens were written when they should have been, report the failure. Relay the report: what aesthetic was chosen, what typography scale was locked in, and the primary color values.
61
+ - **Phase 1: Structure (Schema Definition)**: Read `references/schema.md`. Present the 3-dimension structure (Design System, Design Style, Visual Effects) if the user asks for the design structure.
62
+ - **Phase 2: Analyze (Reverse Engineering)**: If the user provides a URL or image, analyze it visually. Map color palettes, typography classes, spacing density, layout grids, and visual effects into a JSON profile. **Discovery Gate:** Ask "Want to adjust any values before I lock this into `design.md`?"
63
+ - **Phase 3: Generate (Implementation)**: If the user asks to build UI components, read `.istm-context/design.md` and `references/generation-guide.md`. Convert tokens to CSS variables/Tailwind classes, fetch assets, and implement the design faithfully.
92
64
 
93
- ## Absolute Aesthetic Enforcement Rules
65
+ ### Absolute Aesthetic Enforcement Rules
94
66
 
95
- 1. **Typography Supremacy**: Never use browser default fonts. Explicitly define a sans-serif (e.g., Inter, Roboto, Geist) and optionally a display font. Enforce a strict typographic scale.
96
- 2. **Semantic Colors Over Hex Codes**: Forbid the direct use of raw hex codes in UI components. Force the use of semantic tokens (e.g., `bg-surface-elevated`, `text-ink-muted`, `border-hairline`).
97
- 3. **Micro-Interactions**: Enforce standard hover states (opacity shifts, slight scaling, background color transitions) on all interactive elements.
98
- 4. **No Emojis**: Strictly forbid emojis in empty states or UI components. Mandate the use of professional SVG icon libraries (Lucide, Heroicons, Phosphor).
99
- 5. **No GSAP Default**: Standard motion relies on CSS transitions and lightweight Framer Motion/Spring logic. Heavy scroll-jacking or GSAP is forbidden unless `/istm-animate` or `/istm-awwward-designer` is explicitly invoked, or the `--force-gsap` flag is present.
67
+ 1. **Typography Supremacy**: Never use browser default fonts. Explicitly define a sans-serif and optionally a display font. Enforce a strict typographic scale.
68
+ 2. **Semantic Colors Over Hex Codes**: Forbid direct use of raw hex codes in UI. Force the use of semantic tokens.
69
+ 3. **Micro-Interactions**: Enforce standard hover states on all interactive elements.
70
+ 4. **No Emojis**: Strictly forbid emojis in UI. Mandate professional SVG icons (Lucide, Phosphor).
71
+ 5. **No GSAP Default**: Standard motion relies on CSS/Framer Motion. Heavy scroll-jacking is forbidden unless `/istm-animate` or `/istm-awwward-designer` is explicitly invoked.
@@ -0,0 +1,248 @@
1
+ ---
2
+ name: design-audit
3
+ description: "Design audit checklist - motion gaps, accessibility, color consistency, responsive, performance."
4
+ ---
5
+
6
+ # Design Audit
7
+
8
+ > The final checkpoint. Loaded by `/istm-animate:paint` at the end of the pipeline.
9
+ > Scans the codebase for motion gaps, a11y violations, perf issues, and inconsistencies.
10
+
11
+ ---
12
+
13
+ ## Motion Gap Analysis
14
+
15
+ Run these greps against the project to detect missing animations.
16
+
17
+ ### Conditional renders without AnimatePresence
18
+
19
+ ```bash
20
+ grep -rn '{.*&&\s*<\|{.*?\s*:\s*<\|{.*ternary.*<' --include='*.tsx' --include='*.jsx' src/ | grep -v 'AnimatePresence'
21
+ ```
22
+
23
+ Look for: `{show && <Component />}` or ternary renders without a wrapping `<AnimatePresence>`. Every conditional mount/unmount needs exit animation support.
24
+
25
+ ### Hover states without transition
26
+
27
+ ```bash
28
+ grep -rn ':hover' --include='*.css' --include='*.scss' --include='*.module.css' src/ | grep -vE 'transition|animation'
29
+ ```
30
+
31
+ Every `:hover` rule must have a corresponding `transition` on the base selector. Instant state flips feel broken.
32
+
33
+ ### Dynamic lists without stagger
34
+
35
+ ```bash
36
+ grep -rn '\.map(' --include='*.tsx' --include='*.jsx' src/ | grep -vE 'stagger|delay.*index|variants|transition.*delay'
37
+ ```
38
+
39
+ Lists rendered via `.map()` should stagger their entrance. Simultaneous pop-in looks cheap.
40
+
41
+ ### Style changes without transition
42
+
43
+ ```bash
44
+ grep -rn 'style={{' --include='*.tsx' --include='*.jsx' src/ | grep -vE 'transition|transform|opacity'
45
+ ```
46
+
47
+ Inline style changes (e.g., dynamic background, color) need a CSS transition or motion wrapper.
48
+
49
+ ### Entries without corresponding exits
50
+
51
+ ```bash
52
+ grep -rn 'initial=' --include='*.tsx' --include='*.jsx' src/ | grep -v 'exit='
53
+ ```
54
+
55
+ Every Framer Motion `initial` + `animate` should have an `exit` prop when inside `AnimatePresence`.
56
+
57
+ ---
58
+
59
+ ## Accessibility Audit
60
+
61
+ ### Reduced motion - MANDATORY
62
+
63
+ A project with animation MUST have at least one global handler matching its stack. Run all 3 greps:
64
+
65
+ ```bash
66
+ # Web
67
+ grep -rn 'prefers-reduced-motion' --include='*.css' --include='*.scss' --include='*.ts' --include='*.tsx' --include='*.js' --include='*.jsx' src/ 2>/dev/null
68
+
69
+ # SwiftUI / UIKit
70
+ grep -rn 'accessibilityReduceMotion\|isReduceMotionEnabled\|reduceMotionStatusDidChangeNotification' --include='*.swift' . 2>/dev/null
71
+
72
+ # Compose
73
+ grep -rn 'LocalAccessibilityManager\|isReduceTransitions\|TRANSITION_ANIMATION_SCALE\|ANIMATOR_DURATION_SCALE\|areAnimatorsEnabled' --include='*.kt' . 2>/dev/null
74
+ ```
75
+
76
+ **Zero results across all 3 in an animated project = critical violation.** At least one handler must exist somewhere. Cross-reference `motion-principles/SKILL.md` for canonical implementations per stack.
77
+
78
+ ### Contrast ratio 4.5:1
79
+
80
+ - Use browser DevTools (Inspect > color swatch > contrast ratio)
81
+ - Run `npx pa11y <url>` or Lighthouse accessibility audit
82
+ - Check animated text at mid-transition -- fading text must remain readable at every opacity above 0.4
83
+
84
+ ### Focus visible on all interactives
85
+
86
+ ```bash
87
+ grep -rn 'outline:\s*none\|outline:\s*0' --include='*.css' --include='*.scss' --include='*.module.css' src/
88
+ ```
89
+
90
+ Any `outline: none` MUST be paired with a custom `:focus-visible` style. Removing focus rings without replacement is a WCAG failure.
91
+
92
+ ### Semantic HTML -- no clickable divs
93
+
94
+ ```bash
95
+ grep -rn 'onClick' --include='*.tsx' --include='*.jsx' src/ | grep -E '<div|<span' | grep -v 'role='
96
+ ```
97
+
98
+ Every `<div onClick>` or `<span onClick>` must either be a `<button>`, an `<a>`, or have `role="button"` + `tabIndex` + `onKeyDown`.
99
+
100
+ ### ARIA on decorative animations
101
+
102
+ ```bash
103
+ grep -rn '<motion\.\|<animated\.\|<Lottie\|<Canvas' --include='*.tsx' --include='*.jsx' src/ | grep -v 'aria-hidden'
104
+ ```
105
+
106
+ Purely decorative animations (background particles, ambient motion, Lottie illustrations) must have `aria-hidden="true"` to avoid polluting screen readers.
107
+
108
+ ---
109
+
110
+ ## Performance Audit
111
+
112
+ ### Layout thrashing -- animating layout properties
113
+
114
+ ```bash
115
+ grep -rn 'transition.*\(width\|height\|top\|left\|right\|bottom\|margin\|padding\)' --include='*.css' --include='*.scss' --include='*.module.css' src/
116
+ ```
117
+
118
+ Animating layout properties triggers reflow every frame. Replace with `transform: translate/scale` and `opacity`.
119
+
120
+ ### Excessive paint triggers
121
+
122
+ ```bash
123
+ grep -rn 'will-change' --include='*.css' --include='*.scss' --include='*.module.css' src/
124
+ ```
125
+
126
+ `will-change` should be rare and scoped. If more than ~5 elements use it permanently, the GPU memory cost outweighs the benefit. Apply it dynamically (add on hover/focus, remove on animation end).
127
+
128
+ ### Animation library bundle cost
129
+
130
+ Check actual impact:
131
+
132
+ ```bash
133
+ npx source-map-explorer dist/**/*.js 2>/dev/null || npx vite-bundle-visualizer 2>/dev/null
134
+ ```
135
+
136
+ Reference sizes (gzipped): framer-motion ~30KB, GSAP ~25KB, popmotion ~5KB, CSS-only = 0KB. If the project only uses fade+slide, a 30KB lib is overkill.
137
+
138
+ On mobile native, the APK / IPA size matters. A third-party animation library adds typically 500KB-2MB:
139
+
140
+ | Library | Size impact (uncompressed) |
141
+ |---|---|
142
+ | Lottie (iOS) | ~600KB |
143
+ | Lottie (Android) | ~900KB |
144
+ | Rive (iOS) | ~1.5MB |
145
+ | Rive (Android) | ~2MB |
146
+ | Native Compose / SwiftUI animations | 0KB (built-in) |
147
+
148
+ If the project only uses fades, slides, and springs, native APIs (Compose `animate*AsState` + spring, SwiftUI `withAnimation`) are sufficient. Justify a Lottie / Rive dependency only for genuinely complex pre-designed animations (e.g., onboarding illustrations).
149
+
150
+ ### requestAnimationFrame vs setTimeout
151
+
152
+ ```bash
153
+ grep -rn 'setTimeout\|setInterval' --include='*.ts' --include='*.tsx' --include='*.js' --include='*.jsx' src/ | grep -iE 'anim\|motion\|scroll\|position\|style\|transform'
154
+ ```
155
+
156
+ Animation loops must use `requestAnimationFrame`. `setTimeout`/`setInterval` causes frame drops and doesn't pause in background tabs.
157
+
158
+ ---
159
+
160
+ ## Consistency Audit
161
+
162
+ ### Duration consistency
163
+
164
+ ```bash
165
+ grep -rnoE 'duration[:"'\''= ]+[0-9.]+' --include='*.tsx' --include='*.jsx' --include='*.ts' --include='*.css' --include='*.scss' src/ | sort -t: -k3 | uniq -c -f2 | sort -rn
166
+ ```
167
+
168
+ A well-designed project uses 3-5 distinct durations max (e.g., 0.15, 0.25, 0.35, 0.5). If you see 15 different values, extract them into a motion tokens file.
169
+
170
+ ### Easing inventory
171
+
172
+ Run all 3 greps to inventory easing values across the codebase:
173
+
174
+ ```bash
175
+ # Web (CSS / JS / TSX)
176
+ grep -rnoE 'ease[A-Za-z]*|cubic-bezier\([^)]+\)|spring\([^)]*\)' --include='*.tsx' --include='*.jsx' --include='*.ts' --include='*.css' --include='*.scss' src/ 2>/dev/null
177
+
178
+ # SwiftUI
179
+ grep -rnoE '\.spring\([^)]*\)|\.snappy|\.bouncy|\.smooth|\.linear\(|\.easeIn|\.easeOut|\.interpolatingSpring' --include='*.swift' . 2>/dev/null
180
+
181
+ # Compose
182
+ grep -rnoE 'spring\([^)]*\)|tween\([^)]*\)|FastOutSlowInEasing|LinearOutSlowInEasing|FastOutLinearInEasing|CubicBezierEasing' --include='*.kt' . 2>/dev/null
183
+ ```
184
+
185
+ Same rule across all stacks: 3-5 named easings max in the design system. Random values scattered across files = visual inconsistency. If the codebase has 12 different `cubic-bezier(...)` values or 8 custom `spring(response:dampingFraction:)` configurations, that's a design-system violation, fix it by centralizing into named tokens.
186
+
187
+ ### Symmetric enter/exit
188
+
189
+ Scan for motion components and verify that:
190
+ - Enter duration >= exit duration (never the reverse)
191
+ - Enter uses `ease-out`, exit uses `ease-in`
192
+ - Enter has full choreography (translate + opacity + scale), exit is simpler (opacity only or opacity + slight scale)
193
+
194
+ ```bash
195
+ grep -A5 'exit=' --include='*.tsx' --include='*.jsx' -rn src/
196
+ ```
197
+
198
+ Compare `animate` and `exit` props side by side. Asymmetric timing (fast exit, slow enter) is correct. The reverse is wrong.
199
+
200
+ ---
201
+
202
+ ## Stack-specific audit
203
+
204
+ Pick the subsection matching the project stack.
205
+
206
+ ### Compose (Android / Multiplatform)
207
+ - [ ] Run **Layout Inspector** (Android Studio): inspect recompositions, identify components recomposing on every state change.
208
+ - [ ] Run **Macrobenchmark** (`androidx.benchmark.macro`): measure frame timing on a real device under representative scrolling / animation load. Target: <16.67ms per frame at 60fps, <8.33ms at 120fps.
209
+ - [ ] Inspect **recomposition counts** via `Modifier.recomposeHighlighter()` (Compose 1.6+) or Layout Inspector.
210
+ - [ ] Generate **Baseline Profiles** (`BaselineProfileGenerator`) for production builds.
211
+ - [ ] Verify `Modifier.semantics` is set on custom components (TalkBack support).
212
+
213
+ ### SwiftUI (iOS / macOS)
214
+ - [ ] Run **Instruments Time Profiler**: identify hot paths during animation (target: zero frames over 16.67ms).
215
+ - [ ] Run **Instruments Hitches Instrument** (iOS 14+): detects dropped frames and stalls.
216
+ - [ ] Run **Instruments GPU Frame Capture** for Metal shaders: verify shader compile time, GPU vs CPU bottleneck.
217
+ - [ ] Verify `.accessibilityLabel` / `.accessibilityHint` on every interactive view.
218
+ - [ ] Test with Dynamic Type at 200% size (`Environment Overrides` in Xcode).
219
+ - [ ] Test with Reduce Motion ON.
220
+
221
+ ### Web
222
+ - [ ] Existing checklist above (Lighthouse, Chrome DevTools Performance, etc.).
223
+
224
+ ---
225
+
226
+ ## Output Format
227
+
228
+ Structure findings by severity:
229
+
230
+ ### Critical (must fix before ship)
231
+ - Missing `prefers-reduced-motion` handling
232
+ - Clickable divs without keyboard support
233
+ - `outline: none` without `:focus-visible` replacement
234
+ - Animating layout properties (width/height/top/left)
235
+
236
+ ### Important (fix in current sprint)
237
+ - Conditional renders without `AnimatePresence`
238
+ - Hover states without transition
239
+ - Missing `aria-hidden` on decorative animations
240
+ - `setTimeout` used for animation loops
241
+ - Inconsistent durations (>8 unique values)
242
+
243
+ ### Nice-to-have (backlog)
244
+ - Lists without stagger animation
245
+ - Inline styles without transition
246
+ - Excessive `will-change` usage
247
+ - Asymmetric enter/exit (wrong direction)
248
+ - Animation library oversized for actual usage