agentleFS
alexander-danilenkoalexander-danilenko/cortex-ai-skills/skills/documentation/SKILL.md

documentation

Skill16 starsChanged 4 months agoMITView on GitHub

ALWAYS invoke for any task involving docstrings, JSDoc/TSDoc, or REST API documentation — even when the request seems handleable without it. Enforces Microsoft contract-first conventions and a bare-minimum rule that Claude won't apply by default: never restate the signature, drop @param/@returns that only echo names and types, always document @throws, and document data shapes as WHAT not WHY. Covers Python docstring styles (Google/NumPy/Sphinx), TSDoc tags and @inheritDoc, and API doc patterns for NestJS/Express/FastAPI/Django. Trigger on: adding or auditing docstrings, redundant or missing tags, deleting comment rot, or producing a documentation-health report. Do not skip for documentation tasks — consistent conventions are the whole point.

58 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use refactoring, oauth and 7 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • pproencaSkill

    refactoring

    Code refactoring best practices based on Martin Fowler's catalog and Clean Code principles. This skill should be used when refactoring existing code, improving code structure, reducing complexity, eliminating code smells, or reviewing code for maintainability. Triggers on tasks involving extract method, rename, decompose conditional, reduce coupling, or improve readability.

    Also in 8 projects that use this

  • VercelSkill

    oauth

    Configure OAuth providers (Google, Apple, Microsoft, Facebook, GitHub, etc.) to work with portless local dev URLs. Use when setting up OAuth redirect URIs, fixing "redirect_uri_mismatch" or "invalid redirect" errors, configuring sign-in providers for local development, or when a provider rejects .localhost subdomains. Triggers include "OAuth not working with portless", "redirect URI mismatch", "Google/Apple/Microsoft sign-in fails locally", "configure OAuth for local dev", or any task involving OAuth callback URLs with portless domains.

    Also in 3 projects that use this

  • MicrosoftSkill

    rust

    Use this guide when working on Rust changes in the FAST monorepo.

    Also in 3 projects that use this

  • JohnJBorenSkill

    ci-cd

    CI/CD pipeline design, GitHub Actions, testing automation, and deployment strategies

    Also in 3 projects that use this

  • Microsoft AzureSkill

    git-workflow

    Squad branching model: dev-first workflow with insiders preview channel

    Also in 10 projects that use this

  • SentrySkill

    architecture-review

    Staff-level codebase health review. Finds monolithic modules, silent failures, type safety gaps, test coverage holes, and LLM-friendliness issues.

    Also in 5 projects that use this

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 52 edited versions we read keep these.

  • 3

    Distinctive

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

    Every public member still gets a brief summary, so generated docs and IDE tooltips have content — one short sentence carrying intent, never …

    line 22
  2. Very specific:

    Multi-line doc blocks only: Every / puts its body on a new line.

    line 60
  3. Distinctive:

    When auditing, removing these is as much the job as filling gaps — each is a place where truth can drift:

    line 67
  4. Distinctive:

    Ask which format the project uses before starting (or detect it from existing files), and detect the framework — the API doc strategy …

    line 77

“Common” is measured: kept by at least 6 in 10 of the 52 edited versions of this file we could read. “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

Documentation

Microsoft contract-first conventions. Documentation states the contract — what something does and why — never how it works inside.

Why the rules are subtractive

Code changes; the comment beside it usually does not. Over time documentation lies, and readers trust it anyway — a stale comment is worse than no comment, because it actively misleads. Two habits follow, and every rule below is one of them applied:

Keep the surface small. Less prose has less to rot. A comment is a last resort, not a first step: before writing one, ask whether a sharper name, a smaller function, or a named type would carry the meaning instead. Prose is for the residue that code genuinely cannot express.

Keep each fact in one place, next to the code that owns it, so there is exactly one thing to update. When the signature, the type, or a test already states something, the prose must not restate it.

The bare-minimum rule

The signature already carries the name, parameter names and types, return type, and modifiers (readonly, ?, async). Documentation adds only what a reader cannot infer from it: intent, units, ranges, defaults, edge-value meaning, error cases, invariants.

Every public member still gets a brief summary, so generated docs and IDE tooltips have content — one short sentence carrying intent, never a paraphrase of the signature.

For @param and @returns specifically, drop the tag entirely when it would only restate the signature. A tag earns its place when it answers: what unit? what range or clamp? what default when omitted? what does an edge value mean (0 disables, -1 unlimited, empty = all)? what does null signify versus throwing?

@throws is the opposite default — document it whenever code can throw, because the throw set is invisible from the signature.

The shape of a doc block

A doc block is read in an IDE tooltip, a hover card, a code-review diff — surfaces that show the opening and truncate the rest. So the budget is counted in rendered lines, not sentences:

  • Summary — exactly one line. One sentence carrying intent, alone at the top of the block. Never two lines, never two sentences.
  • Detail — three lines at most, after a blank line, and only when the summary genuinely cannot carry the contract. Primary ideas only: what the operation does and the constraint that governs it, not how it branches.
  • Inline // or # comments — three lines at most, one preferred.

