What problem does it solve?
This Skill provides a structural approach to preventing bugs caused by invalid data by implementing validation across multiple system layers. It makes errors "structurally impossible" rather than relying on single checkpoints, significantly enhancing system robustness, security, and reliability.
Core Features & Use Cases
- Four-Layer Framework: Guides validation at entry points (API boundaries), within business logic, through environment guards (e.g., restricting operations to temp directories), and with debug instrumentation.
- Comprehensive Data Flow Mapping: Recommends tracing the complete data flow to identify all checkpoints where validation can be applied.
- Redundant Checks: Ensures that bypassing one layer of validation doesn't compromise overall system safety, providing robust error prevention.
- Use Case: You're building a critical file processing service. Use this skill to implement validation at the API entry point (checking file existence), within the file processing logic (ensuring correct format), with environment guards (restricting operations to secure directories), and debug instrumentation for robust error handling.
Quick Start
Use the defense-in-depth skill to design validation layers for the new 'user-registration' API endpoint.