xml-docs-and-openapi
Skill1 starsChanged 6 days agoMITView on GitHub
How XML documentation comments on requests, entities and presentation members become the API documentation (OpenAPI and Scalar, GraphQL descriptions, MCP tool descriptions), and the generator gotchas. Use when adding or changing a public type, property, endpoint or request model.
In this repository40 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-a-use-caseSkill
- api-conventionsSkill
- branches-and-pull-requestsSkill
- cancellationSkill
- ci-for-your-solutionSkill
- ci-pipelineSkill
- clean-architecture-layersSkill
- configuration-and-environmentsSkill
- coverageSkill
- csharp-house-styleSkill
- data-access-ef-coreSkill
- database-migrationsSkill
- docker-and-composeSkill
- docs-and-voiceSkill
- errors-and-exceptionsSkill
- expose-a-use-caseSkill
- family-syncSkill
- health-checksSkill
- integration-testsSkill
- json-serializationSkill
- mapping-with-mapperlySkill
- mcp-inspectorSkill
- mediatorSkill
- optional-token-authSkill
- packages-and-dependenciesSkill
- pagingSkill
- presentation-integration-testsSkill
- releasesSkill
- sample-dataSkill
- security-findingsSkill
- serilogSkill
- telemetrySkill
- template-authoringSkill
- test-designSkill
- time-providerSkill
- unit-testsSkill
- validationSkill
- writing-a-skillSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
Write for the person calling the API: plain sentences, units and ranges, what an empty value means.
- Distinctive: line 28
Run the app and read the result in the API reference before you call it done.
- Very specific: line 46
Document an injected [FromServices] ISender sender parameter.
- Very specific: line 48
Leave TODO or placeholder comments.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.
Files
XML docs and API documentation
The rule
The API documentation is generated from XML comments, so the comments are the documentation. GenerateDocumentationFile is on for every project. Missing comments (CS1591) aren't build errors, but every request, entity and public presentation member has them anyway.
Where the comments end up:
| Comment on | Shows up as |
Application request properties and entity record <param> tags | Schema and field descriptions (OpenAPI, GraphQL) |
Endpoint or tool <summary>, <remarks>, <param>, <response> | Operation summary, description, parameter text and response codes |
Request model <example> | The example value in the API reference |
Steps
- Requests: a
<summary>on the class saying what the use case does, and one on each property saying what it means and its allowed values. - Entity records: a
<summary>on the record and a<param>for each positional parameter. - Write for the person calling the API: plain sentences, units and ranges, what an empty value means.
- Endpoint and tool comments are covered by
expose-a-use-casefor this template. - Run the app and read the result in the API reference before you call it done.
Example
// src/Application/Movies/Entities/MovieSummary.cs
/// <summary>
/// A movie in a list, with how many reviews it has and their average star rating instead of the reviews themselves.
/// </summary>
/// <param name="Id">The unique identifier of the movie.</param>
/// <param name="Title">The title of the movie.</param>
/// <param name="ReviewCount">The number of reviews written about the movie.</param>
/// <param name="AverageStars">The average star rating to one decimal place, or null when the movie has no reviews.</param>
public record MovieSummary(Guid Id, string Title, int ReviewCount, double? AverageStars);Don't
- Document an injected
[FromServices] ISender senderparameter. The .NET 10 OpenAPI generator puts that text on the request body instead. Leave it undocumented;NoWarn 1573in the Presentation project allows that. - Copy the member name as the summary ("Gets the title").
- Leave
TODOor placeholder comments.
Check
dotnet build
dotnet test --filter "FullyQualifiedName~OpenApi"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
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.