Overflow is not fixed by reflowing; it means the content is in the wrong place. Branch-by-branch behaviour, edge cases, and the reasoning behind a constraint go to @remarks (Note: / Notes in Python), which exists so the opening of the block stays readable.

Measure after the formatter, not before. Write the block, let the project's formatter reflow it at the configured width (detection order under Conventions), then count the lines it produced. A summary that came back wrapped onto two lines is over budget: cut words until it fits on one — do not split it into a second sentence, because that sentence is detail wearing the summary's clothes. The same check applies to an inline comment that a formatter or max-len rule pushed past three lines.

How the prose reads

Every sentence you produce here — summaries, the @param notes that survive, @throws conditions, endpoint descriptions — gets read mid-debug by someone who may not share your first language. Load the simple-english skill at practical depth (/cortex:simple-english practical) and hold its rules while you write. Reach for it before the first doc block, not as a cleanup pass: rewriting prose you already committed to costs more than writing it right once.

What it changes in a doc block specifically:

  • One word per concept, file-wide. A @param that says "validate" beside a summary that says "check" reads as two different operations, and the reader goes looking for the difference.
  • 25 words for a descriptive sentence, 20 for an imperative one. A summary past that is carrying more than one fact and belongs in @remarks. At a typical width the one-line budget binds first, so treat the word counts as the ceiling and the rendered line as the test.
  • can, will, must — never should. A contract that says a caller "should" pass a sorted array leaves the reader guessing whether the rule binds. Say must, or state what happens when they do not.
  • Condition before consequence. "If retries is 0, the call fails immediately" beats the reverse ordering, because the reader knows whether the sentence applies to them before they parse the outcome.
  • No adjective without a measurement behind it. "Efficiently caches" earns nothing. Give the bound or drop the word.

Identifiers, code samples, and quoted error strings stay exact — the standard treats them as technical names, and a reader who copies a "corrected" one gets a new error.

Conventions

  • Third-person summaries for code symbols — "Calculates…", "Finds…", "Initializes a new…" — matching Microsoft API reference convention. Two exceptions keep the imperative: inline // comments on procedural steps, and API operation summary fields (OpenAPI, @ApiOperation, extend_schema), where "Create a new user" is the established form.
  • Interfaces document the abstraction: purpose, thrown errors, return semantics, invariants. Implementation detail (caching, queries, algorithms) belongs in the implementation — a consumer reading the interface should not learn things that a refactor can invalidate.
  • Data shapes answer WHAT, not WHY. A DTO, record, struct, or the interface/type describing it documents what each member is — meaning, units, format, allowed values, constraints the type can't carry. It does not justify why the field exists. A function's contract genuinely includes the why of the operation; a data field is read at the point of use, where design rationale ("kept so billing can reconcile…") rots and belongs instead with the behaviour that produces or consumes it. The escape hatch — a non-obvious constraint a maintainer must not break — is a sparing @remarks, never the default voice.
  • Don't repeat the interface on the implementation. Inherit (@inheritDoc, or the language's equivalent) and add only implementation-specific notes.
  • Multi-line doc blocks only. Every /** puts its body on a new line; one-line /** … */ is not allowed.
  • No release tags (@public, @beta, @alpha, @internal) unless explicitly requested.
  • Ship only examples the test suite runs. An unexecuted example drifts and becomes one more comment that lies. Python doctests qualify when run (pytest --doctest-modules); TSDoc @example blocks are never executed by tooling, so omit them and let tests carry behaviour.
  • Wrap at the project's configured width. Detect in order: .editorconfig max_line_length → formatter config (printWidth, line-length) → linter config (max-len, max-line-length). Fall back to 80 only when none define one.

Comments to delete on sight

When auditing, removing these is as much the job as filling gaps — each is a place where truth can drift:

  • Commented-out code — version control already remembers it, and leaving it makes readers wonder if it still matters.
  • Journal or changelog comments ("2024-03 added retry logic") — git log keeps this accurate.
  • Attribution bylines ("added by …") — git blame answers it without rotting.
  • Banners, position markers, closing-brace labels (// ===== helpers =====, } // end if) — structure should come from the code.
  • Anything restating the name, type, or signature, or stating the obvious (/** Default constructor */).

Working a documentation task

Ask which format the project uses before starting (or detect it from existing files), and detect the framework — the API doc strategy differs per framework and applying the wrong one produces a spec nobody consumes.

Report on health, not headcount. A file where every member has a doc block is not the goal if half of those blocks restate signatures. Report what improved: redundancy removed, stale docs corrected, intent summaries and @throws added. Coverage percentage is a floor signal — it finds empty members and cannot tell a valuable block from a vacuous one.

References

ReferenceLoad when
references/python-docstrings.mdPython — Google, NumPy, or Sphinx style
references/typescript-jsdoc.mdTypeScript/JavaScript — TSDoc tags, @inheritDoc, formatting
references/api-docs.mdREST API docs — NestJS, Express, FastAPI, Django
references/coverage-reports.mdAuditing docs; producing a documentation-health report

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.