ef-core
Get best practices for Entity Framework Core
Best use case
ef-core is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Get best practices for Entity Framework Core
Teams using ef-core should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/ef-core/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How ef-core Compares
| Feature / Agent | ef-core | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Get best practices for Entity Framework Core
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Entity Framework Core Best Practices Your goal is to help me follow best practices when working with Entity Framework Core. ## Data Context Design - Keep DbContext classes focused and cohesive - Use constructor injection for configuration options - Override OnModelCreating for fluent API configuration - Separate entity configurations using IEntityTypeConfiguration - Consider using DbContextFactory pattern for console apps or tests ## Entity Design - Use meaningful primary keys (consider natural vs surrogate keys) - Implement proper relationships (one-to-one, one-to-many, many-to-many) - Use data annotations or fluent API for constraints and validations - Implement appropriate navigational properties - Consider using owned entity types for value objects ## Performance - Use AsNoTracking() for read-only queries - Implement pagination for large result sets with Skip() and Take() - Use Include() to eager load related entities when needed - Consider projection (Select) to retrieve only required fields - Use compiled queries for frequently executed queries - Avoid N+1 query problems by properly including related data ## Migrations - Create small, focused migrations - Name migrations descriptively - Verify migration SQL scripts before applying to production - Consider using migration bundles for deployment - Add data seeding through migrations when appropriate ## Querying - Use IQueryable judiciously and understand when queries execute - Prefer strongly-typed LINQ queries over raw SQL - Use appropriate query operators (Where, OrderBy, GroupBy) - Consider database functions for complex operations - Implement specifications pattern for reusable queries ## Change Tracking & Saving - Use appropriate change tracking strategies - Batch your SaveChanges() calls - Implement concurrency control for multi-user scenarios - Consider using transactions for multiple operations - Use appropriate DbContext lifetimes (scoped for web apps) ## Security - Avoid SQL injection by using parameterized queries - Implement appropriate data access permissions - Be careful with raw SQL queries - Consider data encryption for sensitive information - Use migrations to manage database user permissions ## Testing - Use in-memory database provider for unit tests - Create separate testing contexts with SQLite for integration tests - Mock DbContext and DbSet for pure unit tests - Test migrations in isolated environments - Consider snapshot testing for model changes When reviewing my EF Core code, identify issues and suggest improvements that follow these best practices.
Related Skills
angular-core
Angular core patterns: standalone components, signals, inject, control flow, zoneless. Trigger: When creating Angular components, using signals, or setting up zoneless.
core-web-vitals
Optimize Core Web Vitals (LCP, INP, CLS) for better page experience and search ranking. Use when asked to "improve Core Web Vitals", "fix LCP", "reduce CLS", "optimize INP", "page experience optimization", or "fix layout shifts". Focuses specifically on the three Core Web Vitals metrics. Do NOT use for general web performance (use perf-web-optimization), Lighthouse audits (use perf-lighthouse), or Astro-specific optimization (use perf-astro).
scorecard-marketing
Build quiz and assessment funnels that generate qualified leads at 30-50% conversion. Use when the user mentions "lead magnet", "quiz funnel", "assessment tool", "lead generation", or "score-based segmentation". Covers question design, dynamic results by tier, and automated follow-up sequences. For landing page conversion, see cro-methodology. For full marketing plans, see one-page-marketing.
containerize-aspnetcore
Containerize an ASP.NET Core project by creating Dockerfile and .dockerfile files customized for the project.
core-components
Core component library and design system patterns. Use when building UI, using design tokens, or working with the component library.
aws-agentcore
Build AI agents with AWS Bedrock AgentCore. Use when developing agents on AWS infrastructure, creating tool-use patterns, implementing agent orchestration, or integrating with Bedrock models. Triggers on keywords like AgentCore, Bedrock Agent, AWS agent, Lambda tools.
web-design-guidelines
Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices". Focuses on visual design and interaction patterns. Do NOT use for performance audits (use core-web-vitals), SEO (use seo), or comprehensive site audits (use web-quality-audit).
web-browse
Browse and interact with web pages headlessly. Use when agent needs to navigate websites, click elements, fill forms, read content, or take screenshots.
web-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state ma...
accessibility
Audit and improve web accessibility following WCAG 2.1 guidelines. Use when asked to "improve accessibility", "a11y audit", "WCAG compliance", "screen reader support", "keyboard navigation", or "make accessible". Do NOT use for SEO (use seo), performance (use core-web-vitals), or comprehensive site audits covering multiple areas (use web-quality-audit).
vueuse-functions
Apply VueUse composables where appropriate to build concise, maintainable Vue.js / Nuxt features.
vue
Vue 3 Composition API, script setup macros, reactivity system, and built-in components. Use when writing Vue SFCs, defineProps/defineEmits/defineModel, watchers, or using Transition/Teleport/Suspense/KeepAlive.