typescript-magician
Designs complex generic types, refactors `any` types to strict alternatives, creates type guards and utility types, and resolves TypeScript compiler errors.
Skill by mcollina
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/mcollina-typescript-magician
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: ml
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/typescript-magician
What's inside
- Skill 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`.
- License
- MIT
- Metadata
- tags: typescript, types, generics, type-safety, advanced-typescript
- Instructions
- 112 lines in SKILL.md · view on GitHub
Before installing
- Instructions call the network
Files (16)
- SKILL.md
- array-index-access.md · rules/
- as-const-typeof.md · rules/
- builder-pattern.md · rules/
- conditional-types.md · rules/
- deep-inference.md · rules/
- error-diagnosis.md · rules/
- function-overloads.md · rules/
- generics-basics.md · rules/
- infer-keyword.md · rules/
- mapped-types.md · rules/
- opaque-types.md · rules/
- template-literal-types.md · rules/
- type-narrowing.md · rules/
- utility-types.md · rules/
- tile.json
SKILL.md (first lines)
## When to use
Use this skill for:
- TypeScript errors and type challenges
- Eliminating `any` types from codebases
- Complex generics and type inference issues
- When strict typing is needed
## Instructions
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:
- Advanced generics and conditional types
- Template literal types and mapped types
- Utility types and type manipulation
- Brand types and nominal typing
- Complex inference patterns
- Variance and distribution rules
- Module augmentation and declaration merging
For every TypeScript challenge:
- Explain the type theory behind the problem
- Provide multiple solution approaches when applicable
- Show before/after type representations
- Include comprehensive type tests
- Ensure full IntelliSense support
## Quick Examples
### Eliminating `any` with generics
**Before**
```ts
function getProperty(obj: any, key: string): any {
return obj[key];
}
```
**After**
```ts
function getProperty<T, K extends keyof T>(obj: T, key: K): T[K] {
return obj[key];
}
// getProperty({ name: "Alice" }, "name") → inferred as string ✓
```
### Narrowing an unknown API response
**Before**
```ts
async function fetchUser(): Promise<any> {
const res = await fetch("/api/user");
return res.json();
}
```
**After**
```ts
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;
}
```
## Reference
Read individual rule files for detailed explanations and code examples:
### Core Patterns
- [rules/as-const-typeof.md](rules/as-const-typeof.md) - Deriving types from runtime values using `as const` and `typeof`
- [rules/array-index-access.md](rules/array-index-access.md) - Accessing array element types using `[number]` indexing
- [rules/utility-types.md](rules/utility-types.md) - Built-in utility types: Parameters, ReturnType, Awaited, Omit, Partial, Record
### Advanced Generics
- [rules/generics-basics.md](rules/generics-basics.md) - Fundamentals of generic types, constraints, and inference
- [rules/builder-pattern.md](rules/builder-pattern.md) - Type-safe builder pattern with chainable methods
- [rules/deep-inference.md](rules/deep-inference.md) - Achieving deep type inference with F.Narrow and const type parameters
### Type-Level Programming
- [rules/conditional-types.md](rules/conditional-types.md) - Conditional types for type-level if/else logic
- [rules/infer-keyword.md](rules/infer-keyword.md) - Using `infer` to extract types within conditional types
- [rules/template-literal-types.md](rules/template-literal-types.md) - String manipulation at the type level
- [rules/mapped-types.md](rules/mapped-types.md) - Creating new types by transforming existing type properties
### Type Safety Patterns
- [rules/opaque-types.md](rules/opaque-types.md) - Brand types and opaque types for type-safe identifiers
- [rules/type-narrowing.md](rules/type-narrowing.md) - Narrowing types through control flow analysis
- [rules/function-overloads.md](rules/function-overloads.md) - Using function overloads for complex function signatures
### Debugging
- [rules/error-diagnosis.md](rules/error-diagnosis.md) - Strategies for diagnosing and understanding TypeScript type errorsFrom mcollina/skills, MIT.
More from mcollina/skills
- 0.830score
octocat
mcollina
Use this skill whenever the prompt contains any `github.com` URL, even if the user only pastes a link and gives no GitHub-specific keywords.
SkillAFreshness: A★ 2KClaude Code +9 - 0.784score
nodejs-core
mcollina
Contributes to and debugs Node.js core, including nodejs/node commit and PR tone, contribution workflows, native crashes, V8 performance, node-gyp builds…
SkillBFreshness: B★ 2KClaude Code +9 - 0.779score
fastify-best-practices
mcollina
Guides development of Fastify Node.js backend servers and REST APIs using TypeScript or JavaScript.
SkillBFreshness: B★ 2KClaude Code +9 - 0.652score
skill-optimizer
mcollina
Optimizes AI skills for activation, clarity, and cross-model reliability.
SkillDFreshness: D★ 2KClaude Code +9 - 0.652score
documentation
mcollina
Creates, structures, and reviews technical documentation following the Diátaxis framework (tutorials, how-to guides, reference, and explanation pages).
SkillDFreshness: D★ 2KClaude Code +9 - 0.652score
node
mcollina
Provides domain-specific best practices for Node.js development with TypeScript, covering type stripping, async patterns, error handling, streams, modules…
SkillDFreshness: D★ 2KClaude Code +9 - 0.652score
init
mcollina
Creates, updates, or optimizes an AGENTS.md file for a repository with minimal, high-signal instructions covering non-discoverable coding conventions, tooling…
SkillDFreshness: D★ 2KClaude Code +9 - 0.652score
oauth
mcollina
Implements OAuth 2.0/2.1 authorization flows in Fastify applications — configures authorization code with PKCE, client credentials, device flow, refresh token…
SkillDFreshness: D★ 2KClaude Code +9 - 0.652score
snipgrapher
mcollina
Configures and uses snipgrapher to generate polished code snippet images, including syntax-highlighted PNGs, SVGs, and WebP exports with custom themes…
SkillDFreshness: D★ 2KClaude Code +9 - 0.652score
linting-neostandard-eslint9
mcollina
Configures ESLint v9 flat config and neostandard for JavaScript and TypeScript projects, including migrating from legacy `.eslintrc*` files or the `standard`…
SkillDFreshness: D★ 2KClaude Code +9 - 0.455score
AGENTS.md · mcollina/skills
mcollina
AGENTS.md from mcollina/skills: 72 lines covering What this repository is, High-level architecture, Common commands, Editing rules for this repo and more.
TemplateDFreshness: D★ 2KCodex +5
Signals
- Stars
- 1,959
- Forks
- 147
- Open issues
- 5
- Last commit (this folder)
- Mar 13, 2026 (7 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/mcollina/skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from mcollina
- 0.830score
octocat
mcollina
Use this skill whenever the prompt contains any `github.com` URL, even if the user only pastes a link and gives no GitHub-specific keywords.
SkillAFreshness: A★ 2KClaude Code +9 - 0.784score
nodejs-core
mcollina
Contributes to and debugs Node.js core, including nodejs/node commit and PR tone, contribution workflows, native crashes, V8 performance, node-gyp builds…
SkillBFreshness: B★ 2KClaude Code +9 - 0.779score
fastify-best-practices
mcollina
Guides development of Fastify Node.js backend servers and REST APIs using TypeScript or JavaScript.
SkillBFreshness: B★ 2KClaude Code +9 - 0.652score
skill-optimizer
mcollina
Optimizes AI skills for activation, clarity, and cross-model reliability.
SkillDFreshness: D★ 2KClaude Code +9 - 0.652score
documentation
mcollina
Creates, structures, and reviews technical documentation following the Diátaxis framework (tutorials, how-to guides, reference, and explanation pages).
SkillDFreshness: D★ 2KClaude Code +9 - 0.652score
node
mcollina
Provides domain-specific best practices for Node.js development with TypeScript, covering type stripping, async patterns, error handling, streams, modules…
SkillDFreshness: D★ 2KClaude Code +9
Cite this page
typescript-magician skill. Agent Mart. https://agentmart.dev/skills/mcollina-typescript-magician (last updated 2026-10-24)