Skip to content
Agent Orchestration
Skill

/typescript-best-practices

TypeScript grounding for type-system discipline: discriminated unions over flags, satisfies, parse-don't-validate at boundaries, branded primitives, no non-null assertions on external data.

From plugin
oh-my-claudecode
41k84 skills21 agents21 commands11 hooks
+1

Claude Code

$ npx -y skills add Yeachan-Heo/oh-my-claudecode --skill typescript-best-practices --agent claude-code

SKILL.md

typescript-best-practices.SKILL.md
name: typescript-best-practices
description: "TypeScript grounding for type-system discipline: discriminated unions over flags, satisfies, parse-don't-validate at boundaries, branded primitives, no non-null assertions on external data."
aliases: []
metadata:
  credits:
    type-discipline: pstack
    author: Lauren Tan
    url: "https://github.com/cursor/plugins/tree/main/pstack"
    port: pstack-claude
    port-author: Michael Denyer
    port-url: "https://github.com/michael-denyer/pstack-claude"

TypeScript Best Practices

The type system is the cheapest place to make illegal states unrepresentable (`principles` skill, Type system discipline). Concrete forms:

  • **Discriminated unions over boolean flags.** `type Ev = {kind:'click'; x:number} | {kind:'focus'}` — not `{isClick:boolean; x?:number}`. Exhaustive `switch` on `kind` turns missing cases into compile errors.
  • **`satisfies` for configuration literals.** `{...} satisfies Config` keeps literal inference while checking the shape.
  • **Parse, don't validate, at boundaries.** External data (JSON, env, CLI args, API responses) passes through one parsing function returning a typed result; downstream code takes the parsed type, never `any` re-cast. `unknown` in, typed out.
  • **Brand primitives that carry meaning.** `type SessionId = string & {__brand:'SessionId'}` when mixing two `string`s is a realistic bug.
  • **No non-null assertions on external data.** `!` is allowed only where a check on a previous line proves the value; at boundaries it is a runtime crash with compile-time approval.
  • **Return types that prevent misuse.** A function that can fail returns a result union, not `T` plus a thrown maybe; callers must handle both arms to compile.
  • **`readonly` by default on shared shapes**, mutation as an explicit opt-in.

Reviewing

When reviewing TS, the question per diff hunk is not "does it compile" but "which illegal state did this type just permit" — flag flags-over-unions, boundary `any`s, and unbranded overlapping primitives.

Rules

  • Discipline applies at the boundary and the domain model; inside a single

function, pragmatism wins.

  • Never introduce a type abstraction with one caller and no second one

coming (`minimal-code-discipline`).

Read more
@yeachan-heo
Ships withoh-my-claudecode

For Codex users: Check out oh-my-codex — the same orchestration experience for OpenAI Codex CLI. Liked OmC but found it a bit overkill? Try gajae-code.

41k84 skills21 agents1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
40.7k
Star history of Yeachan-Heo/oh-my-claudecode on GitHub, a chart by star-history.com

Other skills on oh-my-claudecode.

architect

architect

Settle types and module shape before cross-boundary code — competing designs explored in parallel, compared on API surface and…

arena

arena

Run N parallel candidates at one brief and synthesize: rubric-first framing, isolated fan-out, a cross-judge on a different…

More skills from other plugins.

1password

1password

Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.

clawdis11d393k
@steipete@steipeteInstall Skill
computer-use

computer-use

Drives the GUI of a visible local app window through `orca computer`: accessibility tree, clicks, typing, menus, dialogs, and…

orca10d111k
@stablyai@stablyaiInstall Skill
agentmail

agentmail

Use your assigned AgentMail inbox to read email tasks, explicitly send or reply, and check delivery. Provided automatically by…

paperclip10d109k
@paperclipai@paperclipaiInstall Skill
adr-create

adr-create

Create a new Architecture Decision Record with sequential numbering and AgentDB registration

@ruvnet@ruvnetInstall Skill

Questions about typescript-best-practices.

Which coding agents can use typescript-best-practices?
typescript-best-practices installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.