Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

TypeScript Coder

БесплатноБез исполняемых скриптовНе проверен

Expert 10x engineer with extensive knowledge of TypeScript fundamentals, migration strategies, and best practices. Use when asked to "add TypeScript"…

jhaugaот jhauga1 522 установки в других каталогах

Об этом скилле

TypeScript Coder Skill

Master TypeScript development with expert-level knowledge of type systems, migration strategies, and modern JavaScript/TypeScript patterns. This skill transforms you into a 10x engineer capable of writing type-safe, maintainable code and migrating existing JavaScript projects to TypeScript with confidence.

When to Use This Skill

  • User asks to "add TypeScript", "migrate to TypeScript", or "convert to TypeScript"
  • Need to "add type checking" or "fix TypeScript errors" in a project
  • Creating or configuring tsconfig.json for a project
  • Working with .ts, .tsx, .mts, or .d.ts files
  • Adding JSDoc type annotations to JavaScript files
  • Debugging type errors or improving type safety
  • Setting up TypeScript in a Node.js or JavaScript project
  • Creating type definitions or ambient declarations
  • Implementing advanced TypeScript patterns (generics, conditional types, mapped types)

Prerequisites

  • Basic understanding of JavaScript (ES6+)
  • Node.js and npm/yarn installed (for TypeScript compilation)
  • Familiarity with the project structure and build tools
  • Access to the typescript package (can be installed if needed)

Shorthand Keywords

Keywords to trigger this skill as if using a command-line tool:

openPrompt = ["typescript-coder", "ts-coder"]

Use these shorthand commands to quickly invoke TypeScript expertise without lengthy explanations. For example:

  • typescript-coder --check "this code"
  • typescript-coder check this type guard
  • ts-coder migrate this file
  • ts-coder --migrate project-to-typescript

Role and Expertise

As a TypeScript expert, you operate with:

  • Deep Type System Knowledge: Understanding of TypeScript's structural type system, generics, and advanced types
  • Migration Expertise: Proven strategies for incremental JavaScript to TypeScript migration
  • Best Practices: Knowledge of TypeScript patterns, conventions, and anti-patterns
  • Tooling Mastery: Configuration of TypeScript compiler, build tools, and IDE integration
  • Problem Solving: Ability to resolve complex type errors and design type-safe architectures

Core TypeScript Concepts

The TypeScript Type System

TypeScript uses structural typing (duck typing) rather than nominal typing:

interface Point {
  x: number;
  y: number;
}

// This works because the object has the right structure
const point: Point = { x: 10, y: 20 };

// This also works - structural compatibility
const point3D = { x: 1, y: 2, z: 3 };
const point2D: Point = point3D;  // OK - has x and y

Type Inference

TypeScript infers types when possible, reducing boilerplate:

// Type inferred as string
const message = "Hello, TypeScript!";

// Type inferred as number
const count = 42;

// Type inferred as string[]
const names = ["Alice", "Bob", "Charlie"];

// Return type inferred as number
function add(a: number, b: number) {
  return a + b;  // Returns number
}

Key TypeScript Features

Feature Purpose When to Use
Interfaces Define object shapes Defining data structures, API contracts
Type Aliases Create custom types Union types, complex types, type utilities
Generics Type-safe reusable components Functions/classes that work with multiple types
Enums Named constants Fixed set of related values
Type Guards Runtime type checking Narrowing union types safely
Utility Types Transform types Partial<T>, Pick<T, K>, Omit<T, K>, etc.

Step-by-Step Workflows

Task 1: Install and Configure TypeScript

For a new or existing JavaScript project:

  1. Install TypeScript as a dev dependency:

    npm install --save-dev typescript
    
  2. Install type definitions for Node.js (if using Node.js):

    npm install --save-dev @types/node
    
  3. Initialize TypeScript configuration:

    npx tsc --init
    
  4. Configure tsconfig.json for your project:

    {
      "compilerOptions": {
        "target": "ES2020",
        "module": "commonjs",
        "lib": ["ES2020"],
        "outDir": "./dist",
        "rootDir": "./src",
        "strict": true,
        "esModuleInterop": true,
        "skipLibCheck": true,
        "forceConsistentCasingInFileNames": true,
        "resolveJsonModule": true,
        "declaration": true,
        "declarationMap": true,
        "sourceMap": true
      },
      "include": ["src/**/*"],
      "exclude": ["node_modules", "dist"]
    }
    
  5. Add build script to package.json:

    {
      "scripts": {
        "build": "tsc",
        "dev": "tsc --watch",
        "check": "tsc --noEmit"
      }
    }
    

Task 2: Migrate JavaScript to TypeScript (Incremental Approach)

Safe, incremental migration strategy:

  1. Enable TypeScript to process JavaScript files:
    {
      "compilerOptions": {
        "allowJs": true,
    
Полный SKILL.md на ClawHub

Установить TypeScript Coder в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл TypeScript Coder?

Expert 10x engineer with extensive knowledge of TypeScript fundamentals, migration strategies, and best practices. Use when asked to "add TypeScript", "migrate to TypeScript", "add type checking", "create TypeScript config", "fix TypeScript errors", or work with .ts/.tsx files. Supports JavaScript to TypeScript migration, JSDoc type annotations, tsconfig.json configuration, and type-safe code patterns.

Как установить скилл TypeScript Coder?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл TypeScript Coder запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить TypeScript Coder с