$npx -y skills add fusengine/agents --skill fusecoreFuseCore Modular Architecture - Laravel 13 modular monolith with auto-discovery, React 19 integration, and SOLID principles. Use when creating modules, understanding FuseCore structure, or implementing features in FuseCore projects.
| 1 | # FuseCore Modular Architecture |
| 2 | |
| 3 | ## Agent Workflow (MANDATORY) |
| 4 | |
| 5 | Before ANY implementation in FuseCore project, use `TeamCreate` to spawn 3 agents: |
| 6 | |
| 7 | 1. **fuse-ai-pilot:explore-codebase** - Analyze existing modules in `/FuseCore/` |
| 8 | 2. **fuse-ai-pilot:research-expert** - Verify Laravel 13 patterns via Context7 |
| 9 | 3. **fuse-laravel:laravel-expert** - Apply Laravel best practices |
| 10 | |
| 11 | After implementation, run **fuse-ai-pilot:sniper** for validation. |
| 12 | |
| 13 | --- |
| 14 | |
| 15 | ## Overview |
| 16 | |
| 17 | FuseCore is a **Modular Monolith** architecture for Laravel 13 with React 19 integration. |
| 18 | |
| 19 | | Component | Purpose | |
| 20 | |-----------|---------| |
| 21 | | **Module** | Self-contained feature (User, Dashboard, Blog) | |
| 22 | | **Auto-Discovery** | Automatic registration via `module.json` | |
| 23 | | **Traits** | `HasModule` for resource loading | |
| 24 | | **Contracts** | `ModuleInterface`, `ReactModuleInterface` | |
| 25 | | **React Integration** | Isolated React per module | |
| 26 | | **i18n** | Multi-language support (FR/EN/DE/IT/ES) | |
| 27 | |
| 28 | --- |
| 29 | |
| 30 | ## Critical Rules |
| 31 | |
| 32 | 1. **All code in `/FuseCore/{Module}/`** - Never in `/app/` |
| 33 | 2. **One module.json per module** - Required for discovery |
| 34 | 3. **ServiceProvider per module** - Use `HasModule` trait |
| 35 | 4. **Files < 100 lines** - Split at 90 lines (SOLID) |
| 36 | 5. **Interfaces in `/App/Contracts/`** - Never in components |
| 37 | 6. **Migrations in module** - `/Database/Migrations/` |
| 38 | 7. **Routes in module** - `/Routes/api.php` |
| 39 | |
| 40 | --- |
| 41 | |
| 42 | ## Architecture Overview |
| 43 | |
| 44 | ``` |
| 45 | FuseCore/ |
| 46 | ├── Core/ # Infrastructure (priority 0) |
| 47 | │ ├── App/ |
| 48 | │ │ ├── Contracts/ # ModuleInterface, ReactModuleInterface |
| 49 | │ │ ├── Services/ # ModuleDiscovery, RouteAggregator |
| 50 | │ │ ├── Traits/ # HasModule, HasModuleDatabase |
| 51 | │ │ └── Providers/ # FuseCoreServiceProvider |
| 52 | │ ├── Config/fusecore.php |
| 53 | │ └── module.json |
| 54 | │ |
| 55 | ├── User/ # Auth module |
| 56 | │ ├── App/Models/ # User.php, Profile.php |
| 57 | │ ├── Config/ # Module config (sanctum.php, etc.) |
| 58 | │ ├── Database/Migrations/ |
| 59 | │ ├── Resources/React/ # Isolated React |
| 60 | │ ├── Routes/api.php |
| 61 | │ └── module.json # dependencies: [] |
| 62 | │ |
| 63 | └── {YourModule}/ # Your new module |
| 64 | ├── App/ |
| 65 | │ ├── Models/ |
| 66 | │ ├── Http/Controllers/ |
| 67 | │ ├── Services/ |
| 68 | │ └── Providers/{YourModule}ServiceProvider.php |
| 69 | ├── Config/ # Module-specific config |
| 70 | ├── Database/Migrations/ |
| 71 | ├── Resources/React/ |
| 72 | ├── Routes/api.php |
| 73 | └── module.json # dependencies: ["User"] |
| 74 | ``` |
| 75 | |
| 76 | --- |
| 77 | |
| 78 | ## Reference Guide |
| 79 | |
| 80 | ### Architecture |
| 81 | |
| 82 | | Topic | Reference | When to consult | |
| 83 | |-------|-----------|-----------------| |
| 84 | | **Overview** | [architecture.md](references/architecture.md) | Understanding FuseCore design | |
| 85 | | **Module Structure** | [module-structure.md](references/module-structure.md) | Directory organization | |
| 86 | | **Auto-Discovery** | [module-discovery.md](references/module-discovery.md) | How modules are loaded | |
| 87 | | **module.json** | [module-json.md](references/module-json.md) | Module configuration | |
| 88 | |
| 89 | ### Implementation |
| 90 | |
| 91 | | Topic | Reference | When to consult | |
| 92 | |-------|-----------|-----------------| |
| 93 | | **Contracts** | [contracts.md](references/contracts.md) | ModuleInterface, ReactModuleInterface | |
| 94 | | **Traits** | [traits.md](references/traits.md) | HasModule, HasModuleDatabase | |
| 95 | | **ServiceProvider** | [service-provider.md](references/service-provider.md) | Module registration | |
| 96 | | **Routes** | [routes.md](references/routes.md) | API routing | |
| 97 | |
| 98 | ### Resources |
| 99 | |
| 100 | | Topic | Reference | When to consult | |
| 101 | |-------|-----------|-----------------| |
| 102 | | **React Integration** | [react-integration.md](references/react-integration.md) | Frontend per module | |
| 103 | | **Migrations** | [migrations.md](references/migrations.md) | Database per module | |
| 104 | | **i18n** | [i18n.md](references/i18n.md) | Multi-language setup | |
| 105 | |
| 106 | ### Guides |
| 107 | |
| 108 | | Topic | Reference | When to consult | |
| 109 | |-------|-----------|-----------------| |
| 110 | | **Creating Module** | [creating-module.md](references/creating-module.md) | Step-by-step guide | |
| 111 | |
| 112 | --- |
| 113 | |
| 114 | ### Templates (Code Examples) |
| 115 | |
| 116 | | Template | Purpose | |
| 117 | |----------|---------| |
| 118 | | [module.json.md](references/templates/module.json.md) | Module configuration | |
| 119 | | [ServiceProvider.php.md](references/templates/ServiceProvider.php.md) | Module service |