loom-typescript

loom-typescript is a skill for Claude Code, Codex from cosmix/loom. It costs 16 tokens per session (10,325 once invoked), scanned A, original, MIT.

A reference for writing reliable TypeScript, a JavaScript-based language that adds type checking before code runs. It covers strict settings, generics, runtime validation, and patterns for common tools and frameworks.

In plain words
What is it for?
Use it when designing types, configuring a TypeScript toolchain, validating external data, or building applications and libraries with TypeScript.
Why use it?
It helps avoid errors caused by the gap between what TypeScript assumes during development and what JavaScript receives at runtime. It also addresses type-system edge cases that can mislead experienced developers.

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

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 loom-typescript

README.md
[![agentmods](https://agentmods.dev/badge/skills/cosmix/loom/loom-typescript.svg)](https://agentmods.dev/skills/cosmix/loom/loom-typescript)
Your own site
<a href="https://agentmods.dev/skills/cosmix/loom/loom-typescript"><img src="https://agentmods.dev/badge/skills/cosmix/loom/loom-typescript.svg" alt="Measured on agentmods" height="20"></a>
Per session 16 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 10,325 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.00016 $0.10325
Opus 5 $0.00008 $0.05163
Sonnet 5 $0.00003 $0.02065
Haiku 4.5 $0.00002 $0.01033

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

Security

Grade A, and why

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

skills/loom-typescript/SKILL.md · 808 lines

How it starts

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

TypeScript Language Expertise

Overview

Type-safe, production-quality TypeScript: the type system's sharp edges, strict-mode config that actually moves the needle, the type-vs-runtime boundary, and framework patterns (zod/tRPC/Prisma/React/Express). Assumes fluency with JS and basic TS — this is reference for the traps and idioms that bite experienced engineers.

Toolchain assumed throughout: Bun (install/run/test), Vite (app dev server and bundler — Rolldown bundling, Oxc transforms and minifier, Lightning CSS), tsdown (library bundler on Rolldown), oxlint (lint), oxfmt (format), tsc --noEmit (type-check). ESLint, Prettier, esbuild, and Babel are the legacy equivalents — do not add them to a project that has this stack. See Toolchain below.

Type System Essentials

Generics

// Constraints + default type param; `this` return for fluent chaining
interface HasId { id: string }
class Repo<T extends HasId = HasId> {
  private items = new Map<string, T>();
  save(item: T): this { this.items.set(item.id, item); return this; }
  find(id: string): T | undefined { return this.items.get(id); }
}

// Return `as const` to preserve a tuple/literal shape instead of widening
function pair<A, B>(a: A, b: B) { return [a, b] as const; } // readonly [A, B]

Utility types

Utility Result
Partial<T> / Required<T> all props optional / required
Readonly<T> all props readonly (shallow)
Pick<T,K> / Omit<T,K> keep / drop keys K
Record<K,V> object with keys K, values V
Extract<U,V> / Exclude<U,V> keep / drop union members of U assignable to V
NonNullable<T> strip null / undefined
ReturnType<F> / Parameters<F> function return type / param tuple
Awaited<T> recursively unwrap Promise (prefer over a hand-rolled Unwrap)

Read the full file on GitHub · 808 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 · 808 lines · 16 tokens per session scan A 20bfcc87b60b

Subscribe to this mod's changes

loom-typescript is a skill published in the GitHub repository cosmix/loom (54 stars, last pushed today), licensed MIT. It adds 16 tokens to every session and 10,325 once invoked, about $0.0001 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.

Related

Other skills, from other repositories

js-gof

Apply Gang of Four and related design patterns in JavaScript and TypeScript. Use when implementing creational, structural, or behavioral patterns, or when the user mentions factories, builder, prototype, flyweight, singleton, object pool, adapter, wrapper, decorator, proxy, bridge, composite, facade, chain of…

metarhia/metaskills · 107 tokens

error-handling

Apply error handling and recovery patterns in JavaScript/TypeScript or Node.js. Use when implementing error handling, retry logic, or when the user mentions domain errors, error recovery, error escalation.

metarhia/metaskills · 43 tokens

js-conventions

Apply Metarhia JavaScript style. Use when writing or editing .js, .mjs, .ts files (with certain corrections for typescript), formatting code, or when the user asks about code style or linting.

metarhia/metaskills · 50 tokens

apple-cktool-js

Builds and troubleshoots CloudKit automation with Apple's CKTool JS packages, including @apple/cktool.database, @apple/cktool.target.nodejs, and @apple/cktool.target.browser. Use when Codex needs typed JavaScript or TypeScript for CloudKit schema import, export, validation, or reset; container and team discovery…

bastos/skills · 141 tokens

autovault-skill

Understand AutoVault-managed skills and how to install or update them. Use when a skill is visible via symlink, when authoring or editing SKILL.md, or before touching /.autovault/skills. Vault writes must go through autovault add-local or MCP proposeskill/updateskill so AutoVault re-signs; never hand-edit vaulted…

autoworks-ai/autovault · 84 tokens

bun-script

Use when writing a TypeScript script with Bun. Covers the template, conventions, and required patterns.

LandonSchropp/agent-toolkit · 23 tokens