generate-models
Generate TypeScript interfaces and enums from OpenAPI schemas using aptx-ft CLI. Use when user asks to: (1) generate types/models from OpenAPI/Swagger, (2) create TypeScript interfaces from API schema, (3) extract type definitions from openapi.json, (4) generate selective models with --name filter, (5) preserve translated enum values, (6) track generated files with manifest, (7) preview changes before generation, or (8) update barrel files automatically. Do NOT use for full artifact generation with request layer or Material UI enum adaptation.
What this skill does
# Generate TypeScript Models
Generate TypeScript interfaces/enums from OpenAPI via aptx-ft.
## Prerequisites
```bash
pnpm add -D @aptx/frontend-tk-cli
```
## Discovery Phase - MANDATORY FIRST STEP
**Before executing any generation command, you MUST discover the actual project configuration.**
### For Monorepo Projects
1. **Find packages directory:**
```bash
ls -d packages/*/
```
2. **Identify model package and get its name:**
```bash
# Find package that likely contains models (domains, models, types, shared, etc.)
cat packages/domains/package.json 2>/dev/null || cat packages/models/package.json 2>/dev/null
```
Extract the `"name"` field - this is your `--model-path` value.
### Critical Rules
| ❌ NEVER Do This | ✅ ALWAYS Do This |
|------------------|-------------------|
| Guess package name from project directory | Read `package.json` to get actual `"name"` |
| Assume `@project-name/models` | Use the exact value from `"name"` field |
| Infer from `packages/domains/` path | Package name ≠ directory name |
### Example Discovery
```bash
# User says: "generate to packages/domains"
$ cat packages/domains/package.json
{ "name": "@repo/domains", ... } ← Package name is @repo/domains
```
## Workflow
1. **Discovery** → Read `package.json` files to get actual package names
2. **Identify project type** → recommend parameters
3. **Check output directory** → determine if `--preserve` is needed
4. **Confirm with user** → output dir, style, filters
5. **Execute** → show command, get approval, run
## Preserve Parameter Logic
**ALWAYS check if target directory contains existing models before generating:**
```bash
# Check if output directory has existing model files
ls ./src/models/*.ts 2>/dev/null || echo "empty"
```
| Directory State | Action |
|-----------------|--------|
| **Empty or not exists** | Generate WITHOUT `--preserve` |
| **Has existing .ts files** | Generate WITH `--preserve` to keep enum translations |
**Why:** When regenerating models in a non-empty directory, `--preserve` keeps manually translated enum names while adding new values. Only skip `--preserve` for fresh generation.
## Project Types
| Type | Output | Command |
|------|--------|---------|
| Single project | `./src/models` | `pnpm exec aptx-ft -i ./openapi.json model gen --output ./src/models --style module` |
| Monorepo | `./packages/models/src` | `pnpm exec aptx-ft -i ./openapi.json model gen --output ./packages/models/src --style module` |
## Key Options
| Option | Purpose |
|--------|---------|
| `--style module` | ES modules, individual exports (default, recommended) |
| `--style declaration` | Single declaration file (legacy compatibility) |
| `--name <Schema>` | Generate only specified models (repeatable) |
| `--preserve` | Keep manually translated enum names on regeneration |
## Manifest Tracking
The CLI automatically tracks generated files and detects changes between generations.
### Manifest CLI Options
| Option | Default | Purpose |
|--------|---------|---------|
| `--no-manifest` | false | Disable manifest tracking |
| `--manifest-dir <path>` | `.generated` | Custom manifest directory |
| `--dry-run` | false | Preview mode: generate report without updating manifest |
### Generated Manifest Files
When manifest tracking is enabled (default), the following files are generated:
```
<output>/
├── .generated/
│ ├── manifest.json # Tracks all generated files
│ ├── deletion-report.json # Machine-readable change report
│ └── deletion-report.md # Human-readable change report with LLM suggestions
└── models...
```
### Manifest Report Contents
The `deletion-report.md` includes:
- **Summary table**: Added/deleted/unchanged file counts
- **Deleted files**: List of files removed since last generation
- **Added files**: List of new files added
- **LLM suggestions**: Follow-up actions for handling deleted files
### When to Use Manifest Options
| Scenario | Command |
|----------|---------|
| Normal generation | Omit manifest options (default) |
| CI/CD without tracking | Add `--no-manifest` |
| Preview changes before applying | Add `--dry-run` |
| Custom manifest location | Add `--manifest-dir ./meta` |
## Automatic Barrel Updates
**The CLI automatically updates barrel files (index.ts) after generation.**
You no longer need to manually run `barrel gen` after generating models - the `model gen` command handles this automatically.
### What Gets Updated
- `<output>/index.ts` - Barrel file for the models directory
### When Manual Barrel Update is Needed
The automatic update handles most cases. Use manual `barrel gen` only when:
- Fixing corrupted barrel files
- Processing non-standard directory structures
- One-time batch updates across multiple directories
## Preserve Workflow
## Preserve Workflow
**Recommended when regenerating models after API updates.** Keeps manually translated enum names while adding new values.
1. Generate models
2. Manually translate enums (e.g., `Value1` → `Success`)
3. API updates with new enum values
4. Regenerate with `--preserve` → keeps translations, adds new values
```bash
# First generation
pnpm exec aptx-ft -i ./openapi.json model gen --output ./src/models
# After translating enums, regenerate with preserve
pnpm exec aptx-ft -i ./openapi.json model gen --output ./src/models --preserve
```
## Quick Reference
```bash
# Check if output directory has existing models first
ls ./src/models/*.ts 2>/dev/null
# First generation (empty directory)
pnpm exec aptx-ft -i ./openapi.json model gen --output ./src/models
# Regeneration (non-empty directory) - use --preserve
pnpm exec aptx-ft -i ./openapi.json model gen --output ./src/models --preserve
# Declaration style
pnpm exec aptx-ft -i ./openapi.json model gen --output ./src/models --style declaration
# Selective generation
pnpm exec aptx-ft -i ./openapi.json model gen --output ./src/models --name User --name Role
# Preview changes without updating manifest
pnpm exec aptx-ft -i ./openapi.json model gen --output ./src/models --dry-run
# Disable manifest tracking (CI/CD)
pnpm exec aptx-ft -i ./openapi.json model gen --output ./src/models --no-manifest
# Custom manifest directory
pnpm exec aptx-ft -i ./openapi.json model gen --output ./src/models --manifest-dir ./meta
# Without pnpm
npx aptx-ft -i ./openapi.json model gen --output ./src/models
```
## Output
TypeScript model files (interface/enum). Does not include request layer code.
## Boundaries
This skill generates TypeScript models only:
- Does NOT generate request layer code (functions, hooks) → use `generate-artifacts`
- Does NOT adapt Materal-specific enum semantics → use `adapt-materal-enums`
- Does NOT validate OpenAPI specification correctness
- Only supports JSON format (not YAML)
## Related Skills
- **generate-artifacts**: Full generation (models + request layer)
- **adapt-materal-enums**: Materal framework enum adaptation
- **download-openapi**: Fetch OpenAPI spec from URL
Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.