Agent skill

Slab

by stencil-hq in stencil-hq/slab

Writing, editing, and rendering Slab documents (.slab) — the declarative design language for app screens, posters, terminal UIs, and interactive components.

MITAuto-check passedFrontend & Design

Install Slab

skills CLI
$ npx skills add stencil-hq/slab --skill slab -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install stencil-hq/slab slab --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/stencil-hq/slab.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skill .claude/skills/slab && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
slab
GitHub stars
112
Token cost
~3.1k tokens
SKILL.md length
1,376 words
Files
5 (incl. references)
Skills in repo
2
Repo updated
First seen
Licence
MIT

At a glance

Writing, editing, and rendering Slab documents (.slab) — the declarative design language for app screens, posters, terminal UIs, and interactive components.

  • Works in 12 steps: fill is a SIZE keyword, never a color —… → align= positions a node's CHILDREN; to… → % needs a determinate parent axis;… → …
  • Modifying .slab files
  • SKILL.md covers Quick start, Core vocabulary (memorize;…, Rules that prevent 90% of… and Feature selection cues, plus 1 more section
  • Calls bunx, cargo and bun

What it does

Slab is an agent skill from stencil-hq/slab. Writing, editing, and rendering Slab documents (.slab) — the declarative design language for app screens, posters, terminal UIs, and interactive components. Use when authoring or modifying .slab files, rendering via the slab CLI (bunx @stencil-hq/slab or slab-cli: svg/png/apng/tui), bundling via Vite/Bun plugins (@stencil-hq/slab/vite, @stencil-hq/slab/bun), embedding via generated web components (slab gen wc), typed React components (slab gen react), typed Rust modules (slab gen rust), typed Go modules (slab gen…

Its SKILL.md is about 3.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including reference files (for example `references/hosts.md`, `references/language.md` and `references/rendering.md`).

It sits in Frontend & Design, covering React components and Embeddings. It works with Rust, React, Vite and Go. The repository describes itself as: A design language for agents. The licence is MIT.

When your agent uses it

  • Modifying .slab files
  • Rendering via the slab CLI (bunx @stencil-hq/slab
  • Slab-cli: svg/png/apng/tui)
  • Bundling via Vite/Bun plugins (@stencil-hq/slab/vite

Example prompts

  • “/slab”

Workflow steps

12 steps, taken from the first numbered list in SKILL.md.

  1. fill is a SIZE keyword, never a color — backgrounds use bg=.
  2. align= positions a node's CHILDREN; to position the node in its parent
  3. % needs a determinate parent axis; against hug it degrades to hug with
  4. Node headers end at newlines. End each continued header line with \;
  5. Bare idents in value position are keywords or component props — token
  6. Numbers are unitless u (1u = 1px on web/svg). Durations are plain ms.
  7. One shadow inline (shadow=0,2,6,#0004); layered shadows must be a list
  8. TUI paints one cell per grapheme, but layout uses vector font metrics.
  9. Quarter-turn rotate (±90/270) participates in layout; any other angle is
  10. Dynamic rows come from list(Def) + each, including recursive child
  11. Diagnostics are the contract: squeeze = fixed size clamped, clipped
  12. Keep policy in the host: Slab owns layout, gesture mechanics and optional

What it can do on your machine

Read from SKILL.md and the folder at commit 6574737. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • bunx
    • cargo
    • bun

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • stencil-hq.github.io

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Slab loads about 3.1k tokens when it runs, and up to ~36k if it reads all its reference files. Until then it costs about 209 tokens; SKILL.md has 1,376 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~209
When it runs · the whole SKILL.md, loaded when a task matches
~3.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~36k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from stencil-hq/slab at commit 6574737, republished under its MIT licence (© stencil-hq). 1,376 words, ~3,079 tokens.

Download SKILL.mdSave it as .claude/skills/slab/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
slab
description
Writing, editing, and rendering Slab documents (.slab) — the declarative design language for app screens, posters, terminal UIs, and interactive components. Use when authoring or modifying .slab files, rendering via the slab CLI (`bunx @stencil-hq/slab` or `slab-cli`: svg/png/apng/tui), bundling via Vite/Bun plugins (`@stencil-hq/slab/vite`, `@stencil-hq/slab/bun`), embedding via generated web components (`slab gen wc`), typed React components (`slab gen react`), typed Rust modules (`slab gen rust`), typed Go modules (`slab gen go`), `include_doc!` proc-macros, or Ratatui widgets (`slab-ratatui`), declaring the typed host surface (params, list/each, holes, signals, themes, rich-field runs), building rich-text or block editors on kernel fields, working on the conformance corpus, or debugging Slab diagnostics and layout.

Slab

A declarative language for designed surfaces that renders faithfully to web, GPU, TUI, SVG, and PNG from one source. One pipeline: the Rust compiler (slab-compile) lowers .slab text to SLIR (protobuf + Snappy binary IR); one Rust kernel (slab-kernel) owns layout, motion, hit testing, focus, editing, and dispatch on every platform (natively linked, or via WASM in browsers). Thin drivers paint frames, forward events, and expose the retained semantic scene through platform accessibility adapters. spec/SPEC.md is normative; conformance/ is executable (native and WASM match goldens byte for byte). Hosts never parse .slab and never do layout.

The whole layout model in one sentence:

Every node is a box. Every box receives constraints (min/max width and height), returns a size, and its parent places it. Containers differ only in how they place children.

No margins, no selectors/cascade, no z-index, no absolute positioning, no display property. Paint order is tree order; overlap requires an explicit opt-in container (stack, canvas, offset). Mistakes become diagnostics, not silent overlap.

Quick start

slab
tokens {
  color { bg #0e1116; ink #e6edf3; accent oklch(72% 0.16 250) }
  text  { title { size 18; weight 650 } }
}

def Chip(label, tone=color.accent) {
  row pad=4,10 gap=6 radius=999 stroke=tone align=center w=hug {
    rect w=6 h=6 radius=3 bg=tone
    text label size=12 color=tone nowrap
  }
}

col#card w=360 pad=24 gap=12 bg=color.bg radius=12 {
  text "Pale Green Things" style=text.title color=color.ink
  row gap=8 align=center {
    Chip label="FLAC"
    spacer
    text "4:12" size=12 color=color.ink
  }
}

Render (no Rust toolchain needed; the compiler ships as WASM in the npm CLI):

sh
bunx @stencil-hq/slab render doc.slab -o out.png --width 800
bunx @stencil-hq/slab check doc.slab      # ALWAYS run after editing

Output kind infers from the extension (.svg .png .apng .txt); --client tui with no -o prints cells to stdout. check validates the main document and each export definition through its standalone path. Code generators produce typed web components (slab gen wc), React wrappers (slab gen react), Rust modules (slab gen rust), or Go modules (slab gen go). In this repo the native CLI is cargo run -p slab-cli -- (adds fmt, conformance, lsp, and --font).

Fresh releases: bun's minimum-release-age gate blocks packages younger than 24h (… blocked by minimum-release-age). Fix: add [install] minimumReleaseAge = 0 to a project bunfig.toml. bunx ignores a cwd bunfig — use bun add @stencil-hq/slab then ./node_modules/.bin/slab.

Core vocabulary (memorize; details in references/language.md)

  • Containers: row col wrap grid stack canvas para group — stack (layers) and canvas (at=x,y) are the ONLY overlap opt-ins.
  • Leaves/controls: text, span (inside para), rect, img, path (canvas only), icon, divider, spacer, and hole.
  • Sizing per axis: w=240 (request) | hug | fill / fill:2 | 40%
    • clamps min-w max-w min-h max-h. Defaults: main = hug; cross = stretch for containers and rect, hug for other leaves; inside stack/canvas everything hugs.
  • Style: bg stroke stroke-w stroke-align stroke-sides stroke-dash radius smooth shadow blur backdrop backdrop-mask grain mask opacity color family size weight leading tracking strike italic underline code-color code-bg style= align-text rotate scale tilt fit pad gap animate transition scrollbar scrollbar-w scrollbar-fg scrollbar-bg — closed set, nothing else. current is icon-declaration paint, not a general color token.
  • Flags/modes: clip bleed scroll nowrap ellipsis inert focusable multiline drag-ghost; use drag-ghost only with drag=, and use scroll=cross|both, sticky, and each … virtual item-extent=N only in their documented contexts.
  • Reserved attrs: key=, signal binders (act=, pointer/drag lifecycle, field/submit, resize), keys=, a11y metadata/state/relation/value attrs, and overlay placement attach= gravity= collide=.
  • Conditionals: when hover|dragging|drop|tui|dark|w<600|prop|theme(name) { … } patches its node with attrs/children. Binders on the patched node are statically registered, active only while the condition holds, and stop contributing focus/hit behavior when false.
  • Components/data: def Name(params) { body }, Capitalized calls, children splice at slot, and export defs become standalone documents and recursive list(Def) schemas. each param.rows consumes a root list; nested templates use each child_prop. Macro expansion has no arithmetic.
  • Host surface (typed, compiler-checked): scalar params, recursive lists, holes, runtime image registration, signals, keyed scroll/divider/reveal APIs, field caret/runs/range editing, and the retained scene. There is NO tree injection or selector API.

Rules that prevent 90% of mistakes

  1. fill is a SIZE keyword, never a color — backgrounds use bg=.
  2. align= positions a node's CHILDREN; to position the node in its parent use self= (stack children: self=bottom-end offset=4,-4).
  3. % needs a determinate parent axis; against hug it degrades to hug with pct-unbounded. Progress bars live inside fill/fixed tracks.
  4. Node headers end at newlines. End each continued header line with \; indentation alone does not continue it.
  5. Bare idents in value position are keywords or component props — token references are ALWAYS dotted (color.accent, never accent).
  6. Numbers are unitless u (1u = 1px on web/svg). Durations are plain ms.
  7. One shadow inline (shadow=0,2,6,#0004); layered shadows must be a list of presets/token refs (shadow=shadow.crisp,shadow.lift).
  8. TUI paints one cell per grapheme, but layout uses vector font metrics. Use cell-multiple geometry and pad=16,8+ inside borders. Set the full triplet when tui { family="mono" size=13.333 leading=1.2 }: the 600/1000em mono advance becomes exactly 8u (one column) and the line box 13.333 × 1.2 = 16u (one row). The default leading 1.4 yields 18.67u lines, so any stacked text column drifts off the 16u row grid.
  9. Quarter-turn rotate (±90/270) participates in layout; any other angle is ink-only. TUI skips rotated subtrees.
  10. Dynamic rows come from list(Def) + each, including recursive child lists. Give items stable keys; path-address nested lists by index/field. Use kernel virtualization only for a uniform-height top-level each.
  11. Diagnostics are the contract: squeeze = fixed size clamped, clipped = content truncated, and glyph-missing = static text is absent from its resolved embedded family. Fix the named source; never silence by guessing coordinates. cap-* names a declared client degradation.
  12. Keep policy in the host: Slab owns layout, gesture mechanics and optional drag ghosts, focus, scrolling, text editing (caret, selection, rich runs, IME, bounded undo), scene export, and shipped web/native accessibility adapters. The host owns app state, block structure, popover dismissal, and focus traps.
  13. Treat spec/SPEC.md as normative and spec/FRAME.md as the exact host ABI. Skill references are procedural guidance, not replacement specs.
Show full SKILL.md (485 more words)Show less

Feature selection cues

  • Use a recursive list(Def) plus nested each child_prop for trees and grouped rows. Add virtual item-extent=N only to a direct root-list each under a main-axis scrolling row/col; use revealItem for navigation.
  • Use para { each param.runs } for host-supplied rich text; make the run schema body exactly one span.
  • Use field= text nodes for editing: the kernel owns caret, selection, wrapping, IME, and bounded undo. Rich text keeps five inline span sets (bold/italic/underline/strike/code) beside the string via the field-runs API; toggle styles over the selection; code-color/code-bg paint code runs. For a block editor keep one field per block: Shift-click forms a cross-field range, edits arrive as one pre-mutation range_edit request, and structural undo uses the snapshot/commit/restore field transaction.
  • Use path d=param.route (inside canvas) for runtime geometry. Declare reusable static icon assets at top level and tint them through current.
  • Use img src=param.name plus host image registration for runtime pixels; do not encode changing image data into document params.
  • Use press/context/dblclick for gesture starts, pointer-move/pointer-up for routed raw motion/releases, and drag/drag-update/drag-end/drop for a complete drag lifecycle. Consume every signal's typed SignalMeta; add drag-ghost when the kernel should paint the moving source duplicate. Use act= for ordinary keyboard-and-pointer activation.
  • Use scroll=cross|both for two-axis overflow, sticky only on direct main-scroll children, and keyed reveal instead of host-computed offsets.
  • Use divider between two panes; let it own pointer/keyboard resizing. Supply initial/restored extents through the keyed API, not bespoke dragging.
  • Use attach=param.anchor on a stack/canvas child for popovers. Feed a signal's full meta.key back as the anchor; keep dismissal/focus policy in the host.
  • Author complete a11y roles, names, state, relations, values, and live-region metadata. Shipped web/native adapters build the platform semantic tree; application hosts do not rebuild it from scene records.

References — load on demand

  • references/language.md — grammar and node semantics; dynamic paths/icons; para runs; scrolling/sticky; dividers; anchored overlays; accessibility attrs; layout, components, tokens, keys, and diagnostics. Read when authoring beyond basic screens or when a diagnostic is unclear.
  • references/styling.md — gradients, icon current paint, layered/inset shadows, glass, blur, stroke geometry, transforms, interaction states/drag ghosts, and motion. Read when styling effects, icons, interactions, or animation.
  • references/hosts.md — recursive/virtual lists, runtime images, pointer and drag signals with SignalMeta, generated web/Rust/Go bindings, the exact clean-cutover Instance APIs, scroll/reveal/divider state, popovers, rich-field runs and caret/range editing, host structural transactions, and framework accessibility adapters. Read when building an interactive or data-driven app.
  • references/rendering.md — SLIR → kernel → Frame, runtime path/image and scale ops, scene semantics, per-client degradations, TUI rules, CLI, and conformance. Read when implementing a driver, targeting a client, or debugging cross-client differences.

When the repo is available, spec/SPEC.md is normative (spec/SLIR.md and spec/FRAME.md for the machine interfaces) and examples/*.slab are quality references — examples/10-settings.slab is the canonical interactive app (params, signal buttons, kernel-edited field, hole); examples/12-tracklist.slab shows list/each, themes, and scrollbars; examples/01-settings.slab and 06-jcard.slab are the visual-quality bar for static documents; bench/slate/doc/editor.slab is the block-editor reference (one field per block, rich runs, cross-field ranges). Live playground: https://stencil-hq.github.io/slab/

© stencil-hq, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (references) in skill of stencil-hq/slab.

  • SKILL.md
  • references/hosts.md
  • references/language.md
  • references/rendering.md
  • references/styling.md

Open the folder on GitHubat commit 6574737

Compare with similar skills

Slab next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Slab compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Slab this skillstencil-hq/slab112—~3.1kAutomated safety check: PassMIT
Workos Widgetsusenotra/notra256—~2kAutomated safety check: PassAGPL-3.0
Web Artifacts Builderanthropics/skills180k41 repos~769Automated safety check: PassApache-2.0
React Router Developmentremix-run/react-router57k1 repos~1.5kAutomated safety check: PassMIT
Chakra UI v3 Builderchakra-ui/chakra-ui41k—~3.1kAutomated safety check: PassMIT
Creative Tim UI Blockscreativetimofficial/ui12k—~2.1kAutomated safety check: NotesMIT

Similar skills

  • Workos Widgets

    usenotra/notra

    A skill your agent uses when the user is implementing, embedding, or debugging a WorkOS Widget — specifically the User Management, User Profile, Admin Portal SSO Connection, or Admin Portal Domain…

    256 GitHub stars~2k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Web Artifacts Builder

    anthropics/skills

    Official

    Builds multi-component claude.ai HTML artifacts as a small React, TypeScript and Tailwind project, then bundles it into one shareable HTML file.

    180k GitHub starsUsed in 41 repos~769 tokens
    Frontend & DesignAuto-check passed
  • React Router Development

    remix-run/react-router

    Guides work on React Router apps by first identifying whether the app uses Framework, Data or Declarative mode, then loading the matching reference and the installed package docs.

    57k GitHub starsUsed in 1 repo~1.5k tokens
    Frontend & DesignAuto-check passed
  • Chakra UI v3 Builder

    chakra-ui/chakra-ui

    Builds responsive, accessible Chakra UI v3 components and layouts, sets up Chakra in new or existing projects, and designs themes with tokens, semantic tokens and recipes.

    41k GitHub stars~3.1k tokensUpdated 2 days ago
    Frontend & DesignAuto-check passed
  • Creative Tim UI Blocks

    creativetimofficial/ui

    Helps install, generate and review Creative Tim UI blocks: shadcn/ui-based React and Tailwind sections that follow a restrained, production-minded design philosophy.

    12k GitHub stars~2.1k tokensUpdated 6 mo ago
    Frontend & DesignAuto-check: notes
  • South Admin CRUD Generator

    southliu/south-admin-react

    Generates a full CRUD page - page component, data model and API client - from the south-admin-react project's own VS Code snippet templates.

    580 GitHub stars~1.7k tokensUpdated 18 days ago
    Frontend & DesignAuto-check passed

More from stencil-hq/slab

  • Dog Food

    stencil-hq/slab

    Run an exhaustive parallel dogfooding sweep for a library, language, SDK, or runtime: send three independent agents to build the same ambitious application on different supported platforms, drive…

    112 GitHub stars~3.1k tokensUpdated 1 mo ago
    Auto-check passed

Questions about Slab

What does Slab do?

Writing, editing, and rendering Slab documents (.slab) — the declarative design language for app screens, posters, terminal UIs, and interactive components. Slab is an agent skill from stencil-hq/slab.slab) — the declarative design language for app screens, posters, terminal UIs, and interactive components.

When should I use Slab?

Slab fits situations like: modifying .slab files; rendering via the slab CLI (bunx @stencil-hq/slab; slab-cli: svg/png/apng/tui); bundling via Vite/Bun plugins (@stencil-hq/slab/vite.

How do I install Slab in Claude Code?

Run `npx skills add stencil-hq/slab --skill slab -a claude-code`. Or copy the skill folder (skill in stencil-hq/slab) into .claude/skills/slab in your project. Claude Code loads it when a task matches its description.

How do I install Slab in Codex?

Run `npx skills add stencil-hq/slab --skill slab -a codex`. Or copy the skill folder (skill in stencil-hq/slab) into .agents/skills/slab in your project. Codex loads it when a task matches its description.

Can I use Slab in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add stencil-hq/slab --skill slab -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/slab, .gemini/skills/slab, .github/skills/slab and .opencode/skills/slab in your project.

What does Slab need to run?

Going by SKILL.md and its folder, Slab needs the command-line tools its instructions call (bunx, cargo and bun).

Does Slab access the network?

SKILL.md names 1 domain. As links in the text: stencil-hq.github.io. This is read from the text; nothing was executed.

Is Slab safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Slab use?

Slab is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Slab use?

About 3.1k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 33k tokens, read only when the agent opens those files.

What are the alternatives to Slab?

Skills that share tags, products or a category with Slab: Workos Widgets (usenotra/notra, 256 stars), Web Artifacts Builder (anthropics/skills, 180k stars), React Router Development (remix-run/react-router, 57k stars) and Chakra UI v3 Builder (chakra-ui/chakra-ui, 41k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Slab?

stencil-hq (a GitHub organization) maintains it in stencil-hq/slab, which has 112 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on August 22, 2026.

Source: stencil-hq/slab on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.