$npx -y skills add fusengine/agents --skill modularizeUse when converting existing code to modular architecture. Detects Laravel (FuseCore or standard) / Next.js / React and applies correct modular patterns. Triggers: \"modularize\", \"convert to modules\", \"migrate to modular\", \"restructure modules\".
| 1 | ## Agent Workflow (MANDATORY) |
| 2 | |
| 3 | detect framework → explore structure → build migration plan → confirm with user → execute → sniper |
| 4 | |
| 5 | ## Framework Detection |
| 6 | |
| 7 | | Signal | Framework | Delegate To | |
| 8 | |---|---|---| |
| 9 | | `FuseCore/` dir + `artisan` file | Laravel + FuseCore | `fuse-laravel:laravel-expert` | |
| 10 | | `composer.json` + `artisan` (no FuseCore/) | Laravel standard | `fuse-laravel:laravel-expert` | |
| 11 | | `src/modules/` or `app/` + `next.config` | Next.js + modules/ | `fuse-nextjs:nextjs-expert` | |
| 12 | | `src/` + `package.json` (React, no Next) | React | `fuse-react:react-expert` | |
| 13 | |
| 14 | ## Critical Rules |
| 15 | |
| 16 | 1. **Analyze first** — always explore full structure before proposing anything |
| 17 | 2. **Show migration map** — present file-by-file plan before touching any code |
| 18 | 3. **User confirms** — never move or modify files without explicit approval |
| 19 | 4. **Cores = central hub** — no module-to-module imports; all shared logic goes through core |
| 20 | 5. **Sniper after each file** — run `fuse-ai-pilot:sniper` after every file moved or created |
| 21 | |
| 22 | ## Workflow Steps |
| 23 | |
| 24 | 1. Detect framework using signals from the table above |
| 25 | 2. Explore codebase: map all files, dependencies, imports, exports |
| 26 | 3. Build migration plan: list every file to create, move, or refactor |
| 27 | 4. Present plan to user — wait for explicit confirmation before proceeding |
| 28 | 5. Execute step by step; stop and report any conflict immediately |
| 29 | 6. Run sniper validation after each file change |
| 30 | 7. Final report: list all changes made and any remaining manual steps |
| 31 | |
| 32 | ## Reference Guide |
| 33 | |
| 34 | | Stack | Reference File | |
| 35 | |---|---| |
| 36 | | Laravel (FuseCore or standard) | `references/laravel-fusecore.md` | |
| 37 | | Next.js / React | `references/nextjs-react-modules.md` | |
| 38 | |
| 39 | ## DO / DON'T |
| 40 | |
| 41 | **DO:** explore before planning — plan before executing — confirm before touching files — sniper every step |
| 42 | |
| 43 | **DON'T:** assume structure — skip confirmation — import between modules directly — batch changes without validation |