/harness-claude:ts-utility-typesfrom harness-claude
Applies built-in TypeScript utility types (Partial, Pick, Omit, Record, Exclude, ReturnType) to transform and compose types without redundancy. Useful for form types, API shapes, and partial updates.
Claude never picks this skill on its own
Its frontmatter has no description. Without a description, Claude Code leaves it out of the list Claude chooses from. Typing /harness-claude:ts-utility-types still runs it.
What the skill costs in Claude's context, stage by stage
No description Claude Code can read, so Claude's list leaves it out: only you can start it.
SKILL.md joins the conversation and stays.
Apply built-in TypeScript utility types to transform and compose types without redundancy
Partial<T> for optional-update payloads where every field is optional.Required<T> to make every optional field mandatory (opposite of Partial).Pick<T, K> to create a type with only the listed keys from T.Omit<T, K> to create a type with all keys except the listed ones.Record<K, V> to define a mapping type — prefer over index signatures when keys are known.Exclude<T, U> to remove union members assignable to U from T.Extract<T, U> to keep only union members assignable to U.ReturnType<typeof fn> to derive the return type of a function without manually declaring it.Parameters<typeof fn> to derive the parameter tuple of a function.Partial<Pick<User, 'name' | 'email'>>.interface User {
id: string;
name: string;
email: string;
role: 'admin' | 'viewer' | 'editor';
createdAt: Date;
}
// Partial update payload — all fields optional
type UserUpdate = Partial<Omit<User, 'id' | 'createdAt'>>;
// Public profile — only safe fields
type PublicUser = Pick<User, 'id' | 'name' | 'role'>;
// Role lookup map
type RoleConfig = Record<User['role'], { canWrite: boolean; canDelete: boolean }>;
// Exclude admin from public-facing role type
type PublicRole = Exclude<User['role'], 'admin'>; // 'viewer' | 'editor'
// Infer return type without coupling to implementation
async function fetchUser(id: string): Promise<User> {
/* ... */ return {} as User;
}
type FetchUserResult = Awaited<ReturnType<typeof fetchUser>>; // User
// Infer parameters for wrapping/mocking
type FetchUserParams = Parameters<typeof fetchUser>; // [id: string]
All utility types are implemented as generic conditional or mapped types in TypeScript's standard library (lib.es5.d.ts). Understanding their implementation helps you build custom variants when the built-ins don't cover your case.
Implementation anatomy
// Partial<T> implementation
type Partial<T> = { [P in keyof T]?: T[P] };
// Pick<T, K> implementation
type Pick<T, K extends keyof T> = { [P in K]: T[P] };
// Exclude<T, U> implementation
type Exclude<T, U> = T extends U ? never : T;
// ReturnType<T> implementation
type ReturnType<T extends (...args: any) => any> = T extends (...args: any) => infer R ? R : any;
Omit vs Exclude
Omit<T, K> operates on object types and removes properties. Exclude<T, U> operates on union types and removes members. They are not interchangeable.
Record vs index signatures
Record<string, V> and { [key: string]: V } are equivalent for most purposes, but Record<K, V> with a union K creates a required entry for each union member — the index signature does not.
Composing utility types
Utility types compose via nesting. Deep transformations may require recursive types (TypeScript 4.1+) or a custom mapped type. For deeply partial types, the standard library's Partial only goes one level deep.
NonNullable<T>
Removes null and undefined from a type. Equivalent to Exclude<T, null | undefined>. Useful after null-safety guards.
ConstructorParameters<T> and InstanceType<T>
Less common but useful for class-based code: ConstructorParameters extracts the constructor's args, InstanceType extracts what new T() produces.
When to write custom utilities instead
When none of the built-ins express your transformation, write a mapped or conditional type. The built-ins are a starting point, not a ceiling.
https://typescriptlang.org/docs/handbook/utility-types.html
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeRead when SKILL.md points to them.
793 skills in this plugin
/a11y-aria-patternsARIA Patterns> Apply ARIA roles, states, and properties correctly to enhance assistive technology support for custom widgets/a11y-color-contrastColor Contrast and Color Independence> Ensure sufficient color contrast ratios and never use color as the sole means of conveying information/a11y-form-patternsAccessible Form Patterns> Build accessible forms with proper labeling, grouped controls, inline validation, and clear error communicationOther plugins' skills for the same job