# Typescript Type Factory

> Creates and centralizes TypeScript types (Paper, User, Endorsement) under `src/types` to keep store and UI consistent.

- Skill: `tomevault-io/typescript-type-factory` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/typescript-type-factory`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/typescript-type-factory/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/typescript-type-factory

---


# 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

1. First Step: Create `src/types/index.ts` and define exported interfaces/types: `Paper`, `User`, `Endorsement`, `ApiResponse`.

2. Second Step: Ensure stores, components, and services import types from `@/types` to avoid duplication.

3. Third Step: Add comments and sample fixtures that match `mockData` for easy testing.

Examples

```ts
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 `schemaVersion` field.

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/cargdev) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-16 -->

