Claude Skills
CollectionsCompareWorkflowsNominate
Sign inSign up
© 2026 Curated Agent Skills·Learn more about Agent Skills
Back to repository

typescript-utility-types

verified

Built-in TypeScript utility types and their applications

View on GitHub

Marketplace

alphaagent-team

the-answerai/alphaagent-team

Plugin

aai-stack-typescript

stack

Repository

the-answerai/alphaagent-team

plugins/aai-stack-typescript/skills/typescript-utility-types/SKILL.md

Last Verified

February 1, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/the-answerai/alphaagent-team/blob/main/plugins/aai-stack-typescript/skills/typescript-utility-types/SKILL.md -a claude-code --skill typescript-utility-types

Installation paths:

Claude
.claude/skills/typescript-utility-types/
Powered by add-skill CLI

Instructions

# TypeScript Utility Types Skill

Comprehensive guide to TypeScript's built-in utility types.

## Property Modifiers

### Partial<T>

Makes all properties optional.

```typescript
interface User {
  id: string
  name: string
  email: string
}

type PartialUser = Partial<User>
// { id?: string; name?: string; email?: string }

// Use case: Update functions
function updateUser(id: string, updates: Partial<User>): User {
  const user = getUser(id)
  return { ...user, ...updates }
}

updateUser('123', { name: 'New Name' })  // Only update name
```

### Required<T>

Makes all properties required.

```typescript
interface Config {
  host?: string
  port?: number
  timeout?: number
}

type RequiredConfig = Required<Config>
// { host: string; port: number; timeout: number }

// Use case: Ensure all config is provided
function initServer(config: RequiredConfig): void {
  // All properties guaranteed to exist
  console.log(`Server at ${config.host}:${config.port}`)
}
```

### Readonly<T>

Makes all properties readonly.

```typescript
interface State {
  count: number
  users: string[]
}

type ReadonlyState = Readonly<State>
// { readonly count: number; readonly users: string[] }

const state: ReadonlyState = { count: 0, users: [] }
// state.count = 1  // Error: Cannot assign to 'count'

// Note: Only shallow - arrays can still be mutated
// state.users.push('new')  // This still works!

// For deep readonly, use custom type or library
type DeepReadonly<T> = {
  readonly [P in keyof T]: T[P] extends object ? DeepReadonly<T[P]> : T[P]
}
```

## Property Selection

### Pick<T, K>

Creates type with only selected properties.

```typescript
interface User {
  id: string
  name: string
  email: string
  password: string
  createdAt: Date
}

type UserPreview = Pick<User, 'id' | 'name'>
// { id: string; name: string }

// Use case: API response types
type PublicUser = Pick<User, 'id' | 'name' | 'email'>

function getPublicProfile(user: User): PublicUser {
  return {
    id: user.id,

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
7867 chars