efcore-patterns

efcore-patterns is a skill for Claude Code from thapaliyabikendra/ai-artifacts. It costs 60 tokens per session (1,823 once invoked), scanned A, original, Apache-2.0.

A guide to using Entity Framework Core for defining .NET database entities, relationships, database contexts, migrations, and queries. Entity Framework Core is a .NET tool that maps application objects to database tables.

In plain words
What is it for?
Use it to configure entities with Fluent API, create migrations, design relationships, and implement repository patterns with PostgreSQL.
Why use it?
It helps developers keep database design and application code consistent while avoiding common relationship and query-performance problems.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is dotnet ef migrations add AddPatientEntity --startup-project ../ClinicManagementSystem.DbMigrator.

Good fit Use it to configure entities with Fluent API, create migrations, design relationships, and implement repository patterns with PostgreSQL.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/thapaliyabikendra/ai-artifacts
agentmods
npx agentmods add skills/thapaliyabikendra/ai-artifacts/efcore-patterns

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for efcore-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/thapaliyabikendra/ai-artifacts/efcore-patterns/github.svg)](https://agentmods.dev/skills/thapaliyabikendra/ai-artifacts/efcore-patterns)
Your own site
<a href="https://agentmods.dev/skills/thapaliyabikendra/ai-artifacts/efcore-patterns"><img src="https://agentmods.dev/badge/skills/thapaliyabikendra/ai-artifacts/efcore-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for efcore-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/thapaliyabikendra/ai-artifacts/efcore-patterns"><img src="https://agentmods.dev/badge/skills/thapaliyabikendra/ai-artifacts/efcore-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 60 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,823 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00060 $0.01823
Opus 5 $0.00030 $0.00911
Sonnet 5 $0.00012 $0.00365
Haiku 4.5 $0.00006 $0.00182

Measured 8d ago against content hash 0e502c955baa, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

efcore-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/efcore-patterns/SKILL.md · 258 lines

How it starts

The opening of the file, as written. The whole thing — 258 lines — stays where its author put it; the contents beside it link to each section on GitHub.

EF Core Patterns

Entity Framework Core patterns for ABP Framework code-first development with PostgreSQL.

Entity Base Classes

Base Class Fields Included
Entity<TKey> Id
AuditedEntity<TKey> + CreationTime, CreatorId, LastModificationTime, LastModifierId
FullAuditedEntity<TKey> + IsDeleted, DeleterId, DeletionTime
AggregateRoot<TKey> Entity + Domain Events + Concurrency Token
FullAuditedAggregateRoot<TKey> Most common - full features

Entity Configuration

public class Patient : FullAuditedAggregateRoot<Guid>
{
    public string FirstName { get; private set; }
    public string LastName { get; private set; }
    public string Email { get; private set; }

    private Patient() { } // For EF Core

    public Patient(Guid id, string firstName, string lastName, string email) : base(id)
    {
        FirstName = Check.NotNullOrWhiteSpace(firstName, nameof(firstName), maxLength: 100);
        LastName = Check.NotNullOrWhiteSpace(lastName, nameof(lastName), maxLength: 100);
        Email = Check.NotNullOrWhiteSpace(email, nameof(email), maxLength: 255);
    }
}

Fluent API Configuration

public class PatientConfiguration : IEntityTypeConfiguration<Patient>
{
    public void Configure(EntityTypeBuilder<Patient> builder)
    {
        builder.ToTable("Patients");
        builder.HasKey(x => x.Id);

        builder.Property(x => x.FirstName).IsRequired().HasMaxLength(100);
        builder.Property(x => x.LastName).IsRequired().HasMaxLength(100);
        builder.Property(x => x.Email).IsRequired().HasMaxLength(255);

        builder.HasIndex(x => x.Email).IsUnique();
        builder.HasQueryFilter(x => !x.IsDeleted); // ABP soft delete
    }
}

Relationships

One-to-Many (1:N)

builder.Entity<Appointment>(b =>
{
    b.HasOne(x => x.Doctor)
        .WithMany(x => x.Appointments)
        .HasForeignKey(x => x.DoctorId)
        .OnDelete(DeleteBehavior.Restrict);
});

Read the full file on GitHub · 258 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 258 lines · 60 tokens per session scan A 0e502c955baa

Subscribe to this mod's changes

efcore-patterns is a skill published in the GitHub repository thapaliyabikendra/ai-artifacts (24 stars, last pushed 5mo ago), licensed Apache-2.0. It adds 60 tokens to every session and 1,823 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

database

Manage PostgreSQL, SQLite, and Redis databases: create, migrate, backup, restore, query, optimize.

JansenAnalytics/claudex · 24 tokens

database-schema-designer

Design production-ready database schemas for SQL and NoSQL databases. Covers normalization, indexing strategy, migration management with rollback safety, query optimization, and multi-tenant patterns. Supports PostgreSQL, MySQL, SQLite, MongoDB, and Vitess.

JPeetz/agent-skills · 54 tokens

database-migration-assistant

PostgreSQL migration assistant that plans, applies, and rolls back schema changes with drift detection for safe AI-agent execution.

XSpoonAi/spoon-awesome-skill · 30 tokens

alloydb-basics

Manages clusters, instances, and backups for AlloyDB for PostgreSQL, and integrates with AlloyDB Model Context Protocol (MCP) tools for automated database operations. Use when creating, configuring, or administering AlloyDB databases. Do NOT use for general PostgreSQL instances (e.g. Cloud SQL) or other GCP databases.

google/skills · 72 tokens

postgresql-table-design

Use this skill when designing or reviewing a PostgreSQL-specific schema. Covers best-practices, data types, indexing, constraints, performance patterns, and advanced features.

wshobson/agents · 37 tokens

db-repair

Auto-fix gbrain's Postgres access so the brain stays available. When any gbrain command or MCP tool result carries a GBRAINDBACCESS marker (or an operator reports the brain database is down), run the hardcoded gbrain db-repair ladder: diagnose, apply the safe tier, verify. The action is ALWAYS the hardcoded command …

garrytan/gbrain · 96 tokens