typescript-strict

typescript-strict is a skill for Claude Code, Codex from WrongStack/WrongStack. It costs 63 tokens per session (2,307 once invoked), scanned A, original, MIT.

A set of rules for writing and reviewing TypeScript with strict type checking enabled. It covers ways to represent different data shapes and safely handle values that may be missing.

In plain words
What is it for?
Use it when adding or reviewing TypeScript code, especially code that handles external input, arrays, objects, exported functions, or several possible data shapes.
Why use it?
It helps catch type mistakes before they become runtime bugs, without hiding errors through unsafe type casts or non-null assumptions.

Skill for Claude CodeCodex

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/wrongstack/wrongstack/typescript-strict
Any agent
npx skills add WrongStack/WrongStack --skill typescript-strict
Clone the repo
git clone --depth 1 https://github.com/WrongStack/WrongStack

Made for: Claude Code, Codex.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/wrongstack/wrongstack/typescript-strict.svg)](https://agentmods.dev/skills/wrongstack/wrongstack/typescript-strict)
Your own site
<a href="https://agentmods.dev/skills/wrongstack/wrongstack/typescript-strict"><img src="https://agentmods.dev/badge/skills/wrongstack/wrongstack/typescript-strict.svg" alt="Measured on agentmods" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,307 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.00063 $0.02307
Opus 5 $0.00032 $0.01154
Sonnet 5 $0.00013 $0.00461
Haiku 4.5 $0.00006 $0.00231

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

Security

Grade A, and why

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

packages/core/skills/typescript-strict/SKILL.md · 273 lines

How it starts

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

TypeScript Strict Mode — WrongStack

Overview

Strict TypeScript patterns for WrongStack: exhaustive switch, branded types, discriminated unions, and noUncheckedIndexedAccess. WrongStack uses strict: true with additional strictness flags.

Rules

  1. Never silence errors with as any or double assertions — validate or narrow values at trust boundaries.
  2. Don't use ! non-null assertion — silence the type checker without explanation.
  3. Always annotate return types on exported functions — hides errors otherwise.
  4. Use Promise<unknown> or generics instead of Promise<any>.
  5. Be specific with types — Function and Object are too broad.
  6. Enable noUncheckedIndexedAccess — always handle the undefined case on array/object access.

Patterns

Do

// ✅ Exhaustive switch with assertNever
function assertNever(x: never): never {
  throw new Error(`Unhandled: ${JSON.stringify(x)}`);
}
switch (block.type) {
  case 'text': return renderText(block);
  case 'tool_use': return renderToolUse(block);
  case 'error': return renderError(block);
  default: return assertNever(block);
}

// ✅ Branded types for invariants
type UserId = string & { readonly __brand: 'UserId' };
type SessionId = string & { readonly __brand: 'SessionId' };

// ✅ Discriminated union
type Result =
  | { status: 'success'; data: User }
  | { status: 'error'; error: Error }
  | { status: 'loading' };

// ✅ noUncheckedIndexedAccess — always handle undefined
const first = items.at(0);
if (first) console.log(first.toUpperCase());

Don't

// ❌ Non-null assertion — silences the type checker
console.log(name!.toUpperCase());

// ❌ Promise<any> — loses type safety
async function fetchUser(): Promise<any> { ... }

// ❌ Too broad
const handler: Function = () => {};
const data: Object = {};

// ❌ Missing return type on export
export function processData(data: string) { ... }

Non-negotiable rules

{
  "strict": true,
  "noUncheckedIndexedAccess": true,
  "noImplicitReturns": true,
  "exactOptionalPropertyTypes": true
}

Read the full file on GitHub · 273 lines

Files

What ships with it

1 file 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. yesterday First seen · 273 lines · 63 tokens per session scan A 82c56593ca13

Subscribe to this mod's changes

typescript-strict is a skill published in the GitHub repository WrongStack/WrongStack (284 stars, last pushed today), licensed MIT. It adds 63 tokens to every session and 2,307 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.