One-click install
npx skills add https://github.com/baleen37/dotfiles --skill defense-in-depth-baleen37
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: defense-in-depth
Source: https://github.com/baleen37/dotfiles/tree/main/modules/shared/config/claude/skills/defense-in-depth
Command: npx skills add https://github.com/baleen37/dotfiles --skill defense-in-depth-baleen37

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Fixing a bug with a single validation point often leaves other code paths vulnerable, allowing the same bug to reappear. This skill enforces a "defense-in-depth" strategy, requiring validation at every layer data passes through, making bugs structurally impossible to reproduce.

Core Features & Use Cases

  • Four Layers of Validation: Implements checks at entry points, business logic, environment guards, and debug instrumentation.
  • Structural Bug Prevention: Ensures that even if one layer is bypassed, subsequent layers catch invalid data, making the bug impossible.
  • Context-Specific Guards: Prevents dangerous operations in specific contexts (e.g., git init outside temp directories in tests).
  • Use Case: After fixing a bug where an empty directory caused git init in source code, this skill guides you to add validation at the Project.create call, WorkspaceManager, and an environment guard in gitInit to prevent it from ever happening again.

Quick Start

When you find a bug:

1. Trace the data flow: Identify where bad values originate and are used.

2. Map all checkpoints: List every point data passes through.

3. Add validation at each layer:

- Layer 1: Entry Point Validation (e.g., API boundary)

- Layer 2: Business Logic Validation (e.g., operation-specific checks)

- Layer 3: Environment Guards (e.g., prevent dangerous ops in tests)

- Layer 4: Debug Instrumentation (e.g., capture context for forensics)

4. Test each layer: Try to bypass one layer, verify the next catches it.