What problem does it solve?
REST API responses often suffer from field misplacement, ambiguous types, inconsistent null handling, and misused HTTP status codes, while generated downstream artifacts (Excel/CSV/PDF exports, reconciliation files, third-party pushes) can appear successful yet silently fail when required fields are missing. This Skill provides defensive design rules and checklists to prevent these defects before they reach consumers.
Core Features & Use Cases
- API Response Design Rules: Prevents Java generic overload ambiguity, clarifies message vs data field semantics, standardizes null/empty handling, and separates HTTP status codes from business codes.
- Downstream Artifact Integrity Validation: Enforces pre-generation completeness checks for required fields (business fields, dependency configs, foreign-key associations) with explicit business errors listing affected IDs instead of silent empty-value fallbacks.
- Exception Type Discipline: Distinguishes BusinessException (HTTP 200 + business code) from framework exceptions (HTTP 500) so business errors are not misreported as system failures.
- Use Case: When building a WeChat mini-program shipping template export, the Skill ensures mchId, transactionId, and shipping company fields are validated upfront, failing the whole export with specific order numbers rather than producing a file the downstream platform rejects.
Quick Start
Ask the AI to review your REST API response structure or export logic using the cc-api-design-safety rules before committing the code.