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
95%
Does it follow best practices?
Impact
76%
1.16xAverage score across 5 eval scenarios
Passed
No known issues
{
"context": "Tests whether the agent follows the TypeScript improvement workflow: capturing tsc output before and after changes, eliminating any types, using @ts-expect-error for type tests, and documenting the diagnostic process.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Pre-change tsc output captured",
"description": "A file exists containing the tsc --noEmit output from BEFORE the fixes were applied (showing the original errors)",
"max_score": 12
},
{
"name": "Post-change tsc output captured",
"description": "A file exists containing the tsc --noEmit output from AFTER the fixes, showing zero errors",
"max_score": 12
},
{
"name": "No any in solution",
"description": "The fixed TypeScript source files contain NO uses of `any` as a type annotation (neither explicit `: any` nor implicit via cast)",
"max_score": 12
},
{
"name": "ts-expect-error usage",
"description": "At least one `// @ts-expect-error` comment is used in a test or verification file to confirm that an invalid assignment correctly produces a type error",
"max_score": 10
},
{
"name": "Bottom-up error diagnosis",
"description": "Written explanation of at least one error identifies the ROOT CAUSE at the deepest level of the error chain (not just the surface-level message)",
"max_score": 10
},
{
"name": "Strict mode enabled",
"description": "The tsconfig.json has `\"strict\": true` in compilerOptions",
"max_score": 8
},
{
"name": "Before/after representation",
"description": "For at least one fix, a before/after code block or comment shows the original `any`-typed code and the replacement typed code",
"max_score": 10
},
{
"name": "keyof generics pattern",
"description": "At least one function uses `<T, K extends keyof T>(obj: T, key: K): T[K]` or equivalent to replace a generic `any`-indexed access",
"max_score": 10
},
{
"name": "Test type breakdown",
"description": "At least one intermediate `type StepN = ...` alias is used to decompose and inspect a complex type expression",
"max_score": 8
},
{
"name": "typeof with utility types",
"description": "Uses `typeof fnName` when passing a runtime function to `ReturnType<>` or `Parameters<>` (not a type expression)",
"max_score": 8
}
]
}