typescript-rules

typescript-rules is a skill for Claude Code, Codex from softspark/ai-toolkit. It costs 60 tokens per session (2,528 once invoked), scanned A, original, Apache-2.0.

A set of rules for writing TypeScript and JavaScript code, including naming, types, imports, security, and testing practices.

In plain words
What is it for?
Use it in projects built with tools such as React, Next.js, Vue, Vite, Vitest, Jest, or ESLint.
Why use it?
It gives coding agents consistent standards to follow when changing or reviewing TypeScript or JavaScript projects.

Skill for Claude CodeCodex

Part of the ai-toolkit plugin — 114 skills, 44 agents, 14 hooks shipped together

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.

agentmods
npx agentmods add skills/softspark/ai-toolkit/typescript-rules
Any agent
npx skills add softspark/ai-toolkit --skill typescript-rules
Clone the repo
git clone --depth 1 https://github.com/softspark/ai-toolkit

Made for: Claude Code, Codex.

Or install ai-toolkit, the plugin that ships this one along with the rest of its 114 skills, 44 agents, 14 hooks.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/softspark/ai-toolkit/typescript-rules.svg)](https://agentmods.dev/skills/softspark/ai-toolkit/typescript-rules)
Your own site
<a href="https://agentmods.dev/skills/softspark/ai-toolkit/typescript-rules"><img src="https://agentmods.dev/badge/skills/softspark/ai-toolkit/typescript-rules.svg" alt="Measured on agentmods" height="20"></a>
Per session 60 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,528 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00060 $0.02528
Opus 5 $0.00030 $0.01264
Sonnet 5 $0.00012 $0.00506
Haiku 4.5 $0.00006 $0.00253

Measured yesterday against content hash 83948ca55c87, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

typescript-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 yesterday.

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.

app/skills/typescript-rules/SKILL.md · 250 lines

How it starts

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

TypeScript/JavaScript Rules

These rules come from app/rules/typescript/ in ai-toolkit. They cover the project's standards for coding style, frameworks, patterns, security, and testing in TypeScript/JavaScript. Apply them when writing or reviewing TypeScript/JavaScript code.

TypeScript Coding Style

Strict Mode

  • Always use strict: true in tsconfig.json.
  • Never use any -- use unknown + type guards instead.
  • Prefer interface over type for object shapes (extendable).
  • Use as const for literal types and readonly tuples.

Naming

  • PascalCase: types, interfaces, enums, classes, components.
  • camelCase: variables, functions, methods, properties.
  • UPPER_SNAKE: constants, env vars.
  • Prefix interfaces with I only if project convention requires it.

Functions

  • Prefer arrow functions for callbacks and inline.
  • Use function declarations for hoisted, named functions.
  • Max 3 parameters -- use options object beyond that.
  • Always type return values for public/exported functions.

Imports

  • Group: node builtins, external, internal, relative.
  • Use type imports: import type { Foo } from './foo'.
  • No barrel exports unless at package boundary.
  • Prefer named exports over default exports.

Types

  • Use discriminated unions over class hierarchies for state.
  • Use readonly for arrays and objects that should not be mutated.
  • Use satisfies operator to validate types without widening.
  • Prefer unknown over any at API boundaries.
  • Use template literal types for string patterns.

Avoid

  • enum -- use as const objects or union types.
  • namespace -- use ES modules.
  • private keyword -- use # private fields.
  • Non-null assertion ! -- use proper type narrowing.
  • as type casting -- use type guards and narrowing.

Configuration

  • Enable noUncheckedIndexedAccess for safer array/object access.
  • Enable exactOptionalPropertyTypes to distinguish undefined from missing.
  • Use moduleResolution: "bundler" for modern projects.
  • Set isolatedModules: true for bundler compatibility.

Read the full file on GitHub · 250 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. yesterday First seen · 250 lines · 60 tokens per session scan A 83948ca55c87

Subscribe to this mod's changes

typescript-rules is a skill published in the GitHub repository softspark/ai-toolkit (169 stars, last pushed today), licensed Apache-2.0. It adds 60 tokens to every session and 2,528 once invoked, about $0.0003 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-09-03.