/frontend-openapi-skills:generate-artifactsfrom frontend-openapi-skills
Generate frontend artifacts from OpenAPI via aptx-ft, including models and request clients. Use when user wants: (1) to generate API code from OpenAPI/Swagger, (2) React Query hooks from API spec, (3) Vue Query composables from API spec, (4) function-based API clients, (5) a standard flow for frontend projects without framework-specific business adaptation, (6) track generated files with manifest, (7) preview changes before generation, or (8) update barrel files automatically.
Ships in frontend-openapi-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Generate models and request layer code from OpenAPI via aptx-ft CLI.
pnpm add -D @aptx-js/frontend-tk-cli
| Command | Purpose |
|---|---|
model gen | Generate TypeScript models |
aptx functions | Generate endpoint specs + function wrappers |
aptx react-query | Generate React Query hooks |
aptx vue-query | Generate Vue Query composables |
⚠️ Dependency:
react-queryandvue-queryrequirespec/fromaptx functions. Run functions first.
All paths are relative to working directory (project root).
| Parameter | Required | Description |
|---|---|---|
-i | ✅ | OpenAPI file path (e.g., ./openapi.json) |
-o | ✅ | Output directory (e.g., ./src/api) |
--model-mode | ✅ | relative (same project) or package (monorepo) |
--model-path | ✅ | Path or package name for model imports |
--client-mode | ❌ | global (default) / local / package |
--client-package | ❌ | Custom client package name |
--no-manifest | ❌ | Disable manifest tracking (default: false) |
--manifest-dir | ❌ | Custom manifest directory (default: .generated) |
--dry-run | ❌ | Preview mode without updating manifest (default: false) |
Is models directory inside the same package where API code is generated?
├── YES → --model-mode relative --model-path ./src/models
└── NO → --model-mode package --model-path @org/models (from package.json "name")
Which HTTP client will the generated code use?
├── Default @aptx-js/api-client → omit or --client-mode global
├── Custom client in this project → --client-mode local
└── Custom client from npm package → --client-mode package --client-package @org/api-client
⚠️ All
aptxcommands require--model-modeand--model-path. Without these, generated code will have broken imports.
Before executing any generation command, discover the actual project configuration.
# 1. Find packages
ls -d packages/*/
# 2. Get model package name (use THIS for --model-path)
cat packages/domains/package.json # Extract "name" field
# 3. Verify API package dependencies
cat packages/api/package.json
| ❌ NEVER | ✅ ALWAYS |
|---|---|
| Guess package name from directory | Read package.json "name" field |
Assume @project-name/models | Use exact value from "name" |
Infer from packages/domains/ path | Package name ≠ directory name |
packages/domains/)package.json (e.g., @repo/domains)packages/api/)packages/api/src)package.json files--preserve is needed for modelsALWAYS check if target model directory contains existing files before generating:
# Check if model output directory has existing files
ls ./src/models/*.ts 2>/dev/null || echo "empty"
| Directory State | Action |
|---|---|
| Empty or not exists | Generate models WITHOUT --preserve |
| Has existing .ts files | Generate models 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.
The CLI automatically tracks generated files and detects changes between generations.
| 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 |
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
└── api files...
| 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 |
The CLI automatically updates barrel files (index.ts) after generation.
You no longer need to manually run barrel gen after generating artifacts - the generation commands handle this automatically.
<output>/index.ts - Barrel file for the output directoryThe automatic update handles most cases. Use manual barrel gen only when:
# 0. Check if models directory has existing files
ls ./src/models/*.ts 2>/dev/null
# 1. Models (add --preserve if directory is NOT empty)
pnpm exec aptx-ft -i ./openapi.json model gen --output ./src/models --style module --preserve
# 2. Functions
pnpm exec aptx-ft aptx functions -i ./openapi.json -o ./src/api \
--model-mode relative --model-path ./src/models
# 3. Query layer (choose one)
pnpm exec aptx-ft aptx react-query -i ./openapi.json -o ./src/api \
--model-mode relative --model-path ./src/models
# Preview changes without updating manifest
pnpm exec aptx-ft aptx functions -i ./openapi.json -o ./src/api \
--model-mode relative --model-path ./src/models --dry-run
# 0. Check if models directory has existing files
ls ./packages/models/src/*.ts 2>/dev/null
# 1. Models (add --preserve if directory is NOT empty)
pnpm exec aptx-ft -i ./openapi.json model gen --output ./packages/models/src --style module --preserve
# 2. Functions
pnpm exec aptx-ft aptx functions -i ./openapi.json -o ./apps/web/src/api \
--model-mode package --model-path @org/models
# 3. Query layer (choose one)
pnpm exec aptx-ft aptx react-query -i ./openapi.json -o ./apps/web/src/api \
--client-mode package --client-package @org/api-client \
--model-mode package --model-path @org/models
# Custom manifest directory
pnpm exec aptx-ft aptx functions -i ./openapi.json -o ./apps/web/src/api \
--model-mode package --model-path @org/models --manifest-dir ./meta
src/api/
├── .generated/ # Manifest tracking files
│ ├── manifest.json # Tracks all generated files
│ ├── deletion-report.json # Machine-readable change report
│ └── deletion-report.md # Human-readable change report
├── index.ts # Barrel file (auto-updated)
├── spec/namespace/xxx.ts # Endpoint definitions (from functions)
├── functions/namespace/xxx.ts # Function wrappers (from functions)
├── react-query/namespace/ # React Query hooks
│ ├── xxx.query.ts
│ └── xxx.mutation.ts
└── vue-query/namespace/ # Vue Query composables
├── xxx.query.ts
└── xxx.mutation.ts
This skill handles generic OpenAPI → TypeScript generation:
adapt-materal-enumsdownload-openapi firstWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
7 skills in this plugin
/adapt-materal-enumsMateral-specific enum adaptation workflow: fetch enum values from provider API, let LLM fill suggested_name, then apply patch with aptx-ft. Use ONLY when: (1) user mentions Materal framework, (2) Materal naming rules are required, or (3) adapting Materal enum semantics. Do NOT use for generic OpenAPI projects./download-openapiDownload remote OpenAPI/Swagger JSON specification from a URL to local file using aptx-ft CLI. TRIGGER when user mentions: (1) fetch/pull/download swagger or openapi from URL, (2) save API spec to openapi.json locally, (3) get API documentation from server, or (4) prepare local input for code generation. DO NOT TRIGGER when: generating code/types from local file, reading existing openapi.json, downloading non-OpenAPI files, or authentication is required./generate-barrelsGenerate barrel index.ts files for TypeScript projects. Use when user mentions: (1) barrel files, (2) index.ts exports, (3) re-export files, (4) simplify import paths, (5) create index files for directory, or (6) generate export aggregators./generate-modelsGenerate 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./generate-pythonGenerate Python code from OpenAPI via aptx-ft, including Pydantic models, sync API functions, and OpenAI function-calling tools.json. Use when user wants: (1) to generate Python client code from OpenAPI/Swagger, (2) Pydantic v2 data models from API schemas, (3) sync API function wrappers with RequestSpec, (4) OpenAI function-calling tools.json, (5) Python code generation targeting aptx-api-core runtime, (6) track generated files with manifest, (7) preview changes before generation. Do NOT use for TypeScript code generation — use generate-artifacts or generate-models instead./write-pluginWrite custom JS plugins for the aptx-ft CLI to add commands, generate code, or analyze OpenAPI specs. Use when: (1) writing or loading a plugin file (.js/.ts), (2) using --plugin/-p CLI flag, (3) creating custom CLI subcommands, (4) accessing parsed OpenAPI data via ctx.getIr/PluginContext/GeneratorInput, (5) building custom code generators (e.g. Axios clients), (6) producing reports from OpenAPI specs, (7) questions about PluginDescriptor/CommandDescriptor/OptionDescriptor. Do NOT use for standard generation (models, react-query, vue-query, barrel files) — use generate-artifacts or generate-models instead.npx claudepluginhub haibaraaiaptx/frontend-openapi-skills --plugin frontend-openapi-skills