dotnet-create-module
Skill1 starsChanged todayMITView on GitHub
Scaffold a new module in a .NET modular monolith (Domain, Application, Infrastructure, Api projects, its own DbContext and schema, DI registration, test project). Use when a new bounded context needs its own module.
In this repository84 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/angular-coding-style.mdcCursor rule
- .cursor/rules/angular-patterns.mdcCursor rule
- .cursor/rules/angular-security.mdcCursor rule
- .cursor/rules/angular-testing.mdcCursor rule
- .cursor/rules/common-code-review.mdcCursor rule
- .cursor/rules/common-coding-style.mdcCursor rule
- .cursor/rules/common-development-workflow.mdcCursor rule
- .cursor/rules/common-security.mdcCursor rule
- .cursor/rules/common-testing.mdcCursor rule
- .cursor/rules/csharp-coding-style.mdcCursor rule
- .cursor/rules/csharp-data-access.mdcCursor rule
- .cursor/rules/csharp-patterns.mdcCursor rule
- .cursor/rules/csharp-security.mdcCursor rule
- .cursor/rules/csharp-testing.mdcCursor rule
- .cursor/rules/design-design-system.mdcCursor rule
- .cursor/rules/project-backend.mdcCursor rule
- .cursor/rules/project-security.mdcCursor rule
- .cursor/rules/project-testing.mdcCursor rule
- .cursor/rules/project-web.mdcCursor rule
- .cursor/rules/typescript-coding-style.mdcCursor rule
- .cursor/rules/typescript-patterns.mdcCursor rule
- .cursor/rules/typescript-security.mdcCursor rule
- .cursor/rules/typescript-testing.mdcCursor rule
- angular-guideSkill
- break-uiSkill
- dotnet-create-command-querySkill
- dotnet-create-entitySkill
- dotnet-ef-migrationSkill
- emil-design-engSkill
- frontend-designSkill
- impeccableSkill
- review-animationsSkill
- speckit-analyzeSkill
- speckit-checklistSkill
- speckit-clarifySkill
- speckit-constitutionSkill
- speckit-convergeSkill
- speckit-implementSkill
- speckit-planSkill
- speckit-specifySkill
- speckit-tasksSkill
- ui-ux-pro-maxSkill
- angular-guideSkill
- break-uiSkill
- dotnet-create-command-querySkill
- dotnet-create-entitySkill
- dotnet-create-moduleSkill
- dotnet-ef-migrationSkill
- emil-design-engSkill
- frontend-designSkill
- impeccableSkill
- review-animationsSkill
- speckit-analyzeSkill
- speckit-checklistSkill
- speckit-clarifySkill
- speckit-constitutionSkill
- speckit-convergeSkill
- speckit-implementSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 54
Use the repo's provider and naming convention (e.g.
- Very specific: line 75
Add the projects to the solution (dotnet sln add), add the test project, extend architecture tests to the new module.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Create a module
Inputs: module name (PascalCase, plural noun or capability: Invoices, Notifications), its first entity.
First read the repo's architecture doc/ADRs and one existing module end to end. Copy its project references,
package versions (Directory.Packages.props if central), base classes and registration style. The structure below
is the default only.
Structure
src/Modules/<Module>/
<Module>.Domain/ entities, value objects, <Entity>Errors, domain events -> SharedKernel
<Module>.Application/ commands, queries, validators, responses, abstractions -> Domain, mediator
DependencyInjection.cs
<Module>.Infrastructure/ <Module>DbContext, Schema, configurations, repositories -> Application, base Infrastructure
Database/<Module>DbContext.cs, Database/Schema.cs, Database/Configurations/, Database/Migrations/
DependencyInjection.cs
<Module>.Api/ controllers or minimal-API endpoints -> Application
tests/<Module>.Tests/ domain and handler tests (+ integration tests where the repo keeps them)Dependencies point inwards only: Api -> Application -> Domain; Infrastructure -> Application. No project references another module's projects except its public API contract project, if the repo has one.
DbContext and schema
namespace <Module>.Infrastructure.Database;
public static class Schema
{
public const string Name = "<module_snake_case>";
}
public sealed class <Module>DbContext(DbContextOptions<<Module>DbContext> options /*, tenant provider if any */)
: BaseDbContext(options), I<Module>UnitOfWork
{
public DbSet<<Entity>> <Entity>s => Set<<Entity>>();
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.HasDefaultSchema(Schema.Name);
modelBuilder.ApplyConfigurationsFromAssembly(typeof(<Module>DbContext).Assembly);
}
}Use the repo's provider and naming convention (e.g. UseNpgsql(...).UseSnakeCaseNamingConvention()), the shared
connection string, and the migrations history table in the module's schema
(npgsql => npgsql.MigrationsHistoryTable(HistoryRepository.DefaultTableName, Schema.Name)).
Registration
public static IServiceCollection Add<Module>Module(this IServiceCollection services, IConfiguration configuration)
{
services.Add<Module>Application(); // validators, handlers (assembly scan)
services.Add<Module>Infrastructure(configuration); // DbContext, repositories, unit of work
return services;
}Register in the host's Program.cs next to the other modules; add the Api assembly to controller discovery or map
its endpoints; include the module in startup migration application if the repo does that.
Then
- First entity with
dotnet-create-entity, first use cases withdotnet-create-command-query. - Initial migration with
dotnet-ef-migration(Initial<Module>Schema). - Add the projects to the solution (
dotnet sln add), add the test project, extend architecture tests to the new module.
Checklist
- Four projects + test project, references inward only, added to the solution
- Own DbContext, schema and migrations folder
- Registered in the host; endpoints authorised
- Architecture tests cover it; gate passes
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.

