agentleFS
leroyguillaumeleroyguillaume/claude/architecture-conventions/SKILL.md

architecture-conventions

Skill7 starsChanged 4 days agoMITView on GitHub

ARCHITECTURE.md: the system as it stands, in the present tense. TRIGGER when: creating or editing `ARCHITECTURE.md`; a *why* paragraph lands in the README; adding a component, datastore, external service or system, or an invariant; user asks how the system fits together or where a trade-off goes. SKIP when: install/run instructions (`readme-conventions`), or dev setup, pre-commit or CI (`contributing-conventions`).

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Rewrite the affected section so it describes the new state: Do not append a note, do not leave the old paragraph with a strikethrough, do …

    line 80
  2. Distinctive:

    A repository with no code needs none: When it holds only documentation — a handbook, a set of guides, a docs site's content — the documents …

    line 168
  3. Distinctive:

    Every component, path and store named here must exist in the repo under that name.

    line 180

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

ARCHITECTURE conventions

ARCHITECTURE.md answers "why is it built like this, and how do the pieces fit together?" — for someone who is about to change the code and needs the mental model first.

It is the why half of the split with the README (see readme-conventions); the README keeps the commands. In English, like every document (documentation-conventions).

The one rule that shapes everything: present tense only

ARCHITECTURE.md describes the system as it is today. Nothing else.

A reader must be able to trust every sentence as a statement about the current code, without checking a date or wondering whether a paragraph is stale folklore. The moment history creeps in, the file becomes an archaeology exercise: the reader has to reconstruct which layer is still true.

So, never write:

  • past changes — "the cache was moved to Redis", "the operator used to reconcile on a timer", "since v2.3 the API is versioned"
  • migration or bootstrap history — how the cluster was first created, the order the tables were backfilled in, what the old schema looked like
  • a changelog or release notes in any form, dated sections, "recent changes", "what's new"
  • a dated / superseded decision log (ADR-style Status: superseded by ADR-0007). ADRs are how this repository records decisions, and they live one per file under docs/adr/ with their own lifecycle — never inside this file. See adr-conventions
  • references to the change that introduced something — PR numbers, commit hashes, ticket IDs as narrative

Git already stores all of that, with more precision and no maintenance cost. Prose duplicating the log is prose that rots.

What git does not store is why a decision was taken over the alternatives on the table that day — and that is what docs/adr/ is for. The two files are complementary: history is banned here precisely because the ADRs hold it. A decision that changes the architecture lands in both, in one change — a new ADR, and this file rewritten to describe the new state. Linking an ADR from here is fine; narrating the change is not. See adr-conventions.

Most decisions never reach that bar, and get no ADR at all — the ADR gate is deliberately narrow (adr-conventions). Their reasoning still belongs here, as standing rationale in the present tense: a chosen default, a file format, an ergonomics call, a deliberate deviation from a convention. Say what the design is and what the alternative could not do, and the fact that no ADR exists costs nothing. Dropping the reasoning because it had nowhere else to go is how a decision gets silently reversed a year later.

The subtle distinction: standing rationale is not history

A rejected alternative is fair game when the reasoning still holds today, because that is what stops the next person re-litigating it. Phrase it as a present-tense property of the design, not as an event:

  • ✅ "State lives in SQLite rather than PostgreSQL: the workload is single-writer and the deployment must run without an external database."
  • ❌ "We migrated from PostgreSQL to SQLite in early 2025 because ops was tired of managing it."

Same fact, same usefulness — the first one is still true in three years, the second one is a story about people who have left.

When the architecture changes

Rewrite the affected section so it describes the new state. Do not append a note, do not leave the old paragraph with a strikethrough, do not add a "previously" clause. The diff of ARCHITECTURE.md is the history — that's precisely why the file's contents don't need to be.

What goes in

Adapt the order to the project; skip a section that has nothing real to say rather than filling it with boilerplate.

# Architecture

## Overview
## Components
## Data flow
## State and persistence
## Design decisions
## Invariants and constraints
## Limitations
  • Overview — what the system is, in one paragraph, plus a diagram. Enough for a reader to place every later section.
  • Components — one short block per component: its single responsibility, what it owns, what it explicitly does not do, and how it talks to its neighbours (protocol, sync/async, direction). Name them exactly as the directories and services are named in the repo, so the mapping to code is mechanical.
  • Data flow — walk the two or three paths that matter end to end: the main request, the background/reconcile loop, the failure path. Say where retries happen, where the boundaries are transactional, and what is idempotent.
  • State and persistence — where state lives, who owns each store, what the key entities are and how they relate. Schema shape and ownership, not a column-by-column dump the migrations already define.
  • Design decisions — the choices a newcomer would otherwise question, each with its trade-off: what is gained, what is given up, and what the alternative could not do. A few paragraphs, present tense (see above). Include the tooling choices only when they shape the design.
  • Invariants and constraints — what must hold for the system to be correct ("a reconcile handler never raises a permanent error", "IDs are ULIDs so they sort by creation"), and the constraints imposed from outside: org policy, platform limits, quotas, compliance rules. These are the sentences that save an afternoon; make them explicit and unmissable.
  • Limitations — what the design does not handle, and what would have to change to lift it. Present tense: a limitation is a property of the system, not a promise about the future. No roadmap, no dates.

What stays out

  • The CI. Pipelines, workflows, runners, caching strategy, release automation, required checks — none of it belongs here. It is contributor tooling: see contributing-conventions. (The artefacts the system is built into — a static binary, a distroless image, a chart — are architecture and stay; the machinery that produces them is not.)
  • Commands. Install, run, test, deploy → README. If a section here needs one, link to the README instead of repeating it.
  • Dev setup, code style and contributor tooling (linters, hooks, test runners), their why included → CONTRIBUTING.md. A tool the system is built with or runs on (a language, a framework, a provider) is a design choice and stays.
  • Operational runbooks and one-off procedures — how to recover from a corrupted store, how the cluster was bootstrapped. Those are docs/ material; this file explains the design they operate on, not the steps.
  • API reference — endpoint-by-endpoint listings belong in the OpenAPI document or generated docs. Describe the API's shape and boundaries here.
  • Duplication. One home per fact; link across to the README and CONTRIBUTING.md rather than restating.

Diagrams

Inline Mermaid, usually a component graph plus one sequence for the flow that matters — load diagram-conventions before drawing one.

Links

Relative inside the repo, an https:// URL outside it. Link straight at the code described (src/reconciler/), which is what keeps this file verifiable.

Keeping it honest

  • Create it as soon as there is a second document's worth of content — in practice, the first time a why paragraph appears in the README, or the README outgrows the size documentation-conventions sets — and whenever a convention sends content here (a design decision's rationale, an ADR's new state) and the file does not exist yet: create it rather than drop the content.
  • A repository with no code needs none. When it holds only documentation — a handbook, a set of guides, a docs site's content — the documents are the system, and the README's layout section is the whole mental model a contributor needs. Tooling around the docs (a lint config, a CI workflow) does not count as code. There, do not create the file unprompted, even when another convention says "created if missing": the reasoning goes in the README or in the document it concerns. Create it only when the user asks.
  • Cross-link both ways: the README points here from the sections whose reasoning moved out; this file points at the README for commands. Check the anchors after a split — a moved heading takes its anchor with it.
  • Update it in the same change as the code, and by rewriting, not appending.
  • Every component, path and store named here must exist in the repo under that name. A section describing something that was renamed or removed is worse than no section: it lies with authority.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.