writing-typescript — Claude Code skill: what it does, install
writing-typescript — a TypeScript skill for Node.js services, React apps, and TS pattern discussions. It favors strict typing, composition, and a toolchain built around bun and vite.
MIT 111 installs ★ 17 updated 2026-10-14
npx skills add julianobarbosa/claude-code-skills --skill writing-typescript -a claude-codeWhat writing-typescript does
writing-typescript gives the agent a clear style for TypeScript work: keep compiler checks strict, use unknown for data that has not been trusted, parse values at system boundaries, and favor small composed functions over inheritance. It applies to Node.js services, React applications, and TypeScript design questions.
The skill includes examples for type guards, discriminated unions, and utility types. It also covers a strict tsconfig.json setup and a workflow using bun, vite, vitest, eslint, and prettier, with commands such as bun install, bun run build, bun test, bun run lint, and bun run format.
Its gotchas cover import type, as const, satisfies, Array<T>.includes, and how compilerOptions.paths behave through tsconfig.json inheritance. Leaving strictNullChecks: false makes type declarations misleading around null and undefined.
What it helps with
- write TypeScript with strict compiler checks
- parse untrusted values at application boundaries
- choose between
as,satisfies, andas const - set up
tsconfig.jsonfor builds and checks - model results with unions and utility types
Example prompts for the agent
- Write a Node.js service in TypeScript with strict typing and small composed functions.
- Inspect
tsconfig.jsonand suggest a strict TypeScript configuration. - Refactor this result type into a discriminated union and handle both outcomes safely.
How to install writing-typescript
1Skills CLI (Vercel)
npx skills add julianobarbosa/claude-code-skills --skill writing-typescript -a claude-code2Manually: put the files in place
~/.claude/skills/writing-typescript/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/writing-typescript/
1Skills CLI (Vercel)
npx skills add julianobarbosa/claude-code-skills --skill writing-typescript -a codex2Manually: put the files in place
.agents/skills/writing-typescript/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add julianobarbosa/claude-code-skills --skill writing-typescript -a cursor2Manually: put the files in place
.cursor/skills/writing-typescript/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install julianobarbosa/claude-code-skills skills/writing-typescript2Manually: put the files in place
.github/skills/writing-typescript/SKILL.md1Skills CLI (Vercel)
npx skills add julianobarbosa/claude-code-skills --skill writing-typescript -a gemini-cli2Platform CLI
gemini skills install https://github.com/julianobarbosa/claude-code-skills --path skills/writing-typescriptManually: put the files in place
.devin/skills/writing-typescript/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add julianobarbosa/claude-code-skills --skill writing-typescript -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about writing-typescript
How do I install writing-typescript in Claude Code?
Run npx skills add julianobarbosa/claude-code-skills --skill writing-typescript -a claude-code, then check ~/.claude/skills/writing-typescript/SKILL.md.
What does writing-typescript do?
It guides TypeScript work with strict checks, boundary parsing, composition, and common type patterns. It also provides tsconfig.json guidance plus commands for bun, vitest, eslint, and prettier.
Which TypeScript settings does the skill cover?
It covers strict: true, noUncheckedIndexedAccess, exactOptionalPropertyTypes, noImplicitReturns, isolatedModules, along with target: ES2022 and moduleResolution: bundler.
Source text
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