Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

writing-comments

БесплатноБез исполняемых скриптовНе проверен

How to write JSDoc (/** */) and inline (//) comments in the Astro codebase, for contributors reading the source — not end users. Use whenever writing or…

withastroот withastro★ 64 390 звёзд на GitHub

Об этом скилле

Writing Comments

Purpose

Comments in this repository are read by contributors, months or years after they were written, with none of the context you have right now. This skill defines who that reader is, what each kind of comment is for, and which patterns are banned.

Scope Boundary

This skill governs contributor-facing comments in the TypeScript/JavaScript source. It does not apply to end-user documentation:

Everything below is about the source a contributor reads at HEAD.

The Reader

Write for an Astro contributor who is competent in TypeScript but has no access to your current context: not this conversation, not the pull request, not the issue, not the diff. They see only the repository at HEAD.

Two consequences follow directly:

  1. Never narrate change history. Words like "now", "previously", "no longer", "the new approach" are meaningless at HEAD, where only one approach exists. State how the code works, not how it came to be. (A @deprecated notice is the exception — see Conventions — because it describes the contract's future, which the reader needs.)
  2. Never address the reviewer. A comment that argues your change is correct ("this properly handles X") belongs in the PR description, not in the source. The comment must justify the code as it stands, permanently.

Three Kinds of Comments, Three Different Jobs

Kind Syntax Job Contains
File / module overview /** */ at the top of the file Explanation Why the module exists, the concepts and terms it defines, how the pieces relate, design rationale
Item docs /** */ directly above a declaration Reference The contract: behavior, parameters, return value, thrown errors, invariants. Neutral and factual
Inline comments // inside a body Rationale Only what the code cannot say: constraints, workarounds (with issue links), non-obvious coupling

Do not mix the jobs. Implementation details do not belong in the /** */ contract — put them as // comments inside the body. The contract does not belong scattered across inline comments — put it on the declaration.

Behavior Documentation

When item documentation is warranted, write the contract for a human reader, not as a translation of the implementation. This does not require JSDoc for every function; names, types, and structure should carry straightforward behavior on their own.

  • Start with a plain-language description of what the function returns or accomplishes.
  • Use short or medium-length sentences with one main idea each.
  • Avoid internal Astro jargon when callers do not need it. If a technical term is necessary, explain it in the same paragraph.
  • Describe caller-visible caveats that can be surprising: fallback behavior, work limits, ambiguous results, overload ordering, side effects, and the conditions that return undefined, null, an empty result, or another indeterminate value.
  • Document thrown errors when callers are expected to distinguish or recover from them.
  • Do not describe implementation details unless callers need them to understand the behavior or use the API safely.

Add an example when behavior depends on a relationship the signature cannot show clearly. Common Astro and TypeScript cases include:

  • which overload is selected;
  • how arguments map to optional or rest parameters;
  • which public Astro entrypoint exposes a symbol that is implemented or re-exported elsewhere;
  • fallback behavior for ambiguous routes, incomplete configuration, or missing content;
  • a result whose meaning is not obvious from its type.

Introduce the example in prose before the code block. State what it demonstrates and what result is expected. Keep snippets minimal, self-contained, and written from the perspective of an Astro user or the internal caller

Полный SKILL.md на GitHub

Установить writing-comments в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

evals/evals.json

FAQ

Что делает скилл writing-comments?

How to write JSDoc (/** */) and inline (//) comments in the Astro codebase, for contributors reading the source — not end users. Use whenever writing or editing comments in .ts/.js source, including comments added incidentally while fixing bugs or building features. Does not cover the @docs-generated config/error reference.

Как установить скилл writing-comments?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл writing-comments запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить writing-comments с