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 uses const type parameters or F.Narrow for deep literal inference, adds proper constraints, and applies infer/as const/[number] indexing techniques for type-level programming.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Const type parameter or F.Narrow",
"description": "Uses either `<const T>` const type parameter syntax OR imports and applies `F.Narrow` from ts-toolbelt for deep literal type inference",
"max_score": 15
},
{
"name": "Proper inference constraints",
"description": "Generic parameters used with F.Narrow or const type params include an `extends` constraint (e.g., `extends Record<string, unknown>`) rather than being unconstrained",
"max_score": 10
},
{
"name": "infer keyword usage",
"description": "Uses the `infer` keyword inside at least one conditional type to extract a nested type",
"max_score": 10
},
{
"name": "Fallback in conditional types",
"description": "Conditional types that use `infer` provide a `never` or other explicit fallback in the false branch",
"max_score": 8
},
{
"name": "[number] array indexing",
"description": "Uses `T[number]` indexing at least once to extract the union of element types from an array or tuple type",
"max_score": 10
},
{
"name": "as const with [number]",
"description": "When extracting literal element types from an array constant, uses `as const` before the `[number]` access (or equivalent)",
"max_score": 8
},
{
"name": "Obj[keyof Obj] value union",
"description": "Uses `T[keyof T]` at least once to produce a union of all value types from an object/record type",
"max_score": 8
},
{
"name": "Tuple anti-distribution",
"description": "Uses `[T] extends [OtherType]` tuple wrapping in at least one conditional type to prevent unwanted distribution over unions",
"max_score": 10
},
{
"name": "Multiple approaches",
"description": "Provides at least two alternative approaches for achieving deep inference (e.g., const type param AND a fallback approach)",
"max_score": 10
},
{
"name": "Type tests",
"description": "Includes type-level tests that verify literal types are preserved (e.g., testing that a specific literal string type, not just `string`, is inferred)",
"max_score": 11
}
]
}