用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/vuralserhat86/antigravity-agentic-skills --skill typescript-advanced命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | typescript_advanced |
| description | TypeScript 5+ advanced patterns, type utilities ve best practices rehberi. |
TypeScript 5+ advanced patterns rehberi.
// Partial - tüm prop'lar optional
type PartialUser = Partial<User>;
// Required - tüm prop'lar required
type RequiredUser = Required<User>;
// Pick - seçili prop'lar
type UserName = Pick<User, 'id' | 'name'>;
// Omit - prop'ları çıkar
type UserWithoutPassword = Omit<User, 'password'>;
// Record - key-value map
type UserMap = Record<string, User>;
// ReturnType - fonksiyon return tipi
type Result = ReturnType<typeof fetchUser>;
type Result<T> =
| { success: true; data: T }
| { success: false; error: string };
function handle(result: Result<User>) {
if (result.success) {
console.log(result.data); // User
} else {
console.log(result.error); // string
}
}
type EventName = `on${Capitalize<string>}`;
// "onClick", "onHover", etc.
type Route = `/${string}`;
type NonNullable<T> = T extends null | undefined ? never : T;
type Flatten<T> = T extends Array<infer U> ? U : T;
import { z } from 'zod';
const UserSchema = z.object({
id: z.string().uuid(),
email: z.string().email(),
age: z.number().min(0).max(120),
});
type User = z.infer<typeof UserSchema>;
any - use unknown insteadKaynak: TypeScript 5.0 Release Notes & Total TypeScript Best Practices
interface, union ve karmaşık tipler için type alias'larını belirle.z.infer ile TS tiplerini türet.tsconfig.json dosyasında strict: true ayarının aktif olduğunu doğrula.unknown tiplerini type guards (is, in) veya asserts kullanarak daralt.T extends U ? X : Y yapılarını kullan.extends ile kısıtlayarak tip güvenliğini artır.any: Tüm any kullanımlarını unknown veya spesifik union tipleriyle değiştir.@param, @returns ve @typePara etiketleriyle gelişmiş tipleri dökümante et.| Aşama | Doğrulama |
|---|---|
| 1 | eslint-plugin-typescript hataları temizlendi mi? |
| 2 | "Discriminated Unions" ile tüm case'ler handle edildi mi? |
| 3 | Tip tanımları ile gerçek runtime verileri tutarlı mı? |
TypeScript Advanced v1.5 - With Workflow