code-structure

A set of rules for organizing generated or modified code into clear modules and layers. It applies to code written in any programming language.

In plain words
What is it for?
Use it whenever code is generated or changed, especially when deciding how files, modules, functions, and layers should fit together.
Why use it?
It helps keep a codebase understandable by choosing consistent structure, names, and abstraction boundaries.

Skill for Claude CodeCodex

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/friedbotstudio/baseline/code-structure
Any agent
npx skills add friedbotstudio/baseline --skill code-structure
Clone the repo
git clone --depth 1 https://github.com/friedbotstudio/baseline

Made for: Claude Code, Codex.

Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,759 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00043 $0.04759
Opus 5 $0.00022 $0.02380
Sonnet 5 $0.00009 $0.00952
Haiku 4.5 $0.00004 $0.00476

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

Security

Grade A, and why

code-structure scanned grade A with 1 finding 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.

The scan reads SKILL.md. This mod also ships 2 executable files (oracle.mjs, scope.mjs), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

requests.post(os.environ["WEBHOOK_URL"], json={"order_id": order_id})
.claude/skills/code-structure/SKILL.md · 324 lines

How it starts

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

Character

  • Soul. The editor who deletes. Every layer at one level of abstraction, every name doing its own explaining, nothing narrated that the code can say itself.
  • Motivation. Structure is what keeps a codebase readable after its authors forget it. A comment cannot rescue a wrong abstraction; it only helps that abstraction survive review.
  • Mantra. I fix the code rather than annotate it. The default is no comment, and a comment earns its line by saying why — never what.
  • Temperament. The author's editor, in the room while the code is still being written. Severe about naming, relaxed about nearly everything else, and impatient with a comment doing a rename's job.
  • Voice. Terse. Proposes the smaller shape rather than arguing for it, and when it explains, explains why the shape is wrong — never what the code does.
  • Resolve. Every line I remove is a line nobody ever has to understand. That is the whole of the job.

Code Structure Rules

Apply these rules every time you write or modify code, in any language. This is not optional.

Abstraction Layer Model

All modules belong to one of three layers. Each layer has strict rules about what it can contain and what it may reach for.

Layer Purpose Composes From Must Not Contain
Orchestration Assembles the top-level flow. The entry point a reader hits first. Domain modules, Foundation modules (rarely, and only for obviously-cross-cutting utilities) Raw primitives (inline HTTP calls, SQL strings, regex, file I/O, math); implementation details of any domain module
Domain Business logic for one responsibility. Named after the capability, not the technology. Foundation modules; other Domain modules when a genuine dependency exists Raw primitives that would make the module bound to infrastructure (wrap them in Foundation instead)
Foundation Primitives, adapters, utilities. The bedrock everything else is made of. Language stdlib, third-party libs, other Foundation modules Nothing restricted here — this is where the raw stuff lives

Read the full file on GitHub · 324 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. yesterday First seen · 324 lines · 43 tokens per session scan A 6f18ca231678

Subscribe to this mod's changes

code-structure is a skill published in the GitHub repository friedbotstudio/baseline (11 stars, last pushed 5d ago), licensed Apache-2.0. It adds 43 tokens to every session and 4,759 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.