スキル一覧に戻る
vuralserhat86

typescript-advanced

by vuralserhat86

OS for Agents: 130+ Agentic Skills, Gemini Protocols, and Autonomous Workflows. (Antigravity System)

19🍴 9📅 2026年1月23日
GitHubで見るManusで実行

SKILL.md


name: typescript_advanced router_kit: FullStackKit description: TypeScript 5+ advanced patterns, type utilities ve best practices rehberi. metadata: skillport: category: development tags: [architecture, automation, best practices, clean code, coding, collaboration, compliance, debugging, design patterns, development, documentation, efficiency, git, optimization, productivity, programming, project management, quality assurance, refactoring, software engineering, standards, testing, typescript advanced, utilities, version control, workflow] - patterns

📘 TypeScript Advanced

TypeScript 5+ advanced patterns rehberi.


📋 Utility Types

// 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>;

🔧 Advanced Patterns

Discriminated Unions

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
  }
}

Template Literal Types

type EventName = `on${Capitalize<string>}`;
// "onClick", "onHover", etc.

type Route = `/${string}`;

Conditional Types

type NonNullable<T> = T extends null | undefined ? never : T;

type Flatten<T> = T extends Array<infer U> ? U : T;

🎯 Zod Integration

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>;

⚡ Best Practices

  1. Strict mode always on
  2. Avoid any - use unknown instead
  3. Prefer interfaces for objects
  4. Use const assertions for literals
  5. Type narrowing over type assertions

🔄 Workflow

Kaynak: TypeScript 5.0 Release Notes & Total TypeScript Best Practices

Aşama 1: Type Design & Schema

  • Interface vs Type: Nesne yapıları için interface, union ve karmaşık tipler için type alias'larını belirle.
  • Zod Validation: Runtime güvenliği için şemaları tanımla ve z.infer ile TS tiplerini türet.
  • Strict Check: tsconfig.json dosyasında strict: true ayarının aktif olduğunu doğrula.

Aşama 2: Advanced Logic Implementation

  • Type Narrowing: unknown tiplerini type guards (is, in) veya asserts kullanarak daralt.
  • Conditional & Mapped Types: Tekrar eden tipleri dinamik hale getirmek için T extends U ? X : Y yapılarını kullan.
  • Generic Constraints: Generic tipleri extends ile kısıtlayarak tip güvenliğini artır.

Aşama 3: Refactoring & Verification

  • Remove any: Tüm any kullanımlarını unknown veya spesifik union tipleriyle değiştir.
  • Performance Audit: Karmaşık recursive tiplerin derleme (build) süresini etkilemediğini doğrula.
  • Documentation: @param, @returns ve @typePara etiketleriyle gelişmiş tipleri dökümante et.

Kontrol Noktaları

AşamaDoğrulama
1eslint-plugin-typescript hataları temizlendi mi?
2"Discriminated Unions" ile tüm case'ler handle edildi mi?
3Tip tanımları ile gerçek runtime verileri tutarlı mı?

TypeScript Advanced v1.5 - With Workflow

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です