architecture

A set of rules for arranging an application's files, folders, modules, and dependencies so each part has a clear purpose and boundary. It covers frontend, backend, full-stack, monorepo, modular-monolith, and service-based projects.

In plain words
What is it for?
Use it when starting an application, reorganizing an existing codebase, choosing between feature-based and layer-based folders, or separating shared code from private code. A monorepo is one repository containing multiple applications or packages.
Why use it?
It reduces confusion about where code belongs and helps prevent hidden or tangled dependencies. This makes code safer to change and easier for the next developer to understand.

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/danecwalker/agentskills/architecture
Any agent
npx skills add danecwalker/agentskills --skill architecture
Clone the repo
git clone --depth 1 https://github.com/danecwalker/agentskills

Made for: Claude Code, Codex.

Per session 123 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,431 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.00123 $0.01431
Opus 5 $0.00062 $0.00715
Sonnet 5 $0.00025 $0.00286
Haiku 4.5 $0.00012 $0.00143

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

Security

Grade A, and why

architecture 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.

skills/architecture/SKILL.md · 125 lines

How it starts

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

Architecture

Treat the directory tree as a map of runtime boundaries, ownership, and allowed dependencies. Optimize for the next maintainer finding and changing code safely, not for visual symmetry.

Apply these rules

  • Preserve repository instructions, framework-reserved paths, build-tool conventions, and established domain language unless a change has a concrete payoff.
  • Group product code primarily by business capability or feature. Use technical layers inside a capability when they clarify dependency direction.
  • Give every module one purpose, one public surface, and private implementation details.
  • Make dependencies explicit, acyclic, and enforceable. Do not rely on folders alone.
  • Keep code with the feature, team, test suite, and deployment unit that change together.
  • Promote code to shared space only after genuine reuse and stable semantics exist.
  • Keep entry points, routes, controllers, and framework adapters thin. Put decisions in application or domain modules.
  • Separate generated artifacts, migrations, fixtures, operational configuration, and source code.
  • Prefer a well-bounded modular monolith until independent deployment, scaling, reliability, security, or ownership requirements justify services.
  • Use the shallowest tree that preserves meaningful boundaries. Do not create one-file directories or speculative abstractions.
  • Describe recommendations as a synthesis of public practices. Never present a sample tree as “the Google structure” or “the Meta structure.”

Follow the workflow

1. Discover constraints

For an existing repository:

  1. Read local instructions and architecture records.
  2. Inspect the tree, manifests, workspace/build configuration, import aliases, entry points, routes, persistence code, tests, deployment files, and ownership rules.
  3. Identify the framework's mandatory structure and the repository's current dependency direction.
  4. Find code that changes together, duplicated “shared” code, cross-boundary imports, cycles, oversized directories, and ambiguous names.
  5. Preserve unrelated user changes.

Read the full file on GitHub · 125 lines

Files

What ships with it

6 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 · 125 lines · 123 tokens per session scan A dfd502069109

Subscribe to this mod's changes

architecture is a skill published in the GitHub repository danecwalker/agentskills (2 stars, last pushed 8d ago), licensed MIT. It adds 123 tokens to every session and 1,431 once invoked, about $0.0006 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.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

babysit-pr

Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…

openai/codex · 114 tokens

imagegen

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output…

openai/codex · 113 tokens