layered-module-structure

layered-module-structure is a skill for Claude Code, Codex from buYoung/skills. It costs 16 tokens per session (8,977 once invoked), scanned A, original, MIT.

A set of rules for organising software into modules arranged in three dependency layers. A module is a separately managed part of a program, such as a package, library, or build target.

In plain words
What is it for?
Designing a new project, reviewing its structure, moving code between modules, and deciding where new code should be added.
Why use it?
It gives a consistent way to decide where code, shared definitions, and resources belong. This can reduce unclear dependencies and duplicated ownership in a codebase.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Designing a new project, reviewing its structure, moving code between modules, and deciding where new code should be added.

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

Made for: Claude Code, Codex.

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 layered-module-structure

README.md
[![agentmods](https://agentmods.dev/badge/skills/buyoung/skills/layered-module-structure/github.svg)](https://agentmods.dev/skills/buyoung/skills/layered-module-structure)
Your own site
<a href="https://agentmods.dev/skills/buyoung/skills/layered-module-structure"><img src="https://agentmods.dev/badge/skills/buyoung/skills/layered-module-structure/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 layered-module-structure

Your own site · 80×15
<a href="https://agentmods.dev/skills/buyoung/skills/layered-module-structure"><img src="https://agentmods.dev/badge/skills/buyoung/skills/layered-module-structure.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 16 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 8,977 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.00016 $0.08977
Opus 5.5 $0.00006 $0.03591
Sonnet 5.5 $0.00003 $0.01795
Haiku 4.5 $0.00002 $0.00898

Measured 2d ago against content hash 5f44993df148, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

layered-module-structure 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 2d 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/layered-module-structure/SKILL.md · 252 lines

How it starts

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

Layered Module Structure

Organize a codebase as modules in three layers whose dependencies point one way. Every shared definition has one owner, every module has one public surface, resources are stored with the module that owns them, and the source tree holds only what ships. Use the same rules to design a new project, audit an existing one, restructure it, or decide where new code belongs.

The skill names no language and holds no per-language instructions. The rules describe outcomes, not file names: one toolchain reaches an outcome with an entry file that re-exports, and others reach it with visibility modifiers, build targets, or a public header directory. Apply each rule through the mechanism the project's own toolchain provides, and never copy a file convention into a language that has a different one. The mechanism changes a rule's form, never whether it applies: where a toolchain offers only a convention for something another toolchain checks at compile time, the rule still holds and rule V2 covers the gap.

Terms. A module is the smallest unit that declares its dependencies to the build system: a package, assembly, library, or build target. In a project built as one unit, the directories that divide the code by purpose play that role; a directory that only groups them into a layer is a container, not a module. Where build targets or packages select their own source files, a file belongs to the one that includes it, not to the directory it sits in; a file that sits inside another module's directory still reaches that module only through its public surface (E3). A unit is a module or any directory of source files inside one. An execution unit is anything that starts on its own: an app, CLI, service, worker, helper process, or editor tool. A Composition Root is the one place in an execution unit where the concrete lower modules are constructed and connected.

1. Settle the task

The description of this skill says nothing about the task, so read it from the invoking request: the action, the target, and whether files may change.

Read the full file on GitHub · 252 lines

Files

What ships with it

2 files 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. 2d ago First seen · 252 lines · 16 tokens per session scan A 5f44993df148

Subscribe to this mod's changes

layered-module-structure is a skill published in the GitHub repository buYoung/skills (21 stars, last pushed 2d ago), licensed MIT. It adds 16 tokens to every session and 8,977 once invoked, about $0.0001 per session on Opus 5.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-11-28.

Related

layered-module-structure compared with skills from other repositories

layered-module-structure next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
layered-module-structurebuYoung/skillsSkill212d agoMITA16Claude Code, Codex
imagegenopenai/codexSkill137ktodayApache-2.0A113Codex
playwright-climicrosoft/playwrightSkill101ktodayApache-2.0A19Claude Code
browser-automationopenclaw/openclawSkill395ktodayMITA36Claude Code
systematic-debuggingobra/superpowersSkill330k2d agoMITA21Claude Code
free-llm-apismnfst/awesome-free-llm-apisSkill14ktodayCC0-1.0A113Claude Code, Codex
next-cache-components-adoptionvercel/next.jsSkill144ktodayMITA95Claude Code