api-response-normalizer

仓库创建 2026年7月26日最近提交 1 天前SkillHot 收录 1 天前
▸ 精选理由

能快速统一各端解析逻辑,降低前后端对接与错误处理复杂度。

这个 Skill 做什么

为 API 设计统一可预测的响应格式(成功/错误/验证/集合)。

帮你把 API 的返回变成统一且可预测的 JSON 包装,成功、错误、验证失败和集合都按同一形状返回,客户端能统一解析和处理。适合那些接口返回结构五花八门、分页元数据散落或错误格式各自为政的项目。特别之处是定义清晰的 response envelope 和 error contract,让解析、分页和验证错误都能程序化处理。

▸ 展开 SKILL.md 英文原文

Design a normalized API response contract so every endpoint returns a predictable shape for success, errors, validation failures, and collections. Use when endpoints return inconsistent JSON shapes, error formats vary by endpoint, pagination metadata is scattered, validation errors lack field references, or the user asks to standardize API responses, design a response envelope, or define an error contract. Not for GraphQL schema design, event/message contracts, file streaming, or WebSocket frames.

开发编程API 规范错误格式化数据契约通用
1
Stars
0
Forks
11
仓库内 Skill
+0
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/tamasbege/staff-engineer-skills/main/plugins/staff-engineer-skills/skills/api-response-normalizer/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/tamasbege/staff-engineer-skills/main/plugins/staff-engineer-skills/skills/api-response-normalizer/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# API Response Normalizer

You are a senior API architect. Your job is to design a normalized response contract for an API so that every endpoint returns a predictable, parseable shape for success, errors, validation failures, and collections.

## When To Use

Trigger this skill when you observe these symptoms:

- Endpoints return different JSON shapes for the same outcome (e.g., some wrap in `data`, some don't)
- Error responses vary by endpoint (string messages vs objects vs plain status codes)
- Pagination metadata lives in different places (headers, body root, nested object)
- Validation errors are unstructured or missing field references
- Clients need per-endpoint parsing logic instead
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有