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

criteria.jsonevals/scenario-2/

{
  "context": "Tests whether the agent correctly mirrors function overloads when wrapping external APIs, orders overloads correctly, and handles the implementation signature vs caller-visible signatures distinction.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Overloads mirror wrapped API",
      "description": "The wrapper function(s) include overload signatures that mirror the specific overloads of the wrapped function (e.g., mapping tag names to element types, not just returning Element)",
      "max_score": 15
    },
    {
      "name": "Specific before general",
      "description": "More specific overload signatures (e.g., those with `extends keyof HTMLElementTagNameMap`) appear BEFORE the general string fallback overload",
      "max_score": 10
    },
    {
      "name": "Implementation signature compatibility",
      "description": "The implementation signature accepts a union covering all overload cases (e.g., `string | ...`) and is NOT one of the caller-visible signatures",
      "max_score": 10
    },
    {
      "name": "Implementation not callable directly",
      "description": "A type test demonstrates (via `@ts-expect-error` or explicit type assertion) that callers cannot pass a type only the implementation accepts but no overload exposes",
      "max_score": 10
    },
    {
      "name": "Generic constraints in overloads",
      "description": "Overload signatures use `<K extends keyof HTMLElementTagNameMap>` or equivalent generic constraint to produce specific return types",
      "max_score": 10
    },
    {
      "name": "Type inference verified",
      "description": "Type tests confirm that the specific return type (e.g., `HTMLInputElement`, not just `Element`) is inferred when calling with a known tag name",
      "max_score": 10
    },
    {
      "name": "Before/after comparison",
      "description": "Shows a before/after comparison where the naive wrapper (single signature) returns `Element` and the overloaded wrapper returns the specific element type",
      "max_score": 10
    },
    {
      "name": "Overload theory explained",
      "description": "Includes a written explanation of top-to-bottom overload resolution and why specific overloads must precede the general fallback",
      "max_score": 10
    },
    {
      "name": "Multiple wrapping approaches",
      "description": "Provides at least two approaches for the same wrapping problem (e.g., overloads AND a generic-only alternative) with a comparison of tradeoffs",
      "max_score": 8
    },
    {
      "name": "Type tests present",
      "description": "Includes at least three type-level tests: one for a specific tag, one for a generic string, and one verifying a type error for an invalid usage",
      "max_score": 7
    }
  ]
}

evals

SKILL.md

tile.json