lean-dotnet

lean-dotnet is a skill for Claude Code from zdanovichnick/dotnet-pilot. It costs 59 tokens per session (1,331 once invoked), scanned A, original, MIT.

A set of working rules for making the smallest complete change in a .NET project. .NET is Microsoft's platform for building applications, and the rules prefer existing project code and built-in framework features before adding new code.

In plain words
What is it for?
Use it when changing .NET code, especially function signatures, shared logic, dependency-injection setup, configuration, database migrations, or tests.
Why use it?
It helps prevent unnecessary options and duplicate helpers while still updating every affected caller, registration, configuration entry, migration, and test. It focuses on completing the requested change rather than adding unrelated features.

Skill for Claude Code

Written for Claude Code: when-to-use in frontmatter.

Part of the dotnet-pilot plugin — 19 skills, 10 agents, 6 hooks, 1 MCP server shipped together

Good fit Use it when changing .NET code, especially function signatures, shared logic, dependency-injection setup, configuration, database migrations, or tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zdanovichnick/dotnet-pilot/lean-dotnet
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add zdanovichnick/dotnet-pilot --skill lean-dotnet
Clone the repo
git clone --depth 1 https://github.com/zdanovichnick/dotnet-pilot

Made for: Claude Code.

Or install dotnet-pilot, the plugin that ships this one along with the rest of its 19 skills, 10 agents, 6 hooks, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for lean-dotnet

README.md
[![agentmods](https://agentmods.dev/badge/skills/zdanovichnick/dotnet-pilot/lean-dotnet/github.svg)](https://agentmods.dev/skills/zdanovichnick/dotnet-pilot/lean-dotnet)
Your own site
<a href="https://agentmods.dev/skills/zdanovichnick/dotnet-pilot/lean-dotnet"><img src="https://agentmods.dev/badge/skills/zdanovichnick/dotnet-pilot/lean-dotnet/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for lean-dotnet

Your own site · 80×15
<a href="https://agentmods.dev/skills/zdanovichnick/dotnet-pilot/lean-dotnet"><img src="https://agentmods.dev/badge/skills/zdanovichnick/dotnet-pilot/lean-dotnet.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,331 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00059 $0.01331
Opus 5.5 $0.00024 $0.00532
Sonnet 5.5 $0.00012 $0.00266
Haiku 4.5 $0.00006 $0.00133

Measured 6d ago against content hash 4de7a9a51569, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

lean-dotnet scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/lean-dotnet/SKILL.md · 95 lines

How it starts

The opening of the file, as written. The whole thing — 95 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Lean .NET

The best code is the code nobody has to write. Be lazy about the solution, never about the change: finish every place the change must reach — callers, DI registration, appsettings*.json, the migration, the tests your change breaks.

Before you write

List the places the change must reach. For a signature change, that is every caller (mcp__roslyn__find_callers or find_references), every implementation of the interface (find_implementations), and the registration. That list is the scope; features nobody asked for are not.

Bug fix: find every caller of the function you touch first, then fix the root cause once in the shared code. A guard added in one caller leaves the others broken.

The reuse ladder

Take the first rung that fully works:

  1. Does it need to exist? Skip options, flags and flexibility nobody asked for, and name what you skipped in one line of the report.
  2. The codebase already has it — a helper, base endpoint, extension method, Result type, house validator. Use it the way its neighbours do.
  3. The BCL or ASP.NET Core ships it (table below). Unless the project has its own version; the house version wins.
  4. An installed package does it. Check the .csproj and Directory.Packages.props first. Never add a NuGet package for a few lines of code.
  5. Otherwise, the minimum code that passes the test.

Between options of equal size, take the one that is correct on the edge cases (empty, null, default, time zones, cancellation).

Already in the framework

Before you write… Use
Rate limiting middleware AddRateLimiter + RequireRateLimiting (Microsoft.AspNetCore.RateLimiting, .NET 7+)
Retry / timeout / circuit breaker around HttpClient AddStandardResilienceHandler() (Microsoft.Extensions.Http.Resilience) — see resilience
A cache wrapper with stampede locking HybridCache (.NET 9+) or AddOutputCache — see caching
Request DTO validation in minimal APIs DataAnnotations + builder.Services.AddValidation() (.NET 10)
A custom error envelope AddProblemDetails() + IExceptionHandler (.NET 8+) — see error-handling
Config binding and checks AddOptions<T>().Bind(...).ValidateDataAnnotations().ValidateOnStart()
A "now" abstraction TimeProvider (.NET 8+); FakeTimeProvider in tests
A dictionary of strategies keyed by name Keyed services: AddKeyedScoped<T>("key") + [FromKeyedServices] (.NET 8+)
A timer loop in a hosted service BackgroundService + PeriodicTimer
A producer/consumer queue System.Threading.Channels.Channel<T>
Guard clauses ArgumentNullException.ThrowIfNull, ArgumentException.ThrowIfNullOrWhiteSpace, ArgumentOutOfRangeException.ThrowIfNegative
Group-and-count, batching LINQ CountBy / AggregateBy (.NET 9+), Chunk, DistinctBy
Process tasks as they finish Task.WhenEach (.NET 9+)
Sortable IDs Guid.CreateVersion7() (.NET 9+)
URL-safe Base64 System.Buffers.Text.Base64Url (.NET 9+)
A lock object System.Threading.Lock (.NET 9+)
Secure random tokens RandomNumberGenerator.GetHexString / GetInt32 — never Random
Health endpoint AddHealthChecks() + MapHealthChecks("/health")
JSON System.Text.Json, unless the project already uses Newtonsoft

Read the full file on GitHub · 95 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 95 lines · 59 tokens per session scan A 4de7a9a51569

Subscribe to this mod's changes

lean-dotnet is a skill published in the GitHub repository zdanovichnick/dotnet-pilot (5 stars, last pushed 7d ago), licensed MIT. It adds 59 tokens to every session and 1,331 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-24.

Related

lean-dotnet compared with skills from other repositories

lean-dotnet next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
lean-dotnetzdanovichnick/dotnet-pilotSkill57d agoMITA59Claude Code
language-csharplugassawan/swe-workbenchSkill3yesterdayMITA142Claude Code
dotnet-backend-expertmathisk2095/jko-claude-pluginsSkill31mo agoMITA181Claude Code
write-dotnet-codeDynamoDS/dynamo-agent-pluginsSkill24mo agononeA91Claude Code
clean-dotnet-codeDynamoDS/dynamo-agent-pluginsSkill24mo agononeA25Claude Code
agent-framework-builder-dotnetmicrosoft/agent-frameworkSkill15k13d agoMITA82Claude Code, Codex
build-and-testmicrosoft/agent-frameworkSkill15k13d agoMITA26Claude Code, Codex