New Entity
Create a new backend entity with EF Core configuration and migration.
Claude CodeGeneric
Create a new backend entity with EF Core configuration and migration.
Infer entity name, properties, feature name, and enum values from context. Ask only if the entity's purpose or key properties are genuinely ambiguous.
## Steps
**Domain:**
1. Create `src/backend/MyProject.Domain/Entities/{Entity}.cs`:
- Extend `BaseEntity`, private setters, protected parameterless ctor, public ctor with `Id = Guid.NewGuid()`
2. If enums: create alongside entity with explicit integer values
3. Add error messages to `src/backend/MyProject.Shared/ErrorMessages.cs`
**Infrastructure:**
4. Create EF config `Infrastructure/Features/{Feature}/Configurations/{Entity}Configuration.cs`:
- Extend `BaseEntityConfiguration<T>`, mark `internal`, `.HasComment()` on enum columns
5. Add `DbSet<{Entity}>` to `Infrastructure/Persistence/MyProjectDbContext.cs`
6. Run migration:
```bash
dotnet ef migrations add Add{Entity} \
--project src/backend/MyProject.Infrastructure \
--startup-project src/backend/MyProject.WebApi \
--output-dir Persistence/Migrations
Verify and commit:
dotnet build src/backend/MyProject.slnx— fix errors, loop until green- Commit:
feat({feature}): add {Entity} entity and EF configuration
This command stops at Infrastructure. Use
/new-endpointto add service, controller, and API surface.
Maintain New Entity?
Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.
[New Entity on getagentictools](https://getagentictools.com/loops/nickmarcha-new-entity?ref=badge)