System · Harbor

Architecture

Layers, pipeline, frozen vs creative, extension.

architecture.md

Meridian — architecture.md

System layers for humans and agents. Influences: influences.md.
Contracts: ../design.md · ../agents.md. Specs: layout · ux · animations · color · typography · density · ai-surfaces.

1. What Meridian is

An AI design contract — strict guidelines + typed grammar so agents under extreme constraints always produce good UI. Showcased on a cinematic website. Surfaces are proofs, not the product. See north-star.md.

IsIs not
Tokens + grammar + fail-closed lawsParallel component library
shadcn primitives + typeset rhythmForked Button/Card twins / shell zoo
Frozen material + creative compositionFreeform vibe coding
Agent-readable contracts + lintPrompt-only hope

2. Research → system (why each layer exists)

FindingSourceResponse
Agents fabricate tokens / drift mid-sessionSuperdesignClosed unions in lib/design/grammar.ts
Docs ≠ code ≠ componentsPandyaOne grammar imported by UI + check:design
Creativity dies if everything lockedInternal modelFrozen vs creative zones in recipes.ts
Productivity apps need quiet dense chromeCursor app, LinearShell rhythm + workbench proofs
Material needs control vs layer + strokeFluent 2materialLaws, radiusFor, edge
Meaning-bearing color + task densityPolaris ProStatus semantics, data-surface
HTML/markdown type soup repeatsshadcn/typesetOwned typeset.css + frozen presets
Cinema stagingApple-class film patternscinematicLaws, defineCinemaFrame
Parts without wholes failBrad FrostSurfaces validate atoms in product frames
Compose don’t inventshadcn / schema UI gennpx shadcn@latest add

3. North star pipeline

docs/north-star.md             ← product = AI contract
docs/platform.md               ← shared architecture (all contracts)
        ↓
lib/platform/skeleton.ts       ← MCP · filenames · routes · JSON keys (SSOT)
lib/contracts/dna/{id}.ts      ← aesthetic DNA only (may differ)
        ↓
influences.md (ranked absorb)
        ↓
design.md + agents.md          ← contracts (MUST / load order / platform parity)
        ↓
lib/design/{grammar,recipes,typeset,shell,contrast,cx,knobs}.ts
        ↓
app/globals.css + typeset.css  ← OKLCH tokens + typeset rhythm
        ↓
