Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Validates data at all four layers, from entry-point checks to debug logging, so invalid input cannot trigger deep failures.
18% 77%+59 ptsof test cases passed
Passed 17 of 22 test cases with the skill, and 4 of 22 without it.
3 of 3 safety checks passed
Not used yet
When you fix a bug caused by invalid data, adding validation at one place feels sufficient. But that single check can be bypassed by different code paths, refactoring, or mocks.
Core principle: Validate at EVERY layer data passes through. Make the bug structurally impossible.
Single validation: "We fixed the bug" Multiple layers: "We made the bug impossible"
Different layers catch different cases:
Purpose: Reject obviously invalid input at API boundary
function createProject(name: string, workingDirectory: string) {
if (!workingDirectory || workingDirectory.trim() === '') {
throw new Error('workingDirectory cannot be empty');
}
if (!existsSync(workingDirectory)) {
throw new Error(`workingDirectory does not exist: ${workingDirectory}`);
}
if (!statSync(workingDirectory).isDirectory()) {
throw new Error(`workingDirectory is not a directory: ${workingDirectory}`);
}
// ... proceed
}
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.