Skip to content
Back to skills

Zh

ASecurity

新增或修改 HTTP / RPC 接口时使用:检查命名、参数校验、错误、分页、兼容性和安全。

  • 824 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 3, 2026
ai-agentssqlapi

Works with

  • api

Security analysis

A100/100

Scanned December 3, 2026

npx -y skills add w01fb0ss/PiBot --skill zh --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Zh?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Zh
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/w01fb0ss-pibot-817e608c/badge)](https://www.skillsdirectory.com/skills/w01fb0ss-pibot-817e608c)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: api-design-review
description: "新增或修改 HTTP / RPC 接口时使用:检查命名、参数校验、错误、分页、兼容性和安全。"
metadata:
  pibot-name: "接口设计检查"
  pibot-params: "[{\"name\":\"接口\",\"description\":\"接口路径或名称,或相关文件\"}]"
---

# 接口设计检查

接口:{接口}

## 1. 先写出接口约定
用下面的格式写清楚,再对照检查:

```
方法 路径 / 名称:
用途:一句话
请求:字段 | 类型 | 必填 | 说明 | 取值范围
响应:字段 | 类型 | 说明
错误:错误码 | 什么时候出现 | 调用方该怎么做
```

## 2. 逐项检查
- **命名**:和项目已有接口风格一致(路径、大小写、单复数)。
- **输入校验**:在入口处校验类型、长度、范围、枚举;拒绝多余字段或明确忽略。
- **错误**:可预期的错误有明确的错误码和提示,不把内部异常、堆栈、SQL 暴露给调用方。
- **列表**:一律分页(游标或 limit + 游标),有上限;排序稳定。
- **幂等与并发**:重复提交会怎样?同一资源并发修改会怎样?需要时加幂等键或版本号。
- **超时与取消**:耗时操作有超时,能取消。
- **权限**:谁能调用?只能操作自己有权限的数据(检查资源归属,不只检查是否登录)。
- **数据**:查询用参数化语句;多步写入用事务;常用查询条件有索引。
- **兼容**:改已有接口时,旧调用方会不会坏?新增字段是否可选?
- **敏感信息**:响应和日志里不出现密码、令牌、完整证件号等。

## 3. 输出
```
**接口约定**:(上面的表)
**问题**:
1. [必须改 / 建议改] 问题 —— 原因 —— 建议
**兼容性影响**:…
```

## 使用边界

优先使用已有信息;用户的数量、格式和任务范围优先于本文默认模板。工具权限、主目录/附加只读、Plan 模式与预算以当次实际能力为准;不换工具规避拒绝。这里只给工作方法,不授权写入、命令、付费、发送、提交或发布;未执行/验证的步骤如实标明。

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.