T

typescript-magician

by @mcollinav
4.3(47)

TypeScriptに精通し、複雑なジェネリック型の設計や`any`型を厳密な型にリファクタリングする能力に優れ、コードの堅牢性と保守性を向上させます。

typescripttype-safetyadvanced-typescriptfrontend-developmentbackend-developmentGitHub
インストール方法
npx skills add mcollina/skills --skill typescript-magician
compare_arrows

Before / After 効果比較

1
使用前

大規模なTypeScriptプロジェクトでは、型定義の混乱や`any`型の乱用により、コードの保守が困難になります。型安全性の保証が不十分なため、実行時エラーが頻繁に発生し、開発効率とプロジェクトの品質に影響を与えます。

使用後

このスキルを適用することで、複雑なジェネリクスを設計し、`any`型を厳密な代替案にリファクタリングできます。これにより、コードの型安全性と保守性が大幅に向上し、実行時エラーが減少し、開発プロセスが加速します。

SKILL.md

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

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 ✓

Narrowing an unknown API response

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;
}

Reference

Read individual rule files for detailed explanations and code examples:

Core Patterns

Advanced Generics

Type-Level Programming

Type Safety Patterns

Debugging

ユーザーレビュー (0)

レビューを書く

効果
使いやすさ
ドキュメント
互換性

レビューなし

統計データ

インストール数1.4K
評価4.3 / 5.0
バージョン
更新日2026年5月22日
比較事例1 件

ユーザー評価

4.3(47)
5
17%
4
49%
3
30%
2
4%
1
0%

この Skill を評価

0.0

対応プラットフォーム

🔧Claude Code
🔧OpenClaw
🔧OpenCode
🔧Codex
🔧Gemini CLI
🔧GitHub Copilot
🔧Amp
🔧Kimi CLI

タイムライン

作成2026年3月16日
最終更新2026年5月22日