TypeScript Coder
БесплатноБез исполняемых скриптовНе проверенExpert 10x engineer with extensive knowledge of TypeScript fundamentals, migration strategies, and best practices. Use when asked to "add TypeScript"…
от 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.jsonfor a project - Working with
.ts,.tsx,.mts, or.d.tsfiles - 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
typescriptpackage (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 guardts-coder migrate this filets-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:
Install TypeScript as a dev dependency:
npm install --save-dev typescriptInstall type definitions for Node.js (if using Node.js):
npm install --save-dev @types/nodeInitialize TypeScript configuration:
npx tsc --initConfigure
tsconfig.jsonfor 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"] }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:
- Enable TypeScript to process JavaScript files:
{ "compilerOptions": { "allowJs": true,
Установить 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), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic