ShtukbaseStandard
页面/base/icons.md

这段内容尚未翻译,下面是英文原文。

Page icons

What a page icon is, which pages get which kind (tiers), where the files lie, how an agent makes one and how lenses show it.

页面字段(1)
icon🖼️

A page shows a small icon next to its title. In Notion it is an emoji. Here it can also be an SVG that an agent draws for the page. Drawings are not free: they cost tokens, review and bytes in git. So a project decides up front which pages deserve one. That decision is the tier.

The fields

FieldWhereWhat
iconany pageone emoji ("🥕") or a path to an SVG (/assets/icons/carrot.svg)
artany pagea large picture for cards, a path to an SVG
iconsa collection page{tier, item, required, max}: how its records get icons

A path starts at the project root (/assets/icons/x.svg); a path without the slash is read from the page's folder.

Tiers

TierThe record showsThe record may setFor
nonenothingnothinglogs, runs, generated pages
kindthe collection's icons.itemnothingmany uniform records: tasks, bugs, service pages
pickits own emoji or set icon, else the kind iconan emoji, or icon: /assets/icons/set/<name>.svgordinary pages
bespokeits own drawing, else as abovean SVG drawn for it, and artfew important pages: the map, packages, principles

Where the tier comes from, first match wins:

  1. The page is listed in heroes of /design/icons.md — bespoke.
  2. The page is a collection page — collectionTier (bespoke).
  3. The page is a record of a collection — icons.tier of the collection page, or defaultTier (pick) if it has none.
  4. Any other page — looseTier (pick).

A collection allows bespoke for at most icons.max distinct files (default max in the settings, 100). Reusing one file on several pages counts once. Raising the budget is the owner's decision.

# /plants.md
type: Collection
itemType: Plant
icons: {tier: bespoke, max: 40, required: true, item: "🌱"}

Files

  • Every SVG lies in /assets/icons/: one file per drawing, named after the page (plants/dill.md → dill.svg); on a clash, the collection first (plants-dill.svg).
  • Kind icons: /assets/icons/kinds/<itemType>.svg. The shared set: /assets/icons/set/<name>.svg, uniform icons any pick page may use; a set from elsewhere keeps its licence file next to it.
  • Never inline SVG in front matter: it bloats every diff, cannot be shared and breaks short header reads.

The SVG contract

Square viewBox (0 0 96 96 is usual), xmlns, at most 4096 bytes, drawing elements only (path, rect, circle, ellipse, line, polyline, polygon, g, defs, gradients, clipPath, mask, use, symbol, title, desc). No script, event attributes, links out of the file, text, <style>, <image> or currentColor; colours as hex. It reads at 16 px and works on light and dark. The first comment records where it came from: <!-- icon: page=/plants/dill.md; by=<model>; date=2026-11-28; licence=CC0-1.0 -->.

The style

A style package supplies a page type: IconStyle under /design/:

type: IconStyle
title: "Kit pictures"
viewBox: "0 0 96 96"
gradients: false
palette: {red: "#FF7369", yellow: "#FFDC49", green: "#4DAB9A", blue: "#529CCA", white: "#FFFFFF"}
rules: ["Flat, no background tile, no outline.", "2–4 colours of the palette."]
examples: [/assets/icons/carrot.svg]

With it, the prompt quotes the style and the check holds the palette. Without it, the contract alone holds.

For agents: when and how

  1. Making a page? Run shtuk run icons prompt <page.md>. It says the tier and what to do.
  2. none or kind: add nothing.
  3. pick: write one emoji, or a set icon.
  4. bespoke: draw by the printed prompt, write the file, set icon: (or art: with --art), run shtuk run icons validate <file>.
  5. A new collection: decide its tier and write icons: in its page. A kind icon: shtuk run icons prompt <collection>.md --kind.
  6. An SVG from elsewhere: shtuk run icons sanitize <file> --write, then validate.

How lenses show it

Emoji as text, SVG through <img> (no script can run), as decoration next to the title. The chain: the record's own icon → the collection's icons.item → the collection page's icon → 📄; with tier none nothing. A card with the option art shows the large picture instead.

Enforcers of the norms

NormWhat it meansEnforcer (check)
ICN-R01An icon a page refers to exists and is a valid, safe SVGvalid
ICN-R02A page carries only what its tier allows; bespoke files stay in the budgetbudget
ICN-R03A collection that requires icons has one on every recordrequired
包 Page icons 会把此页面放在 /base/icons.md。源文本