Generates or reviews ABP Framework CRUD application-service contracts and implementations using CrudAppService APIs, including DTO separation, repository wiring, object mapping, policy properties, and list filtering.
Ships in abp-module-development. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use the framework CRUD base only when the use case really has the standard get, list, create, update, and delete shape.
*.Application.Contracts and its service in *.Application.CrudAppService for missing policies, mappings, pagination, or operation coverage.IEntity<TKey> key lookup — use application-services for AbstractKeyCrudAppService and implement key resolution.The widest contract is:
ICrudAppService<
TGetOutputDto,
TGetListOutputDto,
TKey,
TGetListInput,
TCreateInput,
TUpdateInput>
It combines these five methods:
Task<TGetOutputDto> GetAsync(TKey id);
Task<PagedResultDto<TGetListOutputDto>> GetListAsync(TGetListInput input);
Task<TGetOutputDto> CreateAsync(TCreateInput input);
Task<TGetOutputDto> UpdateAsync(TKey id, TUpdateInput input);
Task DeleteAsync(TKey id);
The shorter overloads progressively reuse one DTO type for get, list, create, and update, and the shortest overload uses PagedAndSortedResultRequestDto. Prefer the widest overload when the public fields differ between detail, list, create, and update contracts.
ABP's test application contains this shortest-overload implementation. The excerpt omits unrelated test endpoints:
public interface IPeopleAppService : ICrudAppService<PersonDto, Guid>
{
// Other test endpoints omitted.
}
public class PeopleAppService : CrudAppService<Person, PersonDto, Guid>, IPeopleAppService
{
private readonly IHttpContextAccessor _httpContextAccessor;
public PeopleAppService(
IRepository<Person, Guid> repository,
IHttpContextAccessor httpContextAccessor)
: base(repository)
{
_httpContextAccessor = httpContextAccessor;
}
// Other test endpoints omitted.
}
The extra HTTP-context dependency belongs to that test application, not to CrudAppService; the base constructor accepts IRepository<TEntity, TKey>.
For separate DTO contracts, derive from the widest base:
CrudAppService<
TEntity,
TGetOutputDto,
TGetListOutputDto,
TKey,
TGetListInput,
TCreateInput,
TUpdateInput>
TEntity must be a class implementing IEntity<TKey>. The base receives IRepository<TEntity, TKey> and supplies standard key lookup and deletion.
Register mappings for every default mapping path used by the selected generic arguments:
TEntity to TGetOutputDto.TEntity to TGetListOutputDto.TCreateInput to TEntity.TUpdateInput to the existing TEntity instance.Use map-objects-and-dtos to configure the selected object-mapping provider. Override the async mapping methods when entity creation or mutation must go through constructors, aggregate methods, or a domain service. Both are protected virtual with default (object-mapper-backed) bodies, so override the one(s) you need:
Task<TEntity> MapToEntityAsync(TCreateInput createInput) — build the new entity (e.g. via its constructor or a factory). A custom create override therefore owns key assignment.Task MapToEntityAsync(TUpdateInput updateInput, TEntity entity) — apply the changes onto the loaded entity (e.g. through aggregate methods). A custom update override owns any input-ID normalization.The async overrides take precedence over the default synchronous mapping methods.
GetAsync checks GetPolicyName, loads by key, then maps to TGetOutputDto.GetListAsync checks GetListPolicyName, creates the filtered query, counts it, applies sorting, applies paging, executes it, then maps the page to TGetListOutputDto.CreateAsync checks CreatePolicyName, maps a new entity, sets framework-managed values described below, inserts with autoSave: true, then maps the result.UpdateAsync checks UpdatePolicyName, loads the entity, maps onto that existing instance, updates with autoSave: true, then maps the result.DeleteAsync checks DeletePolicyName, then deletes by key.Set all five protected policy-name properties in the derived service. CheckPolicyAsync returns without checking authorization when a property is null or empty; leaving a policy property unset does not deny access.
Guid.Empty) key on an IEntity<Guid> is assigned through GuidGenerator — but only when the Id property is settable and not marked [DisableIdGeneration]. A non-empty client-supplied ID is left as-is (only Guid.Empty is replaced).IMultiTenant entity gets CurrentTenant.Id when the current tenant has a value and the entity exposes a settable TenantId property.TUpdateInput implements IEntityDto<TKey>, its Id is replaced with the loaded entity's ID.Do not depend on a client-supplied ID or tenant ID when these framework paths apply.
Override CreateFilteredQueryAsync to apply filters only:
protected override async Task<IQueryable<TEntity>> CreateFilteredQueryAsync(
TGetListInput input)
{
var query = await base.CreateFilteredQueryAsync(input);
// Apply filters only. Sorting and paging run after the total count query.
return query;
}
Do not sort or page in this method. The base counts the filtered query before calling ApplySorting and ApplyPaging.
Sorting is applied only when the input implements ISortedResultRequest. A non-empty Sorting value is passed to dynamic LINQ OrderBy. When a limited result is requested without explicit sorting, CrudAppService orders descending by CreationTime for IHasCreationTime entities and otherwise by Id.
Paging is applied when the input implements IPagedResultRequest; otherwise a plain ILimitedResultRequest receives Take(MaxResultCount). PagedAndSortedResultRequestDto supplies both paging and sorting. LimitedResultRequestDto.MaxResultCount defaults to 10 and validates against a maximum of 1,000.
*.Application.Contracts.ICrudAppService overload; use the widest overload unless two contract roles intentionally share the same shape.CrudAppService overload and pass IRepository<TEntity, TKey> to the base constructor.GetPolicyName, GetListPolicyName, CreatePolicyName, UpdatePolicyName, and DeletePolicyName to defined permission names.CreateFilteredQueryAsync for filters; leave sorting and paging to their dedicated base methods.TotalCount represents the filtered query before paging, while Items contains only the requested page.CurrentTenant.Id and verify the persisted tenant ID comes from the current tenant.Guid entity with an empty ID (and a settable Id without [DisableIdGeneration]), verify the returned DTO has a non-empty ID; with a non-empty input ID, verify it is kept unchanged.IEntityDto<TKey>, test with a mismatched input ID and verify the method ID remains authoritative.CreateFilteredQueryAsync. It makes TotalCount describe the page instead of the full filtered set and is then paged again by the base.Guid, replace an update DTO ID, and assign the current tenant ID.CrudAppService for a non-standard key. It requires IEntity<TKey> and standard repository key lookup; use the AbstractKeyCrudAppService path in application-services instead.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/abp-module-development:build-crud-application-servicesfrom abp-module-development
npx claudepluginhub abpframework/abp-skills --plugin abp-module-development13 skills in this plugin
/application-servicesWrites or reviews an ABP application service — the DTO-taking, DTO-returning boundary between the domain and the presentation/API layer. USE FOR: implementing IApplicationService/ApplicationService for non-CRUD use cases, using AbstractKeyCrudAppService for composite or non-standard keys, and unit-of-work basics. DO NOT USE FOR: exposing application services as auto/conventional API controllers, routes, verbs or [RemoteService] (use expose-http-apis); a complete standard-key CrudAppService workflow (use build-crud-application-services); detailed object-to-DTO mapping mechanics/profiles (use map-objects-and-dtos); DTO validation attributes and business exceptions (use handle-validation-and-errors); permission definitions and authorization policy (use permissions-and-authorization); the overall layered project structure (use layered-architecture).
/create-plugin-modulesLoad ABP modules at runtime as plug-ins instead of referencing their assemblies directly, via AbpApplicationCreationOptions.PlugInSources. USE FOR: configuring options.PlugInSources with AddFolder / AddFiles / AddTypes (or a custom IPlugInSource), building a class-library plug-in module deriving from AbpModule, wiring MVC/Razor Pages plug-ins with AssemblyPart / CompiledRazorAssemblyPart application parts. DO NOT USE FOR: defining ordinary referenced modules, [DependsOn], or DI registration (use define-application-modules); overall solution layering (use layered-architecture); building the actual UI pages inside a plug-in (use blazor-ui, mvc-razor-ui, or angular-ui).
/customize-application-modulesExtends or customizes a pre-built ABP module (Identity, Account, etc.) referenced as NuGet packages without editing its source. USE FOR: adding extra entity/DTO properties via the module extension system, mapping extra properties to real EF Core columns, replacing/overriding module services, repositories, domain services, and controllers, overriding module UI. DO NOT USE FOR: defining your own new application module from scratch (use define-application-modules); modeling your own aggregates/entities (use model-domain-aggregates); general object-to-DTO mapping mechanics (use map-objects-and-dtos).
/define-application-modulesDefine and wire up an ABP module: the AbpModule class, [DependsOn] dependencies, service registration, options configuration, lifecycle hooks, and conventional DI. USE FOR: creating an AbpModule class, declaring [DependsOn] dependencies, registering services in ConfigureServices / PreConfigureServices / PostConfigureServices, configuring options with Configure for an options class, adding startup/shutdown lifecycle hooks (OnApplicationInitialization / OnApplicationShutdown), relying on ITransientDependency/IScopedDependency/ISingletonDependency conventional DI. DO NOT USE FOR: deciding which project a class belongs in or the overall solution layering (use layered-architecture); modeling entities/aggregates/value objects/domain services (use model-domain-aggregates); loading modules at runtime as plug-ins (use create-plugin-modules); writing application service implementations (use application-services).
/extend-objects-with-extra-propertiesAdd framework-level dynamic properties to any ABP entity or DTO that implements IHasExtraProperties. USE FOR: IHasExtraProperties and ExtraPropertyDictionary; ExtensibleObject and extensible aggregate roots/DTOs; ObjectExtensionManager definitions; GetProperty/SetProperty; EF Core JSON or dedicated-column persistence; MongoDB extra elements; mapping extra properties between entities and DTOs. DO NOT USE FOR: extending an installed Identity, Account, or other pre-built module through its module-specific extension configurator (use customize-application-modules); ordinary object mapping without extra properties (use map-objects-and-dtos); designing aggregate invariants and entity relationships (use model-domain-aggregates).
/handle-validation-and-errorsValidates DTOs/inputs and throws/localizes business errors in an ABP app. USE FOR: data annotations, IValidationEnabled, FluentValidation, BusinessException/UserFriendlyException, error codes, localizing error messages, mapping exceptions to HTTP status codes. DO NOT USE FOR: writing the application service itself or CrudAppService plumbing (use application-services); permission/authorization checks and AbpAuthorizationException policy (use permissions-and-authorization / authorize-resources).
Other plugins' skills for the same job