Cursor rule
.cursor/rules/code-comments.mdcCode comment guidelines for all languages
Cursor rules
Quality
48/100
Scores the file, not the repository.Length
242 words
5 headings · 0 code blocksRepository
0
— · pushed 4 days agoLast changed
3 days ago
First indexed 3 days ago.12345678# Code comments910## Core principles1112- Favor self-documenting code; reach for comments only when the intent or constraints are not obvious from names and structure.13- Prefer explaining _why_ something exists, the invariants it relies on, or context that comes from outside the code.14- Avoid comments that simply restate the implementation, mirror type annotations, or paraphrase variable names.15- Delete or update comments whenever behavior changes — stale commentary is worse than none.1617## When comments add value1819- **Domain or business context**: capture rules, policies, or edge cases not evident from code.20- **Non-obvious algorithms or patterns**: explain unconventional control flow or defensive code paths.21- **Integration nuances**: document assumptions about external systems or data contracts.22- **Preconditions and invariants**: call out expectations that guide safe use.23- **Suppressed warnings**: pair `// @ts-expect-error` or lint suppressions with a justification.2425Use TSDoc/JSDoc blocks sparingly for exported symbols when consumers need extra context beyond the type signature.2627## When comments are harmful2829- Obvious statements about what the code already says.30- Duplicating type information or parameter descriptions.31- Narrating straightforward control flow without additional insight.32- Commented-out code; rely on version control history.3334## Hygiene3536- Re-evaluate comments during code reviews and refactors.37- Do not include secrets, tokens, or sensitive identifiers.38- Reference external resources with stable links when they inform behavior.39- If a comment documents a temporary workaround, annotate it with the issue that will remove it.40
Also in carrot-foundation/middle-earth
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| carrot-foundation/middle-earth.cursor/rules/bmad.mdc · 0 | Cursor rules | gitdo-not | 51/100 | 3 days ago | |
| carrot-foundation/middle-earth.cursor/rules/branch-naming.mdc · 0 | Cursor rules | lint-formatstylegitdo-not | 45/100 | 3 days ago | |
| carrot-foundation/middle-earth.cursor/rules/code-preservation.mdc · 0 | Cursor rules | do-not | 32/100 | 3 days ago | |
| carrot-foundation/middle-earth.cursor/rules/code-style.mdc · 0 | Cursor rules | lint-formatstylearchdependencies+1 | 56/100 | 3 days ago | |
| carrot-foundation/middle-earth.cursor/rules/commit.mdc · 0 | Cursor rules | testlint-formattypesgit | 58/100 | 3 days ago | |
| carrot-foundation/middle-earth.cursor/rules/documentation.mdc · 0 | Cursor rules | lint-formatstylearchdocs | 42/100 | 3 days ago | |
| carrot-foundation/middle-earth.cursor/rules/pull-request-description.mdc · 0 | Cursor rules | git | 39/100 | 3 days ago | |
| carrot-foundation/middle-earth.cursor/rules/pull-request.mdc · 0 | Cursor rules | lint-formatgitagent-behaviour | 69/100 | 3 days ago | |
| carrot-foundation/middle-earth.cursor/rules/testing.mdc · 0 | Cursor rules | teststyletesting-strategy | 73/100 | 3 days ago | |
| carrot-foundation/middle-earth.cursor/rules/typescript.mdc · 0 | Cursor rules | buildlint-formatstylearch+1 | 59/100 | 3 days ago | |
| carrot-foundation/middle-earthAGENTS.md · 0 | AGENTS.md | setupbuildtestlint-format+7 | 97/100 | 3 days ago | |
| carrot-foundation/middle-earthCLAUDE.md · 0 | CLAUDE.md | setupbuildtestlint-format+6 | 97/100 | 3 days ago |
Diff against .cursor/rules/bmad.mdc Diff against .cursor/rules/branch-naming.mdc Diff against .cursor/rules/code-preservation.mdc Diff against .cursor/rules/code-style.mdc Diff against .cursor/rules/commit.mdc Diff against .cursor/rules/documentation.mdc Diff against .cursor/rules/pull-request-description.mdc Diff against .cursor/rules/pull-request.mdc Diff against .cursor/rules/testing.mdc Diff against .cursor/rules/typescript.mdc Diff against AGENTS.md Diff against CLAUDE.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 3 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 3 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 3 days ago |
