Claude Code Plugin

ts-patterns

TypeScript best practices — inline guidance and a dedicated reviewer.

Two components: an inline skill that watches .ts/.tsx files and guides in real time, plus a subagent for full PR reviews, large refactors, and JavaScript-to-TypeScript migrations.
Getting started

Install

# via gago-plugins marketplace
/plugin marketplace add gagoar/gago-plugins
/plugin install ts-patterns@gago-plugins
/reload-plugins
# standalone
/plugin marketplace add gagoar/typescript-patterns-enforcer
/plugin install ts-patterns@ts-patterns
/reload-plugins

What's included

Components

/ts-patterns:check — inline skill, always active on .ts/.tsx files
ts-patterns:review — subagent, spawn for full reviews
  • /ts-patterns:checkAutomatically active while writing or editing TypeScript. Provides inline guidance on types, patterns, and anti-patterns without being invoked.
  • ts-patterns:reviewSpawn via the Agent tool for PR reviews, large refactors, or converting JavaScript to TypeScript. Runs as a dedicated subagent.

Reference

Core principles

PrincipleRule
No 'any'Use unknown and narrow, or define precise types
Explicit return typesRequired on all public APIs
readonly by defaultUse readonly unless mutation is required
async/await onlyNo callbacks or .then() chains
Typed errorsCustom error classes or discriminated-union results
Composition over inheritancePrefer interfaces and composition

Reference

Anti-patterns

Anti-patternPreferred
type Foo = anytype Foo = unknown (then narrow)
function f(): anyfunction f(): ConcreteType
.then(cb).catch(cb)async/await with try/catch
class B extends Ainterface I; class B implements I
try { } catch(e) { e.message }catch(e) { if (e instanceof MyError) ... }
as SomeTypesatisfies or explicit narrowing