Architecture Case Study
Study a real codebase the way architects study buildings. Output is one essay serving
two readers: Jerry building a pattern vocabulary for design discussions (names,
pictures, anchors), and the vault's recall machinery (density, wikilinks). The
series is cumulative — patterns graduate by recurring across studies.
Reference exemplar: ~/vault/atlas/case-studies/brew-architecture-case-study.md — read it for
essay structure, depth, and section shape. It is the promoted atlas entry, so its
frontmatter is not the model for what you write; the stub you hand off takes a different
contract (Phase 6).
Ground rules
- The subject repo is read-only. No edits, no kata binding, no handoff files in it.
Session handoffs go to claudes-home.
- Every factual claim in recon reports and essay is file:line-cited at the pinned commit.
- A study that only flatters its subject is not evidence — the weaknesses section is
mandatory.
Phase 1 — Setup
- Subject lives at
~/devel/case-studies/<name>; clone it there if absent.
- Pin the commit:
git -C ~/devel/case-studies/<name> show -s --format='%h ("%s")'.
- Write one paragraph: why this subject earns a study — the hard question its
architecture is a sustained answer to. Confirm with Jerry before dispatching recon
(fine to present this and the Phase 2 lens list together in one message).
Phase 2 — Lens selection
Survey the tree top-level, build docs, and any architecture docs yourself (cheap reads
only). Propose 5–8 recon lenses — subsystems or cross-cutting axes, sized so one
agent can cover one lens well. Re-derive lenses from the live tree; never reuse a stale
list from a plan or an earlier conversation. Get Jerry's sign-off.
Phase 3 — Recon fan-out
Dispatch one read-only general-purpose agent per lens, all in a single message.
Model: sonnet by default; opus for lenses that are algorithmically deep or
judgment-dense. Each brief must contain:
- Role: architecture recon on for a case-study series.
- Target framing: an AOSA-style essay; we need the architectural shape, key
mechanisms, and deliberate trade-offs — not exhaustive API inventory.
- Audience framing: a developer with no prior exposure to this codebase; translate
jargon, surface intuitions.
- The pinned commit citation; instruction to cite every claim as
file:line.
- Read-only mandate: no edits anywhere in the subject repo.
- Output path:
~/.claude/scratchpad/YYYYMMDD-<subject>-general-purpose-recon-<lens>.md
- Report shape: system role of the lens; how it works (mechanism, not tour); design
decisions and their apparent rationale; warts, hacks, and suspicious spots; 3–5
candidate patterns or anti-patterns with evidence.
- Gap flagging: if a finding's evidence lives in another lens's files, state the gap
explicitly in the report rather than stretching — the synthesizer follows up.
Before synthesis, read each report file and confirm it is substantive — an agent's
"done" is not evidence.
Phase 4 — Synthesis (session model)
Read all recon reports and every prior study — at minimum their pattern-candidate
lists. Prior studies live in two places and you must read both:
~/vault/atlas/case-studies/ — studies that have completed the ingest loop.
~/vault/intake/case-study/ — studies still in flight, promoted but not yet folded into
the atlas. A study can sit here for a long time, so this directory is not an edge case.
Reading only the atlas directory is how a recurrence check silently misses a sibling
study: on 2026-08-11 the git study missed rsync entirely because rsync was in intake/
and atlas/case-studies/ held only brew.
Write the essay with these sections:
- Header paragraph: series positioning, pinned commit, why this subject. Do not
number the entry ("Second entry in the series…"). Studies are often researched in
parallel and cannot know their own ordinal; the number carries nothing the series
order does not already say, and two studies claiming the same one is a coordination
problem with no upside. Name the subject and, where it helps, the prior studies whose
patterns recur here.
- System shape: one dense prose paragraph plus the required mermaid diagram
(Phase 5).
- Cross-cutting themes: shapes visible only across reports, not to any single
recon pass. Each theme gets a graspable name and a "reach for this when…"
line — the handle for a design conversation — then the evidence-backed description.
- Where this could bite or help us: 1–2 sentences per applicable theme anchoring
it to our own projects.
- Where the architecture is weakest (mandatory).
- Style-catalog check (one short paragraph): name the subject's implicit driving
characteristic — the one nobody wrote down — and what was deliberately spent for it;
then name the nearest mainstream architecture style and the "but" clause it needs, or
state that no catalog entry fits.
atlas/concepts/style-catalogs-measure-distribution.md
makes a falsifiable prediction that the "but" clause goes empty on distributed subjects
(kubernetes, containerd) — this paragraph is how that prediction gets tested, so report
the result plainly whichever way it lands, including when it refutes the concept.
- Pattern candidates: new candidates as unresolved
[[wikilinks]] with one-line
definitions, each carrying a buys / spends clause — which architecture
characteristic the mechanism purchases and which one pays for it (adoptability bought
with security-by-default; common-case latency bought with mirrored logic). Without it a
candidate is a named mechanism; with it, it is a decision aid, which is the whole point
of the vocabulary. Derive the trade from the subject's own evidence, not from a generic
-ilities list. Required from 2026-08-18 forward; the first five studies do not carry it
natively and are not being backfilled — the cross-study trades live in
atlas/concepts/style-catalogs-measure-distribution.md instead.
Recurrence check: if a prior study's candidate appears in this
subject, cite its existing wikilink and say so explicitly, and state the running
count — routing.md's earn-an-entry floor of 3+ citations is what graduates a
candidate into a concept entry (writing the entry is a promoter's act, not this
session's). Do not write "graduates on a second sighting": that wording came from
this skill, contradicted routing.md:29, and propagated into three curated studies
before Jerry ruled the 3+ floor standing (2026-08-15, kata vault#5btt). Judgment
(routing clause b) may still fire earlier, but that is a promoter's call stated as
one — never the default the study asserts.
- Sources: method, recon report paths, working tree path, sha256 of the recon
reports concatenated in sorted filename order (
cat <dir>/<glob>*.md | sha256sum
— glob order is sorted, so this is reproducible; repo state is pinned by the
commit citation).
Phase 5 — Diagrams
Mermaid, inline in the essay:
- Required: one system-shape diagram — components/processes and who talks to whom.
- Strongly encouraged: one sequence/flow diagram of the subject's defining
mechanism (the thing the subject is famous for).
- Per-theme diagrams only where a picture beats a paragraph. No quota.
- Keep diagrams renderer-portable: plain
flowchart/sequenceDiagram, no exotic
features; node labels carry file names where that helps navigation.
Phase 6 — Hand off to the vault + wrap-up
Write the essay to ~/vault/_inbox/session-lead/<subject>-architecture-case-study.md.
Never write to ~/vault/intake/ — despite the name, that is the vault's
post-promotion home for source material, and agents may not write there
(_system/routing.md). The agent's only write target is _inbox/{agent-id}/, and the
directory name must match the agent_id field.
Frontmatter is the intake-stub contract in _system/schemas.md ("Intake item") —
not the frontmatter of the brew exemplar at line 13. That exemplar is the promoted
atlas entry; its field set and its provenance/status vocabularies are different,
and copying it produces a stub the gate rejects. Use exactly:
---
name: <subject>-architecture-case-study # matches filename stem
type: intake # literal — NOT `case-study`
subtype: case-study # literal
description: <~150 chars>
provenance: agent-proposed # literal — the gate confers trust, you cannot
source_url: <github tree URL at the pinned commit>
agent_id: session-lead # matches the _inbox/ subdirectory
ingested: YYYY-MM-DD
sha256: <recon reports concatenated, sorted filename order>
status: pending-promotion # literal
---
Do not add subject, created, updated, confidence, contested,
contradictions, or tags — those are atlas fields, written later when the atlas entry
is authored. There is no commit field in any schema; the pinned commit citation lives
in the body's header paragraph and in source_url.
Promotion is Jerry's gate — do not promote, and do not run promote.py in any mode.
Tell him the study is ready and note that it takes two hops (per the brew receipts in
~/vault/_ops/applied/), because the essay is not on the reading surface until the
second one runs:
python3 _system/promote.py _inbox/session-lead/<slug>.md \
--to intake/case-study/<slug>.md --action create --by jerry-curated
python3 _system/promote.py --ingest intake/case-study/<slug>.md \
--into atlas/case-studies/<slug>.md --by jerry-directed
Hop 1 sets status: promoted, which is what makes the study visible to
promote.py --backlog. Hop 2 authors the atlas/case-studies/ entry — that hop creates a
new atlas entry, so the autonomous /manage-vault loop cannot do it; it needs a directed
session. Promoting the stub straight to atlas/case-studies/ fails validation: that
target expects type: case-study, and the stub is type: intake.
Journal entry (mnemosyne): what the study surfaced, what the method missed.
Session handoff in claudes-home if the session is ending.
Common mistakes
| Mistake |
Correction |
| Handoff or notes written into the subject repo |
Subject is read-only; handoffs live in claudes-home |
| Lens list reused from a plan or prior chat |
Re-derive from the live tree at Phase 2 |
| Synthesis without reading prior studies |
Recurrence counting is the series' point — read them |
Prior studies read only from atlas/case-studies/ |
In-flight studies sit in intake/case-study/; read both or the recurrence check misses siblings |
| Numbering the entry ("Second entry…") |
Parallel studies can't know their ordinal — don't number them |
| Essay that only admires the subject |
Weaknesses section is mandatory |
| Trusting recon agents' "done" |
Read each report file before synthesis |
Essay written into ~/vault/intake/ |
That is the post-promotion home; agents write only to _inbox/{agent-id}/ |
Essay at bare ~/vault/_inbox/<slug>.md |
The {agent-id} subdirectory is required and must match the agent_id field |
| Stub frontmatter copied from the brew exemplar |
The exemplar is the promoted atlas entry; a stub takes the intake contract in schemas.md |
type: case-study on the stub |
type: intake + subtype: case-study; case-study is the atlas type |
Invented provenance/status values |
Literals only: provenance: agent-proposed, status: pending-promotion |
Running promote.py yourself |
Promotion is Jerry's gate, in every mode |
| Telling Jerry one promotion finishes it |
Two hops; the study is not on the reading surface until the ingest hop |
1---2name: architecture-case-study3description: Use when studying the architecture of an open-source codebase for the case-study series — "case study", "architecture study", "study how X is built", adding a subject under ~/devel/case-studies. Not for reviewing our own projects' code.4---56# Architecture Case Study78Study a real codebase the way architects study buildings. Output is one essay serving9two readers: **Jerry building a pattern vocabulary** for design discussions (names,10pictures, anchors), and the **vault's recall machinery** (density, wikilinks). The11series is cumulative — patterns graduate by recurring across studies.1213Reference exemplar: `~/vault/atlas/case-studies/brew-architecture-case-study.md` — read it for14essay structure, depth, and section shape. It is the **promoted atlas entry**, so its15frontmatter is *not* the model for what you write; the stub you hand off takes a different16contract (Phase 6).1718## Ground rules1920- The subject repo is **read-only**. No edits, no kata binding, no handoff files in it.21 Session handoffs go to claudes-home.22- Every factual claim in recon reports and essay is file:line-cited at the pinned commit.23- A study that only flatters its subject is not evidence — the weaknesses section is24 mandatory.2526## Phase 1 — Setup27281. Subject lives at `~/devel/case-studies/<name>`; clone it there if absent.292. Pin the commit: `git -C ~/devel/case-studies/<name> show -s --format='%h ("%s")'`.303. Write one paragraph: *why this subject earns a study* — the hard question its31 architecture is a sustained answer to. Confirm with Jerry before dispatching recon32 (fine to present this and the Phase 2 lens list together in one message).3334## Phase 2 — Lens selection3536Survey the tree top-level, build docs, and any architecture docs yourself (cheap reads37only). Propose **5–8 recon lenses** — subsystems or cross-cutting axes, sized so one38agent can cover one lens well. Re-derive lenses from the live tree; never reuse a stale39list from a plan or an earlier conversation. Get Jerry's sign-off.4041## Phase 3 — Recon fan-out4243Dispatch one read-only `general-purpose` agent per lens, all in a single message.44Model: **sonnet** by default; **opus** for lenses that are algorithmically deep or45judgment-dense. Each brief must contain:4647- **Role:** architecture recon on <subject> for a case-study series.48- **Target framing:** an AOSA-style essay; we need the architectural shape, key49 mechanisms, and deliberate trade-offs — not exhaustive API inventory.50- **Audience framing:** a developer with no prior exposure to this codebase; translate51 jargon, surface intuitions.52- The pinned commit citation; instruction to cite every claim as `file:line`.53- Read-only mandate: no edits anywhere in the subject repo.54- Output path: `~/.claude/scratchpad/YYYYMMDD-<subject>-general-purpose-recon-<lens>.md`55- Report shape: system role of the lens; how it works (mechanism, not tour); design56 decisions and their apparent rationale; warts, hacks, and suspicious spots; 3–557 candidate patterns or anti-patterns with evidence.58- Gap flagging: if a finding's evidence lives in another lens's files, state the gap59 explicitly in the report rather than stretching — the synthesizer follows up.6061Before synthesis, read each report file and confirm it is substantive — an agent's62"done" is not evidence.6364## Phase 4 — Synthesis (session model)65661. Read **all recon reports** and **every prior study** — at minimum their pattern-candidate67 lists. Prior studies live in **two** places and you must read both:68 - `~/vault/atlas/case-studies/` — studies that have completed the ingest loop.69 - `~/vault/intake/case-study/` — studies still in flight, promoted but not yet folded into70 the atlas. A study can sit here for a long time, so this directory is not an edge case.7172 Reading only the atlas directory is how a recurrence check silently misses a sibling73 study: on 2026-08-11 the git study missed rsync entirely because rsync was in `intake/`74 and `atlas/case-studies/` held only brew.752. Write the essay with these sections:76 - **Header paragraph:** series positioning, pinned commit, why this subject. **Do not77 number the entry** ("Second entry in the series…"). Studies are often researched in78 parallel and cannot know their own ordinal; the number carries nothing the series79 order does not already say, and two studies claiming the same one is a coordination80 problem with no upside. Name the subject and, where it helps, the prior studies whose81 patterns recur here.82 - **System shape:** one dense prose paragraph plus the required mermaid diagram83 (Phase 5).84 - **Cross-cutting themes:** shapes visible only across reports, not to any single85 recon pass. Each theme gets a **graspable name** and a **"reach for this when…"**86 line — the handle for a design conversation — then the evidence-backed description.87 - **Where this could bite or help us:** 1–2 sentences per applicable theme anchoring88 it to our own projects.89 - **Where the architecture is weakest** (mandatory).90 - **Style-catalog check** (one short paragraph): name the subject's implicit driving91 characteristic — the one nobody wrote down — and what was deliberately spent for it;92 then name the nearest mainstream architecture style and the "but" clause it needs, or93 state that no catalog entry fits. `atlas/concepts/style-catalogs-measure-distribution.md`94 makes a falsifiable prediction that the "but" clause goes empty on distributed subjects95 (kubernetes, containerd) — this paragraph is how that prediction gets tested, so report96 the result plainly whichever way it lands, including when it refutes the concept.97 - **Pattern candidates:** new candidates as unresolved `[[wikilinks]]` with one-line98 definitions, each carrying a **buys / spends** clause — which architecture99 characteristic the mechanism purchases and which one pays for it (adoptability bought100 with security-by-default; common-case latency bought with mirrored logic). Without it a101 candidate is a named mechanism; with it, it is a decision aid, which is the whole point102 of the vocabulary. Derive the trade from the subject's own evidence, not from a generic103 -ilities list. Required from 2026-08-18 forward; the first five studies do not carry it104 natively and are not being backfilled — the cross-study trades live in105 `atlas/concepts/style-catalogs-measure-distribution.md` instead.106 **Recurrence check:** if a prior study's candidate appears in this107 subject, cite its existing wikilink and say so explicitly, and state the running108 count — `routing.md`'s earn-an-entry floor of **3+ citations** is what graduates a109 candidate into a concept entry (writing the entry is a promoter's act, not this110 session's). Do not write "graduates on a second sighting": that wording came from111 this skill, contradicted `routing.md:29`, and propagated into three curated studies112 before Jerry ruled the 3+ floor standing (2026-08-15, kata vault#5btt). Judgment113 (routing clause b) may still fire earlier, but that is a promoter's call stated as114 one — never the default the study asserts.115 - **Sources:** method, recon report paths, working tree path, sha256 of the recon116 reports concatenated in **sorted filename order** (`cat <dir>/<glob>*.md | sha256sum`117 — glob order is sorted, so this is reproducible; repo state is pinned by the118 commit citation).119120## Phase 5 — Diagrams121122Mermaid, inline in the essay:123124- **Required:** one system-shape diagram — components/processes and who talks to whom.125- **Strongly encouraged:** one sequence/flow diagram of the subject's *defining126 mechanism* (the thing the subject is famous for).127- Per-theme diagrams only where a picture beats a paragraph. No quota.128- Keep diagrams renderer-portable: plain `flowchart`/`sequenceDiagram`, no exotic129 features; node labels carry file names where that helps navigation.130131## Phase 6 — Hand off to the vault + wrap-up1321331. Write the essay to `~/vault/_inbox/session-lead/<subject>-architecture-case-study.md`.134135 **Never write to `~/vault/intake/`** — despite the name, that is the vault's136 *post-promotion* home for source material, and agents may not write there137 (`_system/routing.md`). The agent's only write target is `_inbox/{agent-id}/`, and the138 directory name must match the `agent_id` field.139140 **Frontmatter is the intake-stub contract** in `_system/schemas.md` ("Intake item") —141 *not* the frontmatter of the brew exemplar at line 13. That exemplar is the promoted142 **atlas** entry; its field set and its `provenance`/`status` vocabularies are different,143 and copying it produces a stub the gate rejects. Use exactly:144145 ```yaml146 ---147 name: <subject>-architecture-case-study # matches filename stem148 type: intake # literal — NOT `case-study`149 subtype: case-study # literal150 description: <~150 chars>151 provenance: agent-proposed # literal — the gate confers trust, you cannot152 source_url: <github tree URL at the pinned commit>153 agent_id: session-lead # matches the _inbox/ subdirectory154 ingested: YYYY-MM-DD155 sha256: <recon reports concatenated, sorted filename order>156 status: pending-promotion # literal157 ---158 ```159160 Do **not** add `subject`, `created`, `updated`, `confidence`, `contested`,161 `contradictions`, or `tags` — those are atlas fields, written later when the atlas entry162 is authored. There is no `commit` field in any schema; the pinned commit citation lives163 in the body's header paragraph and in `source_url`.1641652. Promotion is Jerry's gate — do not promote, and do not run `promote.py` in any mode.166 Tell him the study is ready and note that it takes **two hops** (per the brew receipts in167 `~/vault/_ops/applied/`), because the essay is not on the reading surface until the168 second one runs:169170 ```171 python3 _system/promote.py _inbox/session-lead/<slug>.md \172 --to intake/case-study/<slug>.md --action create --by jerry-curated173174 python3 _system/promote.py --ingest intake/case-study/<slug>.md \175 --into atlas/case-studies/<slug>.md --by jerry-directed176 ```177178 Hop 1 sets `status: promoted`, which is what makes the study visible to179 `promote.py --backlog`. Hop 2 authors the `atlas/case-studies/` entry — that hop creates a180 new atlas entry, so the autonomous `/manage-vault` loop cannot do it; it needs a directed181 session. Promoting the stub straight to `atlas/case-studies/` fails validation: that182 target expects `type: case-study`, and the stub is `type: intake`.1833. Journal entry (mnemosyne): what the study surfaced, what the method missed.1844. Session handoff in claudes-home if the session is ending.185186## Common mistakes187188| Mistake | Correction |189|---|---|190| Handoff or notes written into the subject repo | Subject is read-only; handoffs live in claudes-home |191| Lens list reused from a plan or prior chat | Re-derive from the live tree at Phase 2 |192| Synthesis without reading prior studies | Recurrence counting is the series' point — read them |193| Prior studies read only from `atlas/case-studies/` | In-flight studies sit in `intake/case-study/`; read both or the recurrence check misses siblings |194| Numbering the entry ("Second entry…") | Parallel studies can't know their ordinal — don't number them |195| Essay that only admires the subject | Weaknesses section is mandatory |196| Trusting recon agents' "done" | Read each report file before synthesis |197| Essay written into `~/vault/intake/` | That is the post-promotion home; agents write only to `_inbox/{agent-id}/` |198| Essay at bare `~/vault/_inbox/<slug>.md` | The `{agent-id}` subdirectory is required and must match the `agent_id` field |199| Stub frontmatter copied from the brew exemplar | The exemplar is the promoted *atlas* entry; a stub takes the intake contract in `schemas.md` |200| `type: case-study` on the stub | `type: intake` + `subtype: case-study`; `case-study` is the atlas type |201| Invented `provenance`/`status` values | Literals only: `provenance: agent-proposed`, `status: pending-promotion` |202| Running `promote.py` yourself | Promotion is Jerry's gate, in every mode |203| Telling Jerry one promotion finishes it | Two hops; the study is not on the reading surface until the ingest hop |