hoc-comments
Comment-writing conventions — what a comment says (the why, never a restatement, no annotation but `NOTE:`), where an inline comment stands (above the code…
от openreachtech★ 17 звёзд на GitHub
Установить hoc-comments в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Shared: Comments
Conventions related to comment writing. Applies across JSDoc, block comments (/* */) and inline comments (//).
Language
- Which language a comment is written in belongs to
/hoc-writing-language. It is read here for the default it gives every comment — English, in source, in the tests generated undertests/and in the code examples of a document or a skill — which holds wherever no instruction, and no language code in the file's name, has settled it first.
What a comment says
A comment carries what the code cannot say for itself — above all, why. Where the code makes a choice a reader would question, the comment stating the reason is the one that has to be there, and it is the one most often missing.
- A comment that restates the code is not written. It says nothing the line beside it does not, and it is one more thing to keep in step with that line.
- A comment moves with the code it describes. Where a change makes a comment untrue, the change corrects it; a comment describing code that is no longer there misleads more than no comment would.
- Code is not commented out and left. The history keeps what was removed; a commented-out block keeps only the question of whether it still matters.
- No annotation is written but
NOTE:; what another would mark is filed as an issue. An issue is seen by whoever plans the work, carries its own discussion, and is closed when the work lands, while an annotation in the code waits for someone to happen to read that line.NOTE:is the one left, because it points out something about the code as it stands, not work left to do. - A comment saying why a workaround exists, and what retires it, is not such an annotation. It
explains the code as it stands — see
/hoc-dependency-defect.
An inline comment stands on the line above
An inline comment goes on a line of its own, above the code it describes. It is put at the end of a line only where moving it there keeps the code's format from breaking:
- A seeder or a test's
caseswritten one element per line. A comment on a line of its own would sit between two elements and break the run of one element per line. - An ESLint option that overrides a default. The default value goes at the end of the line, written as the value alone, so the option keeps the layout it has everywhere else.
// OK: the default noted at the end of the line, the option keeping its layout
'max-len': [
'error',
{
code: 120, // 80
},
],
A comment naming a group stands before the group
- A comment that names a group of elements goes on the line before the group, never at the end of its first element.
- Where groups are marked, a blank line separates one group from the next.
// OK: each group named on the line before it, a blank line between groups,
// and a remark on one element kept at the end of its line
const invalidDates = [
// Days that do not exist
'2026-02-30',
'2026-04-31',
// Strings that are not dates
'tomorrow', // a word a person would type
'',
]
A long comment breaks where its sentence does
Where a comment runs to more than one line, break it at a point the sentence itself offers — after a comma, at a conjunction, between two sentences. A column count such as 80 is not the criterion: filling each line to a margin breaks wherever the word count happens to land.
// NG: filled to the margin, so the line ends mid-clause
/**
* A fragment already on the path contributes nothing, which is what stops a
* cyclic document from being walked forever.
*/
// OK: the break falls after the comma, where the clause does
/**
* A fragment already on the path contributes nothing,
* which is what stops a cyclic document from being walked forever.
*/
- The unit a reader takes in is the line. Broken at a clause, each line is one statement and
the comment can be read down the left edge; broken at a column, a line ends on
stops aand carries no meaning of its own. - This holds for every comment that runs long — a JSDoc block, a
/* */block, and a run of//lines alike. - This governs prose. A type literal inside a JSDoc tag is already one property per line.
A block comment that runs to several lines takes at least three
A block comment written over more than one line takes three lines at the least: the opening
marker on a line of its own, the text, and the closing marker on a line of its own. Every line
between the two markers keeps its leading *.
// NG: two lines, with the text sharing a line with each marker
/* Retries are spaced exponentially,
so a struggling server is given room to recover. */
// NG: the leading * dropped from the lines between the markers
/**
Retries are spaced exponentially,
so a struggling server is given room to recover.
*/
// OK: three lines or more, every line between the ma
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл hoc-comments?
Comment-writing conventions — what a comment says (the why, never a restatement, no annotation but `NOTE:`), where an inline comment stands (above the code, at a line end only to keep a format), where a long comment breaks (at a clause, never at a column), the form of a multi-line block, and lines commented out with `//`. Use when writing or reviewing any comment, or when commenting lines out. Which language a comment is written in belongs to the writing-language convention.
Как установить скилл hoc-comments?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл hoc-comments запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
AnthropicGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
academy-guide
AnthropicStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
internal-comms
AnthropicA set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
skill-development
AnthropicThis skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…