layer-testing

layer-testing is a skill for Claude Code, Codex from bengous/claude-code-plugins. It costs 42 tokens per session (1,427 once invoked), scanned A, original, MIT.

A testing workflow for checking one architectural layer at a time, such as the business logic or infrastructure code. It uses a project playbook or asks which testing approach to follow.

In plain words
What is it for?
Use it to test a chosen module layer, apply coverage targets, and generate tests based on your architecture and testing strategy.
Why use it?
It helps focus tests on the right parts of a layered codebase and shows where coverage is missing. Separate worktrees keep testing changes isolated from the main branch.

Skill for Claude CodeCodex

Part of the claude-orchestration plugin — 1 skill, 6 commands, 3 agents shipped together

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.

agentmods
npx agentmods add skills/bengous/claude-code-plugins/layer-testing
Any agent
npx skills add bengous/claude-code-plugins --skill layer-testing
Clone the repo
git clone --depth 1 https://github.com/bengous/claude-code-plugins

Made for: Claude Code, Codex.

Or install claude-orchestration, the plugin that ships this one along with the rest of its 1 skill, 6 commands, 3 agents.

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 layer-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/bengous/claude-code-plugins/layer-testing.svg)](https://agentmods.dev/skills/bengous/claude-code-plugins/layer-testing)
Your own site
<a href="https://agentmods.dev/skills/bengous/claude-code-plugins/layer-testing"><img src="https://agentmods.dev/badge/skills/bengous/claude-code-plugins/layer-testing.svg" alt="Measured on agentmods" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,427 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00042 $0.01427
Opus 5 $0.00021 $0.00714
Sonnet 5 $0.00008 $0.00285
Haiku 4.5 $0.00004 $0.00143

Measured yesterday against content hash 0a8fc0a45f0c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

layer-testing 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 yesterday.

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.

orchestration/skills/layer-testing/SKILL.md · 247 lines

How it starts

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

Layer Testing Skill

Orchestrate comprehensive layer testing with coverage analysis and isolated worktrees.

Isolated worktrees keep testing work separate from your working branch, preventing accidental commits to main development branches and enabling parallel testing of multiple layers.

  1. Get Parameters

From command invocation:

Testing Request:
- Module: auth
- Layer: infrastructure
- Playbook: docs/playbook.md (optional)
- Coverage Target: 100% (optional)

From natural invocation: Ask user for module, layer, playbook path (optional), coverage target (optional).

  1. Get Testing Strategy

If playbook provided:

Read(${PLAYBOOK_PATH})

If no playbook: Ask user to choose:

<strategy_options>

  1. Hexagonal Architecture - Domain/Application 100%, skip infra schemas
  2. Clean Architecture - Use cases/Entities 100%, skip frameworks
  3. Layered - Services/Logic 100%, skip DTOs/configs
  4. Custom - I'll answer questions about what to test </strategy_options>

If user picks 1-3: Use template from skills/layer-testing/templates/

If user picks 4: Ask:

  • Coverage target? (100%/80%/70%)
  • What to test? (business logic only / all code)
  • What to skip? (types, schemas, mocks, configs)
  • Build strategy from answers

Store strategy for agent use.

  1. Run Coverage First

Check for existing tests:

find src/modules/${MODULE}/${LAYER} -name "*.test.*" -o -path "*/__tests__/*"

If NO tests: Skip to step 4

If tests exist:

Detect framework and run coverage (run these checks in parallel):

if [[ -f "vitest.config.ts" ]] || grep -q "vitest" package.json; then
  pnpm test src/modules/${MODULE}/${LAYER} --coverage --reporter=json-summary
elif [[ -f "jest.config.js" ]] || grep -q "jest" package.json; then
  pnpm test -- src/modules/${MODULE}/${LAYER} --coverage --coverageReporters=json-summary
fi

Parse coverage/coverage-summary.json:

TOTAL_COV=$(jq '.total.lines.pct' coverage/coverage-summary.json)

If 100% coverage:

✅ Already at 100% coverage!

Options:
1. Exit (nothing to do)
2. Verify test quality
3. Enhance tests

Choose (1-3):

If user picks 1, exit successfully.

If < 100%: Continue to Step 4

  1. Analyze Files

Find all files:

find src/modules/${MODULE}/${LAYER} -name "*.ts" ! -name "*.test.*" ! -path "*/__tests__/*"

Categorize using strategy:

  • Testable (matches "what to test" patterns)
  • Skip (matches "what to skip" patterns)

Cross-reference with coverage (if available):

  • Fully covered (100%)
  • Partially covered (<100%, extract uncovered lines)
  • Not tested (0% or not in coverage)
  1. Present Analysis & Ask User

Show results:

📊 ${MODULE}/${LAYER}

Coverage: ${TOTAL_COV}% (target: ${TARGET}%)
Gap: ${GAP}%

✅ Fully Covered:
  - File1.ts (100%)

⚠️ Partially Covered:
  - File2.ts (45%, lines 10-20, 30-40 uncovered)

❌ Not Tested:
  - File3.ts (0%)

⊘ Skip:
  - schema.ts (per strategy)

Which files to test?
1. All gaps
2. Untested only
3. Partial only
4. Custom selection

Wait for user response.

  1. Create Worktree
BRANCH="test/${MODULE}-${LAYER}-coverage"
git worktree add ../worktree-${BRANCH} -b ${BRANCH}
  1. Spawn Testing Agent
Agent({
  subagent_type: 'general-purpose',
  description: 'Test ${MODULE}/${LAYER}',
  prompt: `
Test the ${LAYER} layer of ${MODULE} module.

Strategy: Read ${PLAYBOOK_PATH}
Files: ${SELECTED_FILES}
Target: ${COVERAGE_TARGET}%
Working directory: ${WORKTREE_PATH}

Follow strategy principles.
Write comprehensive tests.
Never modify production code.
Create single commit when done.

Report:
- Coverage achieved
- Tests created
- Any issues
`
})

Read the full file on GitHub · 247 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. yesterday First seen · 247 lines · 42 tokens per session scan A 0a8fc0a45f0c

Subscribe to this mod's changes

layer-testing is a skill published in the GitHub repository bengous/claude-code-plugins (4 stars, last pushed 3d ago), licensed MIT. It adds 42 tokens to every session and 1,427 once invoked, about $0.0002 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-09-03.

Related

Other skills, from other repositories

html-ppt-hermes-cyber-terminal

OpenDesign + BYOK: choosing and wiring your own model, hands-on — cost, quality, and the routing decision. Built as a decision-grade AI literacy deck for engineers, IT, applied-AI teams.

nexu-io/open-design · 53 tokens

development

开发语言能力索引。Python、Go、Rust、TypeScript、Java、C++、Shell。当用户提到编程、开发、代码、语言时路由到此。.

fengshao1227/ccg-workflow · 41 tokens

post-build-flow

Handles workflow verification and setup after build-workflow succeeds, or when the message contains workflow-verification-follow-up or workflow-setup-required. Load after direct builds, when verificationReadiness requires action, or on orchestrator verify/setup follow-up turns.

n8n-io/n8n · 53 tokens

n8n:human-like-code-review

Reviews a GitHub pull request like a thoughtful human reviewer and writes the feedback to a markdown file. Prioritizes context, architecture fit, solution complexity, bugs, security edge cases, and missing tests. Use when given a PR URL to review, or when the user says /human-like-code-review.

n8n-io/n8n · 70 tokens

n8n:create-pr

Creates GitHub pull requests with properly formatted titles that pass the check-pr-title CI validation. Use when creating PRs, submitting changes for review, or when the user says /pr or asks to create a pull request.

n8n-io/n8n · 50 tokens

n8n:reproduce-bug

Reproduce a bug from a Linear ticket with a failing test. Expects the full ticket context (title, description, comments) to be provided as input.

n8n-io/n8n · 41 tokens