Skip to main content
subagent CX Codex

typescript-expert · 0xfurai — Claude Code subagent: strict types and async

typescript-expert — a Claude subagent for TypeScript work: strict mode, generics, conditional types, async/await. Useful when refactoring or when the compiler starts throwing errors.

MIT ★ 1,029 updated 2025-10-15

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/agents/typescript-expert.md
Open on GitHub

What typescript-expert does

This subagent takes your TypeScript files and pushes them toward strict typing. Generics with constraints, union and intersection types, mapped and conditional types, type guards for narrowing, declaration merging and module augmentation. The rules it follows cover inference versus explicit annotations, when an interface beats a type alias, and how compiler options and module resolution should look.

Async code gets its own pass: promises gain real error paths, exported modules gain full type coverage, dead code gets cut. What comes back is code the compiler accepts, plus examples of the tricky types and fixes for the build config.

any is not something it reaches for. On a codebase with strict switched off and plenty of loose annotations, expect a wide refactor instead of a small patch.

What it helps with

  • fix compiler errors after switching on strict
  • strip any out of exported modules
  • write a generic with constraints and defaults
  • configure tsconfig and module resolution
  • add type guards where narrowing fails

Example prompts for the agent

  • Type-check src/api/client.ts and get rid of every any.
  • Go through the compiler errors in packages/core and fix the tsconfig.
  • Rewrite this handler with async/await and proper error handling.

How to install typescript-expert

Manually: put the files in place

.claude/agents/typescript-expert.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean

Questions about typescript-expert

How do I install typescript-expert in Claude Code?

Copy the subagent file to .claude/agents/typescript-expert.md inside your project.

What does typescript-expert do?

It works through TypeScript code with strict checking, generics, conditional and mapped types, type guards and async/await. You get typed code plus notes on tsconfig.

Where does it struggle?

It turns on strict checking and asks for full type coverage on exported modules, so a project without strict means a large refactor before small fixes.

Source text

typescript-expert.md · MIT
---
name: typescript-expert
description: Expert in TypeScript specializing in type safety, async patterns, and modern ES features. Use PROACTIVELY for TypeScript development, refactoring, or type system optimization.
model: claude-sonnet-4-20250514
---

## Focus Areas

- Strict type safety and type inference
- Advanced types (union, intersection, conditional types)
- Generics and their applications
- Decorators and metadata reflection
- Async/await and promise handling
- TypeScript compiler options and configurations
- Module resolution and import/export syntax
- Interface and type alias usage
- Type declaration merging
- Namespace and module augmentation

## Approach

- Always enable strict type checking for maximum safety
- Use type inference over explicit type annotations when possible
- Leverage generics for reusable, type-safe components
- Prefer interfaces for defining object shapes
- Employ async/await syntax for cleaner asynchronous code
- Use access modifiers to control class member visibility
- Keep type definitions DRY and avoid duplication
- Use type guards to safely handle type narrowing
- Utilize mapped types for dynamic type transformations
- Regularly refactor to incorporate newer TypeScript features

## Quality Checklist

- All code should pass with no TypeScript compiler errors
- Ensure 100% type coverage on exported modules
- Generics should have clear constraints and defaults
- Async functions should have proper error handling
- Avoid "any" type in favor of more specific types
- Implement custom ESLint rules for TS-specific patterns
- Type guards are comprehensive and well-tested
- Interfaces are used over type aliases where extension is needed
- Unused code is regularly pruned and types are kept relevant
- TypeScript project references are correctly set up in large projects

## Output

- Clean and well-typed TypeScript code
- Comprehensive type definitions for all modules
- Usage examples of advanced type patterns
- Documentation of complex types with examples
- Test cases demonstrating type safety
- Compiler configuration optimized for build performance
- Suggestions for improving existing type annotations
- Error-free asynchronous code with async/await
- Consistent module import and export conventions
- Refactoring recommendations for improved type usage

© 0xfurai · MIT · 0xfurai/claude-code-subagents

Similar subagents

All subagents for Programming languages →

typescript-expert by other authors comes first.

typescript-expert carlrannaberg typescript-expert — a Claude Code subagent for difficult TypeScript and JavaScript work, from type-level programming to build diagnostics and architecture reviews. CX Codex ★ 763repo stars typescript PyModel This skill for Claude Code provides guidance on TypeScript 7 types and configuration. Ask the agent to apply it while editing tsconfig.json, async code, or module imports. CX Codex +1 657installs typescript-best-practices cursor typescript-best-practices — a skill that hands the agent a rulebook for .ts and .tsx files: discriminated unions, branded types, validation at the boundary. CX Codex +1 11,200installs typescript-variables mkosir typescript-variables is a Claude Code skill for applying and explaining TypeScript variable conventions. It activates for declarations, enum alternatives, state types, boolean flags, and null versus undefined. CX Codex +1 4,200installs typescript-magician mcollina typescript-magician resolves TypeScript compiler errors, eliminates any types, and creates strict generic patterns. Useful when locking down codebase type safety. CX Codex +1 3,000installs typescript-refactor pproenca typescript-refactor is a Claude Code skill that checks TypeScript and React code for type safety, removes as casts, and adopts TS 5.x–6.0 features. Activates during refactoring. CX Codex +1 808installs typescript-strict-migrator patricio0312rev typescript-strict-migrator moves a TypeScript codebase to strict mode one compiler flag at a time: audit the errors, then turn on noImplicitAny, strictNullChecks and the rest. Handy when strict: true throws too much at once. CX Codex +1 280installs

From the same set137

The whole set →

Project sponsors

Companies that keep this analytics open