.cursor/skills/typescript-v5/SKILL.md
Advanced TypeScript patterns for type-safe, maintainable code using sophisticated type system features. Use when building type-safe APIs, implementing complex domain models, or leveraging TypeScript's advanced type capabilities.
npx skillsauth add blockmatic-icebox/basilic-old typescript-advanced-patternsInstall 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.
"strict": true in tsconfig.json)value is Type) for runtime checking with type narrowingunknown over any for type safetyas Type)readonly"strict": true in tsconfig.json)unknown instead of any for untyped valuesvalue is Type) instead of type assertions when possibletype for unions/utilities, interface for object shapesreadonlyany (use unknown with type guards)Transform object types systematically:
type Partial<T> = { [P in keyof T]?: T[P] }
type Readonly<T> = { readonly [P in keyof T]: T[P] }
type Pick<T, K extends keyof T> = { [P in K]: T[P] }
Runtime type checking with type narrowing:
function isString(value: unknown): value is string {
return typeof value === 'string'
}
function isSuccess(result: Result): result is Success {
return result.status === 'success'
}
Create nominal types for type safety:
type UserId = string & { readonly __brand: 'UserId' }
type PostId = string & { readonly __brand: 'PostId' }
function createUserId(id: string): UserId {
return id as UserId
}
Type-safe state machines with exhaustiveness checking:
type LoadingState =
| { status: 'idle' }
| { status: 'loading' }
| { status: 'success'; data: string[] }
| { status: 'error'; error: Error }
development
# Skill: wagmi ## Scope - React/Next.js wallet integration with Wagmi v3 for EVM chains - Contract interactions using viem v2 for address validation and transaction building - Transaction state management and error handling - Custom hooks wrapping wagmi for contract-specific interactions Does NOT cover: - Solana frontend development - Backend RPC interactions - Smart contract development ## Assumptions - Wagmi v3.3.2+ - viem v2.44.4 - React 18+ or Next.js 14+ - TypeScript v5+ with strict mo
development
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
development
TanStack Query (React Query) for async operations, data fetching, caching, and state management. Use when: fetching server data, managing async operations, caching responses, handling mutations, or any operation that benefits from automatic state management and caching.
tools
# Skill: solidity ## Scope - Solidity 0.8.24 smart contract development with Foundry - EVM internals and execution environment understanding - Security patterns and vulnerability prevention - Gas optimization techniques - Testing strategies with Foundry (unit, fuzz, invariant) - Client interactions using viem v2 - OpenZeppelin Contracts integration Does NOT cover: - Frontend wallet integration (see wagmi skill) - Solana development (see solana skill) ## Assumptions - Solidity 0.8.24 - Found