本文へ移動
cccskills
無料GitHub で公開

dotnet-efcore-guidelines

Load for EF Core entities/configurations, semantic value persistence, portable constraints, DbContext/query filters, repositories/specifications, migrations, model snapshots, transactions, or seeded lookup tables; use query-optimization specifically for N+1 or slow SQL diagnosis.

インストール方法を見る

含まれるファイル(7)

  • SKILL.md3.9 KB
  • resources/dbcontext-patterns.md403 B
  • resources/entity-configuration.md478 B
  • resources/migrations.md4.2 KB
  • resources/named-query-filters.md1.4 KB
  • resources/querying-patterns.md424 B
  • resources/repository-pattern.md423 B

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

<!-- ABOUTME: EF Core guidance for Explore.Persistence repositories, DbContext configuration, migrations, query filters, and PostgreSQL-aligned data access. --> <!-- ABOUTME: Keeps persistence entity-first, tenant-safe, soft-delete-aware, and consistent with lookup seeding and migration discipline. -->

Resources

  • Domain model — load for entity ownership and persisted invariants.
  • Record contracts — load for semantic value leaves, portable checks, generated-provider ownership, and migration preflight.
  • Architecture — load for repository and layer boundaries.
  • Codebase insights — load for non-obvious EF conventions.
  • Lookup seeder — load only for lookup-row changes.

Rules

  • Repositories return entities, never DTOs or IQueryable; read-only entity paths prefer AsNoTracking().
  • Named SoftDelete and Tenant filters remain active by default. Ignore only the exact filter required by the use case so tenant isolation cannot be disabled incidentally.
  • Domain entities and lifecycle rows remain classes. Persist selected semantic values through their existing scalar owner columns unless the model explicitly requires separate identity; do not introduce owned/complex entities or broad converters merely because the Domain API uses a record value.
  • Portable semantic constraints come from EF model/configuration or the repository migration generator. Verify provider SQL and malformed-row behavior instead of encoding one provider's syntax in shared configuration.
  • Migration and model-snapshot files are generated artifacts. Fix the model or generator, remove only an unapplied development migration through dotnet ef migrations remove, and regenerate every affected provider; applied migrations require a generated corrective migration.
  • For MariaDB/MySQL non-transactional constraint DDL, run a bounded PII-free preflight before installing a multi-constraint semantic set.
  • Pooled contexts tolerate absent scoped tenant/current-user services during migration and seeding.
  • Stable lookup IDs/codes stay aligned with idempotent missing-row repair. Insert migration-dependent lookup rows before backfill and keep model HasData() forbidden while EF Core #36682 applies.

Workflow

  1. Lock Domain semantics and provider-neutral malformed-row behavior with failing tests.
  2. Update entity/configuration or the migration generator; keep scalar column and wire ownership stable unless the task explicitly changes them.
  3. Generate each provider migration and inspect generated SQL/constraint ownership without hand edits.
  4. Run focused model/provider tests, real-engine lifecycle evidence where required, pending-model detection, and the owning build.

Verification

  • dotnet test --project tests/Event.Architecture.Tests/Event.Architecture.Tests.csproj --configuration Release --verbosity quiet -- --treenode-filter "/*/*/CleanArchitectureTests/*" --minimum-expected-tests 1 --no-progress --maximum-parallel-tests 1
  • dotnet test --project tests/Event.Persistence.IntegrationTests/Event.Persistence.IntegrationTests.csproj --configuration Release --verbosity quiet
  • dotnet build --configuration Release --verbosity quiet

Related

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Load for Blazor/MudBlazor UI changes involving forms, dialogs, focus, keyboard navigation, landmarks, ARIA, color contrast, RTL-safe styling, or WCAG 2.2 AA tests; not for backend-only changes.

日本語の概要は準備中です。原文の説明を表示しています。

islamu-ngo/Event82026年10月8日 更新

Load when a task asks to research, verify, compare, or look up framework/package behavior, release notes, standards, RFCs, CVEs, or unfamiliar APIs; use repository evidence first, then official docs, and not for codebase navigation alone.

日本語の概要は準備中です。原文の説明を表示しています。

islamu-ngo/Event82026年10月8日 更新

aspire

無料

Load for Aspire AppHost work: start/stop/wait resources, inspect dashboard/logs/traces, add integrations/resources, rebuild a service, run isolated worktrees, or diagnose Aspire orchestration; not for plain dotnet apps, container-only deployments, or cloud deployment.

日本語の概要は準備中です。原文の説明を表示しています。

islamu-ngo/Event82026年10月8日 更新

Load for authentication or authorization changes involving BFF cookies/tokens, JWT validation, claims/user ID extraction, policies, handler access checks, impersonation, or 401/403 bugs; not for UI affordance gating alone.

日本語の概要は準備中です。原文の説明を表示しています。

islamu-ngo/Event82026年10月8日 更新

Load for Blazor BFF server work involving YARP proxy routes, cookie sessions, access-token forwarding/refresh, downstream API calls, BFF handlers, or browser-to-API auth failures; not for client component rendering or API JWT validation alone.

日本語の概要は準備中です。原文の説明を表示しています。

islamu-ngo/Event82026年10月8日 更新

Load when editing Blazor `.razor.css`, scoped selectors, `::deep`, BEM class names, RTL/logical CSS properties, or styling nested MudBlazor components; not for global design tokens or non-Blazor CSS.

日本語の概要は準備中です。原文の説明を表示しています。

islamu-ngo/Event82026年10月8日 更新

islamu-ngo のスキルをすべて見る

このスキルの問題を報告する