From arbiter-skills
Exposes Arbiter commands and queries as REST endpoints via Minimal APIs. Automatically registers CRUD routes for entities with no per-route boilerplate.
How this skill is triggered — by the user, by Claude, or both
Slash command
/arbiter-skills:arbiter-endpointsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Minimal API surface that exposes the generic `Arbiter.CommandQuery` commands and queries as REST endpoints automatically. Each entity gets `GET /{prefix}/{name}/{id}`, `GET /{prefix}/{name}` (paged), `POST`, `PUT`, `PATCH`, `DELETE` with no per-route boilerplate.
Minimal API surface that exposes the generic Arbiter.CommandQuery commands and queries as REST endpoints automatically. Each entity gets GET /{prefix}/{name}/{id}, GET /{prefix}/{name} (paged), POST, PUT, PATCH, DELETE with no per-route boilerplate.
dotnet add package Arbiter.CommandQuery.Endpoints
using Arbiter.CommandQuery.Endpoints;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddCommandQuery();
builder.Services.AddEndpointRoutes();
// One IEndpointRoute per entity (see below)
builder.Services.AddSingleton<IEndpointRoute, ProductEndpoint>();
var app = builder.Build();
// Mounts every IEndpointRoute under the prefix (default "/api")
app.MapEndpointRoutes();
app.Run();
MapEndpointRoutes(prefix = "/api", serviceKey = null) returns an IEndpointConventionBuilder, so chain .RequireAuthorization(), .WithOpenApi(), etc.
public class ProductEndpoint
: EntityCommandEndpointBase<int, ProductReadModel, ProductReadModel, ProductCreateModel, ProductUpdateModel>
{
public ProductEndpoint(ILoggerFactory loggerFactory)
: base(loggerFactory, entityName: "Product") { }
}
That single class registers all of:
GET /api/Product/{id}
GET /api/Product
POST /api/Product
PUT /api/Product/{id}
PATCH /api/Product/{id}
DELETE /api/Product/{id}
If you only need queries, derive from EntityQueryEndpointBase<TKey, TListModel, TReadModel> instead.
// Read-only entity (queries only)
public class CategoryEndpoint : EntityQueryEndpointBase<int, CategoryReadModel, CategoryReadModel>
{
public CategoryEndpoint(ILoggerFactory l) : base(l, "Category") { }
}
// Custom routes — override MapEndpoints to add or replace any of the above
protected override void MapEndpoints(IEndpointRouteBuilder app)
{
base.MapEndpoints(app);
app.MapPost($"/{EntityName}/import", ImportProducts).WithName("ImportProducts");
}
// Auth applied via the convention builder returned by MapEndpointRoutes
app.MapEndpointRoutes().RequireAuthorization();
npx claudepluginhub loresoft/arbiter --plugin arbiter-skillsProvides ASP.NET Core MVC controller base classes for exposing Arbiter CQRS commands and queries via controllers instead of minimal API endpoints.
Generates Minimal API endpoints for .NET 8+ using MapGet/MapPost/MapPut/MapDelete with MediatR and FluentValidation, following Microsoft's recommended approach.
Building Minimal APIs. Route groups, endpoint filters, TypedResults, OpenAPI 3.1, organization.