Skip to content
Back to skills

Rules Csharp

ASecurity

ANVIL coding rules for csharp code (**/*.cs, **/*Tests.cs, **/*Test.cs, tests/**/*.cs): C#, C# Testing.

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 30, 2026
developmentc#testingapidatabase

Works with

  • cli
  • api

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add AdityaaaTiwari/ANVIL --skill rules-csharp --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Rules Csharp?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Rules Csharp
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/adityaaatiwari-rules-csharp/badge)](https://www.skillsdirectory.com/skills/adityaaatiwari-rules-csharp)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: rules-csharp
description: "ANVIL coding rules for csharp code (**/*.cs, **/*Tests.cs, **/*Test.cs, tests/**/*.cs): C#, C# Testing."
---

<!-- Generated by `anvil plugin build` from catalog/. Edit the catalog, not this file. -->

# ANVIL rules: csharp

Follow these rules for csharp code (**/*.cs, **/*Tests.cs, **/*Test.cs, tests/**/*.cs).

## C#

# C#
- Nullable reference types enabled; async all the way with `CancellationToken`.
- `using` for disposables; `IHttpClientFactory` for HTTP.
- `dotnet format` and analyzers clean.

## C# Testing

# C# Testing

- Use `[Theory]` / `[InlineData]` (xUnit) or `[TestCase]` (NUnit) for parameterized cases rather than duplicated test methods.
- Pass `CancellationToken.None` or test tokens consistently and inject `TimeProvider` and fake HTTP handlers (`HttpMessageHandler`) instead of `Thread.Sleep` or real network calls.
- Use `WebApplicationFactory<Program>` and isolated containers/temp DBs for API integration tests without mutating shared databases.
- Assert status codes, serialized payloads, and error ProblemDetails structures cleanly.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.