writing-typescript — скилл для Claude Code: что делает, установка
Скилл writing-typescript задаёт идиоматичный стиль TypeScript для сервисов Node.js, React-приложений и обсуждения TS-паттернов. Поддерживает строгую типизацию и современный toolchain.
MIT 111 установок ★ 17 обновлён 2026-10-14
npx skills add julianobarbosa/claude-code-skills --skill writing-typescript -a claude-codeЧто делает writing-typescript
writing-typescript задаёт правила для TypeScript-кода: строгая типизация, unknown вместо any, разбор непроверенных данных на границах системы и композиция небольших функций вместо наследования. Он пригодится при разработке сервисов Node.js, React-приложений и при обсуждении паттернов TypeScript.
В скилле есть примеры type guards, discriminated unions и utility types, а также настройки tsconfig.json для строгого режима. Он ориентируется на bun, vite, vitest, eslint и prettier; команды проекта включают bun install, bun run build, bun test, bun run lint и bun run format.
Есть отдельные подсказки по import type, as const, satisfies, Array<T>.includes и наследованию настроек compilerOptions.paths. Если оставить strictNullChecks: false, типы перестают честно описывать null и undefined.
Какие задачи решает
- писать TypeScript с включёнными строгими проверками
- разбирать непроверенные данные на границах приложения
- выбирать между
as,satisfiesиas const - настраивать
tsconfig.jsonдля сборки и проверок - строить типы через объединения и utility types
Примеры запросов агенту
- Напиши сервис Node.js на TypeScript со строгой типизацией и компози несколькими небольшими функциями.
- Проверь
tsconfig.jsonи предложи настройки для строгого режима TypeScript. - Разбери этот тип с помощью discriminated union и покажи безопасную обработку результата.
Как установить writing-typescript
1Через Skills CLI (Vercel)
npx skills add julianobarbosa/claude-code-skills --skill writing-typescript -a claude-code2Вручную: положить файлы
~/.claude/skills/writing-typescript/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/writing-typescript/
1Через Skills CLI (Vercel)
npx skills add julianobarbosa/claude-code-skills --skill writing-typescript -a codex2Вручную: положить файлы
.agents/skills/writing-typescript/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add julianobarbosa/claude-code-skills --skill writing-typescript -a cursor2Вручную: положить файлы
.cursor/skills/writing-typescript/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install julianobarbosa/claude-code-skills skills/writing-typescript2Вручную: положить файлы
.github/skills/writing-typescript/SKILL.md1Через Skills CLI (Vercel)
npx skills add julianobarbosa/claude-code-skills --skill writing-typescript -a gemini-cli2Командой платформы
gemini skills install https://github.com/julianobarbosa/claude-code-skills --path skills/writing-typescriptВручную: положить файлы
.devin/skills/writing-typescript/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add julianobarbosa/claude-code-skills --skill writing-typescript -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о writing-typescript
Как установить writing-typescript в Claude Code?
Выполните npx skills add julianobarbosa/claude-code-skills --skill writing-typescript -a claude-code, затем проверьте файл ~/.claude/skills/writing-typescript/SKILL.md.
Что делает writing-typescript?
Скилл задаёт правила идиоматичной разработки на TypeScript: строгие проверки, работу с непроверенными данными, композицию функций и типовые паттерны. Он также подсказывает настройки tsconfig.json и команды для bun, vitest, eslint и prettier.
Какие TypeScript-настройки разбирает скилл?
Среди них strict: true, noUncheckedIndexedAccess, exactOptionalPropertyTypes, noImplicitReturns, isolatedModules, а также target: ES2022 и moduleResolution: bundler.
Исходный текст
SKILL.md · MIT
---
name: writing-typescript
description: Idiomatic TypeScript development. Use when writing TypeScript code, Node.js services, React apps, or discussing TS patterns. Emphasizes strict typing, composition, and modern tooling (bun/vite).
allowed-tools: Read, Bash, Grep, Glob
---
# TypeScript Development (2025)
## Core Principles
- **Strict typing**: Enable all strict checks
- **Parse, don't validate**: Transform untrusted data at boundaries
- **Composition over inheritance**: Small, focused functions
- **Explicit over implicit**: No `any`, prefer `unknown`
## Toolchain
```bash
bun # Runtime + package manager (fast)
vite # Frontend bundling
vitest # Testing
eslint # Linting
prettier # Formatting
```
## Quick Patterns
### Type Guards
```typescript
function isUser(value: unknown): value is User {
return typeof value === "object" && value !== null && "id" in value;
}
```
### Discriminated Unions
```typescript
type Result<T, E = Error> = { ok: true; value: T } | { ok: false; error: E };
function processResult<T>(result: Result<T>): T {
if (result.ok) return result.value;
throw result.error;
}
```
### Utility Types
```typescript
type UserUpdate = Partial<User>;
type UserSummary = Pick<User, "id" | "name">;
type UserWithoutPassword = Omit<User, "password">;
type ReadonlyUser = Readonly<User>;
```
## tsconfig.json Essentials
```json
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"noImplicitReturns": true,
"isolatedModules": true
}
}
```
## References
- [PATTERNS.md](PATTERNS.md) - Code patterns and style
- [REACT.md](REACT.md) - React component patterns
- [TESTING.md](TESTING.md) - Testing with vitest
## Commands
```bash
bun install # Install deps
bun run build # Build
bun test # Test
bun run lint # Lint
bun run format # Format
```
---
## Gotchas
- **`import type` with `verbatimModuleSyntax` and named exports**: type-only import of a value triggers errors. Fix: `import { type Foo } from "mod"` (inline marker).
- **`as const` on object: readonly AND literal-narrowed** — different from `as Foo` (asserts type) or `satisfies Foo` (validates without widening).
- **`satisfies` validates without widening; `as` widens** — using `as` where you wanted `satisfies` loses literal types silently.
- **`Array<T>.includes(x)` requires `x` to be of type `T`** — narrowing-from-union doesn't work; the standard fix is a type-predicate helper.
- **`strictNullChecks: false` makes `T` mean `T | null | undefined` for ALL types** — partial migrations leave types that lie about nullability.
- **`tsconfig.json` `extends` doesn't recursively merge `compilerOptions.paths`** — child paths REPLACE parent paths, not merge.
© julianobarbosa · MIT · julianobarbosa/claude-code-skills