claude/marketplace/plugins/sorah-guides/skills/typescript/SKILL.md
This skill should be used when writing or reviewing TypeScript or TSX code, or when the project uses "TypeScript", "React", "tsx", "SWR", "Vite", "Next.js", or TypeScript type patterns. Provides TypeScript coding conventions, React patterns, and best practices. Project-specific conventions always take priority.
npx skillsauth add sorah/config typescriptInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Coding conventions and best practices for TypeScript projects. Project-specific conventions (CLAUDE.md, style guides) always take priority over this guidance.
type over interface for object shapes, API responses, props, and general type aliasesinterface is acceptable only when declaration merging or extends is specifically neededkind or similar literal field for variant typestype Status = "INIT" | "READY" | "ERROR"Pick, Omit, and mapped types to derive types rather than duplicating fields? — avoid | undefined unless semantically distincttype Config = {
region: string;
tracks: TrackSlug[];
};
type ApiResponse =
| { kind: "success"; data: Item }
| { kind: "error"; message: string };
"strict": true in tsconfig)function isScreenMode(v: string): v is ScreenModeany — use unknown when the type is truly uncertain, then narrowimport type { ... } for type-only importsTrackPage.tsx), camelCase for utilities and libraries (api.ts, models.ts)ChatMessage, ScreenControl)trackSlug, onSubmit)UPPER_SNAKE_CASE (HISTORY_LENGTH, ALL_TRACKS)is or should (isRequesting, shouldShowTopic)ReactNode for children typeuseState for local state, React Context for shared/global stateuseSWR, useSWRInfinite) for server data fetching — no Redux/Zustandreact-hook-form (useForm) for form state managementuse* prefix)useEffect, useMemo, useCallback"use client" only when interactivity is neededasync and fetch data directlyserver-only package to enforce server-only modulesasync/await over raw Promise chainsisRequesting state flag in form handlersGetConferenceResponse)Error with additional context fieldsreact-error-boundary) at route levelconsole.error() for critical failures; console.log() acceptable for development debuggingFollow the project's chosen approach — common patterns:
w={["100%", "100%", "auto"]}), centralized theme with extendTheme().css.ts files co-located with components, createTheme() for tokens, globalStyle() for resetsCentralize color palettes and font definitions in a theme.ts or fundamental.css.ts file.
@/components/, @/lib/) when configured — prefer over deep relative paths@loadable/component or React.lazy for route-level code splittingdevelopment
This skill should be used when the user asks about "spec file format", "spec conventions", "spec vs docs", "current status section", "specification structure", "how to write a spec", "spec deliverables", or "self-contained spec". Provides conventions for writing implementation-ready specification documents.
testing
This skill should be used when conducting spec interviews or implementing specs for Ruby projects, or when the spec mentions "Ruby", "RSpec", "service objects", "Struct", or Ruby class/module patterns. Provides Ruby-specific interview and implementation checklist items.
testing
This skill should be used when conducting spec interviews or implementing specs for Ruby on Rails projects, or when the spec mentions "Rails", "ActiveRecord", "ActiveJob", "concerns", "migrations", "Rails.configuration", or "request specs". Provides Rails-specific interview and implementation checklist items.
development
This skill should be used when writing or reviewing Terraform code, or when the project uses "Terraform", "HCL", "tfvars", "aws_iam_role", "data sources", or infrastructure-as-code patterns. Provides Terraform coding conventions, patterns, and best practices. Project-specific conventions always take priority.