scaffold-entity

Generates a new domain entity with enum, DbSet, UnitOfWork wiring, and EF Core migration.

1|Updated Apr 27, 2026
One-click install
npx skills add https://github.com/GSU26SE55/backend --skill scaffold-entity-gsu26se55
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: scaffold-entity
Source: https://github.com/GSU26SE55/backend/tree/main/.claude/skills/dev/be/scaffold-entity
Command: npx skills add https://github.com/GSU26SE55/backend --skill scaffold-entity-gsu26se55

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Adding a new entity to a .NET microservice requires touching many files — the entity class, a status enum, the DbContext, the UnitOfWork interface and implementation, and an EF Core migration — and missing any step causes build or runtime errors. ## Core Features & Use Cases - Entity Scaffolding: Creates a Domain entity class extending AuditableEntity with a status enum whose values start at 1. - Persistence Wiring: Adds the DbSet to ApplicationDbContext and registers a generic repository in both the IUnitOfWork interface and its implementation. - Migration Generation: Runs the dotnet ef migrations add command with the correct project and startup paths. - Use Case: When adding a Battery entity to BatteryService, run the skill with the service and entity names to produce all required files and the migration in one pass. ## Quick Start Ask the AI to scaffold a new entity named Battery in BatteryService following the project's Clean Architecture conventions.

Frequently Asked Questions about scaffold-entity

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new entity to a .NET Clean Architecture project?▼

Create the entity class extending AuditableEntity in Domain/Entities, add a status enum, register a DbSet in ApplicationDbContext, expose a repository through the UnitOfWork interface and implementation, then run dotnet ef migrations add to generate the migration.

How to run EF Core migrations in a multi-project solution?▼

Run dotnet ef migrations add from the Api project directory, passing -p to point at the Infrastructure project containing the DbContext and -s to specify the startup project. This ensures the migration is created in the correct assembly.

Why should enum values start from 1 instead of 0 in C#?▼

Starting enum values at 1 prevents uninitialized properties from defaulting to a valid state, since C# value types default to 0. This skill enforces that convention so a missing status assignment is detectable rather than silently mapping to Active.

What is the UnitOfWork pattern with generic repositories in EF Core?▼

The UnitOfWork pattern coordinates multiple repository operations through a single interface so changes commit together. Each entity gets an IGenericRepository property declared in the IUnitOfWork interface and instantiated in the UnitOfWork constructor.

Does this scaffolding work outside this specific microservice solution?▼

The templates assume this repository's conventions: AuditableEntity base class, ApplicationDbContext naming, and the IGenericRepository UnitOfWork pattern. Projects with different base classes or folder structures would need the templates adjusted.