一键导入
typescript-language-patterns
Modern TypeScript standards for type safety, performance, and maintainability.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Modern TypeScript standards for type safety, performance, and maintainability.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Foundational "High-Density" standard for token-optimized agent instructions and CLI-based automated activation.
Universal principles for clean, maintainable, and robust code across all environments.
Standards for performing high-quality, readable code reviews.
Essential rules for code comments, READMEs, and technical documentation.
CRITICAL - Before ANY file write, audit loaded skills for violations. Auto-report via feedback command.
Universal standards for version control, branching, and team collaboration.
| name | TypeScript Language Patterns |
| description | Modern TypeScript standards for type safety, performance, and maintainability. |
| metadata | {"labels":["typescript","language","types","generics"],"triggers":{"files":["**/*.ts","**/*.tsx","tsconfig.json"],"keywords":["type","interface","generic","enum","union","intersection","readonly","const","namespace"]}} |
interface for APIs. type for unions.strict: true. Null Safety: ?. and ??.as const. No runtime enum.typeof, instanceof, predicates.Partial, Pick, Omit, Record.readonly arrays/objects. Const Assertions: as const, satisfies.on${Capitalize<string>}.kind property.public. Use private/protected or #private.string & { __brand: 'Id' }.any: Use unknown.Function: Use signature () => void.enum: Runtime cost.!: Use narrowing.// Branded Type
type UserId = string & { __brand: 'Id' };
// Satisfies (Validate + Infer)
const cfg = { port: 3000 } satisfies Record<string, number>;
// Discriminated Union
type Result<T> = { kind: 'ok'; data: T } | { kind: 'err'; error: Error };
For advanced type patterns and utility types: See references/REFERENCE.md.
best-practices | security | tooling