PouryaKit
A reusable .NET 10 foundation for modular monoliths, in which Feature code holds only business behaviour.
Each Feature of a Module supplies its command or query, its handler and its endpoint. The Kit runs the Operation with the caller's Operation Context and tenant, owns its one commit in the Unit of Work, writes its Outbox and delivers what it published, in any Host that composes its Capabilities.
dotnet new install PouryaKit.Templates@0.1.0-preview.2A Feature holds only business behaviour
Renaming a product in the Proving Sample: the command names the cache entry it makes stale, and the handler returns a Result. Nothing here saves, commits or sends; the Kit runs the Operation around it. Walk through the Proving Sample.
internal sealed record RenameProductCommand(Guid ProductId, string Name)
: Command,
IInvalidatesCache
{
public IReadOnlyCollection<string> InvalidatedCacheTags =>
[GetProductQuery.ProductTag(ProductId)];
}internal sealed class RenameProductCommandHandler(IRepository<Product, ProductId> products)
: CommandHandler<RenameProductCommand>
{
public override async Task<Result> Handle(
RenameProductCommand command,
CancellationToken cancellationToken
)
{
var product = await products.FindAsync(new ProductId(command.ProductId), cancellationToken);
return product is null ? ProductErrors.NotFound : product.Rename(command.Name);
}
}What the Kit guarantees
Feature code never saves
A structure rule: the sample's tests hold its Modules to it. Those tests are not published, so a project writes its own.
Notifications after the commit
A reaction that reaches outside the Module runs only once the change is committed.
One problem response
Every failure answers the same problem response, with each Error of its Result.
No default Actor
An Operation runs with the Operation Context its caller passes, or not at all.
Tenant scoping
EF Core reads and saves keep to the Operation's tenant; plain SQL states the tenant itself.
Checked when the Host is built
A declaration that cannot work stops the Host before it serves a request.
Capabilities
Each Capability is one or a few packages, used on their own or together.
Domain primitives
PouryaKit.Domain
Commands, queries and validation
PouryaKit.Cqrs, PouryaKit.Validation
Modules
PouryaKit.Modularity
Persistence and the Unit of Work
PouryaKit.Persistence, PouryaKit.Persistence.EFCore, PouryaKit.Persistence.Postgres
Dapper reads
PouryaKit.Persistence.Dapper
Messaging
PouryaKit.Messaging, PouryaKit.Messaging.Wolverine, PouryaKit.Messaging.Wolverine.EFCore
RabbitMQ between Hosts
PouryaKit.Messaging.Wolverine.RabbitMq
Security
PouryaKit.Security, PouryaKit.Security.JwtBearer
Multi-tenancy
PouryaKit.Domain, PouryaKit.Cqrs, PouryaKit.Persistence.EFCore, PouryaKit.Messaging.Wolverine
Web
PouryaKit.Web
API versions and OpenAPI
PouryaKit.Web.OpenApi
gRPC
PouryaKit.Grpc
Testing
PouryaKit.Testing
Observability
PouryaKit.Observability
Project templates
PouryaKit.Templates
Caching
PouryaKit.Caching
File storage
PouryaKit.Storage, PouryaKit.Storage.S3, PouryaKit.Storage.AzureBlob
PouryaKit.Email, PouryaKit.Email.MailKit
Localization
PouryaKit.Localization
Reverse proxy
PouryaKit.ReverseProxy
Aspire resources
PouryaKit.Aspire
Realtime
PouryaKit.Realtime
Reporting
PouryaKit.Reporting
Report Module
PouryaKit.Reporting.Module
AI
PouryaKit.AI, PouryaKit.AI.Postgres
Streams
PouryaKit.Persistence.Marten, PouryaKit.Messaging.Wolverine.Marten
Sagas
PouryaKit.Messaging.Wolverine.Sagas
Core helpers
PouryaKit.Core
The path through the docs
Install the AI skill
The Kit's skill teaches a coding agent the same rules these pages do. Add it to Claude Code, Codex and other agents:
npx skills add PouryaNoufallah96/pouryakit-pubPackages on nuget.org
Every package is published on nuget.org at 0.1.0-preview.2 under the MIT licence. The templates' package pins that version in each solution it generates. The Kit's source repository is private.