Agent skill

Abp Ef Core

by abpframework in abpframework/abp

ABP Entity Framework Core - DbContext, entity configuration, EfCoreRepository implementation, migrations (dotnet ef migrations add), data seeding.

LGPL-3.0Auto-check passedDatabases

Install Abp Ef Core

skills CLI
$ npx skills add abpframework/abp --skill abp-ef-core -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install abpframework/abp abp-ef-core --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/abpframework/abp.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/abp-ef-core .claude/skills/abp-ef-core && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
abp-ef-core
GitHub stars
14k
Token cost
~1.9k tokens
SKILL.md length
170 words
Files
1
Skills in repo
18
Repo updated
First seen
Licence
LGPL-3.0

At a glance

ABP Entity Framework Core - DbContext, entity configuration, EfCoreRepository implementation, migrations (dotnet ef migrations add), data seeding.

  • Working in EntityFrameworkCore projects
  • SKILL.md covers Never Do, DbContext Configuration, Entity Configuration and Repository Implementation, plus 5 more sections
  • Calls dotnet
  • Adding migrations

What it does

Abp Ef Core is an agent skill from abpframework/abp. ABP Entity Framework Core - DbContext, entity configuration, EfCoreRepository implementation, migrations (dotnet ef migrations add), data seeding. Use when working in EntityFrameworkCore projects, adding migrations, or implementing EF Core repositories.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Databases, covering ORMs and data access. It works with .NET. The repository describes itself as: Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides… The licence is LGPL-3.0.

When your agent uses it

  • Working in EntityFrameworkCore projects
  • Adding migrations
  • Implementing EF Core repositories

Example prompts

  • “/abp-ef-core”

What it can do on your machine

Read from SKILL.md and the folder at commit a54b599. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • dotnet

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • abp.io

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Abp Ef Core loads about 1.9k tokens when it runs. Until then it costs about 66 tokens; SKILL.md has 170 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~66
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from abpframework/abp at commit a54b599, republished under its LGPL-3.0 licence (© abpframework). 170 words, ~1,886 tokens.

