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

language-patterns

verified

Provides language-specific patterns for TypeScript, Python, and React including idioms, best practices, and common patterns. Use when implementing features in these languages.

View on GitHub

Marketplace

claude-alchemy

sequenzia/claude-alchemy

Plugin

dev-tools

development

Repository

sequenzia/claude-alchemy
2stars

claude-tools/dev-tools/skills/language-patterns/SKILL.md

Last Verified

February 1, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/sequenzia/claude-alchemy/blob/main/claude-tools/dev-tools/skills/language-patterns/SKILL.md -a claude-code --skill language-patterns

Installation paths:

Claude
.claude/skills/language-patterns/
Powered by add-skill CLI

Instructions

# Language Patterns

This skill provides language-specific patterns and best practices. Apply patterns that match the project's language and framework.

---

## TypeScript Patterns

### Type Safety

**Use strict types over `any`:**
```typescript
// Bad
function process(data: any): any {
  return data.value;
}

// Good
interface DataItem {
  value: string;
  count: number;
}

function process(data: DataItem): string {
  return data.value;
}
```

**Use discriminated unions for variants:**
```typescript
type Result<T> =
  | { success: true; data: T }
  | { success: false; error: Error };

function handleResult<T>(result: Result<T>) {
  if (result.success) {
    // TypeScript knows result.data exists
    console.log(result.data);
  } else {
    // TypeScript knows result.error exists
    console.error(result.error);
  }
}
```

**Use `unknown` over `any` for external data:**
```typescript
async function fetchData(): Promise<unknown> {
  const response = await fetch('/api/data');
  return response.json();
}

// Then validate/parse
const data = await fetchData();
if (isValidData(data)) {
  // Now safely typed
}
```

### Null Handling

**Use optional chaining and nullish coalescing:**
```typescript
// Optional chaining
const userName = user?.profile?.name;

// Nullish coalescing (only for null/undefined)
const displayName = userName ?? 'Anonymous';

// Combine them
const city = user?.address?.city ?? 'Unknown';
```

**Use type guards:**
```typescript
function isUser(obj: unknown): obj is User {
  return (
    typeof obj === 'object' &&
    obj !== null &&
    'id' in obj &&
    'email' in obj
  );
}
```

### Async Patterns

**Prefer async/await over raw promises:**
```typescript
// Good
async function fetchUser(id: string): Promise<User> {
  const response = await fetch(`/api/users/${id}`);
  if (!response.ok) {
    throw new Error(`Failed to fetch user: ${response.status}`);
  }
  return response.json();
}
```

**Handle errors properly:**
```typescript
async function safeO

Validation Details

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