typescript-coding-standards

typescript-coding-standards is a cursor rule for Cursor from TechNickAI/ai-coding-config. It costs 1,399 tokens per session, scanned A, original, MIT.

A set of standards for writing production TypeScript, a programming language that adds types to JavaScript.

In plain words
What is it for?
Use it when adding structured Pino logs, choosing server or browser loggers, and recording useful context for debugging.
Why use it?
It keeps application behavior easier to monitor and prevents inconsistent direct use of console logging.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when adding structured Pino logs, choosing server or browser loggers, and recording useful context for debugging.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/technickai/ai-coding-config/typescript-coding-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/TechNickAI/ai-coding-config

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

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

Your own site · 80×15
<a href="https://agentmods.dev/rules/technickai/ai-coding-config/typescript-coding-standards"><img src="https://agentmods.dev/badge/rules/technickai/ai-coding-config/typescript-coding-standards.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,399 This file is loaded in full into every session.
When invoked 1,399 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.01399 $0.01399
Opus 5.5 $0.00560 $0.00560
Sonnet 5.5 $0.00280 $0.00280
Haiku 4.5 $0.00140 $0.00140

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

Security

Grade A, and why

typescript-coding-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 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/frontend/typescript-coding-standards.mdc · 232 lines

How it starts

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

TypeScript Coding Standards

Write production TypeScript code that is maintainable, observable, and follows modern patterns.

Structured Logging with Pino

Use pino logger for structured JSON logging. The logger auto-silences during tests and provides pretty formatting in development.

import { logger } from "@/lib/logger";

logger.info({ userId, email, service }, "User authenticated");
logger.error({ error, userEmail, action }, "Failed to execute action");
logger.warn({ retryCount, url }, "HTTP request retry");
logger.debug({ requestId, method }, "Processing request");

For client-side code, use the client logger which works in browsers:

import { logger } from "@/lib/client-logger";

logger.error({ error, context }, "Failed to copy text");
logger.info({ service }, "Connection successful");

The first argument is ALWAYS a context object (even if empty {}), the second is ALWAYS the message string. Structure your context with meaningful keys that help debug issues. Use emojis in messages when they add clarity and make logs more scannable.

Never use console.log, console.error, console.warn, or console.info directly. Always use the appropriate logger for consistent structured logging.

Error Monitoring with Sentry

Sentry captures errors with rich context for observability. Add context at error boundaries to make debugging easier.

Capture exceptions with tags and extra data:

import * as Sentry from "@sentry/nextjs";

try {
  await riskyOperation();
} catch (error) {
  logger.error({ error, userId }, "Operation failed");

  Sentry.captureException(error, {
    tags: { component: "api", action: "send_email" },
    extra: { userId, messageId, attemptCount },
  });

  throw error;
}

Add breadcrumbs for important state changes:

Sentry.addBreadcrumb({
  category: "http.retry",
  message: `Retrying ${method} ${url}`,
  level: "warning",
  data: { url, retryCount },
});

Create spans for performance monitoring:

Read the full file on GitHub · 232 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 · 232 lines · 1,399 tokens per session scan A 5a328895d5cd

Subscribe to this mod's changes

typescript-coding-standards is a cursor rule published in the GitHub repository TechNickAI/ai-coding-config (24 stars, last pushed 25d ago), licensed MIT. It adds 1,399 tokens to every session, about $0.0056 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.