defense-in-depth

Official

Make bugs impossible with multi-layer validation.

Authorraas-dev
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill ensures that bugs caused by invalid data are structurally impossible by mandating validation at every layer data passes through, preventing single points of failure and ensuring robust system behavior.

Core Features & Use Cases

  • Four Layers of Validation: Guides adding checks at entry point, business logic, environment guards, and debug instrumentation for comprehensive protection.
  • Structural Bug Prevention: Ensures that even if one validation is bypassed, subsequent layers catch the invalid data, making bugs nearly impossible to reproduce.
  • Comprehensive Data Flow Protection: Applies to any data passing through multiple system components, securing your entire application.
  • Use Case: When a bug is found due to invalid data (e.g., an empty directory causing git init in the wrong place), use this skill to add validation at every point the data is used, making the bug impossible to reproduce and preventing future regressions.

Quick Start

Layer 1: Entry Point Validation

function createProject(name, workingDirectory) { if (!workingDirectory || workingDirectory.trim() === '') { throw new Error('workingDirectory cannot be empty'); }

...

}

Layer 2: Business Logic Validation

function initializeWorkspace(projectDir, sessionId) { if (!projectDir) { throw new Error('projectDir required'); }

...

}

Layer 3: Environment Guards

async function gitInit(directory) { if (process.env.NODE_ENV === 'test') { # Refuse git init outside temp dir during tests }

...

}

Layer 4: Debug Instrumentation

async function gitInit(directory) { logger.debug('About to git init', { directory, cwd: process.cwd() });

...

}

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: defense-in-depth
Download link: https://github.com/raas-dev/configent/archive/main.zip#defense-in-depth

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.