comments

comments is a cursor rule for Cursor from zenml-io/zenml. It costs 250 tokens per session, scanned A, original, Apache-2.0.

Project-wide rules for writing code comments. They ask comments to explain why a decision or constraint exists, rather than restating what the code visibly does.

In plain words
What is it for?
Use them when reviewing, adding, or editing comments and documentation, especially around complex logic, edge cases, public interfaces, and business rules.
Why use it?
They keep comments useful to future maintainers without filling the code with repetitive notes or change history. The guidance also covers when docstrings are more suitable than inline comments.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use them when reviewing, adding, or editing comments and documentation, especially around complex logic, edge cases, public interfaces, and business rules.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/zenml-io/zenml/comments
About the project

ZenML is a Python framework for turning machine-learning and AI workflows into tracked pipelines that run on different infrastructure backends. It is for ML and AI engineers building applications such as model-training workflows, language-model systems, and agent loops in company environments.

zenml-io/zenml · 5,616 stars · on GitHub · zenml.io

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/zenml-io/zenml

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/zenml-io/zenml/comments/github.svg)](https://agentmods.dev/rules/zenml-io/zenml/comments)
Your own site
<a href="https://agentmods.dev/rules/zenml-io/zenml/comments"><img src="https://agentmods.dev/badge/rules/zenml-io/zenml/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/zenml-io/zenml/comments"><img src="https://agentmods.dev/badge/rules/zenml-io/zenml/comments.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 250 This file is loaded in full into every session.
When invoked 250 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.00250 $0.00250
Opus 5.5 $0.00100 $0.00100
Sonnet 5.5 $0.00050 $0.00050
Haiku 4.5 $0.00025 $0.00025

Measured 1mo ago against content hash dac8999ae81f, 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 1mo 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/comments.mdc · 31 lines

What it actually says

Commenting Policy: Explain Why, Not What

Goal: Comments should help a future maintainer understand intent and constraints months later—not narrate edits.

Use comments to explain

  • Non-obvious design decisions / trade-offs and invariants
  • Complex logic or algorithms (what makes them tricky)
  • Business rules and constraints that drive the design
  • Purpose and contract of functions/classes (especially public APIs)
  • Edge cases and gotchas being handled and why they matter

Avoid change-tracking comments

  • “Updated from previous version”
  • “New implementation”
  • “Changed to use X instead of Y”
  • “Refactored this section”

Avoid simple explanatory comments

  • Avoid comments that are obvious descriptions of what the code does when it's already clear from the code itself.

Guidance

  • Prefer self-explanatory code; add comments only where extra context is genuinely needed.
  • Write for “future you” 6+ months from now.
  • In Python, prefer docstrings for API intent and inline comments only for truly non-obvious 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. 1mo ago First seen · 31 lines · 250 tokens per session scan A dac8999ae81f

Subscribe to this mod's changes

comments is a cursor rule published in the GitHub repository zenml-io/zenml (5,616 stars, last pushed today), licensed Apache-2.0. It adds 250 tokens to every session, about $0.0010 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-08-30.