typescript-standards

typescript-standards is a cursor rule for Cursor from aaydin-tr/swagger-navigator-mcp. It costs 888 tokens per session, scanned A, original, MIT.

TypeScript coding rules for strict typing, organized modules, input validation, and explicit error handling.

In plain words
What is it for?
Use them when writing or reviewing TypeScript functions, data types, modules, validation logic, and exception handling.
Why use it?
They reduce unsafe values, unclear interfaces, inconsistent imports, and errors that are hard to diagnose in TypeScript projects.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use them when writing or reviewing TypeScript functions, data types, modules, validation…

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/aaydin-tr/swagger-navigator-mcp/typescript-standards
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/aaydin-tr/swagger-navigator-mcp

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 typescript-standards

README.md
[![agentmods](https://agentmods.dev/badge/rules/aaydin-tr/swagger-navigator-mcp/typescript-standards.svg)](https://agentmods.dev/rules/aaydin-tr/swagger-navigator-mcp/typescript-standards)
Your own site
<a href="https://agentmods.dev/rules/aaydin-tr/swagger-navigator-mcp/typescript-standards"><img src="https://agentmods.dev/badge/rules/aaydin-tr/swagger-navigator-mcp/typescript-standards.svg" alt="Measured on agentmods" height="20"></a>
Per session 888 This file is loaded in full into every session.
When invoked 888 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.00888 $0.00888
Opus 5 $0.00444 $0.00444
Sonnet 5 $0.00178 $0.00178
Haiku 4.5 $0.00089 $0.00089

Measured 6d ago against content hash d55d6f62f53a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

typescript-standards 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 6d 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/typescript-standards.mdc · 168 lines

How it starts

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

TypeScript Standards

Code Quality Guidelines

  • Use strict TypeScript configuration as defined in tsconfig.json
  • Prefer explicit type annotations for function parameters and return values
  • Use proper error handling with typed exceptions
  • Implement comprehensive input validation

Module Organization

  • Export functions and types explicitly
  • Use clear, descriptive names for functions and variables
  • Group related functionality in logical modules
  • Maintain consistent import/export patterns

Type Safety

  • Define interfaces for all data structures in types/
  • Use discriminated unions for complex type scenarios
  • Avoid any type - use proper type definitions
  • Implement type guards where necessary

Error Handling

// Good: Typed error handling
function loadConfig(): Config {
  try {
    // ... loading logic
  } catch (error) {
    if (error instanceof yaml.YAMLException) {
      throw new Error(`Invalid YAML in configuration file: ${error.message}`);
    }
    throw error;
  }
}

// Good: Input validation
function validatePath(path: string): string {
  if (!path || typeof path !== "string") {
    throw new Error("Invalid path provided");
  }
  return resolve(path);
}

Function Design

  • Keep functions focused and single-purpose
  • Use descriptive parameter names
  • Include JSDoc comments for complex functions
  • Return consistent data structures
  • Handle edge cases explicitly

Import/Export Patterns

// Good: Explicit exports
export { loadConfig, detectSourceType, enrichConfigWithTypes };

// Good: Type-only imports when applicable
import type { Config, SourceConfig } from "./types/config";
import { readFileSync } from "fs";

Constants and Configuration

  • Use UPPER_SNAKE_CASE for constants
  • Define configuration constants at module level
  • Use environment variables for runtime configuration
  • Avoid magic numbers and strings

Code Documentation

  • Use JSDoc for public APIs
  • Include examples in documentation
  • Document error scenarios
  • Explain complex business logic
  • Reference related modules and functions

Read the full file on GitHub · 168 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. 6d ago First seen · 168 lines · 888 tokens per session scan A d55d6f62f53a

Subscribe to this mod's changes

typescript-standards is a cursor rule published in the GitHub repository aaydin-tr/swagger-navigator-mcp (2 stars, last pushed 2mo ago), licensed MIT. It adds 888 tokens to every session, about $0.0044 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-08-31.