360 Secure SkillHub
360 安全技能中心

Api Generator

核心功能:支持生成RESTful端点、GraphQL schema、OpenAPI文档,还能生成API客户端、Mock服务器、JWT/OAuth等认证代码、限流组件及Jest测试套件。典型场景:开发人员快速搭建API项目基础骨架,减少重复编码。通过命令行输入指令及资源名调用,输出带完整注释的生产级代码至标准输出,可直接导入项目使用。

ckchzh
ckchzh
热度 98.24
最近更新 2026-05-11 17:30:20
分类:开发依赖:纯提示词应用场景:代码生成 / API 集成

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add api-generator
Metadata
version
2.0.0
name
api-generator
description
API code generator. Generate RESTful endpoints, GraphQL schemas, OpenAPI/Swagger docs, API clients, mock servers, authentication, rate limiting.
author
BytesAgain
homepage
https://bytesagain.com
source
https://github.com/bytesagain/ai-skills

⚡ API Generator

Generate production-ready API code scaffolds from zero. REST, GraphQL, auth, tests — all in one tool.

Usage

bash scripts/apigen.sh <command> <resource_name> [options]

Commands

Core Generation

  • rest <name> — RESTful CRUD endpoints (Express.js)
  • graphql <name> — GraphQL Type + Query + Mutation schema
  • swagger <name> — OpenAPI 3.0 specification document

Utilities

  • client <name> — Python API client class
  • mock <name> — Mock API server with in-memory store
  • auth <type> — Auth code (jwt / oauth / apikey)
  • rate-limit <type> — Rate limiter (token-bucket / sliding-window)
  • test <name> — Jest + Supertest API test suite

Examples

bash scripts/apigen.sh rest user          # RESTful user endpoints
bash scripts/apigen.sh graphql product    # GraphQL product schema
bash scripts/apigen.sh auth jwt           # JWT authentication
bash scripts/apigen.sh test order         # Order API tests

Output

All code prints to stdout. Copy or redirect into your project files. Generated code includes full comments and can serve as a project starting point.

💬 Feedback & Feature Requests: https://bytesagain.com/feedback Powered by BytesAgain | bytesagain.com