defense-in-depth

defense-in-depth is a skill for Claude Code from a-ariff/ariff-claude-plugins. It costs 14 tokens per session (843 once invoked), scanned A, original, MIT.

A validation process that checks a code change in several stages: syntax and types, individual units, connected components, and complete user flows. End-to-end checks test the whole system as a user would use it.

In plain words
What is it for?
Use it after code changes to run progressively broader checks and fix failures before declaring the work complete.
Why use it?
Different checks find different kinds of problems, from typos and type mistakes to logic errors, broken connections, and workflow bugs.

Skill for Claude Code

Written for Claude Code: when-to-use in frontmatter.

Part of the defense-in-depth plugin — 1 skill shipped together

Good fit Use it after code changes to run progressively broader checks and fix failures before declaring the work complete.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/a-ariff/ariff-claude-plugins/defense-in-depth
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add a-ariff/ariff-claude-plugins --skill defense-in-depth
Clone the repo
git clone --depth 1 https://github.com/a-ariff/ariff-claude-plugins

Made for: Claude Code.

Or install defense-in-depth, the plugin that ships this one along with the rest of its 1 skill.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for defense-in-depth

README.md
[![agentmods](https://agentmods.dev/badge/skills/a-ariff/ariff-claude-plugins/defense-in-depth/github.svg)](https://agentmods.dev/skills/a-ariff/ariff-claude-plugins/defense-in-depth)
Your own site
<a href="https://agentmods.dev/skills/a-ariff/ariff-claude-plugins/defense-in-depth"><img src="https://agentmods.dev/badge/skills/a-ariff/ariff-claude-plugins/defense-in-depth/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for defense-in-depth

Your own site · 80×15
<a href="https://agentmods.dev/skills/a-ariff/ariff-claude-plugins/defense-in-depth"><img src="https://agentmods.dev/badge/skills/a-ariff/ariff-claude-plugins/defense-in-depth.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 14 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 843 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00014 $0.00843
Opus 5 $0.00007 $0.00421
Sonnet 5 $0.00003 $0.00169
Haiku 4.5 $0.00001 $0.00084

Measured 10d ago against content hash 5480f7905cc5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

defense-in-depth scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/defense-in-depth/skills/defense-in-depth/SKILL.md · 165 lines

How it starts

The opening of the file, as written. The whole thing — 165 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Defense in Depth

Philosophy

MULTIPLE INDEPENDENT VALIDATION LAYERS
Each layer catches what others miss

One check can fail silently. Four layers rarely do.

The Four Layers

Layer 1: Type/Syntax

What: Static analysis, types, linting
Catches: Typos, syntax errors, type mismatches
Run: First, before anything else

Layer 2: Unit Tests

What: Individual function/module tests
Catches: Logic errors, edge cases, regressions
Run: After each code change

Layer 3: Integration Tests

What: Component interaction tests
Catches: Interface mismatches, data flow errors
Run: After unit tests pass

Layer 4: End-to-End

What: Full system tests, user scenarios
Catches: Missing requirements, workflow bugs
Run: Before claiming complete

The Pipeline

Code Change
    ↓
[Layer 1: Lint/Type Check]
    ↓ PASS?
[Layer 2: Unit Tests]
    ↓ PASS?
[Layer 3: Integration Tests]
    ↓ PASS?
[Layer 4: E2E / Manual Check]
    ↓ PASS?
Done

Fail at any layer → FIX before proceeding

Why Every Layer Matters

Without This Layer What Escapes
No type checks Undefined calls crash at runtime
No unit tests Logic bugs slip through
No integration Components don't work together
No E2E User workflows broken

Implementation Patterns

For Code Changes

1. Make change
2. Run linter immediately
3. Run affected unit tests
4. Run integration suite
5. Test the actual feature

For Bug Fixes

1. Write failing test first
2. Fix the bug
3. Run all tests (regression check)
4. Verify original symptom gone

For New Features

1. Write unit tests for new logic
2. Implement feature
3. Add integration tests
4. Verify against requirements

Layer-Specific Commands

Configure per project:

layer_1:
  command: "npm run lint && npm run typecheck"
  when: "On save, before commit"
  
layer_2:
  command: "npm run test:unit"
  when: "After code changes"
  
layer_3:
  command: "npm run test:integration"
  when: "After unit tests pass"
  
layer_4:
  command: "npm run test:e2e"
  when: "Before claiming done"

Read the full file on GitHub · 165 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 165 lines · 14 tokens per session scan A 5480f7905cc5

Subscribe to this mod's changes

defense-in-depth is a skill published in the GitHub repository a-ariff/ariff-claude-plugins (14 stars, last pushed 5mo ago), licensed MIT. It adds 14 tokens to every session and 843 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.