Defense in Depth Validation
Validate at every layer data passes through to make bugs impossible
Install
/plugin marketplace add mrgoonie/claudekit-skillsThe repo is a Claude Code plugin marketplace. Run /plugin afterwards to pick the plugin that includes this skill.
npx skills add mrgoonie/claudekit-skills --skill Defense-in-Depth Validationgit 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-ValidationPersonal 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 operationDetails
- Skill name
Defense-in-Depth Validation- Repository
- mrgoonie/claudekit-skills
- 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.2kmrgoonie/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).
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.
DOCX
2.2kmrgoonie/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
Systematic Debugging
2.2kmrgoonie/claudekit-skills
Four-phase debugging framework that ensures root cause investigation before attempting fixes. Never jump to solutions.
Webgpu Threejs Tsl
1.3kdgreenheck/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.
Verification Before Completion
2.2kmrgoonie/claudekit-skills
Run verification commands and confirm output before claiming success
Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.