module-layering

module-layering is a skill for Claude Code, Codex from arch3rPro/dsh-skills. It costs 50 tokens per session (572 once invoked), scanned A, original, MIT.

A module-layering practice maps how modules or packages depend on one another and enforces the intended direction of those dependencies. It applies to codebases split into multiple modules or packages.

In plain words
What is it for?
Use it to derive a dependency graph from declared imports or package dependencies, document that graph, and check that modules follow the intended layers.
Why use it?
It makes circular dependencies and unwanted layer crossings visible instead of relying on developers to remember the rules.

Skill for Claude CodeCodex

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also agents/openai.yaml present.

Part of the dsh-skills plugin — 15 skills shipped together

Good fit Use it to derive a dependency graph from declared imports or package dependencies, document that graph, and check that modules follow the intended layers.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/arch3rpro/dsh-skills/module-layering
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 arch3rPro/dsh-skills --skill module-layering
Clone the repo
git clone --depth 1 https://github.com/arch3rPro/dsh-skills

Made for: Claude Code, Codex.

Or install dsh-skills, the plugin that ships this one along with the rest of its 15 skills.

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 module-layering

README.md
[![agentmods](https://agentmods.dev/badge/skills/arch3rpro/dsh-skills/module-layering.svg)](https://agentmods.dev/skills/arch3rpro/dsh-skills/module-layering)
Your own site
<a href="https://agentmods.dev/skills/arch3rpro/dsh-skills/module-layering"><img src="https://agentmods.dev/badge/skills/arch3rpro/dsh-skills/module-layering.svg" alt="Measured on agentmods" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 572 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.00050 $0.00572
Opus 5 $0.00025 $0.00286
Sonnet 5 $0.00010 $0.00114
Haiku 4.5 $0.00005 $0.00057

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

Security

Grade A, and why

module-layering 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 7d 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.

skills/architecture/module-layering/SKILL.md · 43 lines

How it starts

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

Module Layering

A discipline for knowing and enforcing the dependency graph of a multi-module or multi-package codebase. It keeps the intended layering explicit, surfaces circular dependencies, and makes a violation fail instead of silently drifting.

The defining constraint: derive the graph from the canonical dependency signal — the single authoritative statement of what each module depends on (a package manifest's peer dependencies, a module's declared imports) — rather than from ad hoc inspection. Enforce intended direction with tooling, not memory.

Know the graph

  • Identify the canonical dependency signal for each module: the declared peer/regular dependency for packages, or the module imports for in-repo modules.
  • Derive the inter-module edges from that signal, grouped by the package or module hierarchy, so the graph is reproducible rather than hand-maintained.
  • Keep the graph as a documented artifact (a module-graph page or generated report) so it is the single home for dependency facts.

Enforce layering

  • Decide the intended layering — which modules may depend on which. State it explicitly (a layering rule per layer), not implicitly.
  • Detect circular dependencies — a cycle means no clear layer boundary and is a signal to re-examine ownership.
  • Enforce with tooling (e.g. a dependency-cruiser or graph analyzer), running in the check gate so a new edge that violates the intended direction fails rather than silently drifting.

When it applies

Reach for this when a codebase has enough modules or packages that dependency relationships are non-trivial — multiple packages, a plugin ecosystem, or a layered architecture where the direction of dependencies matters. A single small module does not need a graph.

Workflow

  1. Confirm the concern — enough modules that layering matters; if not, skip.
  2. Identify the canonical dependency signal and derive the edges.
  3. State the intended layering explicitly, per layer.
  4. Enforce with tooling in the check gate; treat a circular dependency or an edge against the intended direction as a failure.
  5. Keep the graph as a documented artifact, updated with the code.

Read the full file on GitHub · 43 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 7d ago First seen · 43 lines · 50 tokens per session scan A 7bca1e7d41b3

Subscribe to this mod's changes

module-layering is a skill published in the GitHub repository arch3rPro/dsh-skills (4 stars, last pushed 20d ago), licensed MIT. It adds 50 tokens to every session and 572 once invoked, about $0.0003 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-31.