abp-core

Applies ABP framework conventions for dependency injection, modules, exceptions, and localization.

Updated Jul 21, 2026
One-click install
npx skills add https://github.com/afonsoft/gamehub --skill abp-core-afonsoft
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: abp-core
Source: https://github.com/afonsoft/gamehub/tree/main/.claude/skills/abp-core
Command: npx skills add https://github.com/afonsoft/gamehub --skill abp-core-afonsoft

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers working with the ABP framework often mix in standard ASP.NET Core patterns that conflict with ABP conventions, such as using DateTime.Now, injecting DbContext directly, or registering services manually, leading to untestable and inconsistent code. ## Core Features & Use Cases - Convention Enforcement: Guides use of IClock, IRepository<T>, BusinessException, and marker interfaces like ITransientDependency instead of raw ASP.NET Core equivalents. - Base Class Awareness: Lists built-in properties (Clock, CurrentUser, L, GuidGenerator) available on ApplicationService, DomainService, and AbpController so redundant injections are avoided. - Anti-Pattern Reference: Provides a table of ABP anti-patterns (Minimal APIs, MediatR, manual UnitOfWork) with the correct ABP replacements. - Use Case: When writing a new application service in an ABP modular monolith, consult this Skill to structure the module class, register dependencies, handle localization, and throw properly coded business exceptions. ## Quick Start Review my ABP application service code and fix any violations of ABP conventions such as DateTime usage or direct DbContext injection.

Frequently Asked Questions about abp-core

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

FAQPage Schema
How do I register services in ABP dependency injection?▼

Implement marker interfaces like ITransientDependency, ISingletonDependency, or IScopedDependency and ABP registers the service automatically. Classes inheriting ApplicationService, DomainService, or AbpController are also auto-registered without manual AddScoped calls.

How do I get the current time in ABP framework?▼

Use the Clock property available on ABP base classes, or inject IClock into other services. Never use DateTime.Now or DateTime.UtcNow directly, since IClock is testable and respects configured timezone settings.

Should I use IRepository or inject DbContext in ABP?▼

Use the generic IRepository<TEntity, TKey> for simple CRUD operations and define a custom repository interface only when you need custom query methods. Injecting DbContext directly into application services is an ABP anti-pattern.

How do I throw business exceptions with error codes in ABP?▼

Throw a BusinessException with a namespaced error code like "MyModule:BookNameAlreadyExists" and attach data via WithData. Map the code namespace to a localization resource using AbpExceptionLocalizationOptions so messages are localized.

Can I use MediatR or Minimal APIs with ABP framework?▼

No, both are listed ABP anti-patterns. Use Application Services instead of MediatR handlers, and use ABP Controllers or Auto API Controllers instead of Minimal APIs to stay consistent with the framework's conventions.