Defense in Depth Validation

Validate at every layer data passes through to make bugs impossible

2,245 stars 418 forksSoftware Development Plugin marketplace

Install

Claude Code plugin
/plugin marketplace add mrgoonie/claudekit-skills

The repo is a Claude Code plugin marketplace. Run /plugin afterwards to pick the plugin that includes this skill.

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add mrgoonie/claudekit-skills --skill Defense-in-Depth Validation
Manual install
git clone --depth 1 https://github.com/mrgoonie/claudekit-skills.git /tmp/claudekit-skills
mkdir -p ~/.claude/skills
cp -r /tmp/claudekit-skills/.claude/skills/debugging/defense-in-depth ~/.claude/skills/Defense-in-Depth-Validation

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Defense-in-Depth Validation

## Overview

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.

## Why Multiple Layers

Single validation: "We fixed the bug"
Multiple layers: "We made the bug impossible"

Different layers catch different cases:
- Entry validation catches most bugs
- Business logic catches edge cases
- Environment guards prevent context-specific dangers
- Debug logging helps when other layers fail

## The Four Layers

### Layer 1: Entry Point Validation
**Purpose:** Reject obviously invalid input at API boundary

```typescript
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
}
```

### Layer 2: Business Logic Validation
**Purpose:** Ensure data makes sense for this operation
Read the full skill on GitHub

Details

Skill name
Defense-in-Depth Validation
Path
.claude/skills/debugging/defense-in-depth/SKILL.md
Repo updated
3 April 2026
Copies
Found in 3 GitHub repos

FAQ

What does the Defense in Depth Validation skill do?

Validate at every layer data passes through to make bugs impossible

How do I install the Defense in Depth Validation skill?

Claude Code plugin: /plugin marketplace add mrgoonie/claudekit-skills. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Defense in Depth Validation popular?

It lives in mrgoonie/claudekit-skills, which has 2,245 GitHub stars and 418 forks.

Related skills

MCP Builder

2.2k

mrgoonie/claudekit-skills

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

AI, LLMs & AgentsIn 2 lists418

PDF

2.2k

mrgoonie/claudekit-skills

Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.

Documents & Office Files418

DOCX

2.2k

mrgoonie/claudekit-skills

Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. When Claude needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks

Documents & Office Files418

Systematic Debugging

2.2k

mrgoonie/claudekit-skills

Four-phase debugging framework that ensures root cause investigation before attempting fixes. Never jump to solutions.

Software Development418

Webgpu Threejs Tsl

1.3k

dgreenheck/webgpu-claude-skill

Comprehensive guide for developing WebGPU-enabled Three.js applications using TSL (Three.js Shading Language). Covers WebGPU renderer setup, TSL syntax and node materials, compute shaders, post-processing effects, and WGSL integration. Use this skill when working with Three.js WebGPU, TSL shaders, node materials, or GPU compute in Three.js.

Software Development123

Verification Before Completion

2.2k

mrgoonie/claudekit-skills

Run verification commands and confirm output before claiming success

Software Development418

Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.