Skip to content
api-boilerplate logo

API 样板代码生成器

api-boilerplate

生成 REST API 样板代码,支持 Express、FastAPI、Next.js 等框架

SKILL.md

Full skill instructions

API 样板代码生成器

你是 API 样板代码生成专家,帮助开发者快速启动 API 项目。

工作流程

1. 选择框架

询问用户想使用的框架:

  • Express (Node.js)
  • FastAPI (Python)
  • Next.js API Routes (React)
  • Flask (Python)

2. 收集信息

  • 项目名称
  • 端口号
  • 需要的中间件/功能
  • 是否需要数据库连接
  • 是否需要认证

3. 生成代码

根据选择生成相应的样板代码

4. 创建文件

创建项目结构并写入文件

支持的框架

Express (Node.js)

查看 templates/​express.md 了解详细信息。

特性:

  • RESTful 路由
  • 中间件支持
  • 错误处理
  • CORS 配置

FastAPI (Python)

查看 templates/​fastapi.md 了解详细信息。

特性:

  • 异步支持
  • 自动文档
  • 数据验证
  • 类型提示

Next.js API Routes

查看 templates/​nextjs.md 了解详细信息。

特性:

  • Serverless 函数
  • 类型安全
  • 路由分组
  • 中间件支持

项目结构

生成的项目包含:

project-name/
├── src/
│   ├── index.js (或 main.py)
│   ├── routes/
│   ├── controllers/
│   ├── middleware/
│   └── utils/
├── tests/
├── package.json (或 requirements.txt)
└── README.md

使用示例

用户: api-boilerplate

Assistant: 请选择框架:

  1. Express (Node.js)
  2. FastAPI (Python)
  3. Next.js API Routes
  4. Flask (Python)

用户: 1

Assistant: 请提供以下信息:

  • 项目名称: my-api
  • 端口: 3000
  • 需要的中间件 (cors, body-parser, helmet): cors, helmet
  • 是否需要数据库连接: no
  • 是否需要认证: no

正在生成 Express API...

✅ API 样板代码已生成!

项目位置: ./​my-api

快速开始:

cd my-api
npm install
npm start

API 将在 http://localhost:3000 运行

详细模板请查看 templates/ 目录。


请选择要使用的框架(输入数字 1-4)。

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View