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
+27
View File
@@ -87,6 +87,33 @@ If `graphify` CLI is installed AND complexity >= 30%:
3. Print: `🔗 Scaffold graph generated at graphify-out/`
If `graphify` not installed or complexity < 30% → skip silently.
## STEP 5e — ANIMATION LIB (auto-install)
Install `motion` (ex-`framer-motion`, rebranded Nov 2024) when the stack supports it.
The scaffold has just been validated by the user, so install proceeds silently.
```bash
source "$HOME/.claude/lib/animation-lib-check.sh"
if result=$(detect_anim_eligibility); then
pkg=$(echo "$result" | cut -d'|' -f2)
if ! is_anim_lib_installed >/dev/null; then
cmd=$(recommend_anim_install_cmd "$pkg")
echo "🎬 Installing animation lib: $cmd"
eval "$cmd"
else
installed=$(is_anim_lib_installed)
echo "🎬 Animation lib already present: $installed — skipping install"
fi
else
echo "🎬 Animation lib: stack not eligible — skipping ($(echo "$result" | cut -d'|' -f3))"
fi
```
Rules:
- `motion` for React-family / Svelte / vanilla JS stacks.
- `motion-v` for Vue 3 / Nuxt.
- React Native, Flutter, backend, embedded, static HTML → skipped.
- If another animation lib (gsap, lottie-react, react-spring, …) is already present → skipped.
## STEP 6 — PLAN
Invoke `superpowers:writing-plans` with BRIEF + skeleton.
Granular tasks (2-5 min each), exact file paths, TDD: tests before code.