npx claudepluginhub haibaraaiaptx/frontend-openapi-skillsA collection of frontend skills for working with OpenAPI specifications, including downloading Swagger files and generating TypeScript models.
No description available.
Claude Code marketplace entries for the plugin-safe Antigravity Awesome Skills library and its compatible editorial bundles.
Production-ready workflow orchestration with 79 focused plugins, 184 specialized agents, and 150 skills - optimized for granular installation and minimal token usage
这是一个 Claude Code 技能集,基于底层 aptx-ft 代码生成器,从 OpenAPI 3.x 规范生成前端模型与请求代码。
从 OpenAPI 定义自动生成类型安全的模型代码 — 消除手动类型定义,减少样板代码。
从远程 URL 下载 OpenAPI 3.x JSON 规范文件。
从 OpenAPI 3.x 规范生成 TypeScript 模型(接口、枚举):
aptx-ft model:gen,保持通用、纯净从 OpenAPI 3.x 规范生成通用前端产物:
model:gen)terminal:codegen,如 axios-ts / react-query / vue-query)仅用于 Materal 框架:
suggested_namegenerate-artifacts / generate-models(所有前端项目可用)adapt-materal-enums(仅 Materal,必须专用触发)在使用这些 skill 的目标前端项目中安装 aptx 相关包,并保证命令 aptx-ft 可用。
安装命令(任选其一):
pnpm add -D @aptx/frontend-tk-cli @aptx/frontend-tk-types
npm install -D @aptx/frontend-tk-cli @aptx/frontend-tk-types
yarn add -D @aptx/frontend-tk-cli @aptx/frontend-tk-types
项目代码中请使用包名引用,例如:
import type { APTXFtConfig } from "@aptx/frontend-tk-types";
不要在项目中引用仓库绝对路径(如 F:/... 或 /mnt/...)。
统一使用包命令(pnpm exec aptx-ft ... / npx aptx-ft ...)。
# 将此仓库添加为市场
/plugin marketplace add https://github.com/HaibaraAiAPTX/frontend-openapi-skills
# 安装插件
/plugin install frontend-openapi-skills@frontend-openapi-skills
下载并转换 OpenAPI 3.x JSON 规范为 TypeScript 模型:
Download https://petstore.swagger.io/v2/swagger.json file and convert to TypeScript models
为每个模型生成一个 TypeScript 文件以便更好地组织:
Download https://api.example.com/swagger.json file and convert to TypeScript models in folder mode
输出示例(文件夹模式):
src/types/
├── User.ts
├── UserStatus.ts
├── Order.ts
├── Product.ts
└── index.ts
每个文件自动导入其依赖项:
// User.ts
import { UserStatus } from './UserStatus';
export interface User {
id: number;
email: string;
status: UserStatus;
}
有关详细的配置选项和高级用法,请参阅技能文档。
仅支持 OpenAPI 3.x JSON 格式,不支持 Swagger 2.0 和 YAML 格式
| 功能 | OpenAPI 3.x |
|---|---|
| 基本类型 | ✅ |
| 枚举 | ✅ |
| 数组 | ✅ |
| 对象/嵌套 | ✅ |
| 必填/可选字段 | ✅ |
| 格式类型 | ✅ |
| 引用($ref) | ✅ |
| 描述支持 | ✅ |
| 类型导入 | ✅ |
注意事项:
我们欢迎贡献!要添加新技能:
skills/ 中创建新的技能目录SKILL.md 文件# 克隆仓库
git clone https://github.com/HaibaraaiAPTX/frontend-openapi-skills.git
cd frontend-openapi-skills
# 本地测试(直接使用 aptx 包命令)
pnpm exec aptx-ft input download --url <url> --output ./openapi.json
pnpm exec aptx-ft -i ./openapi.json model gen --output ./src/types --style module
# 将技能安装到 Claude Code 进行测试
cp -r skills/* ~/.claude/skills/
本项目在 MIT 许可证下授权 — 有关详细信息,请参阅 LICENSE 文件。
MIT License
Copyright (c) 2025 HaibaraaiAPTX
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
为 Claude Code 生态系统构建,使前端开发人员的 API 集成更快、更安全。