typescript-magician

typescript-magician is a skill for Claude Code from ushibo/brigade. It costs 108 tokens per session (1,050 once invoked), scanned A, a copy of typescript-magician, MIT.

A TypeScript coding guide for designing generic types, replacing unsafe any types, creating type guards, and fixing compiler errors.

In plain words
What is it for?
Use it for generics, type inference, strict typing, type guards, utility types, removing any, and TypeScript errors.
Why use it?
It helps make TypeScript code safer and easier for editors to understand when types are complex or incomplete.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the brigade plugin — 10 skills, 9 commands, 15 agents, 3 hooks shipped together

Good fit Use it for generics, type inference, strict typing, type guards, utility types, removing any, and TypeScript errors.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ushibo/brigade/typescript-magician
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ushibo/brigade --skill typescript-magician
Clone the repo
git clone --depth 1 https://github.com/ushibo/brigade

Made for: Claude Code.

Or install brigade, the plugin that ships this one along with the rest of its 10 skills, 9 commands, 15 agents, 3 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for typescript-magician

README.md
[![agentmods](https://agentmods.dev/badge/skills/ushibo/brigade/typescript-magician.svg)](https://agentmods.dev/skills/ushibo/brigade/typescript-magician)
Your own site
<a href="https://agentmods.dev/skills/ushibo/brigade/typescript-magician"><img src="https://agentmods.dev/badge/skills/ushibo/brigade/typescript-magician.svg" alt="Measured on agentmods" height="20"></a>
Per session 108 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,050 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00108 $0.01050
Opus 5 $0.00054 $0.00525
Sonnet 5 $0.00022 $0.00210
Haiku 4.5 $0.00011 $0.00105

Measured 7d ago against content hash 5ae7057a8f87, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

typescript-magician scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to typescript-magician — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/typescript-magician/SKILL.md · 118 lines

How it starts

The opening of the file, as written. The whole thing — 118 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

Read the full file on GitHub · 118 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 118 lines · 108 tokens per session scan A 5ae7057a8f87

Subscribe to this mod's changes

typescript-magician is a skill published in the GitHub repository ushibo/brigade (1 stars, last pushed 2mo ago), licensed MIT. It adds 108 tokens to every session and 1,050 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to typescript-magician, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

typescript-best-practices

TypeScript/Node.js best practices. Use when writing or reviewing TypeScript code. Covers type safety, async patterns, and error handling.

Taoidle/plan-cascade · 34 tokens

dev-team-node

Coordinates Node.js/TypeScript development (Next.js, NestJS, Vite, Express) with a team of specialized agents and inline quality gates. Use for multi-step Node.js tasks that need decomposition and multi-agent coordination.

biggora/dev-team · 49 tokens

nest-best-practices

NestJS framework best practices and production patterns. Use whenever working with NestJS — creating modules, controllers, services, DTOs, guards, interceptors, pipes, middleware, or building REST/GraphQL/microservice APIs. Also use when setting up authentication, authorization, validation, queues, health checks…

biggora/dev-team · 129 tokens

typescript-expert

TypeScript language expertise covering the type system, generics, utility types, advanced type patterns, and project configuration. Use this skill whenever writing, reviewing, or refactoring TypeScript code, designing type-safe APIs, working with complex generics, debugging type errors, configuring tsconfig.json…

biggora/dev-team · 146 tokens

nodejs-stack

This skill should be used when working with Node.js, TypeScript, or JavaScript projects, including frameworks like Next.js, NestJS, Express, Fastify, and Vite.

biggora/dev-team · 41 tokens

node-backend

Node.js backend development patterns for Express, NestJS, Fastify, and Hono. Use when implementing APIs, authentication, middleware, services, and server-side logic with Node.js and TypeScript. Provides project structure, code patterns, and best practices.

shahtuyakov/claude-setup · 55 tokens