agentleFS
leather-ioleather-io/mono/.claude/skills/leather-ui/SKILL.md

leather-ui

Skill29 starsChanged 53 days agoMITView on GitHub

Build or change Leather UI in apps/extension, apps/web, apps/mobile, packages/ui or packages/features. Use when adding or editing a screen, sheet, row, card, button, toast, empty or loading state, or any styling, colour, text style or spacing. Covers which @leather.io/ui component to use, the token and ink-ladder specs, and how to check the result.

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. About 0 are common, 4 are distinctive, and 11 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 11

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Colour: Use semantic tokens only: ink.*, red.*, green.*, yellow.*, blue.*, orange.*.

    line 33
  2. Very specific:

    If you're unsure, use ink.text-secondary.

    line 50
  3. Very specific:

    Use exported Leather icons for UI symbols, including CheckmarkIcon for selection.

    line 52
  4. Very specific:

    Spacing: Use space.01–space.11, which are 4, 8, 12, 16, 24, 32, 40, 48, 64, 72 and 128px.

    line 70
  5. Very specific:

    Use them for padding, gaps and margins.

    line 71
  6. Very specific:

    Don't use raw <button>, styled.button, radix-ui imports, or the extension's local tooltip.

    line 101
  7. Distinctive:

    Keep UI copy concise enough to scan while leaving the information needed to decide visible:

    line 125
  8. Very specific:

    Keep needed decision and safety context visible in ink.text-secondary.

    line 130
  9. Distinctive:

    Never move required information into a tooltip to meet a sentence quota.

    line 132
  10. Distinctive:

    Keep label hierarchy clear.

    line 133
  11. Distinctive:

    After screenshotting, do a subtraction pass.

    line 138
  12. Very specific:

    Run pnpm --filter @leather.io/<package> lint.

    line 156
  13. Very specific:

    Look at it. For web or ui changes, render it in the web Playground (pnpm dev in apps/web, then /playground).

    line 162
  14. Very specific:

    Check the ladder. Is every piece of supporting text that informs a decision in ink.text-secondary?

    line 166
  15. Very specific:

    If you needed something that isn't in i-need-to.md, say so in the PR description.

    line 168

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Leather UI

Leather's UI comes from @leather.io/ui (web), @leather.io/ui/native (mobile) and @leather.io/tokens. Prefer composing what exists over adding new markup. When this skill and the code disagree, the code wins. Note the mismatch in the PR so it can be fixed here.

