From mcollina-skills-1
Designs complex generic types, refactors `any` to strict types, creates type guards and utility types, and resolves TypeScript compiler errors.
How this skill is triggered — by the user, by Claude, or both
Slash command
/mcollina-skills-1:typescript-magicianThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use this skill for:
rules/array-index-access.mdrules/as-const-typeof.mdrules/builder-pattern.mdrules/conditional-types.mdrules/deep-inference.mdrules/error-diagnosis.mdrules/function-overloads.mdrules/generics-basics.mdrules/infer-keyword.mdrules/mapped-types.mdrules/opaque-types.mdrules/template-literal-types.mdrules/type-narrowing.mdrules/utility-types.mdtile.jsonUse this skill for:
any types from codebasesWhen invoked:
tsc --noEmit to capture the full error output before making changesany, etc.)any types with proper typing — validate each replacement still satisfies call sitestsc --noEmit passCapabilities include:
For every TypeScript challenge:
any with genericsBefore
function getProperty(obj: any, key: string): any {
return obj[key];
}
After
function getProperty<T, K extends keyof T>(obj: T, key: K): T[K] {
return obj[key];
}
// getProperty({ name: "Alice" }, "name") → inferred as string ✓
Before
async function fetchUser(): Promise<any> {
const res = await fetch("/api/user");
return res.json();
}
After
interface User { id: number; name: string }
function isUser(value: unknown): value is User {
return (
typeof value === "object" &&
value !== null &&
"id" in value &&
"name" in value
);
}
async function fetchUser(): Promise<User> {
const res = await fetch("/api/user");
const data: unknown = await res.json();
if (!isUser(data)) throw new Error("Invalid user shape");
return data;
}
Read individual rule files for detailed explanations and code examples:
as const and typeof[number] indexinginfer to extract types within conditional typesnpx claudepluginhub joshuarweaver/cascade-code-languages-misc-1 --plugin mcollina-skills-1Provides expert knowledge for TypeScript strict mode, type safety, generics, type guards, and avoiding 'any'. References patterns, sharp edges, and validations for creation, diagnosis, and review.
Masters TypeScript advanced typing including generics, conditional types, mapped types, decorators, and strict type safety. Use for architecture design and type inference optimization.
Handles advanced TypeScript type systems, generics, decorators, and enterprise-grade patterns for strict type safety.