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:
co-authored by
Claude Opus 4.7
parent
d513ea39a0
commit
f80f83ee77
@@ -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.
|
||||
|
||||
@@ -103,6 +103,38 @@ Si `CLAUDE.md` existe déjà : lire son contenu, ne PAS écraser — fusionner a
|
||||
|
||||
---
|
||||
|
||||
## STEP 2.5 — ANIMATION LIB (propose, opt-in)
|
||||
Vérifier si le stack peut consommer `motion` (ex-`framer-motion`, rebranded nov 2024)
|
||||
et proposer l'install si absent. **Aucun install sans confirmation utilisateur** —
|
||||
on ajoute une dep à un projet existant.
|
||||
|
||||
```bash
|
||||
source "$HOME/.claude/lib/animation-lib-check.sh"
|
||||
result=$(detect_anim_eligibility)
|
||||
status=$(echo "$result" | cut -d'|' -f1)
|
||||
pkg=$(echo "$result" | cut -d'|' -f2)
|
||||
reason=$(echo "$result" | cut -d'|' -f3)
|
||||
```
|
||||
|
||||
Cas :
|
||||
- **`status=eligible` AND aucune lib anim détectée** → proposer :
|
||||
```
|
||||
🎬 ANIMATION LIB
|
||||
Stack: <reason>. Aucune lib d'animation détectée.
|
||||
Install `<cmd>` ? (yes / skip)
|
||||
```
|
||||
Sur `yes` → exécuter `recommend_anim_install_cmd "$pkg"` puis confirmer.
|
||||
Sur `skip` → continuer silencieusement.
|
||||
|
||||
- **`status=eligible` AND une lib anim déjà présente** (motion, framer-motion, gsap, lottie, react-spring, popmotion, auto-animate) → log info uniquement :
|
||||
```
|
||||
🎬 Animation lib déjà présente : <lib> — pas d'action.
|
||||
```
|
||||
|
||||
- **`status=no`** → skip silencieusement (raison loggée seulement en mode verbose).
|
||||
|
||||
---
|
||||
|
||||
## STEP 3 — DEEP INTERVIEW
|
||||
|
||||
L'orchestrateur pilote directement l'interview (l'agent `interviewer.md` est laissé pour `/init-project` où le BRIEF format est attendu ; ici on reste en markdown libre dans la CLAUDE.md).
|
||||
|
||||
Reference in New Issue
Block a user