What problem does it solve?
Codebases often suffer from unstructured data flow, leading to bugs and maintenance challenges. This Skill codifies a disciplined approach to data flow by applying the 5 Laws of Elegant Defense, helping code stay readable, predictable, and robust.
Core Features & Use Cases
- Early Exit (Guard Clauses): Handle edge cases at the top of functions to prevent cascading errors.
- Parse, Don't Validate: Convert inputs to trusted, typed state at the boundary before business logic.
- Atomic Predictability: Prefer pure functions with no hidden state changes.
- Fail Fast, Fail Loud: Stop on invalid states with descriptive errors rather than patching data.
- Intentional Naming: Use clear, descriptive names to reduce the need for comments.
Quick Start
Apply the five laws to a sample function and outline guard clauses, input parsing, function purity, fail-fast behavior, and naming clarity.