Skip to main content
skill GitHub Copilot official · GitHub

ef-core — GitHub Copilot skill: what it does, how to install

This skill guides Entity Framework Core reviews and suggests practices for models, queries, migrations, security, and tests. Use it when EF Core code needs a focused check.

Install into GitHub Copilot · Skills CLI (Vercel) All methods and platforms ↓
npx skills add github/awesome-copilot --skill ef-core
Open on GitHub

What ef-core does

ef-core helps review Entity Framework Core code against practices for DbContext and entity design. It covers focused DbContext classes, constructor injection, fluent configuration, IEntityTypeConfiguration, relationships, constraints, navigation properties, owned entity types, and DbContextFactory for console apps or tests.

The skill examines query and performance choices such as AsNoTracking(), Skip() and Take(), Include(), Select projections, compiled queries, and N+1 problems. It also looks at IQueryable execution, LINQ operators, transactions, concurrency control, parameterized SQL, data access permissions, and DbContext lifetimes. Migration guidance includes small descriptive changes, checking SQL before production, migration bundles, and isolated migration tests.

For tests, it considers the in-memory database provider, SQLite contexts for integration tests, mocks for DbContext and DbSet, and snapshot testing for model changes. Install it when your project uses EF Core and you want focused code review guidance. It is unnecessary for projects that do not use Entity Framework Core.

What it helps with

  • review DbContext and entity configuration
  • spot N+1 queries and excessive related-data loading
  • choose a suitable EF Core projection or tracking mode
  • check migrations before applying them to production
  • prepare isolated contexts for EF Core tests

Example prompts for the agent

  • Review this DbContext using the ef-core skill.
  • Find N+1 risks and query issues involving Include() and AsNoTracking().
  • Check this migration and its SQLite integration tests against ef-core practices.

How to install ef-core

1Skills CLI (Vercel)

npx skills add github/awesome-copilot --skill ef-core

2GitHub CLI

gh skill install github/awesome-copilot ef-core

3Manually: put the files in place

.github/skills/ef-core/SKILL.md

From the same set554

The whole set →
git-commit official github This skill reviews Git changes, stages related files, and creates Conventional Commits. Use it when you want an agent to make one commit or split work into separate commits. GitHub Copilot 47,165installs excalidraw-diagram-generator official github Turn a plain-language description into an Excalidraw diagram. Useful for mapping processes, system structure, and relationships between entities. GitHub Copilot 31,639installs multi-stage-dockerfile official github This skill guides GitHub Copilot in writing multi-stage Dockerfiles for different languages and frameworks. Use it when the final runtime image should contain fewer build dependencies. GitHub Copilot 29,688installs documentation-writer official github Skill that turns the agent into a technical writer following the Diátaxis framework: tutorials, how-to guides, reference, and explanation. Proposes structure before writing. GitHub Copilot 27,757installs prd official github Turns a feature idea into a structured PRD with user stories, technical requirements, and risks. Use it when planning a software feature or an AI-powered one. GitHub Copilot 24,035installs refactor official github This skill reshapes existing code without changing its external behavior. Use it for gradual cleanup of large functions, duplication, weak types, and code smells. GitHub Copilot 22,321installs java-springboot official github Gives GitHub Copilot Spring Boot development practices, from project layout to tests and security. Use it when writing or reviewing Java application code. GitHub Copilot 21,272installs create-readme official github This skill reviews a project and creates a structured README.md. Use it when the repository needs clear documentation based on its actual files and code. GitHub Copilot 19,081installs

Similar

agent-platform-eval-flywheel official google This skill evaluates AI models and agents on Google Cloud, helping build datasets, choose metrics, and investigate failures. Claude Code Gemini CLI CX Codex 8,334installs fastapi-templates Seth Hobson This skill scaffolds FastAPI projects with async routes, dependency injection, and error handling. Use it when starting a Python API. Claude Code CX Codex Cursor 25,840installs xlsx official anthropics Creates, reads, edits, and converts spreadsheet files. Use it when the requested deliverable is an Excel workbook or another tabular file. Claude Code Claude.ai 187,223installs google-agents-cli-observability official Google This skill guides you through tracing and monitoring AI agents, including ADK agents. Use it when you need to inspect agent execution or monitor a deployed agent. Claude Code CX Codex Cursor +1 509,900installs caveman-evidence-review JuliusBrussee A read-only skill reviews Caveman Cloud evidence on LLM spend, traces, and routing. Use it to see where a project’s model budget goes. Claude Code CX Codex Cursor +1 103,500installs migration JuliusBrussee Enforces reversible, compatibility-safe transitions for schema, data, and API updates. Useful whenever data loss or rollout downtime is unacceptable. Claude Code CX Codex Cursor +1 102,900installs performance-optimization addyosmani An agent skill that measures before it changes code: Core Web Vitals budgets, N+1 queries, missing indexes and slow endpoints. Claude Code CX Codex Cursor +1 64,500installs supabase official supabase Guides the agent through database configuration and strict RLS policies in Supabase. CX Codex GP ChatGPT 8installs

Questions about ef-core

How do I install ef-core in GitHub Copilot?

Run npx skills add github/awesome-copilot --skill ef-core. The skill is then available at .github/skills/ef-core/SKILL.md. You can also run gh skill install github/awesome-copilot ef-core.

What does ef-core do?

It helps review Entity Framework Core code covering DbContext, entities, LINQ queries, migrations, saving changes, security, and testing.

Which EF Core testing approaches does it cover?

It covers the in-memory database provider for unit tests, separate SQLite contexts for integration tests, DbContext and DbSet mocks, isolated migration tests, and snapshot testing for model changes.

Source text

SKILL.md · MIT
---
name: ef-core
description: 'Get best practices for Entity Framework Core'
---

# 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.

© github · MIT · github/awesome-copilot

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor