Guidance for measuring TypeScript type instantiations using @ark/attest. Use when optimizing type-level performance, writing type benchmarks, or debugging slow type evaluation.
Measures TypeScript type instantiations using @ark/attest for performance optimization.
/plugin marketplace add jasonkuhrt/claude-marketplace/plugin install typescript@jasonkuhrtThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Measure TypeScript type instantiations to optimize type-level performance.
Include a "baseline expression" at the top of benchmark files to exclude API setup overhead.
TypeScript caches type evaluations per exact type:
Simplify.All<Map<1, 2>> and Simplify.All<Map<3, 4>> are different → no caching benefitSimplify.All<Map<0, 0>> and benchmark uses Simplify.All<Map<0, 0>> → cached (low instantiations)Map<K, V> extends Map<infer K2, infer V2>) can be expensive (~1800+ inst)import { bench } from '@ark/attest'
import { type } from 'arktype'
// Baseline expression - similar to benchmarks but not identical
type('boolean')
bench('single-quoted', () => {
const _ = type("'nineteen characters'")
// Would be 2697 without baseline, now 610
}).types([610, 'instantiations'])
bench('keyword', () => {
const _ = type('string')
// Would be 2507 without baseline, now 356
}).types([356, 'instantiations'])
.bench-d.ts suffix for type benchmark files (convention)This skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code generation involving libraries, or mentions of specific frameworks like React, Vue, Next.js, Prisma, Supabase, etc.