typescript-safety

typescript-safety is a skill for Claude Code, Codex from LeahyCC/claude-skills. It costs 180 tokens per session (1,780 once invoked), scanned A, original, MIT.

A TypeScript safety guide for making the compiler catch more mistakes before code runs. TypeScript adds checked types to JavaScript, and the guide covers configuration, data validation, narrowing, and safer type patterns.

In plain words
What is it for?
Use it to review tsconfig settings, replace unsafe any types, validate data at system boundaries, improve unions and generics, and migrate between TypeScript versions.
Why use it?
Values from APIs, JSON, storage, and environment variables are not automatically trustworthy, while broad casts can hide real bugs.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to review tsconfig settings, replace unsafe any types, validate data at system boundaries, improve unions and generics, and migrate between TypeScript versions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/leahycc/claude-skills/typescript-safety
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 LeahyCC/claude-skills --skill typescript-safety
Clone the repo
git clone --depth 1 https://github.com/LeahyCC/claude-skills

Made for: Claude Code, Codex.

Its marketplace also offers this one on its own, as the plugin typescript-safety — /plugin install typescript-safety after adding the marketplace above.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/leahycc/claude-skills/typescript-safety/github.svg)](https://agentmods.dev/skills/leahycc/claude-skills/typescript-safety)
Your own site
<a href="https://agentmods.dev/skills/leahycc/claude-skills/typescript-safety"><img src="https://agentmods.dev/badge/skills/leahycc/claude-skills/typescript-safety/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-safety

Your own site · 80×15
<a href="https://agentmods.dev/skills/leahycc/claude-skills/typescript-safety"><img src="https://agentmods.dev/badge/skills/leahycc/claude-skills/typescript-safety.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 180 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,780 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.
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.00180 $0.01780
Opus 5.5 $0.00072 $0.00712
Sonnet 5.5 $0.00036 $0.00356
Haiku 4.5 $0.00018 $0.00178

Measured today against content hash ddbbeb0f8adf, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

typescript-safety 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 today.

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.

skills/typescript-safety/SKILL.md · 88 lines

How it starts

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

TypeScript safety

Getting the compiler to catch bugs before they run, on TypeScript 6 and 7. TS 7.0 is the Go compiler, installed as plain typescript since July 2026. strict has been the default since 6.0, so the remaining gains come from the flags strict leaves off, from narrowing instead of casting, and from parsing data at the edges.

Types describe code, not data. Anything that enters the process (a response body, JSON.parse, storage, env vars) is unchecked until code checks it. An annotation on an any is a cast.

Every escape hatch turns off the check that would have caught the bug. No any in new code. Reach for unknown and narrow. A cast needs a runtime check next to it.

Source checks and dates: SOURCES.md.

Procedure

  1. Read the project's tsconfig.json and the installed typescript version (npx tsc --version). On 5.x or 6.x with deprecation errors, start with upgrade-6-to-7.md.
  2. Compare the config with the baseline in config.md. Turning on a flag in an old codebase can add hundreds of errors: count them with tsc --noEmit first, and fix by module.
  3. Read the resource for the task in the table below.
  4. Write the change. Prefer the first tool that works: narrowing, then a predicate, then a checked cast.
  5. Run tsc --noEmit, and eslint if the project has typed linting. Report both results, and say which TS version ran.
data from outside ──> unknown ──> parse at the edge ──> precise types inside
                                  domain-types.md      narrowing.md, generics.md
                                                              |
  tsconfig flags catch the rest: config.md        types from types: type-level.md
                                                              |
  any / as / ! found? escape-hatches.md      lint what tsc cannot: linting.md

Where to read

Task Resource
tsconfig defaults, the baseline, flags past strict, module by runtime, the empty types default config.md
Upgrading to 6.0 and 7.0, removed options and syntax, running TS 6 next to 7 upgrade-6-to-7.md
Discriminated unions, exhaustive switches, predicates, assertion functions, unsound spots narrowing.md
When a type parameter earns its place, constraints, satisfies, const type parameters, NoInfer generics.md
Utility types, the Omit trap, mapped, conditional, and template literal types, augmentation type-level.md
Untyped data at the edges, branded IDs and units, readonly inputs domain-types.md
any, as, !, @ts-expect-error, and what to use instead escape-hatches.md
typescript-eslint configs and rules, and the TS 6 alias the linter still needs linting.md
Node type stripping, erasableSyntaxOnly, verbatimModuleSyntax, enums node-and-emit.md

Read the full file on GitHub · 88 lines

Files

What ships with it

11 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. today First seen · 88 lines · 180 tokens per session scan A ddbbeb0f8adf

Subscribe to this mod's changes

typescript-safety is a skill published in the GitHub repository LeahyCC/claude-skills (3 stars, last pushed today), licensed MIT. It adds 180 tokens to every session and 1,780 once invoked, about $0.0007 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-10-24.

Related

Other skills, from other repositories

Accessibility Audit Helper

Reviews UI code and components for WCAG 2.1 accessibility violations and provides specific fixes.

Notysoty/openagentskills · 23 tokens

fastify-typescript

This skill should be used when using TypeScript with Fastify, configuring type providers, using @fastify/type-provider-typebox, using @fastify/type-provider-json-schema-to-ts, typing Fastify plugins, declaration merging for decorators, typing route handlers, FastifyInstance generics, FastifyRequest generics…

RadOrigin-LLC/RAD-Claude-Skills · 89 tokens

typescript-expert

TypeScript and JavaScript expert with deep knowledge of type-level programming, performance optimization, monorepo management, migration strategies, and modern tooling.

weAAAre/a11y-agents-kit · 33 tokens

nestjs-expert

Creates and configures NestJS modules, controllers, services, DTOs, guards, and interceptors for enterprise-grade TypeScript backend applications. Use when building NestJS REST APIs or GraphQL services, implementing dependency injection, scaffolding modular architecture, adding JWT/Passport authentication, integrating…

Jeffallan/claude-skills · 107 tokens

typescript-pro

Implements advanced TypeScript type systems, creates custom type guards, utility types, and branded types, and configures tRPC for end-to-end type safety. Use when building TypeScript applications requiring advanced generics, conditional or mapped types, discriminated unions, monorepo setup, or full-stack type safety…

Jeffallan/claude-skills · 69 tokens

a11y-ally

Use when running comprehensive WCAG accessibility audits with axe-core + pa11y + Lighthouse, generating context-aware remediation, or testing video accessibility. Supports 3-tier browser cascade with graceful degradation.

proffesor-for-testing/agentic-qe · 44 tokens