abp-core
Skill0 starsChanged 5 days agoMITView on GitHub
Use when working with ABP module system, dependency injection, base classes, time handling, business exceptions, or localization patterns
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- abpframework/abpedited, first seen Oct 8, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- abpframework/abp★ 14k95% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository67 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- abp-angularSkill
- abp-application-layerSkill
- abp-app-nolayersSkill
- abp-authorizationSkill
- abp-blazorSkill
- abp-cliSkill
- abp-dddSkill
- abp-dependency-rulesSkill
- abp-development-flowSkill
- abp-ef-coreSkill
- abp-infrastructureSkill
- abp-microserviceSkill
- abp-moduleSkill
- abp-mongodbSkill
- abp-multi-tenancySkill
- abp-mvcSkill
- abp-testingSkill
- aspnet-core-apiSkill
- brainstormingSkill
- building-mcp-serversSkill
- caveman-commitSkill
- caveman-compressSkill
- caveman-reviewSkill
- cavemanSkill
- chrome-devtoolsSkill
- create-agent-harnessSkill
- defuddleSkill
- design-patternsSkill
- dispatching-parallel-agentsSkill
- efcore-patternsSkill
- ef-coreSkill
- entity-framework-coreSkill
- executing-plansSkill
- find-skillsSkill
- finishing-a-development-branchSkill
- fluentui-blazorSkill
- github-issuesSkill
- harness-repo-structureSkill
- json-canvasSkill
- memory-mergerSkill
- microsoft-agent-frameworkSkill
- microsoft-code-referenceSkill
- microsoft-docsSkill
- microsoft-skill-creatorSkill
- migrate-aspnetboilerplate-to-abpSkill
- modern-csharp-coding-standardsSkill
- performance-optimizationSkill
- postgresql-code-reviewSkill
- postgresql-optimizationSkill
- premium-frontend-uiSkill
- receiving-code-reviewSkill
- requesting-code-reviewSkill
- rtk-token-killerSkill
- security-jwtSkill
- sonarqube-fixSkill
- sql-code-reviewSkill
- sql-optimizationSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 2 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Use IClock / Clock.Now instead of DateTime.Now / DateTime.UtcNow
- Very specific: line 15
Use ITransientDependency / ISingletonDependency instead of AddScoped/AddTransient/AddSingleton
- Very specific: line 16
Use IRepository<T> instead of injecting DbContext directly
- Very specific: line 17
Check base class properties (Clock, CurrentUser, GuidGenerator, L) before injecting services
- Very specific: line 18
Use BusinessException with namespaced error codes for domain rule violations
- Distinctive: line 21
Every ABP application/module has a module class that configures services:
- Very specific: line 109
Use async all the way - never use .Result or .Wait()
- Very specific: line 110
All async methods should end with Async suffix
- Very specific: line 112
Only pass CancellationToken explicitly when implementing custom cancellation logic
- Very specific: line 115
Never use DateTime.Now or DateTime.UtcNow directly.
- Very specific: line 145
Use BusinessException for domain rule violations with namespaced error codes:
- Distinctive: line 163
Always localize user-facing messages and exceptions
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
ABP Core Conventions
Documentation: https://abp.io/docs/latest API Reference: https://abp.io/docs/api/
Key Rules
- Use
IClock/Clock.Nowinstead ofDateTime.Now/DateTime.UtcNow - Use
ITransientDependency/ISingletonDependencyinstead ofAddScoped/AddTransient/AddSingleton - Use
IRepository<T>instead of injectingDbContextdirectly - Check base class properties (
Clock,CurrentUser,GuidGenerator,L) before injecting services - Use
BusinessExceptionwith namespaced error codes for domain rule violations
Module System
Every ABP application/module has a module class that configures services:
[DependsOn(
typeof(AbpDddDomainModule),
typeof(AbpEntityFrameworkCoreModule)
)]
public class MyAppModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
// Service registration and configuration
}
}Note: Middleware configuration (
OnApplicationInitialization) should only be done in the final host application, not in reusable modules.
Dependency Injection Conventions
Automatic Registration
ABP automatically registers services implementing marker interfaces:
ITransientDependency→ Transient lifetimeISingletonDependency→ Singleton lifetimeIScopedDependency→ Scoped lifetime
Classes inheriting from ApplicationService, DomainService, AbpController are also auto-registered.
Repository Usage
You can use the generic IRepository<TEntity, TKey> for simple CRUD operations. Define custom repository interfaces only when you need custom query methods:
// Simple CRUD - Generic repository is fine
public class BookAppService : ApplicationService
{
private readonly IRepository<Book, Guid> _bookRepository; // ✅ OK for simple operations
}
// Custom queries needed - Define custom interface
public interface IBookRepository : IRepository<Book, Guid>
{
Task<Book> FindByNameAsync(string name); // Custom query
}
public class BookAppService : ApplicationService
{
private readonly IBookRepository _bookRepository; // ✅ Use custom when needed
}Exposing Services
[ExposeServices(typeof(IMyService))]
public class MyService : IMyService, ITransientDependency { }Important Base Classes
| Base Class | Purpose |
Entity<TKey> | Basic entity with ID |
AggregateRoot<TKey> | DDD aggregate root |
DomainService | Domain business logic |
ApplicationService | Use case orchestration |
AbpController | REST API controller |
ABP base classes already inject commonly used services as properties. Before injecting a service, check if it's already available:
| Property | Available In | Description |
GuidGenerator | All base classes | Generate GUIDs |
Clock | All base classes | Current time (use instead of DateTime) |
CurrentUser | All base classes | Authenticated user info |
CurrentTenant | All base classes | Multi-tenancy context |
L (StringLocalizer) | ApplicationService, AbpController | Localization |
AuthorizationService | ApplicationService, AbpController | Permission checks |
FeatureChecker | ApplicationService, AbpController | Feature availability |
DataFilter | All base classes | Data filtering (soft-delete, tenant) |
UnitOfWorkManager | ApplicationService, DomainService | Unit of work management |
LoggerFactory | All base classes | Create loggers |
Logger | All base classes | Logging (auto-created) |
LazyServiceProvider | All base classes | Lazy service resolution |
Useful methods from base classes:
CheckPolicyAsync()- Check permission and throw if not grantedIsGrantedAsync()- Check permission without throwing
Async Best Practices
- Use async all the way - never use
.Resultor.Wait() - All async methods should end with
Asyncsuffix - ABP automatically handles
CancellationTokenin most cases (e.g., fromHttpContext.RequestAborted) - Only pass
CancellationTokenexplicitly when implementing custom cancellation logic
Time Handling
Never use DateTime.Now or DateTime.UtcNow directly. Use ABP's IClock service:
// In classes inheriting from base classes (ApplicationService, DomainService, etc.)
public class BookAppService : ApplicationService
{
public void DoSomething()
{
var now = Clock.Now; // ✅ Already available as property
}
}
// In other services - inject IClock
public class MyService : ITransientDependency
{
private readonly IClock _clock;
public MyService(IClock clock) => _clock = clock;
public void DoSomething()
{
var now = _clock.Now; // ✅ Correct
// var now = DateTime.Now; // ❌ Wrong - not testable, ignores timezone settings
}
}Tip: Before injecting a service, check if it's already available as a property in your base classes.
Business Exceptions
Use BusinessException for domain rule violations with namespaced error codes:
throw new BusinessException("MyModule:BookNameAlreadyExists")
.WithData("Name", bookName);Configure localization mapping:
Configure<AbpExceptionLocalizationOptions>(options =>
{
options.MapCodeNamespace("MyModule", typeof(MyModuleResource));
});Localization
- In base classes (
ApplicationService,AbpController, etc.): UseL["Key"]- this is theIStringLocalizerproperty - In other services: Inject
IStringLocalizer<TResource> - Always localize user-facing messages and exceptions
Localization file location: *.Domain.Shared/Localization/{ResourceName}/{lang}.json
// Example: MyProject.Domain.Shared/Localization/MyProject/en.json
{
"culture": "en",
"texts": {
"Menu:Home": "Home",
"Welcome": "Welcome",
"BookName": "Book Name"
}
}❌ Never Use (ABP Anti-Patterns)
| Don't Use | Use Instead |
| Minimal APIs | ABP Controllers or Auto API Controllers |
| MediatR | Application Services |
DbContext directly in App Services | IRepository<T> |
AddScoped/AddTransient/AddSingleton | ITransientDependency, ISingletonDependency |
DateTime.Now | IClock / Clock.Now |
| Custom UnitOfWork | ABP's IUnitOfWorkManager |
| Manual HTTP calls from UI | ABP client proxies (generate-proxy) |
| Hardcoded role checks | Permission-based authorization |
| Business logic in Controllers | Application Services |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

