
Typescript
Apply 45 prioritized TypeScript performance and correctness rules when agents generate or refactor TS so builds stay fast and types stay sound.
Overview
TypeScript is an agent skill most often used in Build (also Ship) that applies 45 impact-prioritized TypeScript rules for faster compiles, safer types, and cleaner modules during agent-led refactors.
Install
npx skills add https://github.com/pproenca/dot-skills --skill typescriptWhat is this skill?
- 45 rules across 8 categories prioritized by performance impact
- Covers type-system performance, compiler config, async patterns, and modules
- Incorrect vs correct code pairs with quantified impact notes per rule
- Aligned to TypeScript 5.5+ isolatedDeclarations and 5.8+ erasableSyntaxOnly
- Curated dot-skill mirrors SKILL.md for agent-driven refactors
- TypeScript 5.5+ and 5.8+ compiler features referenced
- Per-rule impact metrics (e.g., 2–10× improvement, 200ms savings)
Adoption & trust: 979 installs on skills.sh; 157 GitHub stars; 3/3 security scanners passed (skills.sh audits); trending (+100% hot-view momentum).
What problem does it solve?
Your agent ships TypeScript that typechecks but slows incremental builds and hides async or module bugs until production.
Who is it for?
Indie devs on React, Next.js, or Node TS monorepos who want agents to follow explicit performance rules—not vague “best practices.”
Skip if: Greenfield learners who have not run tsc yet, or projects with zero TypeScript in the stack.
When should I use this skill?
Maintaining or generating TypeScript and you need performance-first compiler, type, async, and module rules—not generic JS tips.
What do I get? / Deliverables
Refactors follow documented incorrect-vs-correct patterns so compiler settings, types, and modules stay optimized for TypeScript 5.5+ codebases.
- Refactored TS snippets following prioritized rules
- Compiler and module configuration recommendations
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
TypeScript craftsmanship anchors in Build because most refactors, compiler tuning, and module layout happen while shipping application code. Frontend is the primary shelf for TS-heavy React/Next stacks, though rules also apply to Node APIs sharing the same repo.
Where it fits
Rewrite verbose inferred types in a Next.js app so isolatedDeclarations keeps CI fast.
Organize shared types and API modules in a Node TS service without circular import stalls.
Run impact-prioritized rules before launch when bundle and tsc times regressed after agent churn.
How it compares
Rule-backed refactor guide for TS performance—not a linter replacement or a generic JavaScript intro skill.
Common Questions / FAQ
Who is typescript for?
Solo builders and small teams using Claude Code, Cursor, or Codex on TypeScript apps who need consistent, high-impact coding standards during generation and review.
When should I use typescript?
During Build when scaffolding features or tightening types; during Ship review or perf passes before release when compile time and bundle weight matter.
Is typescript safe to install?
It is documentation-style guidance; confirm repo access scope in the Security Audits panel on this page before letting an agent apply bulk edits.
SKILL.md
READMESKILL.md - Typescript
# TypeScript This curated skill mirrors `SKILL.md`. When maintaining it, keep the guidance focused on TypeScript performance, compiler errors, async patterns, type definitions, and module organization. --- title: Rule Title Here impact: MEDIUM impactDescription: Quantified impact (e.g., "2-10× improvement", "200ms savings") tags: prefix, technique, related-concepts --- ## Rule Title Here Brief explanation of the rule and why it matters (1-3 sentences). Focus on performance implications. **Incorrect (description of what's wrong):** ```typescript // Bad code example here const badExample = inefficientOperation() ``` **Correct (description of what's right):** ```typescript // Good code example here const goodExample = efficientOperation() ``` Reference: [Link to documentation](https://example.com) { "version": "1.1.9", "organization": "TypeScript Best Practices", "technology": "TypeScript", "date": "February 2026", "abstract": "Comprehensive performance optimization guide for TypeScript applications, designed for AI agents and LLMs. Contains 45 rules across 8 categories, prioritized by impact from critical (type system performance, compiler configuration) to incremental (advanced patterns). Each rule includes detailed explanations, real-world examples comparing incorrect vs. correct implementations, and specific impact metrics to guide automated refactoring and code generation. Updated for TypeScript 5.5+ (isolatedDeclarations) and 5.8+ (erasableSyntaxOnly).", "references": [ "https://github.com/microsoft/TypeScript/wiki/Performance", "https://www.typescriptlang.org/docs/handbook/", "https://v8.dev/blog", "https://nodejs.org/en/learn/diagnostics/memory" ], "category": "Lang" } # Sections This file defines all sections, their ordering, impact levels, and descriptions. The section ID (in parentheses) is the filename prefix used to group rules. --- ## 1. Type System Performance (type) **Impact:** CRITICAL **Description:** Complex types, deep generics, and large unions cause quadratic compilation time. Simplifying type definitions yields the largest compile-time gains. ## 2. Compiler Configuration (tscfg) **Impact:** CRITICAL **Description:** Misconfigured tsconfig causes full rebuilds and unnecessary file scanning. Proper configuration reduces compile time by 50-80%. ## 3. Async Patterns (async) **Impact:** HIGH **Description:** Sequential awaits create runtime waterfalls. Parallelizing async operations yields 2-10× improvement in I/O-bound code. ## 4. Module Organization (module) **Impact:** HIGH **Description:** Barrel files and circular dependencies force excessive module loading. Direct imports reduce bundle size and improve tree-shaking. ## 5. Type Safety Patterns (safety) **Impact:** MEDIUM-HIGH **Description:** Type guards, narrowing, and strict mode prevent runtime errors. Proper patterns eliminate defensive runtime checks. ## 6. Memory Management (mem) **Impact:** MEDIUM **Description:** Object pooling, WeakMap usage, and closure hygiene reduce GC pressure and memory leaks in long-running applications. ## 7. Runtime Optimization (runtime) **Impact:** LOW-MEDIUM **Description:** Loop optimization, property caching, and collection choice improve hot-path performance. ## 8. Advanced Patterns (advanced) **Impact:** LOW **Description:** Branded types, variance annotations, and declaration merging for specialized use cases. --- title: Use Branded Types for Type-Safe IDs impact: LOW impactDescription: prevents mixing incompatible ID types tags: advanced, branded-types, nominal-types, type-safety, ids --- ## Use Branded Types for Type-Safe IDs TypeScript uses structural typing, so `string` types are interchangeable even when they represent different concepts. Branded types add a unique marker to prevent mixing incompatible values. **Incorrect (structural typing allows mixing):** ```typescript type UserId = string type OrderId = string type ProductId = string fun