C# Docs

Streamline programming and development documentation with the C# Docs skill

C# code documentation requires XML comments, consistent formatting, and comprehensive coverage enabling IntelliSense, API documentation generation, and team knowledge sharing. This skill generates complete C# documentation with summary tags, parameter descriptions, return value documentation, example code, exception documentation, and cross-references improving code maintainability and usability.

What Is This?

Overview

C# Docs produces structured XML documentation for C# code. It generates summary tags describing types and members, documents parameters with param tags, describes return values using returns tags, lists exceptions with exception tags, provides code examples using example and code tags, creates see tags for cross-references, and follows documentation conventions enabling documentation tools like DocFX or Sandcastle.

The skill understands C# documentation standards including proper XML comment structure, IntelliSense display considerations, and documentation inheritance. Generated docs integrate with development tools providing contextual help.

Who Should Use This

C# library developers documenting APIs. Team leads establishing documentation standards. Senior developers mentoring juniors. Technical writers creating reference documentation. Open source maintainers helping contributors. Enterprise teams maintaining large codebases.

Why Use It?

Problems It Solves

Incomplete documentation causes developers to read implementation code. Comprehensive docs explain behavior without implementation inspection.

Inconsistent documentation styles across codebase reduce usability. Standardized generation ensures consistent structure and quality.

Writing documentation manually is tedious. Automated generation from code structure and signatures provides complete starting point.

Documentation becomes outdated as code evolves. Generating from current code keeps docs synchronized.

Core Highlights

Summary tag generation. Parameter documentation. Return value description. Exception documentation. Code example inclusion. Cross-reference linking. Documentation inheritance. Consistent formatting. IntelliSense integration.

How to Use It?

Basic Usage

Point to C# code requiring documentation. The skill generates XML comments following conventions.

Document this C# class with all public members
including parameters and return values
Generate XML documentation for API controller
with example requests and responses

Specific Scenarios

For library code, emphasize usage examples.

Document utility class methods with
practical code examples showing usage

For exceptions, detail conditions.

Generate docs listing all thrown exceptions
with conditions causing each exception

For generics, explain type parameters.

Document generic class with typeparam tags
explaining constraints and usage

Real World Examples

A team builds internal NuGet package used across organization. Without documentation, developers constantly ask usage questions. C# documentation is generated for all public types with summary explaining purpose, parameters describing each argument with types and constraints, returns tag explaining return value meaning, example showing common usage scenarios, exception tags listing ArgumentNullException and InvalidOperationException conditions, and see tags referencing related types. Questions decrease significantly with comprehensive IntelliSense documentation.

A developer maintains open source library with growing contributor base. New contributors struggle understanding API design intent. Documentation generation produces structured comments with summary describing design rationale, remarks section with usage guidance, code examples demonstrating integration, exception documentation guiding error handling, and see also references to related functionality. Contributors understand API quickly from documentation.

An enterprise team works on large codebase lacking consistent documentation. Code review frequently requests documentation additions. Standardized documentation generation creates templates for classes with summary, constructors, properties, and methods, parameter descriptions for all arguments, returns tags for non-void methods, exception documentation for error conditions, and example sections for complex members. Review consistency improves with documentation standard.

Advanced Tips

Use inheritdoc for derived types avoiding duplication. Include code examples in example tags. Document thread safety in remarks. Use paramref and typeparamref for references. Add see tags linking related types. Document async behavior clearly. Include version information using para tags. Generate external documentation with DocFX.

When to Use It?

Use Cases

Library and framework documentation. Public API documentation. Internal package documentation. Open source project maintenance. Team onboarding materials. Code review standards. IntelliSense improvement. External documentation generation.

Related Topics

XML documentation comments. IntelliSense in Visual Studio. Documentation generation tools. API documentation standards. Technical writing practices. Code review best practices. Documentation as code. Continuous documentation updates.

Important Notes

Requirements

C# codebase with public APIs. Understanding of code purpose and behavior. Knowledge of documentation conventions. Access to code being documented. Documentation generation tool if creating external docs.

Usage Recommendations

Document all public members consistently. Use clear concise language. Include practical examples. Document exceptions thoroughly. Update docs when code changes. Use proper XML comment structure. Enable documentation warnings in project. Review generated IntelliSense tooltips. Generate external documentation regularly. Link to additional resources where helpful.

Limitations

Cannot document implementation details from signatures alone. Requires human validation for accuracy. Quality depends on code clarity. Examples need manual creation. Does not replace conceptual documentation. Generated docs are starting point needing refinement.