typescript-expert

typescript-expert is a skill for Claude Code, Codex from hoangatg/ai-agent-toolkit. It costs 39 tokens per session (811 once invoked), scanned A, original, MIT.

Advanced TypeScript guidance for using the language's type system to describe data and catch mistakes during compilation. It covers generics, utility types, conditional types, and type-safe API design.

In plain words
What is it for?
Use it to design reusable typed functions, transform existing types, infer types from usage, and build strongly typed application interfaces.
Why use it?
It helps make complex code safer and easier to understand without relying on unchecked type assertions.

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

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/hoangatg/ai-agent-toolkit/typescript-expert.svg)](https://agentmods.dev/skills/hoangatg/ai-agent-toolkit/typescript-expert)
Your own site
<a href="https://agentmods.dev/skills/hoangatg/ai-agent-toolkit/typescript-expert"><img src="https://agentmods.dev/badge/skills/hoangatg/ai-agent-toolkit/typescript-expert.svg" alt="Measured on agentmods" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 811 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.1 $0.00039 $0.00811
Opus 5 $0.00019 $0.00405
Sonnet 5 $0.00008 $0.00162
Haiku 4.5 $0.00004 $0.00081

Measured yesterday against content hash 111d194ac54a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

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

.agent/skills/typescript-expert/SKILL.md · 117 lines

How it starts

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

TypeScript Expert

Types are documentation that the compiler enforces.


1. Type System Mastery

Utility Type Selection

Need Utility Type
Make all optional Partial<T>
Make all required Required<T>
Make all readonly Readonly<T>
Pick specific keys Pick<T, K>
Remove specific keys Omit<T, K>
Extract from union Extract<T, U>
Exclude from union Exclude<T, U>
Get return type ReturnType<T>
Get parameter types Parameters<T>
Non-nullable NonNullable<T>
Get awaited type Awaited<T>

2. Advanced Generics

Constrained Generics

Pattern Use When
<T extends object> Must be object type
<T extends string> String literal types
<T extends keyof U> Key of another type
<T extends (...args) => any> Must be function

Generic Inference

Principle Application
Infer from usage Let TS infer when possible
Constrain, don't assert Use extends, not as
Default types <T = string> for convenience
Multiple generics <TInput, TOutput> when needed

3. Conditional Types

Pattern

type Result<T> = T extends string ? StringResult : OtherResult

Common Patterns

Pattern Purpose
T extends infer U ? ... : ... Extract nested types
Distributive conditionals Apply to each union member
Mapped conditional Transform object types
Template literal types String manipulation at type level

4. Type-Safe Patterns

Discriminated Unions

Component Purpose
Tag field Common literal field for discrimination
Exhaustive check never for unhandled cases
Type narrowing Automatic narrowing in switch/if

Branded Types

Use Case Pattern
Prevent ID mixing type UserId = string & { _brand: 'UserId' }
Unit safety type Pixels = number & { _brand: 'Pixels' }
Validation proof type ValidEmail = string & { _brand: 'ValidEmail' }

Read the full file on GitHub · 117 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 · 117 lines · 39 tokens per session scan A 111d194ac54a

Subscribe to this mod's changes

typescript-expert is a skill published in the GitHub repository hoangatg/ai-agent-toolkit (1 stars, last pushed 5mo ago), licensed MIT. It adds 39 tokens to every session and 811 once invoked, about $0.0002 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

coding-standards

Universal coding standards, best practices, and patterns for TypeScript, JavaScript, React, and Node.js development.

deepelementlab/jupyter-studio · 28 tokens

effective-typescript

Review existing TypeScript code and write new TypeScript following the 62 items from "Effective TypeScript" by Dan Vanderkam. Use when writing TypeScript, reviewing TypeScript code, working with type design, avoiding any, managing type declarations, or migrating JavaScript to TypeScript. Trigger on: "TypeScript best…

booklib-ai/booklib · 101 tokens

golang-patterns

Idiomatic Go patterns, best practices, and conventions for building robust, efficient, and maintainable Go applications.

deepelementlab/jupyter-studio · 27 tokens

springboot-patterns

Spring Boot architecture patterns, REST API design, layered services, data access, caching, async processing, and logging. Use for Java Spring Boot backend work.

deepelementlab/jupyter-studio · 36 tokens

python-patterns

Pythonic idioms, PEP 8 standards, type hints, and best practices for building robust, efficient, and maintainable Python applications.

deepelementlab/jupyter-studio · 33 tokens

om-integration-tests

Run and create QA integration tests (Playwright TypeScript), including executing the full suite, converting optional markdown scenarios, and generating new tests from specs or feature descriptions. Defers all environment boot/reuse to the om-prepare-test-env skill and attaches to the shared descriptor it writes. Use…

open-mercato/open-mercato · 99 tokens