Design Memory — the .sumi/ contract
.sumi/ is what makes the commands compose. /style decides a visual direction
once; /screen, /component, /page, /fix and a dozen others consume it
instead of re-inventing a palette every invocation.
That only works if every command agrees on the file shape. Until v4.1.0 none was
written down, and four commands wrote .sumi/style.json in four different
shapes while other commands read whichever they assumed. This skill is the
single definition.
Constants
The canonical .sumi/style.json. Every writer emits this envelope; nobody
invents keys.
{
"$sumi": "1",
"meta": {
"generated": "ISO-8601 timestamp",
"updatedBy": ["/style"],
"sector": "fintech",
"mood": "professional",
"platform": "web"
},
"project": {
"framework": "react | vue | svelte | vanilla | swiftui",
"styling": "tailwind | css | styled-components | swiftui",
"typescript": true
},
"tokens": {
"$schema": "https://design-tokens.github.io/community-group/format/",
"color": {},
"typography": {},
"space": {},
"radius": {},
"shadow": {},
"duration": {},
"easing": {},
"z": {},
"$themes": { "light": {}, "dark": {} }
},
"tone": {
"formality": "",
"traits": [],
"wordsToUse": [],
"wordsToAvoid": []
},
"references": [
{ "app": "", "platform": "", "stealThis": "", "takeaway": "" }
]
}
Everything under tokens is W3C DTCG. Everything outside it is Sumi's own
envelope, because DTCG has no way to express a sector, a tone of voice, or a
list of reference apps.
The file set
| File |
Written by |
Holds |
.sumi/style.json |
/style, /palette, /type, /tokens, /dark |
the schema above |
.sumi/brief.json |
/brief |
persona, HMW questions, constraints, success criteria |
.sumi/map.json |
/map |
sitemap, screen inventory, content hierarchy |
.sumi/vision.json |
/grade |
visual direction, designer-DNA match, score |
.sumi/wireframe-<screen>.json |
/wireframe |
layout structure, component map |
.sumi/generated-<asset>.json |
/generate |
generation records, prompts, model, score |
.sumi/decisions.log |
any command |
append-only NDJSON: {ts, command, decision, reason, overrides} |
Ownership
A writer touches its own subtree and nothing else. This is what allows four
commands to share one file without clobbering each other.
| Command |
Owns |
/style |
the whole file — it is the only command that may create it |
/palette |
tokens.color |
/type |
tokens.typography |
/tokens |
tokens.* (serialization only; it does not decide) |
/dark |
tokens.$themes.dark |
| everything else |
read-only |
Read order
Broad to specific. Later files override earlier ones where they overlap.
brief.json — who it is for and what problem it solves
map.json — what screens exist
style.json — what it looks like
vision.json — the visual bar and DNA match
wireframe-<screen>.json — the layout of the screen actually in play
decisions.log — the running override log; the last entry wins
Merge rules
- Read-modify-write, never replace. Load the file, deep-merge your subtree,
write it back. Append your command name to
meta.updatedBy and refresh
meta.generated. A whole-file replacement destroys three other commands'
work and is the specific bug this contract exists to prevent.
- Precedence: explicit user instruction > design memory > defaults. An
instruction in the current turn wins immediately and appends to
decisions.log with its reason.
- Absent is not empty. No file means "not decided yet" — generate a value
and offer to persist it. A file present but partial means "decided" for the
sections that exist; fill only the gaps.
- Never invent a token when
style.json exists. If the palette is on disk,
use it. Inventing a second palette mid-session is the most visible way to
break the illusion that the commands are one system.
- Conflict: ask once. If your write would change a value another command set
in a previous session, surface both values in one line and ask. Do not ask
twice in a session, and do not silently overwrite.
Routing
For the full JSON Schema of every file, worked merge examples, and the
migration note for pre-v4.1.0 files: read references/sumi-file-schemas.md.
Cross-References
design-systems-architecture — the DTCG token tiers tokens serializes
design-token-presets — vetted starting token sets to seed tokens from
sumi-orchestrator — pipelines that span several commands, which is when
design memory earns its keep
1---2name: design-memory3description: The .sumi/ design memory contract — which files exist, the canonical style.json schema, which command owns which subtree, read order, and merge rules. Use whenever a command reads or writes .sumi/, or when design decisions from an earlier command must survive into a later one.4---56# Design Memory — the `.sumi/` contract78`.sumi/` is what makes the commands compose. `/style` decides a visual direction9once; `/screen`, `/component`, `/page`, `/fix` and a dozen others consume it10instead of re-inventing a palette every invocation.1112That only works if every command agrees on the file shape. Until v4.1.0 none was13written down, and four commands wrote `.sumi/style.json` in four different14shapes while other commands read whichever they assumed. This skill is the15single definition.1617## Constants1819The canonical `.sumi/style.json`. Every writer emits this envelope; nobody20invents keys.2122```json23{24 "$sumi": "1",25 "meta": {26 "generated": "ISO-8601 timestamp",27 "updatedBy": ["/style"],28 "sector": "fintech",29 "mood": "professional",30 "platform": "web"31 },32 "project": {33 "framework": "react | vue | svelte | vanilla | swiftui",34 "styling": "tailwind | css | styled-components | swiftui",35 "typescript": true36 },37 "tokens": {38 "$schema": "https://design-tokens.github.io/community-group/format/",39 "color": {},40 "typography": {},41 "space": {},42 "radius": {},43 "shadow": {},44 "duration": {},45 "easing": {},46 "z": {},47 "$themes": { "light": {}, "dark": {} }48 },49 "tone": {50 "formality": "",51 "traits": [],52 "wordsToUse": [],53 "wordsToAvoid": []54 },55 "references": [56 { "app": "", "platform": "", "stealThis": "", "takeaway": "" }57 ]58}59```6061Everything under `tokens` is W3C DTCG. Everything outside it is Sumi's own62envelope, because DTCG has no way to express a sector, a tone of voice, or a63list of reference apps.6465## The file set6667| File | Written by | Holds |68|---|---|---|69| `.sumi/style.json` | `/style`, `/palette`, `/type`, `/tokens`, `/dark` | the schema above |70| `.sumi/brief.json` | `/brief` | persona, HMW questions, constraints, success criteria |71| `.sumi/map.json` | `/map` | sitemap, screen inventory, content hierarchy |72| `.sumi/vision.json` | `/grade` | visual direction, designer-DNA match, score |73| `.sumi/wireframe-<screen>.json` | `/wireframe` | layout structure, component map |74| `.sumi/generated-<asset>.json` | `/generate` | generation records, prompts, model, score |75| `.sumi/decisions.log` | any command | append-only NDJSON: `{ts, command, decision, reason, overrides}` |7677## Ownership7879A writer touches its own subtree and nothing else. This is what allows four80commands to share one file without clobbering each other.8182| Command | Owns |83|---|---|84| `/style` | the whole file — it is the only command that may create it |85| `/palette` | `tokens.color` |86| `/type` | `tokens.typography` |87| `/tokens` | `tokens.*` (serialization only; it does not decide) |88| `/dark` | `tokens.$themes.dark` |89| everything else | **read-only** |9091## Read order9293Broad to specific. Later files override earlier ones where they overlap.94951. `brief.json` — who it is for and what problem it solves962. `map.json` — what screens exist973. `style.json` — what it looks like984. `vision.json` — the visual bar and DNA match995. `wireframe-<screen>.json` — the layout of the screen actually in play1006. `decisions.log` — the running override log; the last entry wins101102## Merge rules1031041. **Read-modify-write, never replace.** Load the file, deep-merge your subtree,105 write it back. Append your command name to `meta.updatedBy` and refresh106 `meta.generated`. A whole-file replacement destroys three other commands'107 work and is the specific bug this contract exists to prevent.1082. **Precedence: explicit user instruction > design memory > defaults.** An109 instruction in the current turn wins immediately and appends to110 `decisions.log` with its reason.1113. **Absent is not empty.** No file means "not decided yet" — generate a value112 and offer to persist it. A file present but partial means "decided" for the113 sections that exist; fill only the gaps.1144. **Never invent a token when `style.json` exists.** If the palette is on disk,115 use it. Inventing a second palette mid-session is the most visible way to116 break the illusion that the commands are one system.1175. **Conflict: ask once.** If your write would change a value another command set118 in a previous session, surface both values in one line and ask. Do not ask119 twice in a session, and do not silently overwrite.120121## Routing122123For **the full JSON Schema of every file**, worked merge examples, and the124migration note for pre-v4.1.0 files: read `references/sumi-file-schemas.md`.125126## Cross-References127128- `design-systems-architecture` — the DTCG token tiers `tokens` serializes129- `design-token-presets` — vetted starting token sets to seed `tokens` from130- `sumi-orchestrator` — pipelines that span several commands, which is when131 design memory earns its keep