agisota/old-one/defense-in-depth
Claude Code and agent skill by agisota/old-one
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Defense in Depth Skill
Install
npx vskill@latest install agisota/old-one/defense-in-depthSKILL.md
Technique: Defense in Depth (Swiss Cheese Model)
Concept: After fixing the root cause, you must add "Armor" to the system to catch this specific class of error in the future.
The Three Layers of Defense
Apply at least two of these layers for every critical bug.
Layer 1: The API Boundary (The "Bouncer")
Stop bad data from entering your house.
- Technique: Schema Validation (Zod, Joi, Pydantic).
- Action: If
pricemust be positive, enforceprice > 0at the JSON parsing layer. - Result: The system rejects the request with
400 Bad Requestinstantly. No internal logic runs.
Layer 2: The Service Boundary (The "Contract")
Stop bad data from moving between rooms.
- Technique: Domain Types / Value Objects.
- Action: Don't pass
string email. Pass aEmailAddressclass that throws an error in its constructor if the format is invalid. - Result: You cannot instantiate an invalid object deep in the business logic.
Layer 3: The Database Constraint (The "Vault")
Stop bad data from being written to history.
- Technique: SQL Constraints / Foreign Keys.
- Action: Add
NOT NULLconstraints. AddCHECK (price >= 0). - Result: Even if code fails, the database refuses to accept the corruption.
The Checklist
When closing a bug, ask:
- [ ] Did I fix the root cause?
- [ ] Defense: Did I add a validation check so this inputs fails early next time?
- [ ] Defense: Did I verify the database prevents this state?
Example:
- Bug: User verified with empty email.
- Fix: Updated regex in signup logic.
- Defense 1: Added
class EmailAddress { ... }which validates on creation. - Defense 2: Added
CHECK (length(email) > 5)to Postgres migration.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/defense-in-depth/SKILL.md
Popularity
- Repository stars
- 3
- Repository forks
- 1
- 7-day trend score
- 12
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/agisota/old-one/defense-in-depth)