.NET Development in the Code Agent Era

SkillAI & models

Deterministic guardrails for defining the review/validation process in .NET/C# development agents and agent squads: .editorconfig + dotnet format, TreatWarningsAsErrors, custom Roslyn analyzers, full test suites, Aspire telemetry, and Copilot/Claude Code hooks as the gates a change must pass. USE FOR: defining what 'done' means and which deterministic checks gate an agent-generated .NET change before merge, for a single agent or a squad of agents/subagents sharing a repo. DO NOT USE FOR: general AGENTS.md authoring for non-.NET repos (agents-md); C# style rules (csharp-best-practices); non-agent solution scaffolding (dotnet-solution-setup); BenchmarkDotNet usage (dotnet-benchmarking).

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the .NET Development in the Code Agent Era skill

What this skill tells your AI

The instructions your AI receives, as published by netfabric/netfabric.numerics in .agents/skills/dotnet-agent-guardrails/SKILL.md and read by ahel’s review.

Code agents are non-deterministic — the same prompt can yield different code. The .NET toolchain is deterministic by design; wire it up as guardrails instead of trusting agent output alone.

Anatomy

FilePurpose
SKILL.mdGuardrail overview + AGENTS.md wiring
references/conventions-and-analyzers.md.editorconfig, dotnet format, TreatWarningsAsErrors, custom Roslyn analyzer projects
references/testing-contract.mdTest tiers as the behavioral contract, agent failure-triage pattern
references/aspire-agent-native.mdAspire orchestration, telemetry, and agent-as-service integration
references/hooks-governance.mdHooks as a governance layer, hook categories, file-based C# scripts

The Six Guardrails

GuardrailToolEnforcesConfig
Conventionsdotnet format + .editorconfigstyle, naming, import order.editorconfig
Compiler strictnessTreatWarningsAsErrorsnullability, unreachable code, API misuseDirectory.Build.props
Architecturecustom Roslyn analyzer projectdomain/architecture rules with no built-in analyzerProjectReference OutputItemType="Analyzer"
Behaviorfull test suite (unit/integration/e2e)correctness, regressionsCI + AGENTS.md instruction
RuntimeAspire AppHostservice wiring, config, telemetryAppHost project
Actionsagent hooksintercept/validate agent edits before they landhook scripts (file-based C#)

Each is deterministic: same input, same result, every run. That stability is what lets an agent self-correct across turns instead of drifting.

AGENTS.md Wiring

Encode "done" in operational, checkable terms — not "write clean code":

Run `dotnet format` to ensure code style compliance. Issues not automatically fixed
must be resolved manually. A feature is not complete until `dotnet format` exits
with code 0 and the full test suite passes.

Directory.Build.props — Minimum

<PropertyGroup>
  <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

Set once in Directory.Build.props at the repo root so every project inherits it — see dotnet-solution-setup for the full shared-properties list.

Practical Example

BookStore applies all six guardrails (conventions, analyzers, tests, Aspire, hooks) in one open-source .NET solution.

Reference Files

FileLoad When
references/conventions-and-analyzers.mdWiring .editorconfig/dotnet format/TreatWarningsAsErrors, or scaffolding a custom Roslyn analyzer project
references/testing-contract.mdDeciding test tiers, writing AGENTS.md test instructions, triaging agent-caused test failures
references/aspire-agent-native.mdUsing Aspire orchestration/telemetry so an agent can reason about a running distributed system
references/hooks-governance.mdWriting or categorizing Copilot/Claude Code hooks that gate agent actions

Signals

GitHub stars
36
Forks
1
Last commit
Aug 2026
Advanced
Catalog kind
skill
Gateway key
dotnet-agent-guardrails
Source
github.com/netfabric/netfabric.numerics