| name | typescript-style-guide |
| description | Apply the project's TypeScript conventions when writing, reviewing, refactoring, configuring, or migrating TypeScript. Covers Bun-first tooling, modules, type modeling, API design, neverthrow errors, Zod boundaries, bun:test, and React, CLI, and monorepo overlays. Also use when setting up a project or adding a dependency. |
TypeScript Style Guide
Apply the loaded policy pages directly.
Routing
Workflows
Policy Fast Paths
| Task | Load |
|---|
| Configure TypeScript or Biome | tsconfig, type checking, Biome |
| Change modules, imports, or exports | module resolution, type imports, exports, import paths, barrels |
| Model domain or boundary data | interface vs type, discriminated unions, immutability, runtime validation |
| Handle expected failure or async work | error handling, runtime validation, async patterns, resource management |
| Write tests | test structure, test doubles, type-level tests |
| Write React or TSX | React components, hooks and context |
| Write a CLI | CLI overlay |
| Work in a monorepo | monorepo overlay |
| Other TypeScript policy work | guideline index |
Core Behavior
- Workflows own multi-step procedures and route to their policy pages.
- Fast paths load only the directly linked owner pages.
- Use the guideline index only when no workflow or fast path matches.
- Select overlays using task descriptions in this router, the guideline index, or workflow routing.
- After loading an overlay, apply it only when its
Activation section matches.
- Prefer concrete TypeScript guidance over language tutorials.
- Ask one focused question only when required project context is missing.