agentleFS
GoogleKnown publishergoogle/zerocopy/skills/comment-guidelines/SKILL.md

comment-guidelines

Skill2.7k starsChanged 8 days agoApache-2.0View on GitHub

Write or review explanatory code comments that preserve non-obvious rationale, invariants, assumptions, contracts, and behavior without becoming stale. Use when adding, revising, or reviewing explanatory inline comments or documentation comments. Not for standalone prose documentation, non-prose tool directives, or pure task-tracking markers unless explanatory comment editing is also part of the task.

Trending

More talk lately.about the whole repository

Dec 2025: 1 mentionJan 2026: 1 mentionFeb 2026: 1 mentionMar 2026: 1 mentionApr 2026: 1 mentionMay 2026: 0 mentionsJun 2026: 6 mentionsJul 2026: 3 mentionsAug 2026: 4 mentionsSep 2026: 4 mentionsOct 2026: 11 mentionsNov 2026: 4 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the google/zerocopy repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about google/zerocopy

The biggest 5 of 53 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 53

Talked about on GitHub, Bluesky and Hacker News (53 times).

On GitHub · 50

45 more on GitHub

On Bluesky · 2

On Hacker News · 1

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Write comments for the reader and interface they serve.

    line 14
  2. Distinctive:

    Do not narrate syntax or obvious control flow.

    line 34
  3. Distinctive:

    When a cross-code relationship is essential, name the stable concept or identifier and explain the relationship that must remain true.

    line 62
  4. Distinctive:

    Write prose comments as full sentences with proper grammar, capitalization, and punctuation.

    line 77
  5. Distinctive:

    Use straightforward, factual language.

    line 80
  6. Distinctive:

    Put a blank comment line between prose paragraphs and between a section header and the first line of that section.

    line 88

≈ “Common” is an estimate: at least 1 in 5 of the 383,637 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

Comment guidelines

Write comments for the reader and interface they serve. Help that reader understand information they should not have to reconstruct from elsewhere, and keep that information accurate as the code evolves. Do not add an explanatory comment merely because this skill is active; clear implementation code may need no implementation comment.

Content

Match the comment to its audience

For implementation comments, prioritize information a source reader cannot reliably infer from the surrounding code:

  • why a design or implementation choice exists;
  • invariants and constraints that must remain true;
  • non-obvious semantics, contracts, side effects, edge cases, or safety considerations; and
  • assumptions about external systems, data, or environments when they materially affect correctness, safety, compatibility, or interoperability.

Do not narrate syntax or obvious control flow. When the task permits a code change and the code can express a fact more directly and durably, prefer making the code clearer rather than using a comment to excuse avoidable obscurity.

Caller-facing documentation comments are part of the API. Document the behavior, obligations, side effects, errors, safety conditions, and usage context that callers need without reading the implementation, as relevant to that API and the project's documentation conventions. Do not omit needed API documentation merely because the implementation or type signature makes the information discoverable. Do not expose mutable implementation details as API contract.

Describe the current code, not its chronology

State current facts and current reasons. Do not use explanatory comments as a changelog or roadmap. Mention an ongoing transition, future condition, or prior design only when it is needed to explain why the current code has its present shape or to preserve a lesson that constrains the current design. Make the present constraint understandable without requiring the reader to reconstruct that history.

Keep the relevant context local

A reader should not need unexplained knowledge of distant code to understand a comment. At the same time, do not duplicate mutable implementation details from elsewhere merely to make a comment self-contained; that creates another source of truth that can become stale.

When a cross-code relationship is essential, name the stable concept or identifier and explain the relationship that must remain true. Avoid claims whose correctness silently depends on unrelated mutable details elsewhere in the codebase.

Document assumptions precisely

Explicitly comment a non-obvious external assumption when violating it would change behavior or invalidate correctness, safety, compatibility, or interoperability, unless nearby code, types, APIs, or checks already make the assumption clear. State what must remain true and why it matters. A comment records an assumption; it does not enforce it.

Style

  1. Write prose comments as full sentences with proper grammar, capitalization, and punctuation. Headings, table cells, diagrams, and code fragments need not be sentences.
  2. Use straightforward, factual language. Avoid subjective or superlative claims such as "flawlessly", "seamlessly", or "beautifully".
  3. Wrap comment prose at 80 columns from the left margin, including indentation and any comment marker such as //, ///, or //!. a. Exceptions: Markdown tables, ASCII diagrams, long URLs, code blocks, or other cases where wrapping would impair readability. b. In bulleted lists, indent continuation lines by 2 spaces. c. Do not wrap a link if doing so would break it.
  4. Put a blank comment line between prose paragraphs and between a section header and the first line of that section. Do not write:

    // Lorem ipsum.
    // Dolor sit amet ...

    Instead, write:

    // Lorem ipsum.
    //
    // Dolor sit amet ...

Self-check

  • Is each explanatory comment appropriate for the reader and interface it serves?
  • Does each implementation comment add information the surrounding code does not make clear on its own?
  • Does each caller-facing documentation comment state the contract callers need without requiring them to read the implementation?
  • Does the comment explain the current rationale, invariant, contract, or assumption instead of merely narrating the code or its history?
  • Can a reader understand it without unstated knowledge of distant code, and does it avoid duplicating mutable details from elsewhere?
  • Are material, non-obvious external assumptions documented?
  • Are prose comments complete, grammatical sentences using factual language?
  • Are prose lines wrapped at 80 columns, with the documented exceptions?
  • Are paragraphs and section bodies separated as required?

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.