@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.
- package/README.md +38 -20
- package/bin/cli.js +50 -24
- package/istm-animate/SKILL.md +31 -26
- package/istm-animate/core/motion-principles/SKILL.md +284 -0
- package/istm-animate/core/motion-principles/references/designers.md +127 -0
- package/istm-animate/core/motion-principles/references/easing-guide.md +231 -0
- package/istm-animate/core/motion-principles/references/enter-exit-recipes.md +466 -0
- package/istm-animate/frameworks/canvas-generative/SKILL.md +325 -0
- package/istm-animate/frameworks/canvas-generative/references/algorithms.md +925 -0
- package/istm-animate/frameworks/css-native/SKILL.md +319 -0
- package/istm-animate/frameworks/css-native/references/modern-css.md +465 -0
- package/istm-animate/frameworks/framer-motion/SKILL.md +187 -0
- package/istm-animate/frameworks/framer-motion/references/api.md +312 -0
- package/istm-animate/frameworks/gsap/SKILL.md +188 -0
- package/istm-animate/frameworks/gsap/references/core.md +218 -0
- package/istm-animate/frameworks/gsap/references/plugins.md +371 -0
- package/istm-animate/frameworks/gsap/references/scrolltrigger.md +325 -0
- package/istm-animate/frameworks/gsap/references/timeline.md +218 -0
- package/istm-animate/frameworks/threejs-r3f/SKILL.md +243 -0
- package/istm-animate/frameworks/threejs-r3f/references/scene-setup.md +392 -0
- package/istm-animate/frameworks/threejs-r3f/references/shaders.md +446 -0
- package/istm-animate/mobile/android/compose-graphics/SKILL.md +503 -0
- package/istm-animate/mobile/android/compose-graphics/references/agsl-recipes.md +356 -0
- package/istm-animate/mobile/android/compose-graphics/references/canvas-generative.md +282 -0
- package/istm-animate/mobile/android/compose-graphics/references/m3-expressive-deep.md +303 -0
- package/istm-animate/mobile/android/compose-motion/SKILL.md +359 -0
- package/istm-animate/mobile/android/compose-motion/references/gestures-compose.md +273 -0
- package/istm-animate/mobile/android/compose-motion/references/recomposition-and-anim.md +196 -0
- package/istm-animate/mobile/android/compose-motion/references/shared-transitions.md +281 -0
- package/istm-animate/mobile/android/compose-multiplatform/SKILL.md +311 -0
- package/istm-animate/mobile/android/compose-multiplatform/references/cmp-interop.md +288 -0
- package/istm-animate/mobile/android/compose-multiplatform/references/cmp-platform-quirks.md +156 -0
- package/istm-animate/mobile/apple/swiftui-graphics/SKILL.md +408 -0
- package/istm-animate/mobile/apple/swiftui-graphics/references/canvas-swiftui.md +239 -0
- package/istm-animate/mobile/apple/swiftui-graphics/references/liquid-glass-deep.md +252 -0
- package/istm-animate/mobile/apple/swiftui-graphics/references/metal-recipes.md +382 -0
- package/istm-animate/mobile/apple/swiftui-motion/SKILL.md +379 -0
- package/istm-animate/mobile/apple/swiftui-motion/references/gestures-swiftui.md +336 -0
- package/istm-animate/mobile/apple/swiftui-motion/references/phase-keyframe-deep.md +231 -0
- package/istm-animate/mobile/apple/swiftui-motion/references/springs-cheatsheet.md +129 -0
- package/istm-animate/references/animate.md +199 -0
- package/istm-animate/references/audit.md +115 -0
- package/istm-animate/references/design-engineering.md +674 -0
- package/istm-animate/references/improve.md +101 -0
- package/istm-animate/references/opportunities.md +132 -0
- package/istm-animate/references/plan-template.md +73 -0
- package/istm-animate/references/recipes.md +324 -0
- package/istm-animate/references/review.md +112 -0
- package/istm-animate/references/standards.md +187 -0
- package/istm-animate/references/vocabulary.md +173 -0
- package/istm-awwward-designer/SKILL.md +29 -17
- package/istm-design/SKILL.md +31 -59
- package/istm-design/core/design-audit/SKILL.md +248 -0
- package/istm-design/core/desktop-principles/SKILL.md +363 -0
- package/istm-design/core/desktop-principles/references/keyboard-patterns.md +137 -0
- package/istm-design/core/desktop-principles/references/multi-window.md +105 -0
- package/istm-design/core/mobile-principles/SKILL.md +289 -0
- package/istm-design/core/mobile-principles/references/accessibility-mobile.md +175 -0
- package/istm-design/core/mobile-principles/references/gestures-deep.md +220 -0
- package/istm-design/core/ui-ux-pro-max/SKILL.md +392 -0
- package/istm-design/core/ui-ux-pro-max/UPSTREAM.md +23 -0
- package/istm-design/core/ui-ux-pro-max/data/app-interface.csv +31 -0
- package/istm-design/core/ui-ux-pro-max/data/charts.csv +26 -0
- package/istm-design/core/ui-ux-pro-max/data/colors.csv +193 -0
- package/istm-design/core/ui-ux-pro-max/data/google-fonts.csv +1924 -0
- package/istm-design/core/ui-ux-pro-max/data/icons.csv +106 -0
- package/istm-design/core/ui-ux-pro-max/data/landing.csv +35 -0
- package/istm-design/core/ui-ux-pro-max/data/motion.csv +17 -0
- package/istm-design/core/ui-ux-pro-max/data/products.csv +193 -0
- package/istm-design/core/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/istm-design/core/ui-ux-pro-max/data/stacks/angular.csv +51 -0
- package/istm-design/core/ui-ux-pro-max/data/stacks/astro.csv +54 -0
- package/istm-design/core/ui-ux-pro-max/data/stacks/avalonia.csv +57 -0
- package/istm-design/core/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/istm-design/core/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/istm-design/core/ui-ux-pro-max/data/stacks/javafx.csv +76 -0
- package/istm-design/core/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/istm-design/core/ui-ux-pro-max/data/stacks/laravel.csv +51 -0
- package/istm-design/core/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/istm-design/core/ui-ux-pro-max/data/stacks/nuxt-ui.csv +71 -0
- package/istm-design/core/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/istm-design/core/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/istm-design/core/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/istm-design/core/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/istm-design/core/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/istm-design/core/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/istm-design/core/ui-ux-pro-max/data/stacks/threejs.csv +54 -0
- package/istm-design/core/ui-ux-pro-max/data/stacks/uno.csv +60 -0
- package/istm-design/core/ui-ux-pro-max/data/stacks/uwp.csv +56 -0
- package/istm-design/core/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/istm-design/core/ui-ux-pro-max/data/stacks/winui.csv +60 -0
- package/istm-design/core/ui-ux-pro-max/data/stacks/wpf.csv +57 -0
- package/istm-design/core/ui-ux-pro-max/data/styles.csv +85 -0
- package/istm-design/core/ui-ux-pro-max/data/typography.csv +75 -0
- package/istm-design/core/ui-ux-pro-max/data/ui-reasoning.csv +162 -0
- package/istm-design/core/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/istm-design/core/ui-ux-pro-max/references/pro-rules.md +109 -0
- package/istm-design/core/ui-ux-pro-max/references/quick-reference.md +240 -0
- package/istm-design/core/ui-ux-pro-max/scripts/core.py +464 -0
- package/istm-design/core/ui-ux-pro-max/scripts/design_system.py +1371 -0
- package/istm-design/core/ui-ux-pro-max/scripts/search.py +162 -0
- package/istm-design/core/ui-ux-pro-max/scripts/tests/test_core.py +134 -0
- package/istm-design/core/ui-ux-pro-max/scripts/validate_data.py +114 -0
- package/istm-design/references/apple-design.md +282 -0
- package/istm-design/references/generation-guide.md +209 -0
- package/istm-design/references/pick-ui-library.md +77 -0
- package/istm-design/references/picker.md +197 -0
- package/istm-design/references/prototype.md +90 -0
- package/istm-design/references/schema.md +366 -0
- package/package.json +1 -1
- package/RELEASE_v1.2.0.md +0 -40
package/istm-design/SKILL.md
CHANGED
|
@@ -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
|
|
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
|
|
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
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
|
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),
|
|
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
|
|
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
|
|
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?
|
|
63
|
-
2.
|
|
64
|
-
3.
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
65
|
+
### Absolute Aesthetic Enforcement Rules
|
|
94
66
|
|
|
95
|
-
1. **Typography Supremacy**: Never use browser default fonts. Explicitly define a sans-serif
|
|
96
|
-
2. **Semantic Colors Over Hex Codes**: Forbid
|
|
97
|
-
3. **Micro-Interactions**: Enforce standard hover states
|
|
98
|
-
4. **No Emojis**: Strictly forbid emojis in
|
|
99
|
-
5. **No GSAP Default**: Standard motion relies on CSS
|
|
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
|