# Fusecore

> FuseCore 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.

- **Type:** Skill
- **Install:** `agentstack add skill-fusengine-agents-fusecore`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [fusengine](https://agentstack.voostack.com/s/fusengine)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [fusengine](https://github.com/fusengine)
- **Source:** https://github.com/fusengine/agents/tree/main/plugins/laravel-expert/skills/fusecore

## Install

```sh
agentstack add skill-fusengine-agents-fusecore
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# FuseCore Modular Architecture

## Agent Workflow (MANDATORY)

Before ANY implementation in FuseCore project, use `TeamCreate` to spawn 3 agents:

1. **fuse-ai-pilot:explore-codebase** - Analyze existing modules in `/FuseCore/`
2. **fuse-ai-pilot:research-expert** - Verify Laravel 13 patterns via Context7
3. **fuse-laravel:laravel-expert** - Apply Laravel best practices

After implementation, run **fuse-ai-pilot:sniper** for validation.

---

## Overview

FuseCore is a **Modular Monolith** architecture for Laravel 13 with React 19 integration.

| Component | Purpose |
|-----------|---------|
| **Module** | Self-contained feature (User, Dashboard, Blog) |
| **Auto-Discovery** | Automatic registration via `module.json` |
| **Traits** | `HasModule` for resource loading |
| **Contracts** | `ModuleInterface`, `ReactModuleInterface` |
| **React Integration** | Isolated React per module |
| **i18n** | Multi-language support (FR/EN/DE/IT/ES) |

---

## Critical Rules

1. **All code in `/FuseCore/{Module}/`** - Never in `/app/`
2. **One module.json per module** - Required for discovery
3. **ServiceProvider per module** - Use `HasModule` trait
4. **Files loadModuleMigrations();
    }
}
```

### Routes

```php
Route::middleware(['api', 'auth:sanctum'])->group(function () {
    Route::apiResource('items', ItemController::class);
});
```

---

## Module Checklist

- [ ] `/FuseCore/{Module}/` directory created
- [ ] `module.json` with name, version, dependencies
- [ ] `{Module}ServiceProvider.php` with `HasModule` trait
- [ ] Routes in `/Routes/api.php`
- [ ] Migrations in `/Database/Migrations/`
- [ ] Models in `/App/Models/`
- [ ] Controllers in `/App/Http/Controllers/`
- [ ] React in `/Resources/React/` (if needed)
- [ ] i18n in `/Resources/React/i18n/locales/`

---

## SOLID Compliance

| Rule | FuseCore Implementation |
|------|-------------------------|
| **Single Responsibility** | One module = one feature |
| **Open/Closed** | Extend via `ModuleInterface` |
| **Liskov Substitution** | `ReactModuleInterface extends ModuleInterface` |
| **Interface Segregation** | Separate contracts |
| **Dependency Inversion** | Inject via ServiceProvider |

**File limits**: All files app->bind(PostRepositoryContract::class, EloquentPostRepository::class);
    // NE PAS faire : $defaults = new Post(); ← LogicException en L13
}

public function boot(): void
{
    Post::observe(PostObserver::class);
}
```

### Cache prefixes par module
L13 utilise hyphens par défaut. Pour FuseCore, configurer le préfixe par module via `module.json` reste compatible :

```json
{
  "name": "BlogPost",
  "cache_prefix": "blogpost-"
}
```

## Best Practices

### DO
- Créer un module = un dossier `FuseCore//` complet (Contracts/, Services/, Http/, Models/)
- Déclarer toutes les dépendances inter-modules via Contracts (jamais classes concrètes)
- Utiliser `final readonly class` pour DTOs de module (PHP 8.3+)
- Migrer toute logique Model du `register()` vers `boot()`
- Préférer Inertia 2 + React 19 pour les modules avec UI

### DON'T
- Importer une classe d'un autre module sans passer par son Contract
- Mettre la logique métier dans Controllers (extraire en Service du module)
- Instancier un modèle Eloquent dans `register()` (LogicException L13)
- Dépasser 100 lignes par fichier (splitter en sous-modules ou Services)
- Partager des migrations entre modules (chaque module possède ses tables)

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [fusengine](https://github.com/fusengine)
- **Source:** [fusengine/agents](https://github.com/fusengine/agents)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-fusengine-agents-fusecore
- Seller: https://agentstack.voostack.com/s/fusengine
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
