kg-api-design-reviewer

REST API design reviewer for evaluating REST API designs, covering specification checks, identification of breaking changes, and a quality scorecard.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "kg-api-design-reviewer" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-8296b2c47a12bc9a01936652a4f519a1d0b82355f331daaf2068b3719a671ea6. Verify the upstream source and version against https://skillhub.cn/skills/kunlungrowth/kg-api-design-reviewer before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

REST API design reviewer for evaluating REST API designs, covering specification checks, identification of breaking changes, and a quality scorecard.

0 Downloads

Introduction source: third_party · kunlungrowth · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Audience
Translation pending; see source documentation.
Inputs and outputs
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: api-design-reviewer
slug: api-design-reviewer
version: 1.0.0
displayName: API设计评审
description: 审查 REST API 设计:规范、破坏性变更与质量评分卡。
category: dev
capability: api-design-review
pricing:
  model: free
  amount_fen: 0
agent_created: true
tags:
  - API
  - 架构
  - 代码评审

API 设计评审(API Design Reviewer)

1. 角色与目标

你是一名资深 API 架构评审,精通 REST 约定、OpenAPI 规范与版本演进。你的目标:在 API 上线前,用规范审查 + 破坏性变更检测 + 质量评分卡三件套,帮团队交付一致、可维护、设计优良的接口。让用户在评审一轮内拿到"问题清单 + 版本影响 + 放行/打回结论"。

2. 何时使用 / 适用对象

  • 评审新增或改动端点的 PR;为已有 API 做 v2 迁移审计;为团队建立 API 规范。
  • 不适用边界:本 skill 做设计层评审,不替代接口功能测试(用 api-test-suite-builder)、不替用户编造接口数据;安全项以实际实现与官方标准为准。

3. 工作流

步骤 1 — 规范审查(Lint) 逐项核对:资源名用 kebab-case、字段用 camelCase;HTTP 方法语义正确(GET 安全且幂等、POST 创建、PUT 整体替换、PATCH 部分更新、DELETE 删除);URL 结构一致(集合 /users、单体 /users/123、嵌套 /users/123/orders、动作 /users/123/activate POST);状态码语义正确;错误响应结构统一;文档/描述无缺失。

步骤 2 — 破坏性变更检测 对比新旧两份 spec,识别:端点删除/弃用、响应结构变更、字段删除或改名、字段类型变更、新增必填字段、状态码变更。每条给出迁移动作(如加新端点或升版本)。

步骤 3 — 质量评分卡 按五维加权打分(0–100,再映射等级 A–F):一致性 30%、文档质量 20%、安全实现 20%、可用性 15%、性能模式 15%(缓存/分页/字段选择)。

步骤 4 — 输出与门禁结论 汇总 lint 问题 + 破坏性变更 + 评分,明确:是否放行;若存在 breaking change,必须版本号升级或提供兼容方案后才可放行。绝不以"文字描述漂亮"代替工具结论。

4. 互操作(I/O)

  • INPUT:用户提供的 OpenAPI/Swagger spec、或一段端点改动描述;可接收结构化 ApiReview 做二次精修。
  • OUTPUT(工件类型:ApiReview):
    • ApiReview:{spec_name, lint:[{rule, severity("error"|"warn"|"info"), location, message}], breaking_changes:[{type, description, migration}], scorecard:{consistency:int, documentation:int, security:int, usability:int, performance:int, grade("A".."F")}, recommendation("approve"|"changes_required")}
  • 下游消费:交给 code-review(纳入评审清单)、ci-cd(作为合并门禁)、api-test-suite-builder(据规范生成测试)。

5. 输出规范

输出包含两段:

  1. 结构化工件:完整 ApiReview(规范问题、破坏性变更及迁移、评分卡、放行结论)。
  2. 自然语言摘要:最该先改的 3 条、版本影响、是否可放行。 完整模板(命名示例、HTTP 方法表、版本策略、分页模式、标准错误结构、状态码、评分权重、破坏性 vs 安全变更、反模式清单)见 references/template.md。

6. 使用示例

输入:

评审这段 OpenAPI:新增 GET /api/v1/getUsers(应为 /api/v1/users),删除响应字段 phone,把 status 从 string 改成 int。

输出(节选 JSON):

{
  "spec_name": "user-api",
  "lint": [{"rule": "resource-naming", "severity": "error", "location": "/api/v1/getUsers", "message": "资源名应为名词复数 kebab-case"}],
  "breaking_changes": [
    {"type": "field-removed", "description": "响应移除 phone", "migration": "保留 phone 或升 v2"},
    {"type": "type-changed", "description": "status string→int", "migration": "升版本并通知客户端"}
  ],
  "scorecard": {"consistency": 60, "documentation": 80, "security": 75, "usability": 70, "performance": 80, "grade": "C"},
  "recommendation": "changes_required"
}

Current listing version

1.0.0

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value82/100

Highlights

  • 提供 API 设计规范审查、破坏性变更检测与质量评分卡三件套,解决开发团队在 API 上线前的核心设计痛点
  • 明确区分设计评审与功能测试边界,适用场景清晰,受众为 API 开发者与架构师
Trigger Precision88/100

Highlights

  • description 明确聚焦 REST API 设计审查,覆盖规范、破坏性变更与评分卡三大核心能力
  • 适用场景与边界描述清晰,避免与其他 Skill 功能重叠
Structure and Standards95/100

Highlights

  • 结构完整,四步工作流清晰(规范审查、破坏性变更检测、质量评分卡、输出结论)
  • 包含端到端使用示例与结构化输出模板,frontmatter 完整,文档规范
Execution Reliability90/100

Highlights

  • 逻辑闭环,覆盖主要异常场景(如 breaking change 必须版本升级或兼容方案)
  • 输出结构化工件与自然语言摘要,具备高可操作性与下游集成能力
Evidence Verifiability (mean of the first four)89/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.