typescript-strict
TypeScript strict mode patterns and best practices. Use when writing TypeScript code, fixing type errors, or reviewing TypeScript for type safety. Triggers on TypeScript, type error, strict mode, generics, or type inference keywords.
- License 许可
- MIT
- 最近更新
- 2026-05-18
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- typescript-strict
- description
- TypeScript strict mode patterns and best practices. Use when writing TypeScript code, fixing type errors, or reviewing TypeScript for type safety. Triggers on TypeScript, type error, strict mode, generics, or type inference keywords.
03 SKILL.md 正文
TypeScript Strict Mode — Aurion Standards
Absolute Rules
- ZERO
any— useunknown+ type guards instead strict: truein tsconfig.json (all strict checks enabled)- No
@ts-ignoreor@ts-expect-errorwithout justification - Explicit return types on exported functions
Common Patterns
Union Types > Enums
type ToolName = 'chat' | 'ide' | 'agent-ai' | 'studio' | 'uiforge' | '1code' | 'code-editor' | 'cowork' | 'ai-marketing' | 'text-editor' | 'lsp-server'
Discriminated Unions
type Result<T> = { ok: true; data: T } | { ok: false; error: string }
Type Guards
function isUser(value: unknown): value is User {
return typeof value === 'object' && value !== null && 'id' in value
}
Generic Utility Types
type DeepPartial<T> = { [P in keyof T]?: DeepPartial<T[P]> }
type RequireKeys<T, K extends keyof T> = T & Required<Pick<T, K>>
API Response Types
interface ApiResponse<T> {
data: T | null
error: string | null
status: number
}
React Component Props
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
variant: 'primary' | 'secondary' | 'ghost'
size?: 'sm' | 'md' | 'lg'
loading?: boolean
}
Fix Patterns
Object is possibly undefined
// Bad
user.name
// Good
user?.name ?? 'Unknown'
Type X is not assignable to type Y
// Check: are you using the correct type?
// Check: is the source data typed correctly?
// Fix: type assertion ONLY if you've verified the runtime type
const data = response as ExpectedType // Last resort
Property does not exist on type
// Add the property to the interface
// Or use a type guard to narrow
if ('newProp' in obj) { obj.newProp }
Aurion Config
- tsconfig.json: strict, noUncheckedIndexedAccess, exactOptionalPropertyTypes
- Typecheck:
npm run typecheck(must pass before deploy) - ESLint: strict TypeScript rules in eslint.config.js
04 同仓库更多 Skills
webapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
web-design-guidelines
Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".
vercel-react-view-transitions
Guide for implementing smooth, native-feeling animations using React's View Transition API (`<ViewTransition>` component, `addTransitionType`, and CSS view transition pseudo-elements). Use this skill whenever the user wants to add page transitions, animate route changes, create shared element animations, animate enter/exit of components, animate list reorder, implement directional (forward/back) navigation animations, or integrate view transitions in Next.js. Also use when the user mentions view transitions, `startViewTransition`, `ViewTransition`, transition types, or asks about animating between UI states in React without third-party animation libraries.
vercel-react-best-practices
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
vercel-composition-patterns
React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.
vercel-cli-with-tokens
Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".