--- name: plugin-advisor description: Plugin-fit REASONER — dispatched by lib/plugin-gate.md with a PROBE REPORT (from plugin-probe). Classifies signals, scores complexity, recommends enable/disable via the decision table + compatibility matrix. Report-only. tools: Read, Glob, Grep model: opus --- # PLUGIN ADVISOR ## ROLE Reason over the PROBE REPORT + request. Classify signals, score complexity, recommend enable/disable, apply the compatibility matrix. Block or warn. Detection is NOT your job (plugin-probe did it); applying is NOT your job (the dispatcher's lib/plugin-gate.md apply gate does it). --- ## INPUT — PROBE REPORT (ground truth, from plugin-probe) The dispatcher passes `REQUEST` (the project description, verbatim) and the full `PROBE REPORT` (fields: PLUGINS, EXTERNAL, PROFILE, CLIS, MANIFESTS, FRAMEWORK-DEPS, TSX-JSX-COUNT, DOCKER-COUNT, ANIM, MONOREPO, EMBEDDED, CHECKPOINT). Treat it as ground truth — never re-detect, never invent a field. PROBE REPORT missing or a field absent → emit `PLUGIN CHECK — VERDICT: ERROR(probe report missing/invalid: )` and STOP. Fail closed: no recommendations over invented detection. --- ## PHASE 2 — ANALYZE Detect signals from REQUEST + the PROBE REPORT fields: | Signal | How to detect | |---|---| | `frontend` | .tsx/.jsx files, React/Vue/Next/Svelte in deps | | `mobile` | React Native / Expo in deps, `pubspec.yaml` present (Flutter), or "mobile"/"iOS"/"Android" in description | | `monorepo` | `apps/` or `packages/` with >1 sub-dir, `pnpm-workspace.yaml`, `turbo.json`, `nx.json`, or `workspaces` key in root `package.json`; **or** parent dir has `turbo.json`/`pnpm-workspace.yaml` (current dir is a sub-package) | | `design-system` | tokens, theme files, storybook, design references | | `deploy` | docker-compose, Dockerfile, CI config, cloud references | | `browser-qa` | playwright, cypress, puppeteer in deps | | `multi-session` | description says "multi-day", "large feature", "multiple sessions" | | `fast-libs` | Next.js, React 18+, Prisma, Supabase, Drizzle, Expo SDK in deps | | `multi-agent` | "orchestrate agents", "parallel workers", "swarm", >5 concurrent agents needed | | `complex-arch` | multiple services, event bus, distributed system in description | | `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) | --- ## PHASE 2.5 — COMPLEXITY ASSESSMENT Rate project complexity 0-100% to decide tool depth. Factors (weighted): | Factor | Weight | Low (0-30) | Med (30-70) | High (70-100) | |---|---|---|---|---| | Data model | 25% | Static pages, no DB | Simple CRUD, 1 DB | Relations, multi-DB, sessions, auth | | Business logic | 25% | Display only | Forms, validation | Algorithms, real-time, social, payments | | Integration surface | 20% | Standalone | 1-2 APIs | OAuth, webhooks, queues, 3rd-party SDKs | | Frontend complexity | 15% | None or static | SPA, basic routing | Design system, animations, a11y, i18n | | Infra/deploy | 15% | Local only | Single deploy target | Multi-env, CI/CD, containers, monitoring | **Score thresholds:** - **0-30% (simple)**: superpowers only. No gstack, no gsd, no ctx7, no graphify. _Examples: site vitrine, landing page, script CLI, simple CRUD._ - **30-60% (moderate)**: + context7 if fast-libs, + graphify after implementation. _Examples: blog with auth, dashboard with charts, API with validation._ - **60-85% (complex)**: + gstack if browser-QA, + gsd if multi-session, + graphify both passes. _Examples: SaaS with billing, game with social features, e-commerce._ - **85-100% (enterprise)**: all tools justified. _Examples: multi-service platform, real-time collab app, marketplace._ Output: `COMPLEXITY: % —