Neo dotnet ef core
Neo Skills 是專為現代 AI Agent 設計的全方位能力擴充套件。本專案透過標準化的通訊架構,為 AI 代理安裝可插拔的「技能模組 (Skills)」,使其不僅僅是一個聊天機器人,而是能轉化為具備「感知-推理-行動」能力的多領域專家。
npx -y skills add Benknightdark/neo-skills --skill neo-dotnet-ef-coreAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 7 stars7 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Use this skill when the task involves Entity Framework Core models, DbContext, migrations, LINQ queries, change tracking, database providers, performance tuning, or data access review in .NET projects.
SKILL.md
4.0 KB, as published. Nobody here has run it
EF Core Expert Skill
Trigger On
- The user requests database modeling, writing Linq queries, or handling database migrations.
- The project contains a
DbContextclass or references theMicrosoft.EntityFrameworkCorepackage. - There is a need to optimize database access performance or solve N+1 query problems.
- The task involves complex data relationship design (one-to-many, many-to-many, inheritance mapping).
Workflow
- Perceive (Model Awareness):
- Check
.csprojto identify the EF Core version and database provider. - Analyze
DbContextand entity configurations to confirm whether the Fluent API pattern is adopted. - Identify the current state of Migrations.
- Check
- Reason (Planning Phase):
- Evaluate whether queries need
.AsNoTracking()or.AsSplitQuery(). - Determine whether custom interceptors are needed to handle audit fields.
- Evaluate whether to use
ExecuteUpdate/Delete(.NET 7+) for massive data updates.
- Evaluate whether queries need
- Act (Execution Phase):
- Write efficient and safe Linq queries.
- Implement entity configuration classes (
IEntityTypeConfiguration). - Create and execute database migration commands.
- Validate (Standard Validation):
- Check if the generated SQL meets performance expectations (avoiding full table scans).
- Validate concurrency conflict handling logic.
- Ensure all database accesses follow asynchronous patterns.
Feature Roadmap (.NET 6 - 10)
.NET 6 & 7 (Foundation)
- Split Queries: Solve the Cartesian product problem.
- Bulk Operations: Use
ExecuteUpdate/Deletefor high-performance updates. - JSON Columns: Built-in JSON mapping support.
- Compiled Models: Reduce startup time for large models.
.NET 8 & 9 (Productivity)
- Primitive Collections: Use simple type collections in queries.
- HierarchyId: Support for SQL Server hierarchical data.
- Auto-compiled Queries: Further optimize the query compilation process.
- Complex Types: Better support for Value Objects.
.NET 10+ (Version-Specific Features)
- Advanced Interceptors: More query lifecycle hooks.
- Optimized AOT Support: AOT pre-compilation optimization for cloud-native environments.
Coding Standards
- Fluent API Preference: Prioritize entity configuration classes over Data Annotations.
- Async Always: All I/O operations must be asynchronous.
- No-Tracking by Default: Read-only queries must always use
.AsNoTracking(). - Naming: Entity names correspond to tables, foreign key names have clear semantics.
Deliver
- Optimized Linq Queries: Provide query code with the potential for high-performance SQL translation.
- Migration Scripts & Guidance: Provide correct migration commands and manual adjustment suggestions.
- Database Schema Design: Design normalized entity relationships based on business requirements.
Validate
- Ensure the provided code complies with EF Core performance best practices.
- Validate whether the code correctly handles Nulls and database constraints.
- Confirm database connection and resource release logic is correct (using
usingor Scoped DI).