comments

comments is a cursor rule for Cursor from louisbrulenaudet/monorepo-template. It costs 679 tokens per session, scanned A, original, Apache-2.0.

A set of rules for writing useful code comments. Comments should explain constraints, rejected alternatives, or non-obvious external requirements—not repeat what the code already says.

In plain words
What is it for?
Use it when deciding whether a comment is needed, documenting an external API requirement, or moving a longer explanation into a repository rule.
Why use it?
It keeps source files easier to read and prevents comments from becoming permanent clutter or outdated instructions for AI tools.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: mentions AGENTS.md.

Good fit Use it when deciding whether a comment is needed, documenting an external API requirement, or moving a longer explanation into a repository rule.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/louisbrulenaudet/monorepo-template/comments
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/louisbrulenaudet/monorepo-template

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for comments

README.md
[![agentmods](https://agentmods.dev/badge/rules/louisbrulenaudet/monorepo-template/comments/github.svg)](https://agentmods.dev/rules/louisbrulenaudet/monorepo-template/comments)
Your own site
<a href="https://agentmods.dev/rules/louisbrulenaudet/monorepo-template/comments"><img src="https://agentmods.dev/badge/rules/louisbrulenaudet/monorepo-template/comments/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for comments

Your own site · 80×15
<a href="https://agentmods.dev/rules/louisbrulenaudet/monorepo-template/comments"><img src="https://agentmods.dev/badge/rules/louisbrulenaudet/monorepo-template/comments.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 679 This file is loaded in full into every session.
When invoked 679 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00679 $0.00679
Opus 5.5 $0.00272 $0.00272
Sonnet 5.5 $0.00136 $0.00136
Haiku 4.5 $0.00068 $0.00068

Measured 23d ago against content hash 537b153b7fda, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

comments scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 23d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/quality/comments.mdc · 35 lines

How it starts

The opening of the file, as written. The whole thing — 35 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Comments

Do not add a comment that restates the code. A comment earns its place only by recording something a reader cannot recover from the code and would otherwise undo: a constraint, a rejected alternative, a non-obvious requirement of an external API. Write the why, never the what. Applies to source, YAML and workflows, shell, and config alike.

  • Default to no comment. If a line needs explaining, rename or restructure first; a comment is the fallback.
  • Never write a comment for an AI reader. Path-scoped rules (.claude/rules/, mirrored in .cursor/rules/) are that channel: they cost context only when a matching file is touched, while a comment costs context on every read, forever.
  • An explanation longer than two lines, or one that applies to more than the line below it, belongs in a rule, not a comment block at the top of a file.
  • Keep the comments that prevent a regression: why a key is deliberately absent, why a non-default value is set, why an apparently redundant line is load-bearing. Test: deleting it should feel risky; if deleting it changes nothing, it should not be there.

Do not generate

These fail the test above. Never add them; when you touch a file that has them, delete them - but do not hunt them in files you are not editing, and do not rewrite working code just to make a comment deletable.

  • Restating the next statement, control flow, or a well-named symbol (// increment i, /** Resolve the allowlist. */ on resolveCorsOrigins).
  • Section banners, IDE/scaffold boilerplate, commented-out code (restore it or delete it).
  • TODOs that are no longer actionable.
  • File-header essays repeating a path-scoped rule or AGENTS.md.
  • Config keys that restate the tool's default.
  • Ignore, allow, or dictionary entries for tools or words the repo does not use.
  • The same rationale repeated in every environment block - state it once, in a rule.
  • Rationale in a turbo task description: one clause saying what the task does; the why lives in ../core/turborepo.mdc.

Read the full file on GitHub · 35 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 23d ago Changed · -1 lines · -53 tokens per session 537b153b7fda
  2. 25d ago Changed · +4 lines · +3 tokens per session 2fcf9deef1b3
  3. 27d ago Changed · +17 lines · +292 tokens per session bed70973422e
  4. 1mo ago First seen · 15 lines · 437 tokens per session scan A 9659e556cdb6

Subscribe to this mod's changes

comments is a cursor rule published in the GitHub repository louisbrulenaudet/monorepo-template (19 stars, last pushed today), licensed Apache-2.0. It adds 679 tokens to every session, about $0.0027 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.