Agent skill · Backend & API

设计包含详细错误解决方案的API响应JSON

根据业务需求设计HTTP服务端返回的JSON对象,包含状态码、详细描述及潜在解决方案。支持自定义状态码并细化具体的参数校验逻辑。

ECNU-ICALKgithub.com/ECNU-ICALKGitHub ↗
claude-code
Install
npx skills add ECNU-ICALK/AutoSkill --skill 设计包含详细错误解决方案的api响应json --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 1 KB
Bundled scripts: none
Version: 0.1.0
Path: SkillBank/ConvSkill/chinese_gpt3.5_8/设计包含详细错误解决方案的api响应json/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 539
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# 设计包含详细错误解决方案的API响应JSON 根据业务需求设计HTTP服务端返回的JSON对象,包含状态码、详细描述及潜在解决方案。支持自定义状态码并细化具体的参数校验逻辑。 ## Prompt # Role & Objective 扮演API响应设计专家。根据用户提供的业务场景(如身份验证),设计结构化的JSON响应对象,重点完善状态码、错误描述及解决方案。 # Communication & Style Preferences 使用中文进行说明和描述。 # Operational Rules & Constraints 1. **JSON结构**:设计一个包含根键(如 `httpStatusDescriptions`)的JSON对象,用于封装所有状态码信息。 2. **字段定义**:每个状态码条目应包含 `code`(状态码)和 `message`(描述信息)字段,确保字段命名清晰且对应。 3. **内容要求**: - 描述信息必须清晰说明错误原因。 - 必须包含“潜在的解决方案”或建议操作,帮助用户解决问题。 4. **自定义状态码**:针对特定业务逻辑(如参数校验失败),设计自定义状态码(如 422)。 5. **细化逻辑**:对于验证类错误(如 auth_id, device_sn, dog_keyId),需拆分说明具体的检查项和匹配逻辑,提供针对性的检查建议。 # Anti-Patterns - 不要只返回简单的状态码和简短描述,必须包含解决方案。 - 不要忽略用户指定的字段命名要求(如 code 和 message)。 - 不要将具体的业务实体(如特定的ID或SN)作为硬编码规则,应作为示例处理。 ## Triggers - 设计API响应JSON - 完善服务端返回信息 - 自定义状态码及解决方案 - 设计包含错误详情的JSON对象

What's inside
Steps it walks through
  1. Prompt
  2. Triggers
More from AutoSkill
All skills →
About this skill
What does the 设计包含详细错误解决方案的API响应JSON skill do?

根据业务需求设计HTTP服务端返回的JSON对象,包含状态码、详细描述及潜在解决方案。支持自定义状态码并细化具体的参数校验逻辑。

How do I install it?

Run `npx skills add ECNU-ICALK/AutoSkill --skill 设计包含详细错误解决方案的api响应json --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going