Files
Heimdall/skills/ef-core-persistence/SKILL.md
T
arnaud.dartois 7869800ea5 docs: guider la parallélisation avec Orca (#276)
## Résumé
Ajoute `skills/parallel-development/SKILL.md` avec une procédure de découpage, d’orchestration Orca et d’intégration propre à Heimdall. Relie les skills transverses et `AGENTS.md` à cette procédure.

Closes #275

## Validation
- `git diff --check` : réussi.
- Vérification des liens Markdown locaux dans les 7 fichiers modifiés : réussie.
- Pas de build ou recette Compose : changement de documentation uniquement, sans changement de comportement ou de déploiement.

Reviewed-on: #276
Co-authored-by: Arnaud Dartois <admin@tordais.cc>
2026-11-07 09:32:21 +01:00

3.1 KiB

name, description
name description
ef-core-persistence Implement or review database persistence in Heimdall with Entity Framework Core, including SQLite Agent stores and PostgreSQL behavior.

Heimdall EF Core persistence

Use this skill whenever changing how application or Agent data is read or written.

For work spanning multiple persistence concerns, use parallel development with Orca. Keep each DbContext operation isolated; assign migration/model ownership clearly and serialize edits that touch the same entity configuration or migration chain.

  • Use EF Core LINQ and entity configurations for CRUD. Prefer projections, bounded result sets, asynchronous APIs, and CancellationToken; use AsNoTracking for read-only entity queries.
  • Create a short-lived DbContext per operation. Hosted services and concurrent workers should use IDbContextFactory<TContext> and dispose each context; never share a context across parallel work.
  • Evolve schemas through reviewed EF Core migrations. Preserve deployed data and test upgrades from every supported on-disk schema, including Agent-local SQLite outboxes.
  • Verify PostgreSQL translation, transaction boundaries, concurrency and deletion semantics against PostgreSQL integration tests when those behaviors matter. Do not use EF InMemory as proof of relational behavior.
  • Do not issue CRUD through ADO.NET or hand-written SQL. Raw SQL through EF is an exception for database-specific capabilities that LINQ cannot express or for measured performance needs. Keep it parameterized, add an adjacent EF Core exception: comment with the reason, and add a test for its behavior.
  • Migrations, test database setup, PostgreSQL maintenance/partition DDL, and locks with no portable EF equivalent are valid exceptions. Keep provider-specific code in Infrastructure or a dedicated adapter; do not spread it into use cases.
  • When adding an approved raw EF operation, add its exact source path and a short capability rationale to scripts/ci/check-efcore-usage.py's EF_CORE_EXCEPTIONS allowlist, keep an adjacent EF Core exception: comment, and cover the behavior with a relational test. The scanner intentionally ignores comments when locating a call; a comment alone does not allowlist a new production source.
  • Never enable sensitive-data logging in production. Do not log connection strings or persisted secret values.

Before editing, inspect this repository's AGENTS.md, the linked Gitea issue, model configuration, latest migration, and callers. After editing, run the relevant suite and CI persistence policy check, then update the issue with evidence and remaining deployment checks.

Microsoft references