smithery.ai

api-boilerplate

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

First seen Mar 21, 2026

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Skill metadata

Parsed from SKILL.md frontmatter.

Allowed toolsWrite, Read

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,210 B
  • docs SUMMARY.md 98 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

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](templates/express.md) 了解详细信息。

特性:

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

FastAPI (Python)

查看 [templates/fastapi.md](templates/fastapi.md) 了解详细信息。

特性:

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

Next.js API Routes

查看 [templates/nextjs.md](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/](templates/) 目录。


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