defense-in-depth

Enforce multi-layer validation across system entry points and data paths.

Updated Nov 5, 2025
One-click install
npx skills add https://github.com/mikeyobrien/ghclip --skill defense-in-depth-mikeyobrien
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: defense-in-depth
Source: https://github.com/mikeyobrien/ghclip/tree/main/.claude/skills/defense-in-depth
Command: npx skills add https://github.com/mikeyobrien/ghclip --skill defense-in-depth-mikeyobrien

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a structural approach to preventing bugs caused by invalid data by implementing validation across multiple system layers. It makes errors "structurally impossible" rather than relying on single checkpoints, significantly enhancing system robustness, security, and reliability.

Core Features & Use Cases

  • Four-Layer Framework: Guides validation at entry points (API boundaries), within business logic, through environment guards (e.g., restricting operations to temp directories), and with debug instrumentation.
  • Comprehensive Data Flow Mapping: Recommends tracing the complete data flow to identify all checkpoints where validation can be applied.
  • Redundant Checks: Ensures that bypassing one layer of validation doesn't compromise overall system safety, providing robust error prevention.
  • Use Case: You're building a critical file processing service. Use this skill to implement validation at the API entry point (checking file existence), within the file processing logic (ensuring correct format), with environment guards (restricting operations to secure directories), and debug instrumentation for robust error handling.

Quick Start

Use the defense-in-depth skill to design validation layers for the new 'user-registration' API endpoint.

Frequently Asked Questions about defense-in-depth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent invalid data from causing bugs across my system layers?

Multi-layer validation prevents invalid data bugs by enforcing checks at API boundaries, within business logic, through environment guards, and with debug instrumentation. This ensures that bypassing any single layer doesn't compromise system safety, making errors structurally impossible rather than relying on isolated checkpoints.

What's the best way to design validation for API entry points and data paths?

Map your complete data flow to identify all checkpoints where validation applies—from API boundaries through business logic to environment restrictions. Implement redundant checks at each layer so invalid data cannot propagate, even if one validation layer is circumvented.

How do I ensure file processing operations stay confined to secure directories?

Environment guards restrict risky operations by validating context boundaries—for example, enforcing that file processing only occurs in designated secure or temporary directories. Combined with API and business-logic validation, this prevents unauthorized or unsafe data manipulation.

When should I add debug instrumentation to my validation layers?

Add instrumentation across all layers to provide contextual tracing during development, testing, and production troubleshooting. This validates inputs, enforces operation safety, and surfaces which validation checkpoint caught invalid data, accelerating root-cause analysis.

Can I apply multi-layer validation to an existing API endpoint?

Yes. Audit your endpoint's current data paths, then introduce validation incrementally at the API boundary, business-logic tier, environment guards, and debug points. This approach retrofits robustness without requiring a complete redesign.