typescript-expert
Skill129 starsChanged 10 days agoMITView on GitHub
TypeScript 5.8+ type system, strict types, generics, and branded types / Sistem tipe TypeScript 5.8+, tipe strict, generics, dan branded types.
- Reads credentials
26 other projects use a version of this.
Adopted by
Most recently taken up by
- gromov0737/skillstheir own version, first seen Nov 29, 2026
- AtulPurohit/Antigravity-Awesome-Skillstheir own version, first seen Nov 29, 2026
- martinholovsky/claude-skills-generatortheir own version, first seen Nov 29, 2026
- ederheisler/skills-managertheir own version, first seen Nov 22, 2026
- AtilaMedeiros/skillstheir own version, first seen Nov 16, 2026
- Ivan-propio/claude-skillstheir own version, first seen Nov 16, 2026
Used with
Projects with it also use gh-commit, prek and 7 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
kelvincushmanSkillgh-commit
Create well-formatted commits with conventional commit format.
Also in 3 projects that use this
kelvincushmanSkillprek
Use when setting up or running hooks with prek in any repository. prek is a Rust drop-in alternative to pre-commit for running Git hooks that check, format, lint, and validate code and repository files. Prefer it when speed, workspace mode, built-in hooks, shared toolchains, or native TOML configuration matter.
Also in 3 projects that use this
ant-designSkillgh-create-pr
使用 GitHub CLI (gh) 推送当前分支并创建或更新 PR。在用户说「提 PR」「新建 PR」「用 gh 建 PR」「submit PR」「create pull request」时使用。
Also in 3 projects that use this
carapace-shSkillbun
Use when working with the bun CLI — Bun's all-in-one JavaScript runtime and toolkit. Covers the CLI command reference (install, add, remove, run, build, test, x, create, init, pm, upgrade, link, unlink), bunfig.toml configuration, environment variables, the package manager and lockfile, the test runner, the bundler, the Bun runtime API (Bun.serve, Bun.file, Bun.spawn, Bun.write, hashing, transpiler), the Bun shell ($ template literal), module resolution and loaders, and globals. Triggers on: "bun", "bunx", "bun install", "bun add", "bun remove", "bun run", "bun build", "bun test", "bun x", "bun create", "bun init", "bun pm", "bun upgrade", "bun link", "bun unlink", "bunfig.toml", "bun.lock", "Bun.serve", "Bun.file", "Bun.write", "Bun.spawn", "Bun.hash", "Bun.password", "bun:test", "Bun.build", "Bun.Transpiler", "bun shell", "$ template", "import.meta", "JavaScriptCore", "Bun.serve", "HTMLRewriter", "Bun.SQL", "Bun.RedisClient", "Bun.Glob", "Bun.plugin", "bun:ffi".
Also in 3 projects that use this
xfstudioSkilltypescript-advanced-types
Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications. Use when implementing complex type logic, creating reusable type utilities, or ensuring compile-time type safety in TypeScript projects.
Also in 4 projects that use this
VercelSkillgh-stack
Manages stacked PRs and splits multi-part work into reviewable branches with gh-stack. Use for stack creation, viewing, edits, push, submit, sync, rebase, merge, or checkout; when asked to split or isolate work for review; whenever a user mentions a stack, branch layers, dependent PRs, or gh stack; or when a stack is checked out.
Also in 3 projects that use this
Other versions26 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 26
- remix-run/remix★ 34ksame name
- fathah/hermes-desktop★ 15ksame name
- bastani-inc/atomic★ 886same name
- flora131/atomic★ 886same name
- jasonjgardner/blockbench-mcp-plugin★ 595same name
- keep-starknet-strange/starkzap★ 108same name
- martinholovsky/claude-skills-generator★ 48same name
- kumaran-is/claude-code-onboarding★ 35same name
- weAAAre/a11y-agents-kit★ 33same name
- xfstudio/skills★ 9same name
16 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository372 other files it gives its agents.
- AGENTS.mdAGENTS.md
- rules/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/vibes-plug-anti-slop.mdcCursor rule
- .cursor/rules/vibes-plug-backend.mdcCursor rule
- .cursor/rules/vibes-plug-core.mdcCursor rule
- .cursor/rules/vibes-plug-devops.mdcCursor rule
- .cursor/rules/vibes-plug-frontend.mdcCursor rule
- .cursor/rules/vibes-plug-mcp.mdcCursor rule
- .cursor/rules/vibes-plug-skills.mdcCursor rule
- .cursor/rules/vibes-plug-testing.mdcCursor rule
- llms-full.txtllms.txt
- llms.txtllms.txt
- showcase/llms-full.txtllms.txt
- showcase/llms.txtllms.txt
- a2a-agent-protocol-expertSkill
- accessibility-testing-expertSkill
- adaptive-model-cascadeSkill
- affective-computing-emotion-aiSkill
- agentic-coding-workflow-expertSkill
- agentic-m2m-settlementSkill
- agentic-memory-architectSkill
- agentic-micro-economy-architectSkill
- ai-code-review-autonomousSkill
- ai-llm-integration-expertSkill
- ai-media-generation-expertSkill
- ai-prompt-engineering-expertSkill
- ai-safety-governance-expertSkill
- angular-expertSkill
- anti-slopSkill
- api-design-expertSkill
- api-gateway-proxy-expertSkill
- app-analyzer-optimizerSkill
- apple-ecosystem-expertSkill
- app-promo-media-expertSkill
- astro-framework-expertSkill
- async-queue-temporal-expertSkill
- authentication-identity-expertSkill
- autonomous-api-drift-healerSkill
- autonomous-red-teamerSkill
- autonomous-tdd-debuggerSkill
- biome-linter-formatter-expertSkill
- blockchain-web3-expertSkill
- brainstormingSkill
- browser-automation-expertSkill
- browser-extension-mv3-proSkill
- bun-runtime-expertSkill
- chatbot-messaging-expertSkill
- ci-cd-devops-architectSkill
- cloudflare-workers-expertSkill
- cloud-hosting-expertSkill
- coderabbitSkill
- compliance-gdpr-privacy-expertSkill
- composable-mach-architectSkill
- computer-use-os-agent-expertSkill
- context-window-engineerSkill
- cron-scheduler-expertSkill
- database-orm-expertSkill
- data-pipeline-etl-expertSkill
- data-telemetry-expertSkill
- The first 60 shown.
The file
Files
TypeScript Expert (TypeScript 5.8+ Edition)
English | Bahasa Indonesia
<a name="english"></a>
English
Orchestration & Integration
- Upstream & Foundation:
zero-to-prod-orchestrator(Phase 2 foundation),brainstorming,session-memory-manager. - AST & Codebase Intelligence:
living-codebase-ast-graph(compiler API & type-checker symbols),scalability-clean-code(type-safe clean patterns). - Backend & Fullstack Runtime:
js-backend-expert(Node.js/Bun strict types),database-orm-expert(Prisma/Drizzle schema type generation). - Frontend & Monorepos:
senior-frontend(React 19 type safety),monorepo-architect(composite projects & isolated declarations),form-validation-expert(Zod schema inference). - Cross-Domain Synergy & Subagent Swarm Integration:
angular-expert,solidjs-expert,svelte-sveltekit-expert,blockchain-web3-expert
Description
Expert-level TypeScript development covering the advanced type system, strict mode enforcement, generic programming, utility types, branded types, and type-safe patterns for production applications. Targets TypeScript 5.8+ features including inferred type predicates, isolated declarations, NoInfer, using declarations, variadic tuple improvements, and const type parameters.
Trigger Conditions
- Writing TypeScript with advanced generic constraints.
- Enforcing strict type safety in existing codebases.
- Designing type-safe API contracts (REST, tRPC, Zod schemas).
- Implementing branded types for domain modeling.
- Resolving complex type errors or
anypollution. - Setting up
tsconfig.jsonfor strict projects. - Writing TypeScript utility types or type helpers.
TypeScript 5.x — Key Features
using Declarations (Explicit Resource Management, TS 5.2)
// Automatically calls [Symbol.dispose] on scope exit
function processFile(path: string) {
using handle = openFile(path); // disposed when function exits
handle.write('data');
}
// Async version with [Symbol.asyncDispose]
async function processDatabase() {
await using conn = await getConnection();
await conn.query('SELECT 1');
} // conn.close() called automaticallyNoInfer<T> Utility Type (TS 5.4)
// Prevents unintended type widening in generic inference
function createState<T>(initial: T, fallback: NoInfer<T>): T {
return initial ?? fallback;
}
// TS now errors if fallback type doesn't match initial
createState('hello', 42); // Error: Argument of type 'number' is not assignable to type 'string'const Type Parameters (TS 5.0)
// Infer literal types from generic arguments
function identity<const T>(value: T): T { return value; }
const a = identity(['a', 'b', 'c']); // type: readonly ["a", "b", "c"]
const b = identity({ x: 10 }); // type: { readonly x: 10 }TypeScript 5.5 - 5.8 — New Features
Inferred Type Predicates (TS 5.5)
// TypeScript now infers type predicates from return statements automatically
const nums = [1, null, 2, undefined, 3].filter((x) => x !== null);
// nums is now inferred as number[] — no manual type assertion needed!
// Before TS 5.5 you needed:
const nums = [1, null, 2].filter((x): x is number => x !== null);
// Works with any refinement pattern:
function isString(x: unknown) {
return typeof x === 'string'; // TS 5.5 infers: (x: unknown) => x is string
}Isolated Declarations (TS 5.5)
// New tsconfig option: "isolatedDeclarations": true
// Forces explicit return types on all exported functions — enables
// parallel .d.ts generation (massively speeds up monorepo builds)
export function add(a: number, b: number): number { // explicit return type required
return a + b;
}Iterator Helper Methods (TS 5.6 — ES2025)
// Native iterator methods now fully typed
const result = [1, 2, 3, 4, 5]
.values() // IteratorObject
.filter(x => x % 2 === 0) // 2, 4
.map(x => x * 10) // 20, 40
.toArray(); // [20, 40]Strict Mode Configuration
// tsconfig.json — recommended strict config for Next.js / monorepo projects
{
"compilerOptions": {
"target": "ES2022",
"lib": ["ES2022", "DOM", "DOM.Iterable"],
"module": "Preserve",
"moduleResolution": "Bundler",
"strict": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noImplicitOverride": true,
"isolatedModules": true,
"isolatedDeclarations": true,
"verbatimModuleSyntax": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true
}
}Note: Use
"moduleResolution": "Bundler"with"module": "Preserve"for Vite, Next.js, and other bundler-based projects. Use"NodeNext"for Node.js/Bun/Deno runtimes.
Advanced Type Patterns
Branded Types for Domain Modeling
// Prevent mixing semantically different primitives
type Brand<T, B extends string> = T & { readonly __brand: B };
type UserId = Brand<string, 'UserId'>;
type PostId = Brand<string, 'PostId'>;
type Email = Brand<string, 'Email'>;
// Constructor functions with validation
function createUserId(id: string): UserId {
if (!id.startsWith('user_')) throw new Error('Invalid user ID format');
return id as UserId;
}
function getUser(id: UserId): Promise<User> { /* ... */ }
const postId = 'post_abc' as PostId;
getUser(postId); // Compile error: PostId is not assignable to UserIdDiscriminated Unions for State Machines
type ApiState<T> =
| { status: 'idle' }
| { status: 'loading' }
| { status: 'success'; data: T }
| { status: 'error'; error: Error };
function render<T>(state: ApiState<T>) {
switch (state.status) {
case 'idle': return 'Idle';
case 'loading': return 'Loading...';
case 'success': return `Data: ${JSON.stringify(state.data)}`;
case 'error': return `Error: ${state.error.message}`;
// TypeScript enforces exhaustive matching
}
}Template Literal Types
type EventName = 'click' | 'focus' | 'blur';
type HandlerName = `on${Capitalize<EventName>}`;
// Result: 'onClick' | 'onFocus' | 'onBlur'
type DeepReadonly<T> = {
readonly [K in keyof T]: T[K] extends object ? DeepReadonly<T[K]> : T[K];
};
type Paths<T, Prefix extends string = ''> = {
[K in keyof T & string]: T[K] extends object
? Paths<T[K], `${Prefix}${K}.`>
: `${Prefix}${K}`;
}[keyof T & string];
// Paths<{ user: { name: string; age: number } }> = "user.name" | "user.age"Conditional Types and infer
type UnwrapPromise<T> = T extends Promise<infer U> ? U : T;
type ArrayElement<T> = T extends (infer U)[] ? U : never;
type ReturnType<T> = T extends (...args: any[]) => infer R ? R : never;
// Extract function parameter types
type Parameters<T extends (...args: any) => any> =
T extends (...args: infer P) => any ? P : never;Type-Safe Patterns
Zod Schema + TypeScript Integration
import { z } from 'zod';
const UserSchema = z.object({
id: z.string().cuid(),
email: z.string().email(),
role: z.enum(['USER', 'ADMIN']),
createdAt: z.coerce.date(),
});
type User = z.infer<typeof UserSchema>; // Derive type from schema
// Type-safe parsing with error handling
function parseUser(data: unknown): User {
return UserSchema.parse(data); // throws ZodError on failure
}
const safeResult = UserSchema.safeParse(data);
if (safeResult.success) {
console.log(safeResult.data.email); // fully typed
}Type-Safe Environment Variables
// env.ts — validate env at startup
import { z } from 'zod';
const envSchema = z.object({
DATABASE_URL: z.string().url(),
NEXTAUTH_SECRET: z.string().min(32),
NODE_ENV: z.enum(['development', 'test', 'production']),
PORT: z.coerce.number().default(3000),
});
export const env = envSchema.parse(process.env);
// env.PORT is now type `number`, not `string | undefined`Generic Repository Pattern
interface Repository<T, TId> {
findById(id: TId): Promise<T | null>;
findMany(filter?: Partial<T>): Promise<T[]>;
create(data: Omit<T, 'id' | 'createdAt' | 'updatedAt'>): Promise<T>;
update(id: TId, data: Partial<Omit<T, 'id'>>): Promise<T>;
delete(id: TId): Promise<void>;
}
class UserRepository implements Repository<User, UserId> {
async findById(id: UserId) { /* ... */ }
// TypeScript enforces all interface methods are implemented
}Common Pitfalls to Avoid
| Anti-Pattern | Problem | Solution |
as any | Disables type checking | Use unknown + narrowing or Zod |
as Type (unsafe cast) | Bypasses structural checking | Use type guards or satisfies |
// @ts-ignore | Silences real errors | Fix the root type issue |
! non-null assertion | Runtime errors if null | Use optional chaining + nullish coalescing |
Object / {} type | Accepts anything non-null | Use specific types or Record<string, unknown> |
Implicit any in callbacks | Breaks type inference | Always type function parameters |
The satisfies Operator (TS 4.9+)
// Validates against a type without widening the inferred type
const config = {
port: 3000,
host: 'localhost',
debug: true,
} satisfies Record<string, string | number | boolean>;
// config.port is still inferred as `3000` (literal), not `number`
config.port.toFixed(2); // Works! Literal type preserved.Hard Guardrails (Declarative Invariants)
- Strict Type Checking & Ban on
any/@ts-ignore:- Production codebases MUST enable
"strict": trueintsconfig.json. Usage ofas any, untypedanysignatures, and suppressing errors with// @ts-ignoreis strictly prohibited; developers must useunknownwith narrowing or// @ts-expect-errorwith an actionable issue justification.
- Production codebases MUST enable
- Explicit Type Annotation on Exported Signatures:
- Publicly exported functions, classes, and composite monorepo module boundaries MUST declare explicit return types and parameter types (
isolatedDeclarations: true). Relying on unexported circular inference across package boundaries is strictly prohibited.
- Publicly exported functions, classes, and composite monorepo module boundaries MUST declare explicit return types and parameter types (
- Branded Types for Incompatible Domain Identifiers:
- Strongly typed entities MUST use branded types (e.g.,
type UserId = string & { readonly __brand: unique symbol }) for primary keys and monetary units to prevent catastrophic argument swapping at call sites.
- Strongly typed entities MUST use branded types (e.g.,
- Deterministic Runtime Boundary Validation via Zod/ArkType:
- External inputs crossing process boundaries (HTTP payloads, environment variables, message queues) MUST NOT be cast directly with
as Type. They MUST be parsed via schema validators (schema.parse()) inferring compile-time types.
- External inputs crossing process boundaries (HTTP payloads, environment variables, message queues) MUST NOT be cast directly with
Sovereign Execution, Token Efficiency & Invariants
| Dimension | Sovereign Mandate & Deterministic Contract |
| Frontier Model Cascade | High Fast / High (Gemini 4 Carbon, Gemini 4 Neon, Grok 4.7 High Fast, Claude Sonnet 5.5 High, Gemini 4 Pro) |
| Availability Fallback | Gemini 4 (Carbon/Hydrogen/Neon/Argon/Pro) -> Gemini 3.8 Flash; Claude Opus 5.5 -> Claude Opus 4.6; Grok 4.7 -> Grok 4.6 High Fast (Zero unhandled missing-model errors) |
| KV-Cache & Token Protocol | Pin static instructions & schemas at prompt prefix (kv-cache-prefix-optimizer); pass surgical CONTEXT_MAP.md slices (<250 tokens/call) during Swarm Fan-Out |
| SaaT CLI & MCP Dispatch | CLI: vibes skill exec typescript-expert <audit|eval|verify|generate|blueprint> / MCP: vibes_skill_dispatch, vibes_ast_query, vibes_compile_cache, vibes_optimize_budget, vibes_verify_gate |
| NFR & Anti-Slop Invariants | 100% strict TypeScript compilation (tsc --noEmit with 0 errors), 0 occurrences of "as any" / "@ts-ignore", 100% runtime schema validation at boundaries; 100% complete zero-placeholder output verified via node scripts/check-anti-slop.js --strict |
<a name="bahasa-indonesia"></a>
Bahasa Indonesia
Integrasi Orkestrasi
- Hulu & Pondasi:
zero-to-prod-orchestrator(Pondasi Fase 2),brainstorming,session-memory-manager. - AST & Inteligensi Basis Kode:
living-codebase-ast-graph(compiler API & simbol type-checker),scalability-clean-code(pola clean type-safe). - Runtime Backend & Fullstack:
js-backend-expert(tipe ketat Node.js/Bun),database-orm-expert(generasi tipe skema Prisma/Drizzle). - Frontend & Monorepo:
senior-frontend(type safety React 19),monorepo-architect(composite project & isolated declarations),form-validation-expert(inferensi skema Zod). - Sinergi Lintas Domain & Integrasi Swarm Subagent:
angular-expert,solidjs-expert,svelte-sveltekit-expert,blockchain-web3-expert
Deskripsi
Panduan TypeScript level ahli mencakup sistem tipe tingkat lanjut, penerapan strict mode, pemrograman generik, utility types, branded types, dan pola type-safe untuk aplikasi produksi. Menargetkan fitur TypeScript 5.8+ termasuk inferred type predicates, isolated declarations, NoInfer, deklarasi using, peningkatan variadic tuple, dan parameter tipe const.
Kondisi Pemicu
- Menulis TypeScript dengan generic constraints tingkat lanjut.
- Menerapkan type safety ketat di codebase yang ada.
- Merancang kontrak API type-safe (REST, tRPC, Zod schema).
- Mengimplementasikan branded types untuk pemodelan domain.
- Menyelesaikan type error kompleks atau polusi
any. - Menyiapkan
tsconfig.jsonuntuk proyek strict denganisolatedDeclarations. - Menulis utility types atau type helpers TypeScript.
Panduan Singkat
- Aktifkan strict mode: Selalu gunakan
"strict": trueditambahnoUncheckedIndexedAccess,exactOptionalPropertyTypes, danisolatedDeclarations. - Inferred Type Predicates (TS 5.5): Filter array tanpa type assertion manual — TypeScript inferensikan sendiri.
- Isolated Declarations (TS 5.5): Aktifkan untuk mempercepat build monorepo via parallel
.d.tsgeneration. - Branded Types: Cegah pencampuran primitif yang berbeda secara semantis (UserId vs PostId).
- Discriminated Union: Gunakan untuk state machine dan variant data yang terbatas.
- Zod: Validasi data eksternal dan turunkan tipe TypeScript dari schema Zod.
- Hindari
as any: Gunakanunknowndengan narrowing atau Zod untuk data yang tidak diketahui tipenya. satisfiesoperator: Validasi objek terhadap tipe tanpa melebarkan tipe yang diinferensi.moduleResolution: Bundler: Gunakan untuk proyek Next.js/Vite;NodeNextuntuk Node.js/Bun backend.
Matriks Eksekusi Berdaulat, Efisiensi Token & Invarian
| Dimensi | Mandat Berdaulat & Kontrak Deterministik |
| Kaskade Model Frontier | High Fast / High (Gemini 4 Carbon, Gemini 4 Neon, Grok 4.7 High Fast, Claude Sonnet 5.5 High, Gemini 4 Pro) |
| Invarian Fallback Ketersediaan | Gemini 4 (Carbon/Hydrogen/Neon/Argon/Pro) -> Gemini 3.8 Flash; Claude Opus 5.5 -> Claude Opus 4.6; Grok 4.7 -> Grok 4.6 High Fast (Bebas gagal saat model belum tersedia/kuota penuh) |
| Protokol Hemat Token & KV-Cache | Kunci instruksi & skema statis di prefix awal (kv-cache-prefix-optimizer); kirim potongan CONTEXT_MAP.md (<250 token/panggilan) saat Fan-Out |
| Eksekusi SaaT CLI & MCP | CLI: vibes skill exec typescript-expert <audit|eval|verify|generate|blueprint> / MCP: vibes_skill_dispatch, vibes_ast_query, vibes_compile_cache, vibes_optimize_budget, vibes_verify_gate |
| Invarian NFR & Anti-Slop | 100% kompilasi TypeScript strict (tsc --noEmit dengan 0 error), 0 kemunculan "as any" / "@ts-ignore", 100% validasi skema runtime di batas sistem; kode 100% tuntas tanpa placeholder diverifikasi melalui node scripts/check-anti-slop.js --strict |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

