{"id":110646,"plugin_id":"plugin_asdk_app_6af0f968725481919facc8e463d213ef","kind":"skill","collection_source":"plugin_package","comparison_source":null,"observed_at":"2026-11-23T00:14:47.766Z","digest":"69fc2c3502e789f7ad7c5473469bcf50dcf16cc04f6d3853ac49ff8e2f2ec44b","against":null,"payload":{"description":"Bring a company's design system into diagramkit so every visual uses its colours, type, shape, surfaces and canvas, and draws their figures their way. Use when someone asks to make diagramkit match their brand or their own diagrams, apply their Claude Design system or design tokens, or use their company colours and fonts. Business and Enterprise accounts only.","included_files":[],"name":"set-brand","skill_md_contents":"---\nname: set-brand\ndescription: Bring a company's design system into diagramkit so every visual uses its colours, type, shape, surfaces and canvas, and draws their figures their way. Use when someone asks to make diagramkit match their brand or their own diagrams, apply their Claude Design system or design tokens, or use their company colours and fonts. Business and Enterprise accounts only.\n---\n\n# Bring a design system into diagramkit\n\nA brand restyles every new visual for the account (and its previews): colour\nroles, fonts by role, shape, density, surfaces, lines, charts, the page behind\nthe visual, motion and categorical colours. Earlier visuals keep their look.\n\nMap the design system as completely as the source allows. A brand that sets\nonly colours still looks like diagramkit in other colours; the other fields are what\nmake it look like the company's own.\n\n## Colour roles\n\n| Role | What it colours |\n| --- | --- |\n| `background` | The page behind the visual |\n| `surface` | Cards, panels, control backgrounds |\n| `text` | Body text and outlines |\n| `muted` | Secondary text and captions |\n| `border` | Dividers and quiet borders |\n| `primary` | The active path, selected controls, links and emphasis |\n| `glyph`, `glyphAccent` | The fills of actor illustrations |\n| `success`, `warning`, `error` | State colours (set them when the brand has its own) |\n\nRoles you leave out are derived from the ones you give. Only `primary` is required.\n\n## Theme\n\n`theme` says which palette visuals use:\n\n- `\"light\"`: the light colours everywhere, including in a dark host. This is the\n  default when the source has no dark colours. diagramkit never invents a dark palette.\n- `\"follow-host\"`: light or dark to match the host. The default when the source\n  has dark colours (Claude Design themes named dark, `colors.dark`, token groups\n  named `dark`). Without dark colours, diagramkit derives them.\n- `\"dark\"`: the dark colours everywhere.\n\nA brand guide that shows only light pages, or says to keep its paper in dark\nmode, is `\"light\"`. The preview's last capture is a dark host: it shows the dark\ntheme, or that a fixed theme keeps its look.\n\n## Everything else\n\n| Field | What it sets |\n| --- | --- |\n| `typography` | `heading`, `body`, `mono` font stacks; `headingWeight`, `strongWeight` (100 to 900); `headingTracking`, `labelTracking` (em, e.g. -0.02, 0.08); `labelFont` (`mono`, `body`, `heading`) and `labelTransform` (`none`, `uppercase`) for labels, captions and metadata; `scale` (type size, 0.75 to 1.5) |\n| `shape` | `corners`: `square`, `soft`, `round` or a radius multiplier 0 to 2. `borders`: `hairline`, `standard`, `bold` or a width multiplier. `shadows: false` removes every shadow |\n| `density` | `compact`, `standard`, `comfortable` or a spacing multiplier 0.6 to 1.6 |\n| `surfaces` | Cards and panels. `style`: `flat` (page colour, no border), `outlined` (surface and border, no shadow), `filled` (surface, no border), `elevated` (surface and shadow). Optional `background`, `borderColor`, `borderWidth` (px), `gradient` (`{ to, angle }`, shading over the card) and `highlight` (a light top edge) |\n| `lines` | Connectors and diagram lines: `weight` (multiplier), `color`, `dash` (`solid`, `dashed`, `dotted`). Heads and bends are `diagram.look.link`: `head` (`triangle`, `chevron`, `none`), `path` (`orthogonal`, `rounded`, `curved`), `corner` (bend radius, px); every `FigSkinArrow` takes them |\n| `charts` | `gridColor`, `gridDash`, `axisColor` |\n| `canvas` | The page behind the visual, as their figures show it (a grid in their website's CSS is not one in their figures): `pattern` (`none`, `grid`, `dots`), `size` (px, default 24), `color` (default: text at 7%), `gradient` (`{ kind: linear or radial, colors, angle, at }`, a backdrop or glow), `grain` (opacity, 0.04 is subtle) and `image` (`{ asset, fit, position }`, one of `assets` behind everything: lighting, texture, artwork) |\n| `motion` | `none`, `subtle` or `standard` |\n| `assets` | Up to 8 images their figures use (`{ name, format, data_base64 }`): a backdrop, a texture, their product mark. Each is `var(--brand-asset-NAME)` in `customCss` and the kit, and an icon as `FigSkinIcon` `name=\"asset:NAME\"`. Left out, a preview keeps the current ones |\n| `categories` | Up to 8 colours for groups, series and legends, in order, as `{ \"name\": \"Data\", \"color\": \"#1a3fd6\" }`. Keep them apart from success, warning and error |\n| `visualStyle` | Up to 2,000 characters of plain text on how their diagrams look that the other fields cannot set. Every client and agent drawing for the account reads it; it is never drawn |\n\nA figure they always show on dark, on a site with light pages too, keeps the brand\nfollowing the host; the figure sets `theme: \"dark\"` in its own `visual` export.\n\n## Looks\n\nWhen their figures come in a few kinds that look different (a lit page for\nproduct flows, a faint grid for systems and records), set the most common as the\nbrand's own fields and each other kind as one of `looks`: `{ name, when, ... }`\nwith only what differs, from `theme`, `canvas`, `surfaces`, `lines`, `shape`,\n`density` and `typography` (no fonts). `canvas` replaces the default's page; the\nothers change only the keys they set. Colours, fonts, assets and the kit stay\nthe brand's. `when` says in a few words which figures use it, and every client\nreads it. A visual picks a look with `look: \"grid\"` in its `visual` export, and\ndiagramkit paints the page for it, so no figure draws its own backdrop. When the\nkit's `skin` sets what a look changes (its cards' border, say), the kit also\nexports `looks`, the skin tokens each look changes:\n`export const looks: Record<string, FigSkin> = { grid: { tokens: { cardBorderStyle: 'solid' } } }`.\nRecreate one of their figures in each look before you apply the brand.\n\nAny colour field in `surfaces`, `lines`, `charts` and `canvas` also takes a role\nname (`\"text\"`, `\"border\"`, `\"primary\"`...), which follows the theme. Use a role\nwhenever the brand means \"the ink colour\" rather than one fixed value.\n\nA drafting-table brand, for example: `theme: \"light\"`, `shape: { corners:\n\"square\", borders: \"hairline\", shadows: false }`, `surfaces: { style: \"outlined\",\nborderColor: \"text\", borderWidth: 1 }`, `canvas: { pattern: \"grid\", size: 24 }`,\n`typography: { labelFont: \"mono\", labelTransform: \"uppercase\", labelTracking: 0.08 }`.\n\n## Visual style\n\nSome of a brand's look is a feel no token captures: airy or dense, illustrated\nor schematic, one primary visual or several panels. Describe it in\n`visualStyle`, in a few short, general sentences about the overall feel, how\nmuch white space there is, how a figure is composed (what leads, what is left\nout), how many words sit on it, and decoration (texture, tilt, shadows,\nhand-drawn touches). Leave out colours, hex codes, fonts, corners and line\nweights: the other fields hold them. Describe only the feel, within what\ndiagramkit draws: never the subjects, words or data of their figures, and no\ncharacters or illustrations of people. For example: \"Airy and lightweight,\nillustration-led. One primary visual under a short header and nothing else,\nwith lots of white space around it. Few words on the figure: a label only where\na part needs naming.\"\n\n## Match their own figures: skin, then kit\n\nColours and fonts alone leave every figure looking like diagramkit's. When the person\npoints you at figures they already publish, set the account up so every new\nfigure is drawn their way. diagramkit's standard parts (`@caret/fig/skin`) cover\nwhat technical figures are made of; your job is to draw them the company's way (a\nskin), build only what they lack (the company's own parts), and prove it by\nrecreating their figures one to one. Both go in the brand's `kit`: one TSX module\nthat exports `skin` and any parts, imported by every visual as `\"@caret/tenant\"`,\nand a `guide` every client reads. diagramkit places nothing: whoever draws a figure\nlays out every part at their own coordinates, so a kit only decides how each part\nlooks.\n\n### 1. Read every figure and map it onto diagramkit's parts\n\nRead all the figures you are given (ask for more if you have fewer than five:\nmore figures, fewer surprises later). For each element, name the standard part\nit maps to:\n\n| Standard part | Covers |\n| --- | --- |\n| `FigSkinCard` | a box or card: icon and title, a caption above, a detail under, `chips` inside (pills), `items` (a list, `checks` to tick them) |\n| `FigSkinChip` | a pill or chip |\n| `FigSkinGroup` | a region, container or group with a title, framed round parts placed in it |\n| `FigSkinIcon` | an icon by name |\n| `FigSkinArrow` | an arrow: colour, weight, solid, dashed or dotted, the head (open, filled, bar, none; its length, width and stroke), a head at both ends, a label on or beside the line |\n\nAlso note the text conventions exactly: what text appears (names only, a muted\naddress, labels on some lines) and what never does (titles, captions, subtitles).\n\n### 2. Write the skin\n\n`export const skin: FigSkin = { tokens, parts }` (`import type { FigSkin } from\n'@caret/fig/skin'`). `tokens` set every standard part at once, from their\nfigures: `font`, `page`, `ink`, `muted`; `card`, `cardBorder`,\n`cardBorderWidth`, `cardBorderStyle` (`solid`, `dashed`, `none`), `cardRadius`,\n`cardShadow` (a CSS shadow), `cardPadding`; `titleSize`, `titleWeight`,\n`titleAlign` (`left`, `center`), `captionStyle`, `detailFont` (`body`, `mono`),\n`detailSize` (against the title, 0.7 by default); `icon`, `iconStroke`, `iconSize`, `iconPlace` (`left`, `top`,\n`none`), `icons` (their own icon drawings by name, 24-unit SVG markup in\n`currentColor`: every icon their figures repeat, their product mark included, so\nno figure draws it by hand); `group`, `groupBorder`, `groupBorderStyle`, `groupBorderWidth`,\n`groupRadius`, `groupTitle` (`inside`, or `border` set into the outline),\n`groupTitleAlign` (`left`, `center`), `groupTitleWeight`, `groupTitleColor`\n(`ink`, `muted`, `border`);\n`chip`, `chipBorder`, `chipInk`, `chipRadius`; `line`, `lineWidth`,\n`lineAccent`, `head` (`open`, `filled`, `bar`, `none`), `headSize`, `corner`,\n`lineLabel` (`text` or `pill`), `lineLabelPlace` (`on`: labels set in a gap in\nthe line; `beside`: always next to it), `lineLabelSize`, `lineLabelColor`\n(`muted`, `line`, `ink`), `lineLabelFont` (`body`, `mono`); `ok`, `bad`, `warn`.\nA kit's own token wins over the brand's general field for the same thing (its\n`cardRadius` over `shape.corners`, `cardBorderWidth` and `cardShadow` over\n`surfaces`). Sizes are in drawing units: they scale with the viewBox a figure\ndraws in, so draw wide figures about 1400 units across and phone ones about 390;\nborder widths are CSS pixels, so a 1px border in a figure scaled to half size\nneeds 2. A kit's own part sizes its text as the standard parts do: times 0.72\nwhen `useFigFit().compact` (from `@caret/fig/flow`) is true. Read colours from the\nfigures as exactly as you can. `parts` replaces a standard part's drawing outright\n(`Card`, `Node`, `Chip`, `Icon`, `Group`, `Figure`) when theirs cannot be reached\nwith tokens. The kit's `Figure` wraps every visual: `<FigSkinProvider skin={skin}>\n<FigSkinFigure>{children}</FigSkinFigure></FigSkinProvider>`. `FigSkinFigure` lays\nthe drawing out at `design` px (1400) and switches to its compact (phone) layout\nbelow `compactAt` px (620); a wide, dense figure style sets `compactAt` higher, and a\nvisual picks its drawing with `useFigFit().compact` from `@caret/fig/flow`.\n\nArrows are tokens, never drawn by the kit. Measure a head in their figures and\nset `headLength` (along the line) and `headWidth` (across it), in px at the\n1400px design scale, and `headWeight`, the stroke of an open or bar head (an\noutline on a filled one, which makes it heavier); `headSize` sets both at once\nwhen the head is a plain one. `lineDash` (`solid`, `dashed`, `dotted`) sets every\nline's pattern; an arrow takes `dashed` and `both` (a head at each end). Fig\ndraws each arrow as one drawing: the head turned to the way the line arrives,\nits tip on the end point, the stroke stopping inside it, and dashes spaced to end\nwhole at its base. Never draw a head with an SVG `marker` or a text glyph such as\n▸, which sits off the line's axis and lets a dashed line end in a part dash.\n\n### 3. Build what does not map\n\nFor each element no standard part can draw (a company's device tile, a cylinder,\na stack of layers), write a part in the same module and export it. Export\n`examples` beside them, props for each part by name (`{ ServerTile: { title:\n\"api-1\" } }`): the Brand page draws every part with them. A part draws\none thing, taking its content as props (a `title`, an `icon`, a `tone`); whoever\ndraws a figure puts it where it goes (in an SVG, an HTML part sits in a\n`foreignObject`). The kit's contract, enforced:\n\n- A kit restyles the parts an author places, and nothing else: the skin's\n  tokens and the bodies of the part slots (`Card`, `Node`, `Chip`, `Icon`,\n  `Group`, `Figure`), plus parts of its own that each draw one thing, such as a\n  pill, a cylinder or a stack of three offset pills drawn as one body (its label\n  on the front one).\n- It never ships arrows or arrowheads: an SVG `marker`, a `FigArrowPath` or\n  `FigSkinArrow` export, a component that draws a connector, or a text glyph\n  such as ▸ or → used as an arrow. Every arrow is a `FigSkinArrow` the author\n  draws, styled by the line, head and dash tokens.\n- It never ships layouts that arrange other parts (its own stacks, lanes or\n  grids of parts). A group of the company's is the `Group` slot, a frame round\n  parts the author places in it.\n- Every part draws the label it is given.\n\npreview_brand reads the kit's TSX and turns it down with each breach named (the\nexport, its line, the rule and the fix), set_brand refuses a draft that breaks\nit, and a kit saved before the contract must be rebuilt before its next\npreview. Redraws draw their arrows the same way: preview_brand refuses a\nsample_source with an SVG marker or an arrow glyph.\n\nData with its own geometry has its own parts, each drawn the kit's way:\n\n- `FigTreemap` (from `@caret/fig/treemap`): their treemaps (storage by table,\n  cost by service). `items` with a `value` each, optionally in `groups`.\n  diagramkit squarifies the blocks and sets each label inside its block when it\n  fits, the rest outside with leaders. Draw each `block`, `group` and `leader` in\n  `draw`; give the label's two forms in `text.label` (`info.form` is `full` or\n  `short`, `info.place` is `inside` or `outside`).\n- `FigSankeyFlow` (from `@caret/fig/sankey`): their sankeys. `nodes` (`id`,\n  `label`, `column` to pin one, `highlight`) and `links` (`from`, `to`, `value`,\n  `highlight`), with `format`, `unit`, `gap`, `height`, `nodeWidth` and\n  `minWidth`. diagramkit sizes nodes and bands on one scale and sets each label\n  beside its node. Draw in `draw` from the boxes and paths given (`link`, `node`,\n  `backing`, `under`, `over`) and style each label in `text.label`.\n- `FigMap` (from `@caret/fig/diagram/map`) with `draw`: their maps. diagramkit\n  fits the projection and places the labels; draw each `region`, `point` and\n  `route` from its geometry and set `--fig-map-ink`, `--fig-map-ink-muted` and\n  `--fig-map-paper` on your root for the labels.\n\n### 4. Recreate their figures, then show every part\n\nRebuild each of their figures from the standard parts and your own, laid out\nyourself at your own coordinates, and send it as `sample_source` with\n`preview_brand`. First write down every element of their figure: each card with\nits icon and text, each region and badge, each line with its colour, direction\nand arrowhead, each label and tag. Then compare the preview with that list and\nwith their figure, strictly: structure, text, shapes, lines and heads, regions,\ncolours, type. Fix the skin or the part and preview again until nothing is\nmissing or added and a designer at the company would take it for theirs. Then\npreview a gallery: one figure using every standard part (a card of each kind,\nchips, a group, labelled arrows), so the parts their figures never showed are\nchecked in their style too. Check every returned capture.\n\n### 5. Write the guide\n\n`kit.guide` is what every client reads. List your own parts with their props and\nwhen to use them (the standard parts are described to clients already), then\nthe company's conventions as rules: the text their figures carry and never add,\nwhich arrows get which heads and labels, how a figure is composed. Never tell a\nclient to let diagramkit place or connect parts: the client places every part.\n\n### Smaller changes: `diagram.look`\n\nFor an account that wants diagramkit's own diagrams in its colours with a few changes\n(dashed boxes, curved links, open arrowheads), `diagram.look` restyles diagramkit's\ndefault brand-kit parts through a compatibility adapter: `node.form` (`glyph`, `tile`, `card`, `box`),\n`node.icon` (`glyph`, `line`, `none`), panel `fill`, `border`, `radius`, `shadow`;\n`link.path` (`orthogonal`, `rounded`, `curved`), `head` (`triangle`, `chevron`,\n`none`), `midArrow`, `start: \"dot\"`, `weight`, `emphasis`; `label.form` (`text`,\n`tag`); `zone.form` (`filled`, `outlined`, `dashed`), `labelPlace`, `fill`;\n`kinds` (`{ \"firewall\": { \"form\": \"wall\" } }`); `map.land` (`solid`, `dots`);\n`diagram.glyphs` for their icons. The images\n`authoring/skills/set-brand/forms-*.png` show each choice. A look is not enough to\nmatch a company's own figures; use a kit for that.\n\n## Steps\n\n1. Get exact values from their source (below): their design tokens, their\n   site's CSS custom properties and most-used colours, font families by name\n   (the font files their site serves, downloaded and sent in `fonts.files` as base64),\n   and their logo (`logo`). Never guess a colour from a screenshot when a file\n   has it. Ask for their published figures: five or more, where they have them.\n2. Read their figures and write `visualStyle` (above), then the kit (above):\n   the skin from their figures, a part only for what no standard part draws.\n3. Call `preview_brand` with the brand `name`, the values, the `kit`, and\n   `sample_source`: their first figure recreated with the kit, its own data,\n   text and arrangement, and any logo or picture in it brought in with\n   `import_image`. Compare the capture with their figure and fix what differs,\n   then preview a gallery of every standard part in their style. A refusal\n   names each kit or figure breach and its fix.\n4. Show the person the captures (they cannot see the tool's result) and pass\n   on every line under \"Check these\" (low contrast, font files diagramkit could\n   not find, tokens it could not map). Fix what they ask and preview again.\n   Fields you send override what diagramkit read from tokens, field by field.\n5. Only when they say it looks right, call `set_brand` with the returned\n   `brand_id`. This changes every new visual for the account, so never set a\n   brand the person has not seen. `set_brand` with `clear: true` undoes it.\n\n`get_brand` returns the current brand's fields in `structuredContent.style`,\nthe kit included, in the same shape `preview_brand` takes, so a change starts\nfrom what is set. A preview without a `kit` keeps the account's current one.\n\n## From a Claude Design system\n\nA Claude Design system keeps its tokens in `project/tokens.json`. Read that file\nfrom the system (for example with the Artifact tool's `read` on the system's link\nand `path: \"project/tokens.json\"`) and send it whole as `claude_design.tokens`.\ndiagramkit reads its colour themes, aliases and usage notes, font families and type\nstyles, radius, shadow and border tokens, and tokens named as categories\n(`category-data`, `chart-1`). Spacing and other families are named in the\nwarnings: set `density` and the rest yourself from the system's guidelines.\nRead the system's README or guidelines too, and add what tokens do not carry:\nthe theme policy, surfaces, canvas and label style.\n\nFonts: `tokens.json` names font files under `fonts/` but does not contain them.\nTo use a typeface, read each `.woff2` file the system lists for the regular and\nbold weights and send them in `fonts.files` as base64 (up to four files, about\n500 KB each). Google-hosted families need no files: diagramkit fetches the heading,\nbody and mono families when you preview.\n\n## From design tokens\n\nA W3C Design Tokens file (Tokens Studio, Style Dictionary, Figma variable\nexports: `$value` and `$type`) goes whole in `design_tokens.tokens`. Groups named\n`light` and `dark` are themes. diagramkit reads `color`, `dimension` (radius, border\nwidth), `fontFamily`, `fontWeight`, `shadow`, `border` and `typography` tokens.\n\n## From any other source\n\nMap what the source has onto the fields and send them explicitly: `colors.light`\n(and `colors.dark` only when the brand defines dark colours), `typography`,\n`shape`, `surfaces` and the rest. Accepted colours: hex, `rgb()`, `hsl()`, `oklch()`.\n\n- **Figma variables or styles:** colour variables by role; text styles for\n  heading, body and label fonts, weights and tracking; corner radius and effects\n  for `shape`.\n- **CSS variables, Tailwind config or a theme file:** read the values; follow\n  aliases to their final value. `border-radius: 0` everywhere is `corners: \"square\"`.\n- **Website or brand guidelines:** the primary brand colour is `primary`; a\n  second brand colour suits `glyphAccent`; named palette colours are\n  `categories`; neutrals for the rest. Look at the pages for corners, borders,\n  shadows and the background.\n\n## Custom CSS\n\n`customCss` (up to 20 KB) is for what the fields cannot express, applied after\nthem inside the visual only. Use it last, and keep it small. It accepts style\nrules, `@media` and `@font-face`; no `@import`, no `url()` except `data:` fonts\nand images, no `position: fixed`, and `html`, `body` and `:root` take only\ncolour, background and font properties. Brand variables are `!important`, so a\nrule that must win over them needs `!important` too.\n\nEvery diagramkit part's root carries `data-fig` with its name, and its parts use stable\n`fig-` class names. Target those, for example\n`[data-fig=\"FigSkinCard\"]`, `[data-fig=\"FigSkinGroup\"]`,\n`[data-fig=\"FigSkinArrow\"]`. A part's `data-fig` name\nis the name it is imported by.\n\n## Logo\n\nSend the company logo as `logo` (SVG, PNG or WebP, base64, up to about 140 KB)\nand it is kept with the brand. From Claude Design, use the file\nin the system's Logos asset group.\n\n## Writing visuals for a branded account\n\nNothing changes in how you write a visual. Use diagramkit parts and tokens, the\n`--caret-host-*` variables for colour (never fixed hex values for things a brand\nshould restyle), `var(--font-sans)` for text and `var(--font-heading)` for\nheadings, and `--color-cat-1` onwards for categories, and the brand reaches\nevery part.\n"},"changes":[],"summary":"First saved snapshot. No earlier version is available for comparison.","summary_kind":"deterministic","summary_metadata":{}}