Harden Android Kotlin API DTO/mapping (Retrofit/Moshi/Gson) for nullability and contract safety. Use when fixing 4xx/5xx parsing, NPEs, or mismatched fields.
Install
npx skillscat add envy-7z/mobile-agent-skillpack/android-api-dto-safety Install via the SkillsCat registry.
SKILL.md
Android API DTO Safety
Rules
- Do NOT change backend contract.
- Prefer safe defaults where appropriate; avoid
!!. - Keep changes localized to DTO/mappers.
- Add notes about potential migration impact.
Workflow
- Compare actual API payload vs DTO fields.
- Identify nullability mismatches and missing fields.
- Adjust DTO types/defaults and mapper logic safely.
- Suggest test coverage (unit test for mapper, sample JSON).
Output format
- What mismatched
- What changed
- Sample JSON + expected mapping behavior