agentleFS
LeanMeanCleanAppsLeanMeanCleanApps/CleanModelContextProtocol/.agents/skills/xml-docs-and-openapi/SKILL.md

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.

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
  1. Distinctive:

    Write for the person calling the API: plain sentences, units and ranges, what an empty value means.

    line 26
  2. Distinctive:

    Run the app and read the result in the API reference before you call it done.

    line 28
  3. Very specific:

    Document an injected [FromServices] ISender sender parameter.

    line 46
  4. Very specific:

    Leave TODO or placeholder comments.

    line 48

≈ “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.

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

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 onShows up as
Application request properties and entity record <param> tagsSchema 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

  1. 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.
  2. Entity records: a <summary> on the record and a <param> for each positional parameter.
  3. Write for the person calling the API: plain sentences, units and ranges, what an empty value means.
  4. Endpoint and tool comments are covered by expose-a-use-case for this template.
  5. 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 sender parameter. The .NET 10 OpenAPI generator puts that text on the request body instead. Leave it undocumented; NoWarn 1573 in the Presentation project allows that.
  • Copy the member name as the summary ("Gets the title").
  • Leave TODO or placeholder comments.

Check

dotnet build
dotnet test --filter "FullyQualifiedName~OpenApi"

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.