documentation
Creates, structures, and reviews technical documentation following the Diátaxis framework (tutorials, how-to guides, reference, and explanation pages). Use…
Designs complex generic types, refactors `any` types to strict alternatives, creates type guards and utility types, and resolves TypeScript compiler errors. Use when the user asks about TypeScript (TS) types, generics, type inference, type guards, removing `any` types, strict
$ npx -y skills add mcollina/skills --skill typescript-magician --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/typescript-magicianContext preview
The summary Claude sees to decide when to auto-load this skill.
Designs complex generic types, refactors `any` types to strict alternatives, creates type guards and utility types, and resolves TypeScript compiler errors. Use when the user asks about TypeScript (TS) types, generics, type inference, type guards, removing `any` types, strict
name: typescript-magician description: Designs complex generic types, refactors `any` types to strict alternatives, creates type guards and utility types, and resolves TypeScript compiler errors. Use when the user asks about TypeScript (TS) types, generics, type inference, type guards, removing `any` types, strict typing, type errors, `infer`, `extends`, conditional types, mapped types, template literal types, branded/opaque types, or utility types like `Partial`, `Record`, `ReturnType`, and `Awaited`. metadata: tags: typescript, types, generics, type-safety, advanced-typescript
Use this skill for:
When invoked: 1. Run `tsc --noEmit` to capture the full error output before making changes 2. Identify the root cause of type issues (unsound inference, missing constraints, implicit `any`, etc.) 3. Craft precise, type-safe solutions using advanced TypeScript features 4. Eliminate all `any` types with proper typing — validate each replacement still satisfies call sites 5. Confirm the fix compiles cleanly with a second `tsc --noEmit` pass
Capabilities include:
For every TypeScript challenge:
**Before**
function getProperty(obj: any, key: string): any {
return obj[key];
}**After**
function getProperty<T, K extends keyof T>(obj: T, key: K): T[K] {
return obj[key];
}
// getProperty({ name: "Alice" }, "name") → inferred as string ✓**Before**
async function fetchUser(): Promise<any> {
const res = await fetch("/api/user");
return res.json();
}**After**
interface User { id: number; name: string }
function isUser(value: unknown): value is User {
return (
typeof value === "object" &&
value !== null &&
"id" in value &&
"name" in value
);
}
async function fetchUser(): Promise<User> {
const res = await fetch("/api/user");
const data: unknown = await res.json();
if (!isUser(data)) throw new Error("Invalid user shape");
return data;
}Read individual rule files for detailed explanations and code examples:
Repo: mcollina/skills
Creates, structures, and reviews technical documentation following the Diátaxis framework (tutorials, how-to guides, reference, and explanation pages). Use…
Guides development of Fastify Node.js backend servers and REST APIs using TypeScript or JavaScript. Use when building, configuring, or debugging a Fastify…
Creates, updates, or optimizes an AGENTS.md file for a repository with minimal, high-signal instructions covering non-discoverable coding conventions, tooling…
Configures ESLint v9 flat config and neostandard for JavaScript and TypeScript projects, including migrating from legacy `.eslintrc*` files or the `standard`…
Provides domain-specific best practices for Node.js development with TypeScript, covering type stripping, async patterns, error handling, streams, modules,…
Contributes to and debugs Node.js core, including nodejs/node commit and PR tone, contribution workflows, native crashes, V8 performance, node-gyp builds,…