typescript-rules

typescript-rules is a skill for Claude Code 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 Code

Written for Claude Code: allowed-tools in frontmatter.

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

Good fit Use it in projects built with tools such as React, Next.js, Vue, Vite, Vitest, Jest, or ESLint.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/softspark/ai-toolkit/typescript-rules
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.

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.

Or install ai-toolkit, the plugin that ships this one along with the rest of its 115 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/github.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/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-rules

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00060 $0.02528
Opus 5.5 $0.00024 $0.01011
Sonnet 5.5 $0.00012 $0.00506
Haiku 4.5 $0.00006 $0.00253

Measured 1mo ago against content hash 83948ca55c87, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 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.

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. 1mo ago 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 (180 stars, last pushed 9d ago), licensed Apache-2.0. It adds 60 tokens to every session and 2,528 once invoked, about $0.0002 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-03.

Related

Other skills, from other repositories

typescript

Apply when writing TypeScript code. Strict types, discriminated unions, async patterns, and runtime safety.

sordi-ai/skill-everything · 23 tokens

typescript-advanced

Advanced TypeScript patterns including branded/nominal types, discriminated unions with exhaustive matching, conditional types with infer, mapped types, template literal types, module augmentation, declaration merging, satisfies operator, const assertions, variance annotations, strict library authoring, and type-level…

medy-gribkov/arcana · 81 tokens

typescript

TypeScript patterns covering strict types, generics constraints, utility types (Pick, Omit, Record, Extract), discriminated unions, async patterns, and common mistakes with BAD/GOOD comparisons.

medy-gribkov/arcana · 41 tokens

bun-runtime

Bun as runtime, package manager, bundler, and test runner. When to choose Bun vs Node, migration notes, and Vercel support.

affaan-m/ECC · 34 tokens

adding-a-command

Creates a new CLI command following the Commander.js pattern in src/commands/. Handles command registration in src/cli.ts, telemetry tracking via tracked() wrapper, and option parsing. Use when user says add command, new CLI command, create subcommand, or adds files to src/commands/. Do NOT use for modifying existing…

caliber-ai-org/ai-setup · 76 tokens

react-component-generator

Generate React components with TypeScript, proper props, hooks, and accessibility. Use when creating new React components, UI elements, or refactoring existing components.

OneWave-AI/claude-skills · 35 tokens