comments

comments is a cursor rule for Cursor from louisbrulenaudet/monorepo-template. It costs 437 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

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.

agentmods
npx agentmods add rules/louisbrulenaudet/monorepo-template/comments
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.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.svg" alt="Measured on agentmods" height="20"></a>
Per session 437 This file is loaded in full into every session.
When invoked 437 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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.00437 $0.00437
Opus 5 $0.00218 $0.00218
Sonnet 5 $0.00087 $0.00087
Haiku 4.5 $0.00044 $0.00044

Measured 2d ago against content hash 9659e556cdb6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, 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 2d 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 · 15 lines

What it actually says

Comments

Do not add a comment that restates the code. A comment earns its place only when it records 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.

  • Default to no comment. If a line needs explaining, rename something or restructure it first. A comment is the fallback, not the first move.
  • Never write a comment for an AI reader. Path-scoped rules under .claude/rules/ (mirrored in .cursor/rules/) are the channel for that, and they cost context only when a matching file is touched. A comment costs context every time anyone reads the file, forever, and pushes the code apart while it does.
  • If the explanation runs past two lines, or applies to more than the line below it, it belongs in a rule - not a comment block at the top of a file. The exception is a config file whose comments are already the documented source of truth: root turbo.json task descriptions and wrangler.jsonc annotations are cited as authoritative by ../core/turborepo.md and ../backend/workers-config.md. Extend those in place; do not strip them into a rule.
  • 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. The test is simple - deleting it should feel risky. If deleting it changes nothing, it should not be there.
  • Applies to source, YAML and workflows, shell, and config alike.
  • Not covered by this rule: JSDoc/docstrings carrying types or a public API contract, @internal tags Knip depends on, and oxlint-disable-* directives, which code-style.md requires to carry a reason. Those are machine-read, not prose.
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. 2d 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 4d ago), licensed Apache-2.0. It adds 437 tokens to every session, about $0.0022 per session on Opus 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.