google-csharp-style

Applies Google's C# style conventions for naming, formatting, and source organization.

Updated Aug 22, 2026
One-click install
npx skills add https://github.com/chughtapan/google-guide-skills --skill google-csharp-style-chughtapan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: google-csharp-style
Source: https://github.com/chughtapan/google-guide-skills/tree/main/skills/google-csharp-style
Command: npx skills add https://github.com/chughtapan/google-guide-skills --skill google-csharp-style-chughtapan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? C# codebases drift into inconsistent naming, formatting, and language-feature usage when teams lack a shared style standard, making reviews slower and code harder to maintain. ## Core Features & Use Cases - Naming and Formatting Rules: Enforces PascalCase/camelCase/_camelCase conventions, 2-space indentation, 100-column limit, and brace placement rules. - Language Feature Guidance: Covers when to use const vs readonly, IEnumerable vs IList, structs vs classes, LINQ vs imperative code, var, extension methods, and ref/out parameters. - Source Organization: Defines file naming, class member ordering, using directive placement, and namespace depth limits. - Use Case: When reviewing a C# pull request, apply this guide to flag inconsistent member ordering, magic numbers that should be named constants, or long LINQ chains that should be imperative code. ## Quick Start Review my C# file against Google's style guide and list any naming, formatting, or language-feature violations.

Frequently Asked Questions about google-csharp-style

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I apply Google's C# style guide to my code?

Apply the guide's rules for naming (PascalCase for classes and methods, camelCase for locals, _camelCase for private fields), 2-space indentation, a 100-column limit, and braces on all blocks. Repository-specific requirements take precedence over the guide.

What naming conventions does Google use for C#?

Classes, methods, enums, public members, and namespaces use PascalCase; local variables and parameters use camelCase; private and internal fields use _camelCase. Interfaces start with I, and acronyms are treated as words, so MyRpc not MyRPC.

When should I use var in C# according to Google style?

Use var when the type is obvious from the right-hand side, such as var apple = new Apple(), or for transient variables passed directly to other methods. Avoid it for basic types, compiler-resolved numeric expressions, and cases where knowing the type aids readability.

Should I use IEnumerable or IList for C# method parameters?

For inputs, use the most restrictive type possible such as IReadOnlyCollection or IEnumerable when the input should be immutable. For outputs transferring ownership, prefer IList; otherwise prefer the most restrictive option.

When should I avoid extension methods in C#?

Avoid extension methods when you have access to the original class source and can modify it directly. Only add them for core general features in widely available libraries, since they obfuscate code and create readability issues when availability varies.