agentleFS
MovGP0MovGP0/Skills/csharp-compiler-warnings/SKILL.md

csharp-compiler-warnings

Skill1 starsChanged 4 months agoMITView on GitHub

Non-nullability C# compiler warning meanings and examples

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use this skill for enabled C# compiler diagnostics that are not nullable-reference warnings.

    line 10

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “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

C# compiler warnings

C# compiler diagnostics (CS)

Use this skill for enabled C# compiler diagnostics that are not nullable-reference warnings. For nullable CS8xxx warnings, use ../nullability-warnings/SKILL.md.

CS0162 - Unreachable code detected

What it flags: The C# compiler reported code that is unreachable, unused, malformed, or inconsistent with language rules.

Example:

  • Bad: code after return, throw, or an always-false branch.
  • Fix: remove the unreachable statement or correct the control flow.

CS0168 - Variable is declared but never used

What it flags: The C# compiler reported code that is unreachable, unused, malformed, or inconsistent with language rules.

Example:

  • Bad: catch (Exception ex) { LogFailure(); } without using ex.
  • Fix: remove the variable or use it, for example in logging.

CS0219 - Variable is assigned but its value is never used

What it flags: The C# compiler reported code that is unreachable, unused, malformed, or inconsistent with language rules.

Example:

  • Bad: var result = Calculate(); and result is never read.
  • Fix: remove the assignment or use the value.

CS0628 - New protected member declared in sealed type

What it flags: The C# compiler reported code that is unreachable, unused, malformed, or inconsistent with language rules.

Example:

  • Bad: protected void M() in a sealed class.
  • Fix: make the member private or unseal the class if inheritance is intended.

CS1696 - Single-line comment or end-of-line expected

What it flags: The C# compiler reported code that is unreachable, unused, malformed, or inconsistent with language rules.

Example:

  • Bad: malformed preprocessor or comment syntax near a directive.
  • Fix: correct the directive/comment so the compiler can parse the line.

CS1998 - Async method lacks await operators

What it flags: The C# compiler reported code that is unreachable, unused, malformed, or inconsistent with language rules.

Example:

  • Bad: async Task SaveAsync() { Save(); } with no await.
  • Fix: remove async and return a completed task, or await real async work.

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.

Reviews can't be read right now.

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.