Defense in Depth
Use when implementing validation or safety checks. Multi-layer validation approach prevents bugs through redundant safeguards. Makes bugs structurally impossible.
Install
/plugin marketplace add Freddy-CHEN-ux/00_claude_skillsThe repo is a Claude Code plugin marketplace. Run /plugin afterwards to pick the plugin that includes this skill.
npx skills add Freddy-CHEN-ux/00_claude_skills --skill defense-in-depthgit clone --depth 1 https://github.com/Freddy-CHEN-ux/00_claude_skills.git /tmp/00_claude_skills
mkdir -p ~/.claude/skills
cp -r /tmp/00_claude_skills/skills/defense-in-depth ~/.claude/skills/defense-in-depthPersonal 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
## Core Principle
**Make bugs structurally impossible through multiple independent layers of validation.**
## Overview
Single-layer protection is insufficient. Defense in depth adds multiple independent validation layers so that if one fails, others catch the problem. Different code paths require different validations.
## When to Use This Skill
- Implementing data validation
- Adding safety checks
- Preventing invalid state bugs
- Handling user input
- Processing external data
- Critical operations that must not fail
## The Four Layers
### Layer 1: Entry Point Validation
**Purpose:** Reject bad input at API boundaries
**Where:** Controllers, API endpoints, function entry points
**What to validate:**
- Type correctness
- Required fields present
- Format validity (email, phone, etc.)
- Basic constraints (min/max, length)
**Example:**
```php
// Laravel Controller
public function createUser(Request $request)
{
// Layer 1: Entry point validation
$validated = $request->validate([
'email' => 'required|email|max:255',
'password' => 'required|min:8',
'age' => 'required|integer|min:18',
]);
// Continue with business logic...
}
```
### Layer 2: Business Logic Validation
**Purpose:** Enforce operational requirements
**Where:** Service classes, domain logic
**What to validate:**
- Business rules
- State transitions
- Relationships
- Domain constraints
**Example:**Details
- Skill name
defense-in-depth- Repository
- Freddy-CHEN-ux/00_claude_skills
- Path
skills/defense-in-depth/SKILL.md- Repo updated
- 10 January 2026
FAQ
What does the Defense in Depth skill do?
Use when implementing validation or safety checks. Multi-layer validation approach prevents bugs through redundant safeguards. Makes bugs structurally impossible.
How do I install the Defense in Depth skill?
Claude Code plugin: /plugin marketplace add Freddy-CHEN-ux/00_claude_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 popular?
It lives in Freddy-CHEN-ux/00_claude_skills, which has 8 GitHub stars and 3 forks.
Related skills
Add Integration
8Freddy-CHEN-ux/00_claude_skills
Build a new API integration for Nexus. Load when user mentions "add integration", "new integration", "integrate with", "connect to [service]", or "build [service] integration". Interactive workflow that discovers API endpoints, plans the integration, and creates a project for implementation.
AI Agents
8Freddy-CHEN-ux/00_claude_skills
Production-grade AI agent patterns with MCP integration, agentic RAG, handoff orchestration, multi-layer guardrails, and observability (modern best practices)
AI LLM
8Freddy-CHEN-ux/00_claude_skills
Production LLM engineering skill. Covers strategy selection (prompting vs RAG vs fine-tuning), dataset design, PEFT/LoRA, evaluation workflows, deployment handoff to inference serving, and lifecycle operations with cost/safety controls.
Executing Plans
8Freddy-CHEN-ux/00_claude_skills
Use when implementing a multi-step plan. Execute systematically with verification checkpoints to catch errors early.
Create Project
8Freddy-CHEN-ux/00_claude_skills
Create new projects. Load when user wants to START something new with a deliverable endpoint. Keywords: create project, new project, start project, plan project.
Explain Nexus
8Freddy-CHEN-ux/00_claude_skills
Explain what Nexus is and how it works. Load when user says "explain nexus", "what is nexus", "how does nexus work", "nexus overview", "about nexus", or asks for help understanding the system.
Browse the most popular Claude skills, all other skills, or write your own with the skills generator.