framework_eng/rules/semantic-code-comments/SKILL.md
Explain why in comments, do not restate the code
npx skillsauth add steelmorgan/1c-agent-based-dev-framework semantic-code-commentsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
A good comment explains why, not what. Names, structure, and expressions already show what the code does; a comment is needed for business meaning, constraints, tradeoffs, and hidden invariants.
Code is written once, but read many times. If a future reader asks “why is it like this?”, “what will break if we remove it?”, “what business rule is being protected here?” - a semantic comment is needed.
| Comment (why) | DO NOT comment (what) |
|-------------------------|-------------------------|
| Non-obvious business rules | Code restatement (// adding A and B) |
| Protection against external failures and edge cases | Obvious operations (// incrementing the counter) |
| Workaround and tradeoffs | |
| Hidden invariants and call order | |
| Reasons for rejecting the obvious solution | |
| Magic numbers and constants | |
A comment that contradicts the code is unacceptable: an outdated comment is worse than none - it creates false confidence. When changing code, check nearby comments.
Good:
// Скидку применяем только после подтверждения лимита, потому что договор
// может запрещать ретроспективное изменение цены.
Если ЛимитПодтвержден И ДоговорРазрешаетИзменениеЦены Тогда
Bad:
// Плохо: складываем A и B.
Сумма = A + B;
| Good | Bad | |--------|-------| | "We do not use X because Y" | "X is here" | | "Protection against an empty response from an external service" | "Checking the value" | | "If removed, the period invariant will break" | "Do not touch" | | "First we populate the cache because the next request reads from it" | "Populating the cache" |
agent-code-marking shows who changed the code and when; semantic-code-comments explains why the code is structured this way. Markers provide auditability, comments provide meaning.
depends_on:
development
1C server maintenance webhooks: container restart and external component cache cleanup
development
Interactive DAP debugging of a single BSL procedure
tools
Rules for using RLM tools for project search and navigation in 1C/BSL
development
Creates web applications and routes on Winow (a web server on OneScript and Autumn). Use when working with a web server on OneScript, routing, or Winow controllers.