Shared first
What an article may bring of its own, the order to try before it does, and how an exception is declared and checked.
Shared first. An article is built from the shared baseline; styles or code of its own are exceptions, each declared with its reason. Try the rungs in order and stop at the first that serves.
Agents read the same rule from the MCP: get_component_policy, and in short from get_lifecycle.
Order to try
1. Use a shared block as it is
The catalog has a block, layout, surface, player part or figure primitive for the job.
catalog_list (kind "block", "layout", "figure") and find_similar with a one-line description of the need. Use what it returns.
Where the work lands: index.mdx only.
2. Configure it
A shared block does the job at another size, layout, tone or with other slots.
Its props, sizes (compact, normal, expanded), layout and short forms, as catalog_get lists them. The look is changed through tokens, never by CSS aimed at a shared block's classes from a piece.
Where the work lands: index.mdx only.
3. Compose shared parts into a figure
The piece shows something of its subject: a diagram, a chart of its data, a replay of its run.
A plate on the plot kit (pens, weights, dashes, type) in plates.tsx; a playable figure on the shared Player (transport, panels, keys, zoom, fullscreen), the piece supplying only the drawing and the data; a console, printout or dialogue on the shared surfaces.
Where the work lands: plates.tsx and figures/ in the piece's folder, listed under bespoke.
4. Extend the shared baseline
The need is general and not about this article's subject (tabs, a tooltip, a data table, a bar chart, a timeline, a viewer), or a second piece needs something one piece already has.
Add the block, variant or token to the shared code in its own pull request, derived from a reference library where one has it (see references), restyled wholly on the site's tokens, with a spec so the catalog lists it. Then the piece uses it on the first rung. The MCP cannot write code: say what is missing in the pull request and use <Pending> where it would go.
Where the work lands: src/blocks and src/tokens, never the piece.
5. Keep it the piece's own
It is intrinsic to this article's subject and no other piece could use it: the terrain of this dataset, the circuit of this board, the scene of this experiment.
Declare it in the frontmatter under bespoke: what (the files), reason (what is specific to this subject, and which shared parts it stands on), nearest (the shared unit weighed and why it does not serve). It still takes its colours, weights, type and spacing from tokens.
Where the work lands: The piece's folder, every file covered by a bespoke entry.
Is it truly the article's own?
- Could another article use it with other data or other words? Then it is general: extend the baseline.
- Does it draw or compute this article's subject (its data, its device, its experiment)? Then it may be the piece's own.
- Is it a control, a container, a caption, a legend, a table, a card, a tooltip or a transport? Those are never a piece's own.
- Does it only change how a shared block looks? That is a token or a variant of the block, not piece CSS.
Declaring an exception
frontmatter bespoke: [{what, reason, nearest}]. Every .tsx, .ts, .js and .css file in the piece's folder is covered by an entry, except components.tsx (the register of what the MDX may use) and tests.
| Field | Meaning |
|---|---|
what | The files, relative to the piece's folder; a folder ending in / covers what is under it. |
reason | What is specific to this article's subject, and which shared parts it stands on. |
nearest | The shared unit weighed against it (a catalog id) and why it does not serve. |
What is checked
- validate_draft warns on a
bespokeentry with nonearest. - open_pull_request refuses a code or style file of a piece that no
bespokeentry covers, and a piece stylesheet aimed at a shared block's classes. - bun run lint:prose reports both for every piece in the repository.
- validate_draft, open_pull_request and the prose lint refuse an opt-in style marked on a passage (
\<Prose dropcap\>) in a piece whose frontmatter does not name it underallow. - validate_draft and open_pull_request refuse a piece that names a
motifwith a picture beside the title (hero.side). - The audit budgets the lines of code one piece may carry, and find_similar looks for a shared or piece-owned component like a proposed one.
Openers
A piece opens with one of a fixed set, picked in its frontmatter and drawn by the template. There is no opener of a piece's own. A motif may sit beside the title above a picture, a still or a live figure, but never with a picture beside the title (hero.side), which takes the same place. A picture is never wrapped in a component to change how it sits.
| Opener | Pick it for | Frontmatter | What is drawn |
|---|---|---|---|
Title and deck (plain) | A short piece, or one whose first figure belongs in the body. | Neither motifnorhero. | The dateline, the title, the deck and the byline or facts row. |
Motif beside the title (motif) | The default for a labs write-up and most research pieces: one small line drawing of the subject. | motif: \{src: /pieces/\<slug\>/motif.svg\} | The drawing at the right of the title in the ink colour, a hairline stroke whatever the file says; under the dateline and smaller on a narrow page. Decorative: no caption, aria-hidden. |
Picture under the deck (picture) | A photograph or rendered image that is the piece's subject. | hero: \{src, alt, caption?, credit?\} | A full-width figure in the wide ratio under the deck, cropped to the frame, with its caption on the text edge. Opens in the viewer. |
Still, kept whole (still) | A frame whose edges matter: a film still with subtitles, a screenshot. | hero: \{src, alt, fit: contain, caption?, credit?\} | The same frame as a picture, with the image whole inside it and nothing cropped. |
Picture beside the title (split) | A square or portrait picture, or a still, that should sit with the title and not above the text. | hero: \{src, alt, side: start | end, fit?, caption?\} | Two columns on the wide column, the picture on the named side; the picture first where the page is too narrow for two. |
Live figure under the deck (live) | The piece's own playable or interactive figure is its opening: a replay, a map. | hero: \{component: Name, props?, caption?, credit?\} | The component the piece exports from components.tsx, in the figure frame under the deck. It is a figure on the shared Player or the plot kit, declared under bespoke; a picture is never wrapped in a component to change how it sits. |
Styles that are off unless excepted
A decorative style is off unless excepted twice: the page names it under allow in its frontmatter with the reason, and each place that takes it is marked. Naming it for the page alone draws nothing, and marking a passage on a page that has not named it is refused.
| Style | What it is | For the page | At each place |
|---|---|---|---|
Drop cap (dropcap) | A three-line initial on a paragraph's first letter. Decorative: it says nothing the text does not, so it is never a default. | allow: [\{style: dropcap, reason: \<why this page has it\>\}] | \<Prose dropcap\> around the passage that takes it. |
Where a new shared block comes from
A new shared block is derived from one of these where it has the part, taken as source and restyled wholly on the site's tokens. None is used in its own look, and a piece never imports one.
| Library | Look there for |
|---|---|
| shadcn/ui | General controls and containers: tabs, tooltip, popover, dialog, accordion, table, badge, slider. |
| Tremor | Charts and data display: bar, line and area charts, sparklines, trackers, KPI tiles, data tables. |
| Kibo UI | Richer composites: code blocks with tabs, image compare, gantt, kanban, tree, marquee. |
| Cult UI | Expressive pieces of layout and motion, taken sparingly and stripped to the house look. |
| Dice UI media player | The anatomy of any playback frame, player or viewer: the base or the inspiration for the shared Player's chrome. |
| AI SDK UI | Chat, completion and streamed-object interfaces, where a piece shows a model at work. |
| ui-sdk.dev | Named by the owner as a further source; read it before building an interface part from nothing. |