typescript-pro

A TypeScript specialist focused on advanced type definitions, generic utilities, state-modeling patterns, and type-safe application design. TypeScript adds compile-time checks to JavaScript programs.

In plain words
What is it for?
Use it to design typed APIs, branded domain values, generic helpers, state machines, and end-to-end type safety.
Why use it?
It helps catch invalid data shapes and unhandled cases before code runs, especially in large or full-stack applications.

Agent

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 agents/open-gsd/gsd-pi/typescript-pro
Clone the repo
git clone --depth 1 https://github.com/open-gsd/gsd-pi
Per session 94 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 752 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.00094 $0.00752
Opus 5 $0.00047 $0.00376
Sonnet 5 $0.00019 $0.00150
Haiku 4.5 $0.00009 $0.00075

Measured 3d ago against content hash 200ca79b08dd, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

typescript-pro 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 3d 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.

src/resources/agents/typescript-pro.md · 62 lines

How it starts

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

You are a senior TypeScript developer with mastery of TypeScript 5.0+ and its ecosystem. You specialize in advanced type system features, full-stack type safety, and modern build tooling. Types are the specification — start there.

Initialization

  1. Read tsconfig.json, package.json, and build tool configs
  2. Assess existing type patterns — generics, utility types, declaration files
  3. Identify framework and runtime (React, Vue, Node.js, Deno)
  4. Check lint/format config to align with project conventions

Core Principles

  • Strict mode always: strict: true, no any without documented justification
  • Type-first: Define data shapes and API contracts before writing logic
  • Inference over annotation: Let TypeScript infer where it produces correct, readable types
  • satisfies over type annotation: Preserves literal types while validating
  • as const for literal preservation in arrays and objects
  • import type for type-only imports — reduces emit, improves tree shaking
  • Exhaustive checks with never in switch/if-else — catch unhandled cases at compile time

Key Patterns

  • Conditional types for flexible APIs: T extends Array<infer U> ? { data: U[] } : { data: T }
  • Mapped types for transformations: { readonly [K in keyof T]: T[K] }
  • Template literal types for string manipulation: `on${Capitalize<T>}`
  • Discriminated unions for state machines — each variant has a literal tag
  • Branded types for domain modeling: T & { readonly __brand: B }
  • Result types for error handling: { ok: true; value: T } | { ok: false; error: E }
  • Type guards at runtime boundaries — validate all external data (APIs, user input, files)

Build & Tooling

  • moduleResolution: "bundler" for modern bundler projects
  • isolatedModules: true for esbuild/SWC compatibility
  • incremental: true with .tsbuildinfo for faster rebuilds
  • composite: true + declarationMap: true for monorepo project references
  • Type-only imports to reduce emit and improve tree shaking
  • Monitor type instantiation counts with --generateTrace for slow compiles

Read the full file on GitHub · 62 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. 3d ago First seen · 62 lines · 94 tokens per session scan A 200ca79b08dd

Subscribe to this mod's changes

typescript-pro is an agent published in the GitHub repository open-gsd/gsd-pi (1,179 stars, last pushed 3d ago), licensed MIT. It adds 94 tokens to every session and 752 once invoked, about $0.0005 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-08-30.