Download SKILL.mdSave it as .claude/skills/abp-ef-core/SKILL.md (or your agent's skills folder).
name
abp-ef-core
description
ABP Entity Framework Core - DbContext, entity configuration, EfCoreRepository implementation, migrations (dotnet ef migrations add), data seeding. Use when working in EntityFrameworkCore projects, adding migrations, or implementing EF Core repositories.

ABP Entity Framework Core

Docs: https://abp.io/docs/latest/framework/data/entity-framework-core

Never Do

Don'tDo Instead
Skip b.ConfigureByConvention()Always call it first in entity config
AddDefaultRepositories(includeAllEntities: true)Use AddDefaultRepositories() only for aggregate roots
Inject DbContext in application/domain servicesUse IRepository<T> or custom repository interface
Use DbContext directly outside the EF Core projectAccess via GetDbContextAsync() inside repository only

DbContext Configuration

csharp
[ConnectionStringName("Default")]
public class MyProjectDbContext : AbpDbContext<MyProjectDbContext>
{
    public DbSet<Book> Books { get; set; }
    public DbSet<Author> Authors { get; set; }

    public MyProjectDbContext(DbContextOptions<MyProjectDbContext> options)
        : base(options)
    {
    }

    protected override void OnModelCreating(ModelBuilder builder)
    {
        base.OnModelCreating(builder);

        // Configure all entities
        builder.ConfigureMyProject();
    }
}

Entity Configuration

csharp
public static class MyProjectDbContextModelCreatingExtensions
{
    public static void ConfigureMyProject(this ModelBuilder builder)
    {
        Check.NotNull(builder, nameof(builder));

        builder.Entity<Book>(b =>
        {
            b.ToTable(MyProjectConsts.DbTablePrefix + "Books", MyProjectConsts.DbSchema);
            b.ConfigureByConvention(); // ABP conventions (audit, soft-delete, etc.)

            // Property configurations
            b.Property(x => x.Name)
                .IsRequired()
                .HasMaxLength(BookConsts.MaxNameLength);

            b.Property(x => x.Price)
                .HasColumnType("decimal(18,2)");

            // Indexes
            b.HasIndex(x => x.Name);

            // Relationships
            b.HasOne<Author>()
                .WithMany()
                .HasForeignKey(x => x.AuthorId)
                .OnDelete(DeleteBehavior.Restrict);
        });
    }
}

Repository Implementation

csharp
public class BookRepository : EfCoreRepository<MyProjectDbContext, Book, Guid>, IBookRepository
{
    public BookRepository(IDbContextProvider<MyProjectDbContext> dbContextProvider)
        : base(dbContextProvider)
    {
    }

    public async Task<Book> FindByNameAsync(
        string name,
        bool includeDetails = true,
        CancellationToken cancellationToken = default)
    {
        var dbSet = await GetDbSetAsync();

        return await dbSet
            .IncludeDetails(includeDetails)
            .FirstOrDefaultAsync(
                b => b.Name == name,
                GetCancellationToken(cancellationToken));
    }

    public async Task<List<Book>> GetListByAuthorAsync(
        Guid authorId,
        bool includeDetails = false,
        CancellationToken cancellationToken = default)
    {
        var dbSet = await GetDbSetAsync();

        return await dbSet
            .IncludeDetails(includeDetails)
            .Where(b => b.AuthorId == authorId)
            .ToListAsync(GetCancellationToken(cancellationToken));
    }

    public override async Task<IQueryable<Book>> WithDetailsAsync()
    {
        return (await GetQueryableAsync())
            .Include(b => b.Reviews);
    }
}

Extension Method for Include

csharp
public static class BookEfCoreQueryableExtensions
{
    public static IQueryable<Book> IncludeDetails(
        this IQueryable<Book> queryable,
        bool include = true)
    {
        if (!include)
        {
            return queryable;
        }

        return queryable
            .Include(b => b.Reviews);
    }
}

Migration Commands

bash
# Navigate to EF Core project
cd src/MyProject.EntityFrameworkCore

# Add migration
dotnet ef migrations add MigrationName

# Apply migration (choose one):
dotnet run --project ../MyProject.DbMigrator   # Recommended - also seeds data
dotnet ef database update  # EF Core command only

# Remove last migration (if not applied)
dotnet ef migrations remove

# Generate SQL script
dotnet ef migrations script

Note: ABP templates include IDesignTimeDbContextFactory in the EF Core project, so -s (startup project) parameter is not needed.

Module Configuration

csharp
[DependsOn(typeof(AbpEntityFrameworkCoreModule))]
public class MyProjectEntityFrameworkCoreModule : AbpModule
{
    public override void ConfigureServices(ServiceConfigurationContext context)
    {
        context.Services.AddAbpDbContext<MyProjectDbContext>(options =>
        {
            // Add default repositories for aggregate roots only (DDD best practice)
            options.AddDefaultRepositories();
            // ⚠️ Avoid includeAllEntities: true - it creates repositories for child entities,
            // allowing them to be modified without going through the aggregate root,
            // which breaks data consistency
        });

        Configure<AbpDbContextOptions>(options =>
        {
            options.UseSqlServer(); // or UseNpgsql(), UseMySql(), etc.
        });
    }
}

Best Practices

Repositories for Aggregate Roots Only

Don't use includeAllEntities: true in AddDefaultRepositories(). This creates repositories for child entities, allowing direct modification without going through the aggregate root - breaking DDD data consistency rules.

csharp
// ✅ Correct - Only aggregate roots get repositories
options.AddDefaultRepositories();

// ❌ Avoid - Creates repositories for ALL entities including child entities
options.AddDefaultRepositories(includeAllEntities: true);
Always Call ConfigureByConvention
csharp
builder.Entity<MyEntity>(b =>
{
    b.ConfigureByConvention(); // Don't forget this!
    // Other configurations...
});
Use Table Prefix
csharp
public static class MyProjectConsts
{
    public const string DbTablePrefix = "App";
    public const string DbSchema = null; // Or "myschema"
}
Performance Tips
  • Add explicit indexes for frequently queried fields
  • Use AsNoTracking() for read-only queries
  • Avoid N+1 queries with .Include() or specifications
  • ABP handles cancellation automatically; use GetCancellationToken(cancellationToken) only in custom repository methods
  • Consider query splitting for complex queries with multiple collections
Accessing Raw DbContext
csharp
public async Task CustomOperationAsync()
{
    var dbContext = await GetDbContextAsync();

    // Raw SQL
    await dbContext.Database.ExecuteSqlRawAsync(
        "UPDATE Books SET IsPublished = 1 WHERE AuthorId = {0}",
        authorId
    );
}

Data Seeding

csharp
public class MyProjectDataSeedContributor : IDataSeedContributor, ITransientDependency
{
    private readonly IRepository<Book, Guid> _bookRepository;
    private readonly IGuidGenerator _guidGenerator;

    public async Task SeedAsync(DataSeedContext context)
    {
        if (await _bookRepository.GetCountAsync() > 0)
        {
            return;
        }

        await _bookRepository.InsertAsync(
            new Book(_guidGenerator.Create(), "Sample Book", 19.99m, Guid.Empty),
            autoSave: true
        );
    }
}

© abpframework, LGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/abp-ef-core of abpframework/abp.

Open the folder on GitHubat commit a54b599

Compare with similar skills

Abp Ef Core next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Abp Ef Core compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Abp Ef Core this skillabpframework/abp14k—~1.9kAutomated safety check: PassLGPL-3.0
Entity Framework6managedcode/dotnet-skills486—~1.1kAutomated safety check: PassMIT
Entity Framework Coremanagedcode/dotnet-skills486—~2.3kAutomated safety check: PassMIT
Ef Corecodewithmukesh/dotnet-claude-kit7511 repos~2.3kAutomated safety check: PassMIT
Content Create Hero Imageprisma/web1.1k—~6.9kAutomated safety check: PassNone
Sea Orm 2FlyinPancake/yoink112—~2.9kAutomated safety check: PassApache-2.0

Similar skills

  • Entity Framework6

    managedcode/dotnet-skills

    Maintain or migrate EF6-based applications with realistic guidance on what to keep, what to modernize, and when EF Core is or is not the right next step.

    486 GitHub stars~1.1k tokensUpdated yesterday
    DatabasesAuto-check passed
  • Entity Framework Core

    managedcode/dotnet-skills

    Design, tune, or review EF Core data access with proper modeling, migrations, query translation, performance, and lifetime management for modern .NET applications.

    486 GitHub stars~2.3k tokensUpdated yesterday
    DatabasesAuto-check passed
  • Ef Core

    codewithmukesh/dotnet-claude-kit

    Entity Framework Core patterns for .NET 10. An agent skill from codewithmukesh/dotnet-claude-kit.

    751 GitHub starsUsed in 1 repo~2.3k tokens
    DatabasesAuto-check passed
  • Official

    A skill your agent uses when the operator wants a hero or meta image for a Prisma blog post; asks to create or generate a blog hero, cover, social card, Open Graph, or YouTube image; mentions cover…

    1.1k GitHub stars~6.9k tokensUpdated today
    DatabasesAuto-check passed
  • Sea Orm 2

    FlyinPancake/yoink

    Expert guidance for SeaORM 2.0, Rust's async ORM with strongly-typed columns, nested ActiveModels, Entity Loader API, and entity-first workflow.

    112 GitHub stars~2.9k tokensUpdated 4 days ago
    DatabasesAuto-check passed
  • Prisma Client API

    curvenote/curvenote

    Prisma Client API reference covering model queries, filters, operators, and client methods.

    169 GitHub starsUsed in 2 repos~1.6k tokens
    DatabasesAuto-check passed

More from abpframework/abp

All 18 skills in this repo
  • Abp Angular

    abpframework/abp

    ABP Angular UI patterns - generate-proxy, ListService, PermissionGuard, abpLocalization pipe, ConfirmationService, ToasterService, ConfigStateService.

    14k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Abp App Nolayers

    abpframework/abp

    ABP Single-Layer (No-Layers / nolayers) application template - single project structure, feature-based file organization, no separate Domain/Application.Contracts projects.

    14k GitHub stars~575 tokensUpdated today
    Auto-check passed
  • Abp Application Layer

    abpframework/abp

    ABP Application Services, DTOs, CRUD service, object mapping (Mapperly/AutoMapper), validation, error handling.

    14k GitHub stars~2k tokensUpdated today
    Auto-check passed
  • Abp Authorization

    abpframework/abp

    ABP permission system - PermissionDefinitionProvider, [Authorize] attribute, CheckPolicyAsync, IsGrantedAsync, ICurrentUser, IPermissionManager, multi-tenancy side.

    14k GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Abp Blazor

    abpframework/abp

    ABP Blazor UI patterns - AbpComponentBase, AbpCrudPageBase, DataGrid, IMenuContributor, Message/Notify, Validations, JavaScript interop.

    14k GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Abp CLI

    abpframework/abp

    ABP CLI commands - generate-proxy, install-libs, add-package-ref, new-module, install-module, abp update, abp clean, abp suite generate.

    14k GitHub stars~633 tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Abp Ef Core

What does Abp Ef Core do?

ABP Entity Framework Core - DbContext, entity configuration, EfCoreRepository implementation, migrations (dotnet ef migrations add), data seeding. Abp Ef Core is an agent skill from abpframework/abp. ABP Entity Framework Core - DbContext, entity configuration, EfCoreRepository implementation, migrations (dotnet ef migrations add), data seeding.

When should I use Abp Ef Core?

Abp Ef Core fits situations like: working in EntityFrameworkCore projects; adding migrations; implementing EF Core repositories.

How do I install Abp Ef Core in Claude Code?

Run `npx skills add abpframework/abp --skill abp-ef-core -a claude-code`. Or copy the skill folder (.agents/skills/abp-ef-core in abpframework/abp) into .claude/skills/abp-ef-core in your project. Claude Code loads it when a task matches its description.

How do I install Abp Ef Core in Codex?

Run `npx skills add abpframework/abp --skill abp-ef-core -a codex`. Or copy the skill folder (.agents/skills/abp-ef-core in abpframework/abp) into .agents/skills/abp-ef-core in your project. Codex loads it when a task matches its description.

Can I use Abp Ef Core in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add abpframework/abp --skill abp-ef-core -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/abp-ef-core, .gemini/skills/abp-ef-core, .github/skills/abp-ef-core and .opencode/skills/abp-ef-core in your project.

What does Abp Ef Core need to run?

Going by SKILL.md and its folder, Abp Ef Core needs the command-line tools its instructions call (dotnet).

Does Abp Ef Core access the network?

SKILL.md names 1 domain. As links in the text: abp.io. This is read from the text; nothing was executed.

Is Abp Ef Core safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Abp Ef Core use?

Abp Ef Core is published under the LGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Abp Ef Core use?

About 1.9k tokens (SKILL.md is roughly 7.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Abp Ef Core?

Skills that share tags, products or a category with Abp Ef Core: Entity Framework6 (managedcode/dotnet-skills, 486 stars), Entity Framework Core (managedcode/dotnet-skills, 486 stars), Ef Core (codewithmukesh/dotnet-claude-kit, 751 stars) and Content Create Hero Image (prisma/web, 1.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Abp Ef Core?

abpframework (a GitHub organization) maintains it in abpframework/abp, which has 14,443 GitHub stars. The repository holds 18 skills in this directory. The repository was last updated on October 8, 2026.

Source: abpframework/abp on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.