Install any skill in seconds. Free to start, no credit card required.
Get Started Free →rohitg00/typescript-advanced
Advanced TypeScript patterns including generics, conditional types, mapped types, template literals, and type guards
Passed 21 of 23 test cases with the skill, and 20 of 23 without it.
2 fixed19 passed either way1 still failing1 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 2 test cases the skill fixed. Same model, same prompt, with and without the skill.
When filtering null or undefined out of an array using .filter(), TypeScript still includes null and undefined in the output type. Instead of using type assertions, how can I write a reusable type guard function isNonNull<T>?
| Checked | Without skill | With skill |
|---|---|---|
| Uses custom type predicate syntax value is T | Passed | Passed |
| Checks value != null with loose inequality for null and undefined filtering | Missed | Passed |
The instructions your model reads when the skill loads.
interface HasId {
id: string;
}
function findById<T extends HasId>(items: T[], id: string): T | undefined {
return items.find(item => item.id === id);
}
function groupBy<T, K extends string | number>(
items: T[],
keyFn: (item: T) => K
): Record<K, T[]> {
return items.reduce((acc, item) => {
const key = keyFn(item);
(acc[key] ??= []).push(item);
return acc;
}, {} as Record<K, T[]>);
}
type ApiResponse<T> = {
data: T;
meta: { page: number; total: number };
};
async function fetchApi<T>(url: string): Promise<ApiResponse<T>> {
const res = await fetch(url);
return res.json();
}
type IsString<T> = T extends string ? true : false;
test cases passed, vs 20 / 23 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.