#601

Globales Ranking · von 601 Skills

typescript-patterns AI Agent Skill

Quellcode ansehen: oakoss/agent-skills

Safe

Installation

npx skills add oakoss/agent-skills --skill typescript-patterns

46

Installationen

TypeScript Patterns

Overview

Advanced TypeScript patterns that use the type system to prevent runtime errors. Focuses on strict mode TypeScript with patterns for type inference, narrowing, and compile-time validation. Not a beginner tutorial.

When to use: Building type-safe APIs, complex data transformations, library authoring, preventing runtime errors through types, working with strict mode flags.

When NOT to use: Learning TypeScript basics (primitives, interfaces, classes), JavaScript-to-TypeScript migration guidance, tooling setup, or build configuration.

Quick Reference

Pattern API Key Points
Utility types Pick<T, K>, Omit<T, K> Extract or exclude properties
Partial/Required Partial<T>, Required<T> Make properties optional or required
Record type Record<K, V> Object with known keys
Awaited type Awaited<T> Unwrap Promise return types
ReturnType/Parameters ReturnType<F>, Parameters<F> Extract function types
Generic constraints <T extends Type> Constrain generic parameters
Type inference type Inferred = typeof value Let TypeScript infer from values
Type guards typeof, instanceof, in Narrow types at runtime
Custom type guards (x): x is Type User-defined narrowing functions
Inferred predicates (x) => x !== null Auto-inferred type predicate filters
Discriminated unions Union with literal type property Exhaustive pattern matching
Conditional types T extends U ? X : Y Type-level conditionals
Mapped types { [K in keyof T]: T[K] } Transform all properties
Template literals `${A}-${B}` String literal type manipulation
Const assertions as const Narrowest possible literal types
Satisfies operator value satisfies Type Type check without widening
NoInfer utility NoInfer<T> Prevent inference from a position
Const type params <const T extends Type> Narrow inference without as const
Inline type imports import { type User } Import types explicitly
Module augmentation declare module 'lib' { ... } Extend third-party types
Assertion functions function assert(x): asserts x is T Throw if type guard fails

Common Mistakes

Mistake Correct Pattern
Using any without justification Use unknown and narrow with type guards
Manual type assertions everywhere Let inference work, type function returns
Destructuring before type narrowing Keep object intact for discriminated unions
Index access without undefined check Enable noUncheckedIndexedAccess
as Type casting unsafe values Use satisfies Type to preserve narrow types
Inline objects in generics Extract to const or type alias
Omitting extends in constraints Always constrain generics when possible
Using Parameters<typeof fn>[0] Type the parameter directly in function
Not handling union exhaustiveness Use never checks in switch/if-else
value as const satisfies Type Use satisfies Type then as const if needed

Delegation

  • Pattern discovery: Use Explore agent to find existing patterns in codebase
  • Type error debugging: Use Task agent for multi-step type resolution
  • Code review: Delegate to code-reviewer skill for type safety audit

References

Installationen

Installationen 46
Globales Ranking #601 von 601

Sicherheitsprüfung

ath Safe
socket Safe
Warnungen: 0 Bewertung: 90
snyk Low
EU EU-Hosted Inference API

Power your AI Agents with the best open-source models.

Drop-in OpenAI-compatible API. No data leaves Europe.

Explore Inference API

GLM

GLM 5

$1.00 / $3.20

per M tokens

Kimi

Kimi K2.5

$0.60 / $2.80

per M tokens

MiniMax

MiniMax M2.5

$0.30 / $1.20

per M tokens

Qwen

Qwen3.5 122B

$0.40 / $3.00

per M tokens

So verwenden Sie diesen Skill

1

Install typescript-patterns by running npx skills add oakoss/agent-skills --skill typescript-patterns in your project directory. Führen Sie den obigen Installationsbefehl in Ihrem Projektverzeichnis aus. Die Skill-Datei wird von GitHub heruntergeladen und in Ihrem Projekt platziert.

2

Keine Konfiguration erforderlich. Ihr KI-Agent (Claude Code, Cursor, Windsurf usw.) erkennt installierte Skills automatisch und nutzt sie als Kontext bei der Code-Generierung.

3

Der Skill verbessert das Verständnis Ihres Agenten für typescript-patterns, und hilft ihm, etablierte Muster zu befolgen, häufige Fehler zu vermeiden und produktionsreifen Code zu erzeugen.

Was Sie erhalten

Skills sind Klartext-Anweisungsdateien — kein ausführbarer Code. Sie kodieren Expertenwissen über Frameworks, Sprachen oder Tools, das Ihr KI-Agent liest, um seine Ausgabe zu verbessern. Das bedeutet null Laufzeit-Overhead, keine Abhängigkeitskonflikte und volle Transparenz: Sie können jede Anweisung vor der Installation lesen und prüfen.

Kompatibilität

Dieser Skill funktioniert mit jedem KI-Coding-Agenten, der das skills.sh-Format unterstützt, einschließlich Claude Code (Anthropic), Cursor, Windsurf, Cline, Aider und anderen Tools, die projektbezogene Kontextdateien lesen. Skills sind auf Transportebene framework-agnostisch — der Inhalt bestimmt, für welche Sprache oder welches Framework er gilt.

Data sourced from the skills.sh registry and GitHub. Install counts and security audits are updated regularly.

EU Made in Europe

Chat with 100+ AI Models in one App.

Use Claude, ChatGPT, Gemini alongside with EU-Hosted Models like Deepseek, GLM-5, Kimi K2.5 and many more.

Kundensupport