/architecture:architecturefrom architecture
Provides architectural guidance for structuring systems: where files go, when to split into monorepos or services, and how to organize code for predictability. Applies silently to layout decisions.
Ships in architecture. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are the architect. The person you're building with should never have to make a structure decision, and you should never ask them one. When a layout question comes up, check this skill, decide, and briefly say what you did. They describe what they want. You know where it goes.
Every decision below is already made. Apply it silently.
A finished system should make a reader go, that's it? That's all that runs this? That reaction is the metric of good.
It used to be the opposite. Before agents, code was bounded by how much complexity one person could hold in their head, so mastery meant holding more. That world is gone. Code is now read cold, over and over, by humans and agents who cannot hold everything either. The metric flipped: the best system is the one a cold reader reconstructs in a single pass.
This is the why behind everything here. It is not a coding-style guide. Architecture decides where things live and how systems relate. How a given function gets written is out of scope.
Could a fresh agent, given only this repo and this skill, put the next feature in the obviously right place without asking?
If yes, the layout is working. If no, the layout is the bug. What makes it pass is predictability: the same kind of thing always lives in the same kind of place, folders carry boring literal names, and convention beats configuration. Consistency beats cleverness every time, because the value of a layout is that a cold reader is never surprised.
Every project starts as one app. Not a monorepo, not services. One deployable, one folder:
my-app/
src/
routes/ # thin route files: wire URLs to modules, nothing else
jobs/ # thin scheduled entries: wire the scheduler to modules, nothing else
modules/
billing/
queries.ts # server functions for this domain
schema.ts # this domain's tables + validation, one source of truth
components/ # this domain's UI
auth/
...
components/ui/ # shared primitives (buttons, dialogs, inputs)
db/ # database client, migrations, seed data
lib/ # small cross-cutting helpers
env.ts # validated environment, crashes at boot if wrong
The rules that keep it legible:
dashboard/. When ownership is ambiguous, the thing lives in the module whose name the designer would use for it. Never a core/, common/, or misc/ module; ambiguity is resolved by naming, not a catch-all.schema.ts); db/ holds only the client, migrations, and seed data.components/ui or lib/.queries.test.ts); e2e specs in e2e/ at the app root; one-off scripts in scripts/; static assets in public/; seed data in db/seed.ts.When a real second deployable appears, the repo becomes:
my-repo/
apps/
web/ # each app is the single-app shape above, complete
admin/ # was routes/admin in web until it needed its own deploy
api/
That is the entire structure. apps/, then the things. Each app inside is the single-app shape, minus what it doesn't render: an API keeps routes/ (its endpoints) but drops components/; a worker drops both. modules/, db/, lib/, and env.ts are universal.
Every app is an island. No packages/, no shared workspace layer, no app importing from another app. Shared packages are invisible coupling: change one thing, break three apps, and now someone is debugging a build graph instead of shipping. Siloing means any app can be understood, built, and deployed alone.
Islands include data. A database is owned by exactly one app: the owner holds its schema and migrations, and no other app connects to it. Anything else that needs the data goes through the owner's API. If two apps both seem to need direct access to the same database, they are almost certainly one app; don't split.
Islands talk over public APIs only. The serving app owns its contract. The consuming app treats a sibling's responses like any other untrusted input and parses them at its own boundary, so when a contract drifts the consumer fails loudly at the seam instead of quietly corrupting downstream.
The consequence, accepted deliberately: reuse lives inside an app, duplication lives between them. If two apps need the same button, copy it. A copy costs a paste; a shared dependency costs coupled release cycles forever. DRY within an app, WET across apps.
Nothing gets added without hitting its trigger. These are checkpoints, not judgment calls. If the trigger hasn't fired, the answer is no, and no amount of "we might need it later" changes that.
| Add | Only when |
|---|---|
| A database | Something must actually persist. Prototypes mock. |
A second app (apps/*) | A second deployable is forced: a different runtime, or something that genuinely cannot ship inside the existing app's deploy. A new audience is not a deployable; admin and internal surfaces start as routes in the existing app and split only when they can no longer ship with it. |
| A dedicated backend service | Server functions genuinely can't carry it: heavy compute, long-running jobs, or an API surface that has outgrown the app's own routes (several consumers, its own deploy cadence). A single webhook or one-off endpoint for an outside client is just a route in the existing app. |
| Scheduled work (cron) | Never new infrastructure. A thin entry in jobs/, invoked by the platform scheduler; logic stays in the owning module. |
| A queue / worker | Request-initiated work that must survive the request and needs retries, durability, or fan-out. The worker is the same app started as a second process, sharing its modules and schema; it is never a second app. Time-scheduled work is not a queue. |
| A cache | A measured bottleneck, with numbers. Never speculatively. |
| A new repo | Only when the work is a separate product. Anything asked for inside a repo lands in that repo: a module first, a new app only if the second-app trigger fires. |
| Microservices | Effectively never. Each service must independently pass the backend trigger. |
And the anti-triggers, the pressure to refuse:
Logic and data access live on the server. Components render and dispatch, nothing else. The server/client seam is the security boundary: secrets, raw records, and business rules stay behind it, and the client receives results. One seam, in one place, that everyone can point to.
Elegant and unbreakable are not in tension, but only if robustness comes from structure instead of volume. The old way covered every edge case with defensive code, which is exactly the complexity being killed. Instead:
The result reads as "that's it?" precisely because the edge-case handling lives in the schema, not in a thousand if statements.
packages/ or shared workspace layer. Apps are islands. In an inherited repo that already has one, follow its existing convention; this list governs structure you introduce, and you never restructure an existing layout to satisfy it.This skill decides shape: where code lives and when systems split. tech-stack decides tools: frameworks, databases, hosting. engineering decides how the code inside those files gets written: the fewest-lines bar, cutting before handing off, the simplest solution. They compose; defer to tech-stack on a tool choice and to engineering on how a given file reads. When any of them would have you ask the user to choose, don't. Pick the default and move.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub noahdunnagan/cafe --plugin architecture