원클릭으로
typescript
TypeScript strict patterns and best practices. Trigger: When writing TypeScript code - types, interfaces, generics.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
TypeScript strict patterns and best practices. Trigger: When writing TypeScript code - types, interfaces, generics.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Testing E2E strategies based on Clean Architecture layers with cypress. Trigger: Invoke when writing tests E2E or testing user flows, verifying full integration in realistic scenarios.
Standardizes how the application handles asynchronous states, errors, and feedback using TanStack Query/Router patterns. Trigger: Apply when building async UIs to implement Suspense, Skeletons, and Error Boundaries instead of manual loading states.
Tailwind CSS 4 patterns and best practices. Trigger: When styling with Tailwind - cn(), theme variables, no var() in className.
TanStack Query and Router patterns and best practices. Trigger: When implementing data fetching and routing with TanStack Query and Router.
Testing strategies based on Clean Architecture layers. Trigger: Invoke when writing tests to enforce layer-specific mocking strategies (Unit vs Integration)
Zod 4 schema validation patterns. Trigger: When using Zod for validation - breaking changes from v3.
| name | typescript |
| description | TypeScript strict patterns and best practices. Trigger: When writing TypeScript code - types, interfaces, generics. |
| license | Apache-2.0 |
| metadata | {"author":"jmgomezdev","version":"1.0"} |
// ✅ ALWAYS: Create const object first, then extract type
const STATUS = {
ACTIVE: 'active',
INACTIVE: 'inactive',
PENDING: 'pending',
} as const;
type Status = (typeof STATUS)[keyof typeof STATUS];
// ❌ NEVER: Direct union types
type Status = 'active' | 'inactive' | 'pending';
Why? Single source of truth, runtime values, autocomplete, easier refactoring.
// ✅ ALWAYS: One level depth, nested objects → dedicated interface
interface UserAddress {
street: string;
city: string;
}
interface User {
id: string;
name: string;
address: UserAddress; // Reference, not inline
}
interface Admin extends User {
permissions: string[];
}
// ❌ NEVER: Inline nested objects
interface User {
address: { street: string; city: string }; // NO!
}
any// ✅ Use unknown for truly unknown types
function parse(input: unknown): User {
if (isUser(input)) return input;
throw new Error('Invalid input');
}
// ✅ Use generics for flexible types
function first<T>(arr: T[]): T | undefined {
return arr[0];
}
// ❌ NEVER
function parse(input: any): any {}
Pick<User, 'id' | 'name'>; // Select fields
Omit<User, 'id'>; // Exclude fields
Partial<User>; // All optional
Required<User>; // All required
Readonly<User>; // All readonly
Record<string, User>; // Object type
Extract<Union, 'a' | 'b'>; // Extract from union
Exclude<Union, 'a'>; // Exclude from union
NonNullable<T | null>; // Remove null/undefined
ReturnType<typeof fn>; // Function return type
Parameters<typeof fn>; // Function params tuple
function isUser(value: unknown): value is User {
return (
typeof value === 'object' &&
value !== null &&
'id' in value &&
'name' in value
);
}
import type { User } from './types';
import { type Config, createUser } from './utils';
typescript, ts, types, interfaces, generics, strict mode, utility types