typescript-coding
Expert TypeScript/JavaScript development guidance. Use when planning or writing TypeScript/JavaScript code, setting up TS/JS projects, configuring build tools (pnpm, Vite, TypeScript), implementing tests (Vitest), adding logging (pino for services, chalk/console for CLIs), working with React/Tailwind/Xstate, or following FP patterns. Covers stack decisions, tooling setup, testing strategies, and logging patterns for both services and CLI tools.
What this skill does
# TypeScript Coding
## Overview
Expert TS/JS development guidance across:
- Stack decisions (preferred libs)
- Tooling setup (pnpm, Vite, TS configs)
- Testing patterns (Vitest)
- Logging strategies (CLI vs services)
## Quick Reference
### Stack → ./STACK.md
Preferred libraries by category:
- Package mgmt: pnpm, Vite, TypeScript
- State/testing: Xstate, Vitest
- Quality: ESLint, Prettier
- UI: React, Tailwind, shadcn/ui
- Forms/data: react-hook-form, zod, tanstack query/router
- CLI: boxen, chalk, commander, ora
- Utils: date-fns, dotenv
- Release: semantic-release, husky
### Tooling → ./TOOLING.md
Setup patterns:
- FP patterns (avoid `this`, `new`, classes)
- Import aliases config
- pnpm commands & workspaces
- tsconfig.json templates
- Vite setup
- ESLint/Prettier config
- Monorepo structure
### Testing → ./TESTING.md
Vitest patterns:
- Parameterized (`test.each`) vs individual tests
- Decision framework
### Logging → ./LOGGING.md
App-specific patterns:
- **CLI tools** → console + chalk/ora (human-readable)
- **Services/APIs** → pino (structured JSON)
## Common Tasks
**New React app:**
```bash
pnpm create vite . --template react-ts
```
**Install deps:**
```bash
pnpm add <package> # regular
pnpm add -D <package> # dev
pnpm add <pkg> --filter @org/target # workspace
```
**ESLint setup:**
See ./TOOLING.md#eslint - Never disable rules except `no-console` for CLI
**Tailwind setup:**
See ./TOOLING.md#tailwind
**Monorepo:**
See ./TOOLING.md#pnpm-workspaces for complete structure
**Testing decision:**
- Pure fn w/ similar cases → `test.each()`
- Different setup/mocks → individual tests
- See ./TESTING.md for decision tree
**Logging:**
- CLI → console + chalk (see ./LOGGING.md#cli-logging)
- Service → pino (see ./LOGGING.md#pino)
## FP Patterns
- Avoid `this`, `new`, prototypes
- Plain objects `{}`, not classes
- Exception: custom `Error` classes
- Small, focused functions
See @docs/CODING_STYLE.md for universal FP guidelines
Related in Web Dev
generating-lwc-components
IncludedLightning Web Components with PICKLES methodology and 165-point scoring. Use this skill when the user creates or edits LWC components, builds wire service patterns, or writes Jest tests for LWC. TRIGGER when: user creates/edits LWC components, touches lwc/**/*.js, .html, .css, .js-meta.xml files, or asks about wire service, SLDS, or Jest LWC tests. DO NOT TRIGGER when: Apex classes (use generating-apex), Aura components, or Visualforce.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Set up queries with useQuery, mutations with useMutation, configure QueryClient caching strategies, implement optimistic updates, and handle infinite scroll with useInfiniteQuery. Use when: setting up data fetching in React projects, migrating from v4 to v5, or fixing object syntax required errors, query callbacks removed issues, cacheTime renamed to gcTime, isPending vs isLoading confusion, keepPreviousData removed problems.
document-processor-api
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
nutrient-document-processing
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Covers useMutationState, simplified optimistic updates, throwOnError, network mode (offline/PWA), and infiniteQueryOptions. Use when setting up data fetching, fixing v4→v5 migration errors (object syntax, gcTime, isPending, keepPreviousData), or debugging SSR/hydration issues with streaming server components.
accelint-nextjs-best-practices
IncludedNext.js performance optimization and best practices. Use when writing Next.js code (App Router or Pages Router); implementing Server Components, Server Actions, or API routes; optimizing RSC serialization, data fetching, or server-side rendering; reviewing Next.js code for performance issues; fixing authentication in Server Actions; or implementing Suspense boundaries, parallel data fetching, or request deduplication.