feat(animation): auto-install motion lib + detection across init/onboard/advisor

Add lib/animation-lib-check.sh with detect_anim_eligibility,
is_anim_lib_installed and recommend_anim_install_cmd helpers.
Wire it into the framework:
- init-project STEP 5e: silent auto-install after scaffold validated
- onboard STEP 2.5: propose + wait for user confirmation (opt-in on
  existing projects)
- plugin-advisor PHASE 1/2/3: read-only detection only, never installs
- scaffolder PHASE 4: clarifies boundary (orchestrator owns motion install)
- design-gate filesystem signals: motion / motion-v / framer-motion /
  gsap / lottie-react / react-spring / popmotion / auto-animate

Recommends `motion` (rebranded from framer-motion in Nov 2024) for
React-family and Svelte stacks, `motion-v` for Vue 3 / Nuxt. Excludes
React Native (use react-native-reanimated), backend, embedded, Flutter.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
bastien
2026-04-27 15:32:46 +02:00
co-authored by Claude Opus 4.7
parent d513ea39a0
commit f80f83ee77
7 changed files with 220 additions and 0 deletions
+18
View File
@@ -35,6 +35,13 @@ ls package.json pyproject.toml Cargo.toml go.mod 2>/dev/null | head -5
grep -rl "next\|react\|vue\|prisma\|supabase" package.json 2>/dev/null | head -3 || true
find . -name "*.tsx" -o -name "*.jsx" 2>/dev/null | head -3 | wc -l
find . -name "docker-compose*" -o -name "Dockerfile" 2>/dev/null | head -3 | wc -l
# Animation lib status (motion / motion-v) — read-only detection
if [ -f "$HOME/.claude/lib/animation-lib-check.sh" ]; then
source "$HOME/.claude/lib/animation-lib-check.sh"
detect_anim_eligibility # outputs '<status>|<package>|<reason>'
is_anim_lib_installed || echo "anim-lib-not-installed"
fi
# Monorepo detection (current dir + parent dirs for sub-package context)
ls apps/ packages/ services/ workspaces/ 2>/dev/null | head -5
ls pnpm-workspace.yaml turbo.json nx.json lerna.json 2>/dev/null
@@ -70,6 +77,8 @@ Detect signals from the project description and filesystem scan:
| `skill-creation` | "create a skill", "new skill", "custom skill", `/plugin-dev:create-plugin` in description |
| `embedded` | "firmware", "bare-metal", "microcontroller", "STM32", "ESP32", "RTOS", "driver", "kernel", "bootloader" in description; **or** `platformio.ini` present; **or** linker script (`*.ld`, `*.lds`) present; **or** `Makefile` + `src/*.c` + no `package.json`/`Cargo.toml`/`go.mod`/`setup.py`/`pyproject.toml` (C project without standard ecosystems). Note: `.c` files with a Rust/Node/Go manifest = FFI binding, NOT embedded. |
| `simple` | single file, hotfix, quick script, no frontend, no deploy |
| `anim-lib-eligible` | output of `detect_anim_eligibility` starts with `eligible|` (React/Vue/Svelte stack) |
| `anim-lib-installed` | `is_anim_lib_installed` returns 0 (any of motion / motion-v / framer-motion / gsap / lottie-react / react-spring / popmotion / auto-animate present) |
---
@@ -117,11 +126,20 @@ RECOMMENDATIONS:
ℹ️ OPTIONAL: [plugin] — [marginal benefit, low priority]
🖥️ CLI : [gsd v2] — [run 'gsd' in terminal if multi-session]
ANIMATION LIB:
✅ <lib> installed (anim-lib-installed)
ℹ️ eligible (<reason>) — install via /onboard or /init (eligible, not installed)
— not eligible (<reason>) (no UI framework / RN / backend)
CONFLICTS: [plugin A ↔ plugin B — overlap on X] or none
BLOCKING: [issues] or none
ACTION REQUIRED? YES / NO
```
> ANIMATION LIB is **read-only** in this report. The advisor never installs
> packages itself — it just states the status. Installation happens in
> `/init-project` STEP 5e (auto) or `/onboard` STEP 2.5 (opt-in).
## PHASE 4 — AUTO-ACTIVATION (when called from /init-project or /ship-feature)
After presenting RECOMMENDATIONS, if any plugin has ⚡ ENABLE status: