add-entity
Skill2 starsChanged 32 days agoMITView on GitHub
Adds a Govern domain entity with its EF Core configuration, DbSet and migration (and optional domain event). Use when a feature needs a new table/aggregate or child entity ("store X", "add an Order entity").
3 other projects use a version of this.
Adopted by
Most recently taken up by
- aiqadam/qadam-flowtheir own version, first seen Oct 8, 2026
- fullstackhero/dotnet-starter-kittheir own version, first seen Oct 8, 2026
- jpoindexter/theft-kittheir own version, first seen May 20, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- fullstackhero/dotnet-starter-kit★ 6.9ksame name
- aiqadam/qadam-flow★ 5same name
- jpoindexter/theft-kit★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository7 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- add-infra-concernSkill
- add-migrationSkill
- add-use-caseSkill
- develop-featureSkill
- outdated-packagesSkill
- verifySkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 1 is distinctive, and 5 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Run inside /develop-feature.
- Very specific: line 12
Read first: persistence.md, mapping.md, and architecture.md (the Domain template).
- Distinctive: line 19
No EF, ASP.NET or DTO types in Domain (arch test).
- Very specific: line 32
Run /add-migration with a name like Add[Names].
- Very specific: line 36
Document the entity (fields, invariants, events) in docs/features/[feature].md.
- Very specific: line 40
Run dotnet build Govern.slnx, then dotnet test Govern.slnx.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Add an entity
Run inside /develop-feature. Reference implementation: src/Govern.Domain/Entities/User.cs (aggregate root) and RefreshToken.cs (child created only through the root), src/Govern.Infrastructure/Persistence/Configurations/UserConfiguration.cs.
Read first: persistence.md, mapping.md, and architecture.md (the Domain template).
1. Domain: src/Govern.Domain/Entities/[Name].cs
- Derive from
BaseAuditableEntity(orBaseEntitywhen timestamps make no sense). The Guid v7Idcomes from the base. sealed classwith aprivateparameterless constructor for EF andprivate setproperties. Initialise strings tostring.Empty.- Creation: a static factory (
public static Order Create(...)) that validates invariants with guard clauses and raises a domain event if something should react. - Changes: go through intention-revealing methods (
Rename,Close). Keep children inprivate readonly List<T>exposed asIReadOnlyCollection<T>; children are created and changed only through the root (useinternalmembers on the child). - No EF, ASP.NET or DTO types in Domain (arch test).
- Optional event:
src/Govern.Domain/Events/[Name][Happened]Event.csas asealed record ... : BaseEvent, with a handler insrc/Govern.Application/[Feature]/EventHandlers/[Event]Handler.cs(internal sealed,INotificationHandler<TEvent>).
2. Persistence
src/Govern.Application.Common/Abstractions/IApplicationDbContext.cs: add aDbSet<[Name]> [Names] { get; }with an XML summary.src/Govern.Infrastructure/Persistence/ApplicationDbContext.cs: addpublic DbSet<[Name]> [Names] => Set<[Name]>();.src/Govern.Infrastructure/Persistence/Configurations/[Name]Configuration.cs: aninternal sealedclass implementingIEntityTypeConfiguration<[Name]>.- The key.
- A max length on every string.
- Required columns.
- Unique indexes for business keys.
- Foreign keys with explicit
OnDelete, and an index on each. - Backing-field navigations with
UsePropertyAccessMode(PropertyAccessMode.Field).
- Run
/add-migrationwith a name likeAdd[Names].
3. Tests and docs
- Integration tests exercise the entity through the endpoints of the use cases that need it (
/add-use-case). There are no unit tests for Domain or Application. - Document the entity (fields, invariants, events) in
docs/features/[feature].md. - Optionally run the
ef-core-specialistagent on the change.
4. Check
Run dotnet build Govern.slnx, then dotnet test Govern.slnx. The architecture tests check the base type, the folder, the naming and the Domain dependencies.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