Where to look

  • docs/design/i-need-to.md: each job ("confirm a risky action", "show an address") mapped to one component, with a working snippet. Read the matching section before writing JSX.
  • docs/design/never.md: the things lint rejects, and what to use instead.
  • packages/tokens/README.md: the ink text ladder.
  • packages/ui/src/exports.web.ts and packages/ui/src/native.ts: everything the ui package exports.
  • docs/design/recipes.md: page shells, rows, review sheet, amount, section header and inline info. Compose screens from these. Use typed page actions and notices; spacing belongs to the recipes. Variants are for consequential workflow or UX trade-offs, not cosmetic differences.
  • docs/design/explore.md: the protocol for exploring a feature (today's flow first, recreated faithfully, then one coherent feature with its states for a fixed brief; alternatives only for consequential choices).
  • apps/extension/AGENTS.md, apps/web/AGENTS.md: platform sizes, input and what to verify.

When no pattern fits, don't invent a one-off. Follow the escalation step in explore.md: bring the missing pattern and a focused proposal to design, with alternatives only for consequential choices. The answer becomes a recipe or a component.

Specs

Colour. Use semantic tokens only: ink.*, red.*, green.*, yellow.*, blue.*, orange.*. Each one already switches between light and dark.

NeedToken
Page backgroundink.background-primary
Raised or grouped surfaceink.background-secondary
Component fill (inputs, chips)ink.component-background-default
Hover / pressed fillink.component-background-hover / -pressed
Divider, borderink.border-default (or border="default")
Error, warning, success, infored, yellow, green, blue + .background-secondary

Text colour: the ink ladder. Pick the step by how much the reader depends on the text: ink.text-primary for the content itself, ink.text-secondary for text that informs a decision, ink.text-subdued for metadata someone can skip (only on ink.background-primary), and ink.text-non-interactive for disabled. The full rules are in packages/tokens/README.md.

If you're unsure, use ink.text-secondary. Don't use opacity to make an in-between shade. An icon next to text matches the text's ink or is lighter, never darker: use InlineIcon. Use exported Leather icons for UI symbols, including CheckmarkIcon for selection; never substitute a font glyph.

Type. Web textStyle values are display.01–02, heading.01–05, label.01–03, body.01–02, caption.01–02, code and address. Native Text variant uses the same names without the dot (label01).

  • Sheet titles: heading.05
  • Row titles: label.01 (use Title)
  • Buttons and values: label.02
  • Captions: caption.01 (use Caption)
  • Addresses: address. Mono (address, code) is for full addresses and code only, never an amount, total or fee (lint no-mono-amount; on web that includes tabular-nums).

display.*, heading.02 and heading.03 are Marche and already uppercase. Don't set textTransform yourself. Keep a small area (a row, a card, a review group) to about three text styles; nested numbers and labels go a size smaller than their parent.

Spacing. Use space.01–space.11, which are 4, 8, 12, 16, 24, 32, 40, 48, 64, 72 and 128px. Use them for padding, gaps and margins. Radii are xs, sm, md, lg and round. A page has one horizontal gutter (space.05 in the popup): rows, inputs and header icon glyphs all sit on it.

Compositions. In the web Playground, build screens from the recipes in docs/design/recipes.md. Page shells take typed actions and a notice, and the inline ReviewSheet is a visual demo, so product code uses the real Sheet + SheetHeader. The descriptor shapes and the Sheet footer are in docs/design/i-need-to.md ("Place the screen's actions", "Open a focused task").

Components.

JobWeb (@leather.io/ui)Native (@leather.io/ui/native)
Action with a labelButton (solid once per view, then outline, ghost)Button
Important actionlabelled Button with an icon, never a bare + iconButton
Text fieldInput (floating label; see i-need-to.md for when)Input
Icon-only actionIconButton + aria-labelIconButton + label
Clickable row or cardPressablePressable
List rowListItemBox or ItemLayoutCell, ItemLayout
Focused task, confirmSheet + SheetHeaderSheet (ref), WarningSheetLayout
Approve or signApproverApprover
Problem that staysCallout (edge to edge, top of its region)Callout
Icon beside textInlineIcon—
Asset as the subjectits token icon: BtcAvatarIcon, StxAvatarIcon, …same names
Short feedbackthe app's useToastuseToastContext().displayToast
LoadingSkeletonLoader, Button aria-busySkeletonLoader
AddressAddressDisplayer, truncateMiddleAddressDisplayer
Moneythe app's Balance + formatCurrencyBalance
TooltipBasicTooltipinfo sheet

Don't use raw <button>, styled.button, radix-ui imports, or the extension's local tooltip. Lint rejects all of them.

Example

A fee row on a review screen (web). The info icon sits inside the label, so it takes the label's line, size and ink:

<Flex justifyContent="space-between" alignItems="flex-start">
  <styled.span textStyle="body.02" color="ink.text-secondary">
    Sponsored fee
    <BasicTooltip label="A sponsor pays this fee, so you need no STX for this transaction" asChild>
      <InlineIcon icon={InfoCircleIcon} tone="subdued" placement="end" tabIndex={0} />
    </BasicTooltip>
  </styled.span>
  <Balance balance={fee} formatCurrency={formatCurrency} textStyle="label.02" />
</Flex>

A destructive confirm, and every other job: docs/design/i-need-to.md.

Copy and density

Keep UI copy concise enough to scan while leaving the information needed to decide visible:

  • Title: 5 words or fewer. Buttons: 1–3 words, verb first ("Send", "Review", "Remove wallet"). Screen actions (Add, Save, Done) sit in the footer; never two competing primaries. A follow-up after a task is a footer choice requiring product review.
  • Keep needed decision and safety context visible in ink.text-secondary; use as much concise context as the task requires. Optional background can go behind BasicTooltip or "Learn more". Never move required information into a tooltip to meet a sentence quota.
  • Keep label hierarchy clear. A body heading below a task title adds distinct information; it does not repeat the task. Receive uses the asset identity below the single “Receive” header, as established in the owner review on 26 Oct 2026 (recipes.md#receive-asset-identity).
  • Review facts use labels and values in key-value rows; keep required risk and decision context visible alongside them.
  • After screenshotting, do a subtraction pass. Remove each element that doesn't change a decision.

Before you say done

Inspect the current equivalent app pattern first. For fees, read apps/extension/src/app/features/fee-editor/fee-editor.tsx and its components/ before choosing a composition. Reuse its decisions without copying known bulk or clipping problems.

At narrow widths, inspect every interactive state, including edit forms. Check each body scroller's scrollWidth against clientWidth, not only the document: nested horizontal overflow can be missed. Popup screens have one vertical body scroller with header/footer in reach; tab pages may scroll as a whole.

Passing tokens and width checks is not enough. Follow Fees and transaction status for fee choices, Money/fiat, quote provenance, identity grouping and pending-state semantics. Review popup content inside its intended device frame, not stretched across the browser.

  1. Run pnpm --filter @leather.io/<package> lint. For changed web/extension feature paths, also run pnpm design:check <changed-feature-path> from the repository root. Ordinary lint enforces design rules only on the shared recipes, recipe gallery and Receive example; other features need this explicit check. Mobile uses its native component and package checks. When a design rule fails, apply the replacement named in its message. Don't add suppressions.
  2. Run pnpm --filter @leather.io/<package> typecheck.
  3. Look at it. For web or ui changes, render it in the web Playground (pnpm dev in apps/web, then /playground). Take a screenshot in light and dark, and attach before and after to the PR. For mobile, take a simulator screenshot. On Playground screens run pnpm design:align <url> (one gutter, symmetric header); it exits 1 on a finding.
  4. Check the ladder. Is every piece of supporting text that informs a decision in ink.text-secondary? Is ink.text-subdued used only on ink.background-primary?
  5. If you needed something that isn't in i-need-to.md, say so in the PR description.
  6. In the Playground, every deviation from shipped UI, restyles included (Caption.color, Button.size), needs a row in DEVIATIONS.md with a why.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.