TypeScript Type-Factory
When to use this skill
- Use when adding new domain models or when types diverge between UI and store.
- Triggered by requests to generate types, add optional fields, or migrate type shapes.
Instructions
First Step: Create
src/types/index.tsand define exported interfaces/types:Paper,User,Endorsement,ApiResponse.Second Step: Ensure stores, components, and services import types from
@/typesto avoid duplication.Third Step: Add comments and sample fixtures that match
mockDatafor easy testing.
Examples
export type Paper = { id: string; title: string; authors: string[]; categories: string[]; abstract?: string }
Notes
- Keep versioning/migrations in mind if types are persisted to localStorage; consider a simple
schemaVersionfield.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.