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.
npx agentmods add skills/friedbotstudio/baseline/code-structurenpx skills add friedbotstudio/baseline --skill code-structuregit clone --depth 1 https://github.com/friedbotstudio/baselineWhat 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.
| Model | Per session | Once 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 |
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.
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}) 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 |
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.
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.
- yesterday First seen · 324 lines · 43 tokens per session scan A 6f18ca231678
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.
Other skills, from other repositories
dev-standards
Enforces development workflows, quality gates, coding standards, and release processes for the deterministic-agent-control-protocol project. Use when implementing features, fixing bugs, refactoring architecture, adding integrations, updating policies, writing tests, updating documentation, or preparing releases.
code-review-with-lsp
Code review with LSP-powered code intelligence. Uses MCP tools (diagnostics, hover, references, definition, symbols) for semantic code understanding, not just text grep.
i18n-check
国际化完整性检查。检查翻译 key 是否缺失、硬编码文本、locale 文件一致性。.
vue-best-practices
Vue 2/3 代码规范检查。包括组件命名、Props 校验、Composition API 规范等。.
python-review
Python 遗留代码审查:bare except、SQL 注入、反序列化、密钥、调试输出.
rust-review
Rust 服务审查:panic、SQL 注入、密钥、错误吞没、遗留标记.