Skip to content
Skills Library
Programming · Writing

code-documentation

/code-documentation

Write code comments and API docs that carry what the code cannot say, and nothing it already does. Use when documenting functions, modules, or tricky passages.

Repository
AI-SKILLS ↗
Licence
MIT
Last repository change
05.09.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 05.09.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Write code comments and API docs that carry what the code cannot say, and nothing it already does. Use when documenting functions, modules, or tricky passages.

Original author description

Write code comments and API docs that carry what the code cannot say, and nothing it already does. Use when documenting functions, modules, or tricky passages.

How it works

  1. Method
  2. What not to write
  3. Litmus test
Original SKILL.md headings · 46 lines, 352 words
SKILL.md preview
---
name: code-documentation
description: Write code comments and API docs that carry what the code cannot say, and nothing it already does. Use when documenting functions, modules, or tricky passages.
---

# Code documentation

The code says what happens. Documentation exists for everything else: why,
when, what must stay true, and what will bite. Write for the maintainer at
their moment of confusion.

## Method

1. **Comment the why, never the what.** "Retry three times" restates the
   loop; "the vendor API drops roughly 1 in 50 calls under load, and three
   retries brings failure below our SLO" earns its bytes. Before writing a
   comment, ask what the reader cannot learn from the code below it.
2. **Document the contract at every public boundary:** what the function
   promises, what it requires, what happens on bad input, whether it is
   safe to call twice, what it costs (network? blocking? allocation-heavy?).
   Private helpers usually need a good name more than a docstring.
3. **Mark the landmines explicitly.** Ordering requirements ("must run
   after migrations"), units ("milliseconds"), thread-safety, the reason a
   simpler approach was rejected. These comments prevent the confident
   refactor that breaks production.
4. **Keep examples honest and runnable.** One realistic call with its
   actual result beats three paragraphs. If the example cannot be tested,
   it will drift; prefer examples that live in tests or doctests.
5. **Delete lies on sight.** A comment contradicting the code is worse
   than none, because half the readers will trust it. Editing code means
   auditing its comments in the same change.
6. **Match the house style:** the project's docstring format, tone, and
   density. A file where every second line is commented reads as noise;
   one comment on the genuinely surprising line reads as a flare.

## What not to write

- Restatements: "increment i by one".
- Changelogs in comments: version control already remembers.
- Commented-out code: delete it; the attic is git.
- Apologies without information: "hack, sorry" helps nobody, while
  "workaround for framework issue #4182, removable at v3" is a plan.

## Litmus test

Cover the code and read only the comments and names: do you know what this
module is for, what its edges are, and what you must not break? Then cover
the comments: does anything in the code surprise you that a comment should
have flagged?

Versions

RepositoryScoreLicence
This page · Amey-Thakur/AI-SKILLS100MIT
bytedance/deer-flow100MIT
erikaax08/erikas-skills100Apache-2.0
flutter/agent-plugins100BSD-3-Clause
hoducvinhh/code-documentation100MIT
MoizIbnYousaf/ai-agent-skills100MIT
seb1n/awesome-ai-agent-skills100MIT

Database snapshot: 13.11.2026 · package version 3e9936a94210 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100agent-documentation-writer
    Specialist subagent: Generates comprehensive documentation including READMEs, API docs, architecture docs, and inline comments. Use when documenting code, creating guides, or explaining systems.
  • 100clean-comments
    Comment only what the code cannot say itself — no metadata, no redundancy, no commented-out code, no stale docs, and explain why rather than what (C1-C5). Use when writing or reviewing comments and doc blocks, and on commented-out blocks, TODO banners, author/date/ticket…
  • 100documentation
    Creates clear, comprehensive documentation. Use when writing READMEs, API docs, code comments, or user guides. Follows documentation best practices.
  • 100documentation
    In-code documentation, folder READMEs, code comments. Use when: "document this", "add JSDoc", "write a README", "explain this code", or writing README.md/JSDoc.
  • 100code-comments
    Write clear, plain-spoken code comments and documentation that lives alongside the code. Use when writing or reviewing code that needs inline documentation—file headers, function docs, architectural decisions, or explanatory comments. Optimized for both human readers and AI…
  • 100documentation
    Documentation standards and best practices for code changes. Use when writing or reviewing documentation, adding public APIs, making user-facing changes, or checking documentation quality. Triggers on: 'use documentation mode', 'document', 'documentation', 'docstring', 'add…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.