agentleFS
dprakash2101dprakash2101/dotnet-production-agent-skills/skills/code-quality/SKILL.md

code-quality

Skill4 starsChanged 51 days agoMITView on GitHub

Use when improving or reviewing modified .NET code for SonarCloud/Roslyn findings, duplication, complexity, maintainability, or existing helper reuse. Avoid unrelated legacy cleanup.

77 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use spring-boot, logging-patterns and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • ffsshhttiikkSkill

    spring-boot

    Spring Boot framework and Java enterprise patterns

    Also in 3 projects that use this

  • DIL8654Skill

    logging-patterns

    Keep logs structured, correlated, low-noise, and safe for production support. Use when adding operational logging, reviewing observability, or improving diagnostics in .NET services.

    Also in 3 projects that use this

  • mstuder-slalomSkill

    jpa-patterns

    JPA/Hibernate patterns for entity design, relationships, query optimization, transactions, auditing, indexing, pagination, and pooling in Spring Boot.

    Also in 3 projects that use this

  • ffsshhttiikkSkill

    design-patterns

    Practical application and coding skills for Design Patterns

    Also in 4 projects that use this

  • glommerSkill

    pr-workflow

    General guidelines for Commits, formatting, CI, dependencies, security

    Also in 4 projects that use this

  • vm0-aiSkill

    cli-design

    Design patterns and conventions for the Okou CLI user experience

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 71 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not extract an abstraction because two trivial lines look alike, combine unrelated concepts in a global helper, or refactor a large area …

    line 12
  2. Distinctive:

    Prefer clear names, focused methods, guard clauses, accurate null handling, structured logging, correct async/cancellation, dependency …

    line 14
  3. Distinctive:

    Avoid deep nesting, giant methods, unexplained magic values, unnecessary static state, swallowed or over-broad exceptions, dead/commented …

    line 16
  4. Distinctive:

    Use the repository analyzer configuration and the specific actionable diagnostic rather than inventing rules.

    line 20

“Common” is measured: kept by at least 6 in 10 of the 71 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

.NET code quality

Write new and materially modified code cleanly on the first pass. Optimize it for reliability, security, maintainability, readability, testability, low cognitive complexity, and low duplication. Inspect and obey repository-specific SonarCloud/SonarQube configuration, quality profiles or suppressions represented in source, analyzers, .editorconfig, nullable settings, language version, and conventions; repository rules take precedence over generic assumptions.

Before adding substantial logic, search the relevant feature, layer, and shared components for materially equivalent behavior. Reuse an existing sound implementation when its contract and scope match. When multiple callers genuinely need the same meaningful business or technical behavior, consider a focused helper, service method, extension, mapper, utility, or shared component. Search usages and preserve every caller's behavior before changing shared code.

Do not extract an abstraction because two trivial lines look alike, combine unrelated concepts in a global helper, or refactor a large area to remove insignificant duplication.

Prefer clear names, focused methods, guard clauses, accurate null handling, structured logging, correct async/cancellation, dependency injection, safe disposal, and immutable/read-only state where useful. Design exception paths, resource ownership, and async behavior alongside the happy path. Keep code straightforward to test.

Avoid deep nesting, giant methods, unexplained magic values, unnecessary static state, swallowed or over-broad exceptions, dead/commented code, complex LINQ that obscures intent, sync-over-async, secret logging, hardcoded credentials, unjustified allocations on hot paths, and analyzer suppression as a substitute for a fix.

Apply Clean-as-You-Code: introduce no new issues, vulnerabilities, security hotspots, or avoidable duplication in changed code. Improve a pre-existing issue only when the requested change materially touches it or it blocks safe implementation. Do not turn feature work into a historical Sonar cleanup. Run the repository's configured analyzer/Sonar-equivalent check when available and proportionate; do not invent a generic rule set when the repository defines one.

Use the repository analyzer configuration and the specific actionable diagnostic rather than inventing rules. Validate any fix with the narrow affected build or configured analyzer check.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.