add-module

Create and register a bounded-context module in the dotnet-starter-kit.

6.7k|2.0k|Updated Aug 20, 2021
One-click install
npx skills add https://github.com/fullstackhero/dotnet-starter-kit --skill add-module-fullstackhero
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-module
Source: https://github.com/fullstackhero/dotnet-starter-kit/tree/main/.agents/skills/add-module
Command: npx skills add https://github.com/fullstackhero/dotnet-starter-kit --skill add-module-fullstackhero

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Adding a new bounded context to the starter kit is error-prone because the module must be registered consistently across multiple host entry points or its endpoints and handlers will not load and migrations/seeding will be skipped.

Core Features & Use Cases

  • Scaffold a new module’s runtime + contracts projects: Creates the expected runtime and public API structure for a distinct business domain.
  • Wire module loading, permissions, and DbContext: Adds the module definition (IModule), permission registration, and a tenant-aware DbContext extending BaseDbContext with correct model-building rules.
  • Ensure production-ready registration and migrations: Registers the module in all required locations (API + DbMigrator, Mediator markers + moduleAssemblies) and sets up initial migrations for the module’s schema.
  • Use case: When you introduce a new business capability like “Inventory” that requires its own data model, permissions, authorization surface, and database schema, this skill guides the full add-module workflow with the kit’s architectural rules.

Quick Start

Create a new inventory domain module by running the add-module skill with the argument Inventory.

Frequently Asked Questions about add-module

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

FAQPage Schema
How do I add a new domain module to a dotnet starter kit with EF Core and Mediator?

To add a new domain module, you must scaffold runtime and contracts projects, wire FshModule registration, configure a tenant-aware DbContext, and register Mediator markers across API and DbMigrator entry points for endpoints and migrations to load correctly.

Why are my Mediator handlers and endpoints not loading after adding a bounded context?

Mediator handlers and endpoints fail to load when module registration is inconsistent across host entry points. You must synchronize moduleAssemblies and add Mediator discovery markers in both the API and DbMigrator projects to ensure handlers are recognized.

How do I configure multitenancy in EF Core migrations for a new module?

Configuring multitenancy for EF Core migrations requires extending BaseDbContext with correct OnModelCreating ordering and registering the module in the DbMigrator host so that tenant-aware schemas are applied during migrate and seed operations.

What's the best way to scaffold permissions and authorization resources for a new dotnet module?

The best way to scaffold permissions is to define the module's IModule implementation, add permission registration within the module definition, and configure authorization resources alongside the API surface under versioned routes.

Do I need separate runtime and contracts projects when introducing a new business domain?

Yes, introducing a distinct business domain requires its own runtime and contracts projects to establish correct public API structure, data model boundaries, and architectural registration via FshModule for the domain's bounded context.

Why are EF Core migrations being skipped for my newly added dotnet module?

EF Core migrations are skipped when the module is not registered in moduleAssemblies and the DbMigrator host. You must ensure synchronized assembly-level registration across all required entry points for successful migration and seeding behavior.