entity-design

A guide for designing database entities with Entity Framework Core, Microsoft’s .NET tool for mapping objects to database tables. It covers relationships, value objects, audit fields, and inheritance.

In plain words
What is it for?
Use it to create entities, navigation properties, Fluent API configurations, DbContext registration, and table-per-hierarchy models.
Why use it?
It provides a repeatable way to define the domain model, configure database mappings, and check the migration that changes the database schema.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/andresharpe/dotbot/entity-design
Any agent
npx skills add andresharpe/dotbot --skill entity-design
Clone the repo
git clone --depth 1 https://github.com/andresharpe/dotbot

Made for: Claude Code, Codex.

Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 648 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00054 $0.00648
Opus 5 $0.00027 $0.00324
Sonnet 5 $0.00011 $0.00130
Haiku 4.5 $0.00005 $0.00065

Measured 2d ago against content hash 52bc46a70174, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

entity-design scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

content/stacks/dotnet-ef/recipes/skills/entity-design/SKILL.md · 79 lines

How it starts

The opening of the file, as written. The whole thing — 79 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Entity Design (EF Core)

Design and configure EF Core entities following project conventions.

Workflow

  1. Define the entity class with properties and base class inheritance
  2. Add navigation properties for relationships
  3. Create IEntityTypeConfiguration<T> with Fluent API configuration
  4. Register in DbContext via OnModelCreating or assembly scanning
  5. Generate and review migration to verify the resulting schema

Entity Structure

public class Invoice : EntityBase
{
    public string InvoiceNumber { get; set; } = string.Empty;
    public decimal Total { get; set; }
    public InvoiceStatus Status { get; set; }

    // Navigation properties
    public Guid CustomerId { get; set; }
    public Customer Customer { get; set; } = null!;
    public ICollection<InvoiceLineItem> LineItems { get; set; } = new List<InvoiceLineItem>();
}

Configuration

public class InvoiceConfiguration : IEntityTypeConfiguration<Invoice>
{
    public void Configure(EntityTypeBuilder<Invoice> builder)
    {
        builder.HasKey(x => x.Id);
        builder.Property(x => x.InvoiceNumber).HasMaxLength(50).IsRequired();
        builder.Property(x => x.Total).HasPrecision(18, 2);

        builder.HasOne(x => x.Customer)
            .WithMany(c => c.Invoices)
            .HasForeignKey(x => x.CustomerId)
            .OnDelete(DeleteBehavior.Restrict);

        builder.HasMany(x => x.LineItems)
            .WithOne(li => li.Invoice)
            .HasForeignKey(li => li.InvoiceId)
            .OnDelete(DeleteBehavior.Cascade);

        // Concurrency token
        builder.Property<byte[]>("RowVersion").IsRowVersion();
    }
}

Best Practices

  • Fluent API over data annotations for complex mappings — keeps entities clean
  • Owned types for value objects (e.g., Address, Money) — builder.OwnsOne(x => x.Address)
  • Shadow properties for audit fields (CreatedAt, ModifiedAt) via SaveChanges override
  • Explicit cascade delete — always configure OnDelete() to avoid surprise cascades
  • Concurrency tokens — add [Timestamp] or IsRowVersion() for entities edited concurrently

Read the full file on GitHub · 79 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 79 lines · 54 tokens per session scan A 52bc46a70174

Subscribe to this mod's changes

entity-design is a skill published in the GitHub repository andresharpe/dotbot (54 stars, last pushed 6d ago), licensed MIT. It adds 54 tokens to every session and 648 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

refactoring-csharp

Rename and refactor C# symbols in a .NET solution or multi-solution monorepo with a one-shot Roslyn CLI. Use when the user asks to rename a symbol, preview impact, update references across a solution, or refactor shared projects across several solutions.

CodeAlive-AI/ai-driven-development · 60 tokens

csharp-idioms

C# rewards type safety, LINQ expressiveness, and async-first design. Modern C# (10+/.NET 6+) favors records, nullable reference types, and minimal APIs. Idiomatic C# = clean, async-aware, framework-integrated.

irahardianto/awesome-agv · 0 tokens

csharp-dotnet

Use when writing, reviewing, testing, or shipping C# / .NET code — ASP.NET Core APIs (minimal APIs vs controllers), EF Core data access, async correctness, solution layout in .cs/.csproj/.sln. NOT a Java/Spring backend (that is spring-boot), NOT a Node/TypeScript backend (that is nestjs), NOT framework-neutral REST…

ericrisco/rsc-harness · 89 tokens

hedgehog-planning-intake

Use on any core for first-run planning intake — Phase 0 runs the vendored BMAD-METHOD planning shelf, shared by every core, and Phase 1 (mining 04-prd.md into intent records plus the Add-ons/sync-and-remote-entities decision) is full-stack-app's and pwa-app's shared procedure — identical mechanics, a different…

skyf0xx/hedgehog · 374 tokens

inbound-triage

Maintainer-only. Use when triaging inbound GitHub issues and pull requests on skyf0xx/hedgehog — "triage the issues", "check the PRs", "review inbound", "what's in the queue". Reads each item read-only, judges it for security and for whether it is real, then fixes and closes or comments and closes. Not part of the…

skyf0xx/hedgehog · 102 tokens

bmad-product-brief

Create, update, or validate a product brief. Use when the user wants help producing, editing, or validating a brief.

skyf0xx/hedgehog · 31 tokens