typescript-expert

sickn33/antigravity-awesome-skills · updated Apr 28, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill typescript-expert
0 commentsdiscussion
summary

Advanced TypeScript expertise covering type systems, performance optimization, monorepo patterns, and modern tooling.

  • Diagnoses and resolves complex type errors, circular dependencies, and performance bottlenecks with systematic debugging approaches
  • Guides migrations from JavaScript to TypeScript, ESM/CJS transitions, and tool upgrades (ESLint to Biome, Lerna to Nx/Turborepo)
  • Provides type-level programming patterns including branded types, conditional types, and inference techniques
skill.md

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:

  1. 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."

  2. Analyze project setup comprehensively:

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

    # 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
  3. Identify the specific problem category and complexity level

  4. Apply the appropriate solution strategy from my expertise

  5. Validate thoroughly:

    # 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

// 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) { }

Advanced Conditional Types

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

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

# 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 type intersections with interfaces
# 2. Split large union types (>100 members)
# 3. Avoid circular generic constraints
# 4. Use type aliases to break recursion

Build Performance Patterns

  • Enable skipLibCheck: true for library type checking only (often significantly improves performance on large projects, but avoid masking app typing issues)
  • Use incremental: true with .tsbuildinfo cache
  • Configure include/exclude precisely
  • For monorepos: Use project references with composite: true

Real-World Problem Resolution

Complex Error Patterns

"The inferred type of X cannot be named"

Missing type declarations

  • Quick fix with ambient declarations:
// types/ambient.d.ts
declare module 'some-untyped-package' {
  const value: unknown;
  export default value;
  export = value; // if CJS interop is needed
}

"Excessive stack depth comparing types"

  • Cause: Circular or deeply recursive types
  • Fix priority:
    1. Limit recursion depth with conditional types
    2. Use interface extends instead of type intersection
    3. Simplify generic constraints
// Bad: Infinite recursion
type InfiniteArray<T> = T | InfiniteArray<T>[];

// Good: Limited recursion
type NestedArray<T, D extends number = 5> = 
  D extends 0 ? T : T | NestedArray<T, [-1, 0, 1, 2, 3, 4][D]>[];

Module Resolution Mysteries

  • "Cannot find module" despite file existing:
    1. Check moduleResolution matches your bundler
    2. Verify baseUrl and paths alignment
    3. For monorepos: Ensure workspace protocol (workspace:*)
    4. Try clearing cache: rm -rf node_modules/.cache .tsbuildinfo

Path Mapping at Runtime

  • TypeScript paths only work at compile time, not runtime
  • Node.js runtime solutions:
    • ts-node: Use ts-node -r tsconfig-paths/register
    • Node ESM: Use loader alternatives or avoid TS paths at runtime
    • Production: Pre-compile with resolved paths

Migration Expertise

JavaScript to TypeScript Migration

# Incremental migration strategy
# 1. Enable allowJs and checkJs (merge into existing tsconfig.json):
# Add to existing tsconfig.json:
# {
#   "compilerOptions": {
#     "allowJs": true,
#     "checkJs": true
#   }
# }

# 2. Rename files gradually (.js → .ts)
# 3. Add types file by file using AI assistance
# 4. Enable strict mode features one by one

# Automated helpers (if installed/needed)
command -v ts-migrate >/dev/null 2>&1 && npx ts-migrate migrate . --sources 'src/**/*.js'
command -v typesync >/dev/null 2>&1
how to use typescript-expert

How to use typescript-expert on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add typescript-expert
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill typescript-expert

The skills CLI fetches typescript-expert from GitHub repository sickn33/antigravity-awesome-skills and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/typescript-expert

Reload or restart Cursor to activate typescript-expert. Access the skill through slash commands (e.g., /typescript-expert) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

Task Automation & Efficiency

Automate repetitive workflows and reduce manual effort

Example

Generate reports, summarize documents, draft communications

Save 3-5 hours per week on routine tasks

Knowledge Enhancement

Learn new skills, understand complex topics, get expert guidance

Example

Explain concepts, provide examples, suggest learning resources

Accelerate learning and skill development by 2x

Quality Improvement

Enhance output quality through reviews, suggestions, and refinements

Example

Review drafts, suggest improvements, catch errors

Improve work quality by 30-40% with less effort

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client with skill support
  • Clear understanding of task or problem to solve
  • Willingness to iterate and refine outputs

Time Estimate

15-45 minutes depending on use case complexity

Installation Steps

  1. 1.Install skill using provided installation command
  2. 2.Test with simple use case relevant to your work
  3. 3.Evaluate output quality and relevance
  4. 4.Iterate on prompts to improve results
  5. 5.Integrate into regular workflow if valuable

Common Pitfalls

  • Expecting perfect results without iteration
  • Not providing enough context in prompts
  • Using skill for tasks outside its intended scope
  • Accepting outputs without review and validation

Best Practices

✓ Do

  • +Start with clear, specific prompts
  • +Provide relevant context and constraints
  • +Review and refine all outputs before using
  • +Iterate to improve output quality
  • +Document successful prompt patterns

✗ Don't

  • Don't use without understanding skill limitations
  • Don't skip validation of outputs
  • Don't share sensitive information in prompts
  • Don't expect skill to replace human judgment

💡 Pro Tips

  • Be specific about desired format and style
  • Ask for multiple options to choose from
  • Request explanations to understand reasoning
  • Combine AI efficiency with human expertise

When to Use This

✓ Use When

Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.

✗ Avoid When

Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.

Learning Path

  1. 1Familiarize yourself with skill capabilities and limitations
  2. 2Start with low-risk, non-critical tasks
  3. 3Progress to more complex and valuable use cases
  4. 4Build expertise through regular use and experimentation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.775 reviews
  • Pratham Ware· Dec 24, 2024

    typescript-expert is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Ava Choi· Dec 16, 2024

    We added typescript-expert from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Ava Park· Dec 8, 2024

    I recommend typescript-expert for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Sakura Smith· Dec 4, 2024

    typescript-expert reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Valentina Okafor· Dec 4, 2024

    Useful defaults in typescript-expert — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Meera Sanchez· Dec 4, 2024

    Keeps context tight: typescript-expert is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Ava Agarwal· Nov 27, 2024

    Keeps context tight: typescript-expert is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Ren Smith· Nov 23, 2024

    Registry listing for typescript-expert matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Valentina Wang· Nov 23, 2024

    We added typescript-expert from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Valentina Perez· Nov 23, 2024

    I recommend typescript-expert for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

showing 1-10 of 75

1 / 8