CtrlK
BlogDocsLog inGet started
Tessl Logo

mcollina/typescript-magician

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`.

87

1.16x
Quality

95%

Does it follow best practices?

Impact

76%

1.16x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

Evaluation results

48%

10%

Type-Safe Feature Flag System

Criteria
Without context
With context

Const type parameter or F.Narrow

13%

13%

Proper inference constraints

40%

80%

infer keyword usage

0%

0%

Fallback in conditional types

0%

0%

[number] array indexing

100%

100%

as const with [number]

100%

100%

Obj[keyof Obj] value union

0%

0%

Tuple anti-distribution

0%

0%

Multiple approaches

40%

100%

Type tests

90%

90%

81%

8%

Type-Safe DOM Query Utilities

Criteria
Without context
With context

Overloads mirror wrapped API

66%

100%

Specific before general

100%

100%

Implementation signature compatibility

100%

100%

Implementation not callable directly

0%

20%

Generic constraints in overloads

100%

100%

Type inference verified

100%

100%

Before/after comparison

100%

100%

Overload theory explained

90%

100%

Multiple wrapping approaches

0%

0%

Type tests present

57%

57%

80%

50%

Type-Safe Event System with Handler Inference

Criteria
Without context
With context

Mapped type with as clause

0%

100%

Never to filter keys

20%

100%

Template literal types

0%

100%

String-only template literals

0%

100%

Discriminated union

30%

100%

Exhaustiveness check

100%

100%

Callback narrowing awareness

50%

100%

Intersection type accumulation

0%

0%

never for union filtering

0%

0%

Type theory explanation

90%

100%

97%

32%

Hardening a Healthcare Platform's Type Safety

Criteria
Without context
With context

Opaque pattern

100%

100%

Multiple opaque types

100%

100%

Assertion function syntax

0%

100%

Type predicate syntax

0%

100%

Both predicate and assertion present

0%

100%

Async utility types

100%

100%

typeof with utility types

100%

100%

Type theory explanation

100%

100%

Before/after comparison

100%

100%

Type tests

100%

57%

43%

-11%

Fixing a Loosely-Typed Data Pipeline Library

Criteria
Without context
With context

Pre-change tsc output captured

0%

25%

Post-change tsc output captured

0%

25%

No any in solution

33%

16%

ts-expect-error usage

0%

0%

Bottom-up error diagnosis

60%

70%

Strict mode enabled

100%

100%

Before/after representation

100%

100%

keyof generics pattern

100%

100%

Test type breakdown

100%

0%

typeof with utility types

100%

0%

Evaluated
Agent
Claude
Model
Claude Haiku 4.5

Table of Contents