components/ui/*                ← shadcn atoms (compose only)
        ↓
components/surfaces/*          ← proofs (validation only)
components/cinematic/*         ← film stages
        ↓
check:platform · design · shell · proofs · typeset · contrast

Agents invent stories and compositions. They do not invent colors, shadows, radii, or type scales.
They also do not invent Meridian-only MCP tools or machine filenames — see platform.md.

4. Frozen vs creative

FROZEN                              CREATIVE
──────────────────────────────      ─────────────────────────────
colorRoles / OKLCH                  copy / voice
radii / depths / strokeFor          information architecture
surfaces / shell rhythm             domain objects
typeset presets / laws              which typeset preset
themeKnobs / activity               frame sequence (ideas: 1)
cinematicLaws / materialLaws        which shadcn wholes
banned / designInfluences           narrative within one idea
contrast pairs

5. Layer catalog

LayerPathOwner
North stardocs/north-star.mdProduct
Ranked influencesdocs/influences.mdResearch
Spatial systemdocs/layout.mdResearch
Interaction / UXdocs/ux.mdResearch
Motiondocs/animations.mdResearch
Colordocs/color.mdResearch
Type + typesetdocs/typography.mdResearch
Densitydocs/density.mdResearch
Operator UXdocs/ux.mdPillar
Developer / agent DXdocs/dx.mdPillar
AI UIdocs/ai-surfaces.mdResearch
Human DNAdocs/meridian.mdDNA
Source ledgerdocs/sources.mdDNA
AI contractdesign.mdContract
Agent OS manualagents.mdContract
Typed grammarlib/design/grammar.tsCode
Recipes / lawslib/design/recipes.tsCode
Typeset presetslib/design/typeset.tsCode
Shell rhythmlib/design/shell.tsCode
Contrast pairslib/design/contrast.tsCode
Class helperslib/design/cx.tsCode
Drift lintscripts/check-*.mjsCI
Tokensapp/globals.cssTheme
Typeset CSSapp/typeset.cssTheme
Primitivescomponents/ui/*shadcn
Proofscomponents/surfaces/*Validation
Filmcomponents/cinematic/*Marketing
Skillsskills/*/SKILL.mdAgents
Agents.cursor/agents/*Agents

6. Typed grammar surface

Import @/lib/design — never ad-hoc fabrication.

ExportJob
colorRolesClosed semantic colors
radii / radiusForControl vs layer vs shell
depths / depthForedge → soft → raised
strokeForthin edge / focus ring
surfacesapplication · marketing · mobile · desktop
activityRolesthinking · search · read · edit
provenanceRolesuser · assistant · tool · …
bannedDrift patterns
typesetClass / typesetLawsFrozen HTML/markdown rhythm
uxLaws / dxLawsTwin pillars — operator + agent/dev experience
shellRhythm / shellLawsSurface density contract
cinematicLawsFilm contract
materialLawsFluent-shaped material
designInfluencesAbsorb / reject lists
defineCinemaFrameTyped one-idea frames
defineInteractiveProofProof recipe (validation)
contrastPairsWCAG AA audit data

7. Runtime architecture (Next.js)

app/
  page.tsx                 home film
  globals.css              tokens
  typeset.css              shadcn/typeset (owned)
  theme/                   grammar showcase
  surfaces/                proof gallery (validation)
  for-agents/              designed agents guide
  architecture/            designed architecture
  system/                  research docs index + [slug]
  design.md/route.ts       negotiated contract
  agents.md/route.ts
  architecture.md/route.ts
  *.md/route.ts            other negotiated docs
components/
  ui/                      shadcn (compose only)
  surfaces/                proofs — not a shell product
  cinematic/               stages
  home/                    film beats
  docs/                    DocShell, MarkdownBody (typeset)
lib/design/                typed law
scripts/check-*.mjs        gates

Content negotiation: browsers → designed HTML; agents → raw markdown (Accept or ?raw=1).

8. Toolchain roles

KindRoleExamples
ContractAlways-on lawdesign.md, agents.md, north-star.md
Research specDeep merge rulesdocs/layout.md, typography.md, …
SkillTask workflowmeridian-compose
AgentAuthor / reviewermeridian-author
LintFail closedcheck:design, shell, proofs, typeset, contrast

9. Website routes

RouteJob
/Cinematic positioning
/design · /meridian/design.mdContract
/meridian/for-agents · /meridian/agents.mdAgent OS
/meridian/architecture · /meridian/architecture.mdThis file
/system · /meridian/system/[slug]Research specs (influences, layout, ux, …)
/meridian/theme · /meridian/surfaces · /skillsShowcase
/llms · /meridian/llms.txtDiscovery

10. Extension protocol

  1. New token rolegrammar.ts + globals.css + cx.ts + contrast if text/bg (same PR).
  2. New banbanned + check-design.mjs rule.
  3. New influence win → update influences.md merge matrix + encode in recipes/CSS.
  4. New skill when a workflow repeats three times.
  5. Keep MUST lists short — raise the floor, don’t write a novel in the contract; put depth in docs/*.

11. Dependency rules

docs/research  →  informs  →  design.md / recipes
recipes        →  imported by  →  UI / theme pages
UI             →  may import  →  @/lib/design, @/components/ui, @/lib/icons
UI             ✗  must not    →  invent hex, shadow-*, lucide direct

12. Done definition (architectural)

  • Change sits in the correct layer
  • Frozen vocabulary unchanged unless intentional + tests/lint updated
  • Influence merge matrix still true (or updated)
  • Gates green

Sources

Raw