What problem does it solve?
This skill prevents bugs and security vulnerabilities by implementing a multi-layered validation strategy, ensuring that if one safeguard fails, others catch the problem, making bugs structurally impossible. This reduces the likelihood of critical failures and enhances system robustness.
Core Features & Use Cases
- Four Layers of Validation: Guides you to implement validation at the entry point, within business logic, as environment guards, and through debug instrumentation, providing comprehensive protection.
- Robust Error Prevention: Catches invalid data and unexpected states at multiple stages, significantly reducing the likelihood of critical failures and improving data integrity.
- Use Case: When implementing user registration, this skill ensures you validate email format at the controller (Layer 1), check for unique emails in the service (Layer 2), verify database connection before saving (Layer 3), and log all user creation attempts (Layer 4).
Quick Start
I'm implementing a new payment processing endpoint. Use the defense-in-depth skill to ensure robust validation.