skills/typescript-engineer/SKILL.md
Designs complex generic types, refactors `any` to strict alternatives, creates type guards and utility types, resolves TypeScript compiler errors, and explains type-level concepts. 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, `satisfies`, `unknown`, function overloads, declaration merging, strict mode, or utility types like `Partial`, `Record`, `ReturnType`, `Awaited`, and `NoInfer`.
npx skillsauth add johnie/skills typescript-engineerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill for:
any types from codebasesIdentify the user's goal, then follow the matching path.
tsc --noEmit to capture the full error outputany, etc.)tsc --noEmit again to confirm clean compilationExpect<Equal<…>> pattern)any, unvalidated casts, and loose typesany to its proper typetsc --noEmitMatch keywords in the user's request to load the right rule file.
| Keyword / topic | Rule file |
|---|---|
| as const, typeof, satisfies, enum alternative, derive types from values | as-const-typeof.md |
| array element type, [number] index | array-index-access.md |
| Partial, Record, Omit, Pick, ReturnType, Parameters, Awaited, NoInfer, utility type | utility-types.md |
| generic, constraint, extends, type parameter | generics-basics.md |
| builder pattern, chainable, fluent API | builder-pattern.md |
| deep inference, const type parameter, F.Narrow, preserve literal types | deep-inference.md |
| conditional type, extends ? :, distribute | conditional-types.md |
| infer, extract inner type | infer-keyword.md |
| template literal type, string manipulation at type level | template-literal-types.md |
| mapped type, in keyof, transform properties | mapped-types.md |
| brand type, opaque type, nominal typing, validated ID | opaque-types.md |
| narrowing, typeof, instanceof, in, discriminated union, type guard, is | type-narrowing.md |
| assertion function, asserts value is, validate-and-throw | assertion-functions.md |
| overload, multiple signatures | function-overloads.md |
| type error, diagnostic, ts(…), "not assignable" | error-diagnosis.md |
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;
}
satisfiesBefore
// Annotation loses literal types
const palette: Record<string, [number, number, number]> = {
red: [255, 0, 0],
green: [0, 255, 0],
};
palette.red; // [number, number, number] — literals lost
After
const palette = {
red: [255, 0, 0],
green: [0, 255, 0],
} as const satisfies Record<string, readonly [number, number, number]>;
palette.red; // readonly [255, 0, 0] — literals preserved, shape enforced ✓
Read individual rule files for detailed explanations and code examples:
as const, typeof, and satisfies[number] indexingconst type parameters and F.Narrowinfer to extract types within conditional typestools
WordPress CLI operations for database management, plugins, themes, users, content, and site configuration. Use for migrations, bulk updates, user audits, content imports, or any wp-cli commands.
tools
Build type-safe CLI applications with Stricli. Use when creating TypeScript CLIs with typed flags/positional args, multi-command routing, or automatic help generation. Stricli catches parameter errors at compile time. Use this whenever the user mentions CLI frameworks, command-line tools, argument parsing, or typed commands in TypeScript.
tools
Create, update, and review GitHub PRs. Commands: create [-v] [--draft], update [-v], review <number|url>. Generates structured PR bodies with conditional sections (Testing, Deployment, Screenshots). Requires gh CLI.
tools
Fetch and analyze GitHub Actions logs via gh CLI. Diagnoses CI failures, detects flaky tests, profiles slow steps, and suggests fixes. Use when CI is broken, builds are failing, or you need to understand workflow run history.