Adds database resiliency to EF Core with connection retry on transient failures, command timeouts, and correct manual-transaction handling using execution strategy.
Ships in TheCodeMan .NET AI ToolKit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Make EF Core survive transient database failures (timeouts, failovers, throttling) with the built-in execution strategy — and do it correctly, including the manual-transaction caveat that trips people up.
Works on a target: a file, project, or GitHub URL. Find DB setup: grep -rn "UseNpgsql\|UseSqlServer\|EnableRetryOnFailure\|BeginTransaction" --include=*.cs <target>.
builder.Services.AddDbContext<AppDbContext>(o =>
o.UseNpgsql(conn, npg => npg.EnableRetryOnFailure(
maxRetryCount: 5,
maxRetryDelay: TimeSpan.FromSeconds(10),
errorCodesToAdd: null))); // SQL Server: o.UseSqlServer(conn, s => s.EnableRetryOnFailure());
Also set a sensible command timeout: npg.CommandTimeout(30).
With a retrying execution strategy, you cannot wrap multiple SaveChanges/commands in a manual BeginTransaction directly — the strategy needs to own the retry boundary. Use the execution strategy explicitly:
var strategy = db.Database.CreateExecutionStrategy();
await strategy.ExecuteAsync(async () =>
{
await using var tx = await db.Database.BeginTransactionAsync(ct);
// ... multiple operations ...
await db.SaveChangesAsync(ct);
await tx.CommitAsync(ct);
});
Retries can re-run a unit of work. Ensure operations are idempotent (or guarded by a unique key / outbox) so a retry after a partial success doesn't double-apply.
CreateExecutionStrategy().ExecuteAsync(...)."Add connection retry to my DbContext", "handle transient DB failures", "my multi-step transaction breaks with retry enabled — fix it", "make these DB writes resilient and idempotent". Pairs with dbcontext-config-auditor.
What SKILL.md sets; muted values are Claude Code's defaults
/dotnet-ai-toolkit:db-resiliency-setupfrom TheCodeMan .NET AI ToolKit
npx claudepluginhub stefanthecode/dotnet-ai-toolkit --plugin dotnet-ai-toolkit49 skills in this plugin
/adonet-data-access-auditorAudit and fix classic ADO.NET data-access code (SqlConnection / SqlCommand / SqlDataReader / DataSet) on .NET Framework. Use this skill whenever the user shares raw ADO.NET code, a DAL / repository built on SqlCommand, stored-proc calls, string-concatenated SQL, or mentions SQL injection, parameterized queries, connection leaks, "using / Dispose", reading the same column multiple times, transactions, or "why does my old data layer leak connections / is it safe". Always use this skill for classic ADO.NET review instead of answering from memory; it applies a fixed security + correctness + performance checklist and rewrites the code./async-await-auditorAudit C#/.NET code for async/await anti-patterns and concurrency bugs. Use this skill whenever the user shares async C# code or asks about deadlocks, async void, .Result/.Wait(), blocking calls, ConfigureAwait, sync-over-async, fire-and-forget tasks, CancellationToken usage, or "why does my async code hang/deadlock". Always use this skill for async correctness/performance reviews instead of answering from memory; it applies a fixed checklist and rewrites the code./authorization-policy-generatorDesign ASP.NET Core authorization — policy-based, role-based, and claims/requirement-based with custom authorization handlers and resource-based checks. Use this skill whenever the user wants authorization policies, role/claim checks, custom AuthorizationHandler, resource-based authorization, permission checks, or asks "how do I authorize this / policy vs role / restrict this endpoint to X". Always use this skill for authorization requests; it generates policies, handlers, and endpoint wiring.Other plugins' skills for the same job