What problem does it solve?
Fixing a bug with a single validation point is often insufficient, as other code paths, refactoring, or mocks can bypass it, leading to recurring issues and system instability.
Core Features & Use Cases
- Multi-Layered Validation: Mandates validation at every layer data passes through: entry point, business logic, environment guards, and debug instrumentation.
- Structural Bug Prevention: Makes bugs structurally impossible by adding redundant checks, ensuring data integrity across the system.
- Context-Specific Guards: Implements environment-specific checks (e.g., refusing
git init outside temp directories in tests) to prevent dangerous operations.
- Use Case: After fixing a bug caused by an empty
projectDir leading to git init in source code, use this skill to implement validation at all relevant layers, ensuring the bug cannot recur.
Quick Start
Use the defense-in-depth skill to add robust validation for the user_input variable across all system layers, starting with entry point validation.