mcpField
T
typescript-advanced-patterns

typescript-advanced-patterns

github.com/pproencaDevelopment221155 installsUpdated 12w ago
Repository

About typescript-advanced-patterns

A TypeScript 5.x guidance skill for advanced type-level programming, library APIs, and implementation patterns. It is aimed at developers building DSLs, typed workflows, and libraries that use modern language features and declaration mechanisms.

Key features

  1. 0140 rules across 5 categories
  2. 02Fluent builders and typed DSL patterns
  3. 03Recursive conditional and tuple techniques
  4. 04Advanced TypeScript 5.x features
  5. 05Type-safe workflow and state modeling
  6. 06Declaration and module system guidance

Use cases

  1. 01Design a typed public library API
  2. 02Implement type-level transformations and tests
  3. 03Encode workflow states and transitions in types
  4. 04Publish types for JavaScript or TypeScript libraries

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/pproenca/dot-skills --skill typescript-advanced-patterns

After installing, type/typescript-advanced-patternsin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

AGENTS.md
metadata.json
assets/templates/
_template.md
references/
_sections.md
decl-ambient-asset-modules.md
decl-authoring-d-ts-for-js.md
decl-declaration-merging.md
decl-exports-and-types-versions.md
decl-global-augmentation-discipline.md
decl-module-augmentation.md
dsl-fluent-builder-phantom-state.md
dsl-narrow-api-surface.md
dsl-overloads-vs-conditional-returns.md
dsl-route-param-inference.md
dsl-schema-first-inference.md
dsl-type-safe-object-paths.md
dsl-type-safe-query-builder.md
dsl-typed-event-emitter.md
impl-assert-never-exhaustive.md
impl-env-config-loader.md
impl-finite-state-machine.md
impl-phantom-feature-flags.md
impl-schema-derived-api-client.md
impl-state-discriminated-union.md
impl-tagged-result-type.md
impl-type-safe-form-builder.md
mod-const-type-params-overloads.md
mod-method-vs-property-bivariance.md
mod-noinfer-overload-disambiguation.md
mod-phantom-capability-tracking.md

Details

From the project README

TypeScript Advanced Patterns Best Practices

Type-level programming, library-author idioms, and feature-implementation patterns that go beyond surface uses of TypeScript 5.x. Contains 40 rules across 5 categories, prioritised by impact on consumer codebases.

When to Apply

Reference these guidelines when:

  • Designing a public library or DSL surface (fluent builders, event emitters, route parsers, query builders, schema-derived clients)
  • Writing type-level algorithms (recursive conditionals, accumulator pattern, key remapping, variadic tuples, type-level string/number ops, type-level tests)
  • Using TS 5.x features in non-trivial ways (Stage 3 decorators, using composition, const T for overload disambiguation, NoInfer for anchor-vs-constrained parameters, variance annotations, the bivariance hole)
  • Encoding workflow state, transitions, and capabilities at the type level so illegal states and missing checks are compile errors
  • Integrating with the declaration & module system (module augmentation, declaration merging, ambient asset modules, library type publishing via exports/typesVersions)

Boundary with neighbouring skills

SkillDon't reach for this skill if you need…
typescript (curated)Compiler performance / tsconfig tuning
typescript-refactorGeneral refactoring patterns and modern-TS surface basics
ts-googleGoogle-style code style decisions
clean-code-ts-reactClean-code principles (naming, function shape, abstraction)
effect-ts / opencode-tsEffect library-specific patterns

If a rule in this skill overlaps with one in typescript-refactor or .curated/typescript, the rule's Scope delta section names what this skill adds beyond the simpler version.

Rule Categories by Priority

PriorityCategoryImpactPrefixRules
1Library Author / DSL PatternsCRITICALdsl-8
2Type-level ProgrammingHIGHtlp-10
3Modern Features at DepthHIGHmod-8
4Feature Implementation PatternsMEDIUM-HIGHimpl-8
5Declaration & Module SystemMEDIUMdecl-6

Quick Reference

1. Library Author / DSL Patterns (CRITICAL)
2. Type-level Programming (HIGH)
3. Modern Features at Depth (HIGH)
4. Feature Implementation Patterns (MEDIUM-HIGH)
5. Declaration & Module System (MEDIUM)

How to Use

Read individual reference files for detailed explanations, code examples, and "when NOT to apply" guidance:

Rules cross-link via [[other-rule-slug]]; follow them when a related pattern is referenced.

Reference Files

FileDescription
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules
metadata.jsonVersion and reference information

Comments

Markdown supported