# {{PROJECT_NAME}} - PHP Clean Architecture

> Genere: {{GENERATION_DATE}} | Claude Craft v{{VERSION}}

## Quoi (Stack & Structure)

**Stack**: {{TECH_STACK}}
**Framework**: {{PHP_FRAMEWORK}} + PHP {{PHP_VERSION}}

### Structure du projet
```
src/
├── Domain/               # Logique metier (AUCUNE dependance externe)
│   ├── Entity/           # Entites avec comportement
│   ├── ValueObject/      # Types immuables
│   ├── Event/            # Domain events
│   └── Repository/       # Interfaces (contrats)
├── Application/          # Use cases (CQRS)
│   ├── UseCase/
│   │   ├── Command/      # Operations d'ecriture
│   │   └── Query/        # Operations de lecture
│   └── DTO/              # Data Transfer Objects
├── Infrastructure/       # Concerns externes
│   ├── Persistence/      # Doctrine/Eloquent
│   └── Service/          # Services externes
└── Presentation/         # UI layer
    └── Controller/       # HTTP controllers
```

## Pourquoi (Objectif & Organisation)

### Architecture: Clean Architecture + CQRS
- **Domain**: Logique metier pure, interfaces pour inversion
- **Application**: Orchestration des use cases
- **Infrastructure**: Implementations techniques
- **Presentation**: Adaptateur HTTP

Voir `rules/02-architecture.md` pour les patterns.

### Regles critiques

| Regle | Description |
|-------|-------------|
| Analyse avant code | Consulter `rules/01-workflow-analysis.md` |
| strict_types | `declare(strict_types=1)` partout |
| PHPStan level 9 | 0 erreurs obligatoire |
| Coverage 80%+ | Domain 90%+ |

## Comment (Commandes & Workflows)

### Commandes de developpement
```bash
composer install           # Installation
{{CACHE_CLEAR_COMMAND}}    # Clear cache
```

### Pipeline de qualite
```bash
vendor/bin/phpstan analyse          # Analyse statique
vendor/bin/php-cs-fixer fix         # Fix code style
vendor/bin/phpunit                  # Tests
vendor/bin/phpunit --coverage-html  # Coverage
composer quality                    # Full check
```

### Base de donnees
```bash
{{MIGRATION_CREATE_COMMAND}}   # Creer migration
{{MIGRATION_RUN_COMMAND}}      # Executer migrations
{{MIGRATION_ROLLBACK_COMMAND}} # Rollback
```

### Workflow de developpement
1. **Analyser** - `rules/01-workflow-analysis.md`
2. **TDD** - Test first (PHPUnit/Pest)
3. **Qualite** - `composer quality`
4. **Commit** - Conventional Commits

## References

| Contexte | Fichier |
|----------|---------|
| Workflow | `rules/01-workflow-analysis.md` |
| Architecture | `rules/02-architecture.md` |
| Standards | `rules/03-coding-standards.md` |
| SOLID | `rules/04-solid-principles.md` |
| Tests | `rules/07-testing.md` |
| Securite | `rules/11-security.md` |

<!-- PROJECT-SPECIFIC-START -->
## Specificites du projet

<!-- Cette section est preservee lors des mises a jour -->

<!-- PROJECT-SPECIFIC-END -->
