experiments: Cursor rule for Cursor

.cursor/deprecated/ts-coding-rules.mdc

ts-coding-rules is a cursor rule for Cursor from reliverse/experiments. It costs 2,735 tokens per session, scanned A, original, MIT.

A project rule set for JavaScript and TypeScript codebases. It defines how the coding agent should write code, use Bun, check accessibility, and follow Biome formatting and linting rules.

In plain words
What is it for?
Use it to guide coding-agent changes in a JavaScript or TypeScript project, especially when applying existing code patterns and validating code quality.
Why use it?
It keeps generated code consistent with the project's type-safety and quality standards. It also reduces avoidable mistakes in commands, formatting, accessibility, and error handling.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

This is reliverse/experiments's own configuration. It tells Cursor how to work on experiments itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything experiments configures →

Reuse

Borrowing it

Nothing to install: this file belongs to reliverse/experiments. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/reliverse/experiments/main/.cursor/deprecated/ts-coding-rules.mdc
Clone the repo
git clone --depth 1 https://github.com/reliverse/experiments

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 ts-coding-rules

README.md
[![agentmods](https://agentmods.dev/badge/rules/reliverse/experiments/ts-coding-rules/github.svg)](https://agentmods.dev/rules/reliverse/experiments/ts-coding-rules)
Your own site
<a href="https://agentmods.dev/rules/reliverse/experiments/ts-coding-rules"><img src="https://agentmods.dev/badge/rules/reliverse/experiments/ts-coding-rules/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 ts-coding-rules

Your own site · 80×15
<a href="https://agentmods.dev/rules/reliverse/experiments/ts-coding-rules"><img src="https://agentmods.dev/badge/rules/reliverse/experiments/ts-coding-rules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,735 This file is loaded in full into every session.
When invoked 2,735 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.02735 $0.02735
Opus 5.5 $0.01094 $0.01094
Sonnet 5.5 $0.00547 $0.00547
Haiku 4.5 $0.00274 $0.00274

Measured 1mo ago against content hash 332c5c6cb374, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ts-coding-rules 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/deprecated/ts-coding-rules.mdc · 272 lines

How it starts

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

Project Context

The current codebase enforces strict type safety, accessibility standards, and consistent code quality for JavaScript/TypeScript projects using Biome's lightning-fast formatter and linter.

Key Principles

  • Strictly speak in English
  • Never produce in code non-English text
  • Zero configuration required
  • Subsecond performance
  • Maximum type safety
  • AI-friendly code generation

Before Writing Code

  1. Analyze existing patterns in the codebase
  2. Consider edge cases and error scenarios
  3. Follow the rules below strictly
  4. Validate accessibility requirements

Rules

Terminal & Package Manager

  • Always use Bun as the package manager.
  • Always use cd <absolute/path/to/directory> to change the current working directory.
  • Never use cd without an absolute path.
  • When working on CLI commands, you can check their performance by running Measure-Command { bun dler tsc --verbose }.

Code Complexity and Quality

  • Don't add _ prefix to disable unused variable, when this variable is really unused (just use e.g. } catch { instead of } catch (_error) {)
  • Don't use consecutive spaces in regular expression literals.
  • Don't use the arguments object.
  • Don't use primitive type aliases or misleading types.
  • Don't use the comma operator.
  • Don't use empty type parameters in type aliases and interfaces.
  • Don't write functions that exceed a given Cognitive Complexity score.
  • Don't nest describe() blocks too deeply in test files.
  • Don't use unnecessary boolean casts.
  • Don't use unnecessary callbacks with flatMap.
  • Use for...of statements instead of Array.forEach.
  • Don't create classes that only have static members (like a static namespace).
  • Don't use this and super in static contexts.
  • Don't use unnecessary catch clauses.
  • Don't use unnecessary constructors.
  • Don't use unnecessary continue statements.
  • Don't export empty modules that don't change anything.
  • Don't use unnecessary escape sequences in regular expression literals.
  • Don't use unnecessary labels.
  • Don't use unnecessary nested block statements.
  • Don't rename imports, exports, and destructured assignments to the same name.
  • Don't use unnecessary string or template literal concatenation.
  • Don't use String.raw in template literals when there are no escape sequences.
  • Don't use useless case statements in switch statements.
  • Don't use ternary operators when simpler alternatives exist.
  • Don't use useless this aliasing.
  • Don't use any or unknown as type constraints.
  • Don't initialize variables to undefined.
  • Don't use the void operators (they're not familiar).
  • Use arrow functions instead of function expressions.
  • Use Date.now() to get milliseconds since the Unix Epoch.
  • Use .flatMap() instead of map().flat() when possible.
  • Use literal property access instead of computed property access.
  • Don't use parseInt() or Number.parseInt() when binary, octal, or hexadecimal literals work.
  • Use concise optional chaining instead of chained logical expressions.
  • Use regular expression literals instead of the RegExp constructor when possible.
  • Don't use number literal object member names that aren't base 10 or use underscore separators.
  • Remove redundant terms from logical expressions.
  • Use while loops instead of for loops when you don't need initializer and update expressions.
  • Don't reassign const variables.
  • Don't use constant expressions in conditions.
  • Don't use Math.min and Math.max to clamp values when the result is constant.
  • Don't return a value from a constructor.
  • Don't use empty character classes in regular expression literals.
  • Don't use empty destructuring patterns.
  • Don't call global object properties as functions.
  • Don't declare functions and vars that are accessible outside their block.
  • Make sure builtins are correctly instantiated.
  • Don't use super() incorrectly inside classes. Also check that super() is called in classes that extend other constructors.
  • Don't use variables and function parameters before they're declared.
  • Don't use 8 and 9 escape sequences in string literals.
  • Don't use literal numbers that lose precision.

Read the full file on GitHub · 272 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 · 272 lines · 2,735 tokens per session scan A 332c5c6cb374

Subscribe to this mod's changes

ts-coding-rules is a cursor rule published in the GitHub repository reliverse/experiments (117 stars, last pushed 7mo ago), licensed MIT. It adds 2,735 tokens to every session, about $0.0109 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-01.