Help us improve
Share bugs, ideas, or general feedback.
From ABP Sensei
Defines ABP Framework v10.4 layer dependency rules: correct project references, anti-patterns (no DbContext in Application, don't expose IQueryable), and repository location.
npx claudepluginhub burakdmir/abp-skills --plugin abp-senseiHow this skill is triggered — by the user, by Claude, or both
Slash command
/abp-sensei:abp-dependency-rulesThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
ABP Framework v10.4 layer dependency rules and project-structure guardrails. Correct dependency direction, use of abstractions, and common violations.
Applies C++ Core Guidelines to write, review, or refactor C++ code. Enforces modern, safe, and idiomatic practices for C++17/20/23.
Share bugs, ideas, or general feedback.
ABP Framework v10.4 layer dependency rules and project-structure guardrails. Correct dependency direction, use of abstractions, and common violations.
Domain.Shared → Constants, enums, localization keys
↑
Domain → Entity, repository interface, domain service
↑
Application.Contracts → App service interface, DTO
↑
Application → App service implementation
↑
HttpApi → REST controller (optional)
↑
Host → Final application with DI + middleware
| Project | Can reference | Referenced by |
|---|---|---|
| Domain.Shared | (none) | All |
| Domain | Domain.Shared | Application, Data layer |
| Application.Contracts | Domain.Shared | Application, HttpApi, Clients |
| Application | Domain, Contracts | Host |
| EntityFrameworkCore / MongoDB | Domain | Host only |
| HttpApi | Contracts only | Host |
// DbContext directly in the Application layer
public class BookAppService : ApplicationService
{
private readonly MyDbContext _dbContext; // ❌ WRONG — use a repository
}
// Domain depending on application
public class BookManager : DomainService
{
private readonly IBookAppService _appService; // ❌ WRONG
}
// HttpApi depending on the Application implementation
public class BookController : AbpController
{
private readonly BookAppService _bookAppService; // ❌ WRONG — use the interface
}
public class BookAppService : ApplicationService
{
private readonly IBookRepository _bookRepository; // ✅ repository abstraction
}
public class BookController : AbpController
{
private readonly IBookAppService _bookAppService; // ✅ contract (interface)
}
// Interface → Domain project
public interface IBookRepository : IRepository<Book, Guid>
{
Task<Book> FindByNameAsync(string name);
}
// Implementation → EntityFrameworkCore project
public class BookRepository : EfCoreRepository<MyDbContext, Book, Guid>, IBookRepository { }
// or MongoDB project
public class BookRepository : MongoDbRepository<MyDbContext, Book, Guid>, IBookRepository { }
MyProject.Admin.Application — Admin-specific services
MyProject.Public.Application — Public-specific services
MyProject.Domain — Shared domain (both reference it)
| Violation | Impact | Solution |
|---|---|---|
| DbContext in Application | Breaks DB independence | Use a repository |
| Returning entity as DTO | Exposes internal structure | Map to a DTO |
IQueryable in interface | Breaks the abstraction | Return a concrete type |
| App service call across modules | Tight coupling | Use an event or domain |
IQueryable — return a concrete type