backend-module

Scaffolds a new DDD domain module with entity, EF configuration, and DI wiring in a .NET API.

Updated May 7, 2026
One-click install
npx skills add https://github.com/Pieter-1337/Euricom-tsz --skill backend-module-pieter-1337
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: backend-module
Source: https://github.com/Pieter-1337/Euricom-tsz/tree/main/.claude/skills/tsz-backend-module
Command: npx skills add https://github.com/Pieter-1337/Euricom-tsz --skill backend-module-pieter-1337

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Setting up a new domain module in a modular .NET API involves many repetitive, error-prone steps: creating two class library projects, writing a DDD-style entity, configuring EF Core, wiring dependency injection, registering endpoints, and generating migrations. This Skill codifies the entire scaffold so a new module follows the established conventions exactly. ## Core Features & Use Cases - Two-project module scaffold: Creates the implementation classlib (Tsz.Modules.<Feature>) and the public Contracts classlib with correct project references and csproj contents. - DDD entity and EF Core setup: Generates an entity with private setters, a static Create factory, named mutators, and an IEntityTypeConfiguration auto-discovered via ApplyConfigurationsFromAssembly — no DbSet plumbing required. - Module wiring and facade: Produces the <Feature>Module : IModule class, an access-module facade over IDispatcher for cross-module queries, an endpoints shell, Program.cs registration, a test builder, and an EF migration command. - Use Case: When adding a new domain concept like Customers to the API, run this Skill once to scaffold the full module, then use the backend-slice skill to add individual operations. ## Quick Start Scaffold a new backend module named Customers with a Customer entity that has Name and Email fields.

Frequently Asked Questions about backend-module

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

FAQPage Schema
How do I scaffold a new domain module in a modular .NET API?

Create two class libraries per feature: an implementation project and a Contracts project. Add a DDD entity with a static Create factory, an IEntityTypeConfiguration, an IModule class for DI and endpoints, then register the module in Program.cs and generate an EF migration.

How do I register EF Core entities without DbSet properties?

Implement IEntityTypeConfiguration<T> for each entity and call ApplyConfigurationsFromAssembly in OnModelCreating. The DbContext discovers configurations automatically, and data access goes through context.Set<T>() inside a generic repository.

How should modules reference each other in a modular monolith?

Modules reference each other by plain Guid properties only, with no EF navigation properties or database foreign keys across module boundaries. Cross-module integrity is enforced in FluentValidation validators using the other module's repository, and impl projects may reference only other modules' Contracts.

Can I use a separate DbContext per module with EF Core?

In this architecture, no. One shared AppDbContext serves the whole API, and each module contributes its entity configurations via ApplyConfigurationsFromAssembly. Per-module DbContexts would break the shared IUnitOfWork and IRepository abstraction used by slices, seeders, and tests.

Why does my EF migration not include the new entity?

The dotnet ef tool discovers entities through ApplyConfigurationsFromAssembly calls in OnModelCreating, not DbSet properties. Confirm you added the new module's assembly to AppDbContext and that the configuration class implements IEntityTypeConfiguration<T>.