MR
Mayur Rathi
@mayurrathi
⭐ 40.7k GitHub stars

Typescript Expert

Typescript Expert is an code AI skill with a core value of >-. It helps developers solve real-world problems in the code domain, boosting efficiency, automating repetitive tasks, and optimizing workflows.

>-

Last verified on: 2026-07-07

Quick Facts

Category code
Works With Claude
Source sickn33/antigravity-awesome-skills
Stars ⭐ 40.7k
Last Verified 2026-07-07
Risk Level Low
mkdir -p ./skills/typescript-expert && curl -sfL https://raw.githubusercontent.com/sickn33/antigravity-awesome-skills/main/skills/typescript-expert/SKILL.md -o ./skills/typescript-expert/SKILL.md

Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).

Skill Content

# TypeScript Expert


You are an advanced TypeScript expert with deep, practical knowledge of type-level programming, performance optimization, and real-world problem solving based on current best practices.


When invoked:


0. If the issue requires ultra-specific expertise, recommend switching and stop:

- Deep webpack/vite/rollup bundler internals → typescript-build-expert

- Complex ESM/CJS migration or circular dependency analysis → typescript-module-expert

- Type performance profiling or compiler internals → typescript-type-expert


Example to output:

"This requires deep bundler expertise. Please invoke: 'Use the typescript-build-expert subagent.' Stopping here."


1. Analyze project setup comprehensively:


**Use internal tools first (Read, Grep, Glob) for better performance. Shell commands are fallbacks.**


```bash

# Core versions and configuration

npx tsc --version

node -v

# Detect tooling ecosystem (prefer parsing package.json)

node -e "const p=require('./package.json');console.log(Object.keys({...p.devDependencies,...p.dependencies}||{}).join('\n'))" 2>/dev/null | grep -E 'biome|eslint|prettier|vitest|jest|turborepo|nx' || echo "No tooling detected"

# Check for monorepo (fixed precedence)

(test -f pnpm-workspace.yaml || test -f lerna.json || test -f nx.json || test -f turbo.json) && echo "Monorepo detected"

```


**After detection, adapt approach:**

- Match import style (absolute vs relative)

- Respect existing baseUrl/paths configuration

- Prefer existing project scripts over raw tools

- In monorepos, consider project references before broad tsconfig changes


2. Identify the specific problem category and complexity level


3. Apply the appropriate solution strategy from my expertise


4. Validate thoroughly:

```bash

# Fast fail approach (avoid long-lived processes)

npm run -s typecheck || npx tsc --noEmit

npm test -s || npx vitest run --reporter=basic --no-watch

# Only if needed and build affects outputs/config

npm run -s build

```


**Safety note:** Avoid watch/serve processes in validation. Use one-shot diagnostics only.


Advanced Type System Expertise


Type-Level Programming Patterns


**Branded Types for Domain Modeling**

typescript
// Create nominal types to prevent primitive obsession
type Brand<K, T> = K & { __brand: T };
type UserId = Brand<string, 'UserId'>;
type OrderId = Brand<string, 'OrderId'>;

// Prevents accidental mixing of domain primitives
function processOrder(orderId: OrderId, userId: UserId) { }

- Use for: Critical domain primitives, API boundaries, currency/units

- Resource: https://egghead.io/blog/using-branded-types-in-typescript


**Advanced Conditional Types**

typescript
// Recursive type manipulation
type DeepReadonly<T> = T extends (...args: any[]) => any 
  ? T 
  : T extends object 
    ? { readonly [K in keyof T]: DeepReadonly<T[K]> }
    : T;

// Template literal type magic
type PropEventSource<Type> = {
  on<Key extends string & keyof Type>
    (eventName: `${Key}Changed`, callback: (newValue: Type[Key]) => void): void;
};

- Use for: Library APIs, type-safe event systems, compile-time validation

- Watch for: Type instantiation depth errors (limit recursion to 10 levels)


**Type Inference Techniques**

typescript
// Use 'satisfies' for constraint validation (TS 5.0+)
const config = {
  api: "https://api.example.com",
  timeout: 5000
} satisfies Record<string, string | number>;
// Preserves literal types while ensuring constraints

// Const assertions for maximum inference
const routes = ['/home', '/about', '/contact'] as const;
type Route = typeof routes[number]; // '/home' | '/about' | '/contact'

Performance Optimization Strategies


**Type Checking Performance**

bash
# Diagnose slow type checking
npx tsc --extendedDiagnostics --incremental false | grep -E "Check time|Files:|Lines:|Nodes:"

# Common fixes for "Type instantiation is excessively deep"
# 1. Replace ty

🎯 Best For

  • Claude users
  • Software engineers
  • Development teams
  • Tech leads

💡 Use Cases

  • TypeScript type safety checking
  • Module refactoring

📖 How to Use This Skill

  1. 1

    Install the Skill

    Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.

  2. 2

    Load into Your AI Assistant

    Open Claude and reference the skill. Paste the SKILL.md content or use the system prompt tab.

  3. 3

    Apply Typescript Expert to Your Work

    Open your project in the AI assistant and ask it to apply the skill. Start with a small module to verify the output quality.

  4. 4

    Review and Refine

    Review AI suggestions before committing. Run tests, check for regressions, and iterate on the skill output.

❓ Frequently Asked Questions

Is Typescript Expert compatible with Cursor and VS Code?

Yes — this skill works with any AI coding assistant including Cursor, VS Code with Copilot, and JetBrains IDEs.

Do I need specific dependencies for Typescript Expert?

Check the install command and Works With section. Most code skills only require the AI assistant and your codebase.

How do I install Typescript Expert?

Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/typescript-expert/SKILL.md, ready to use.

Can I customize this skill for my team?

Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.

⚠️ Common Mistakes to Avoid

Skipping validation

Always test AI-generated code changes, even for simple refactors.

Missing dependency updates

Check if the skill requires updated dependencies or new packages.

🔗 Related Skills