/boxel-skills:boxel-patternsfrom boxel-skills
Use when the user names an outcome ("show a chart", "let users pick a color", "build a dashboard", "summarize comments", "embed AI image generation", "lay out a moodboard") and you need a working code example to start from. This skill is the bridge between user intent and the existing patterns in Boxel realms. Index your search by what the user wants to DO, not by which CardDef/FieldDef class to extend. Activates when the user asks "do we have a pattern for…", "how is X typically done", or names a feature outcome that isn't in core syntax.
Ships in boxel-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
The curated boxel skill and its siblings teach you how the framework works. This skill catalogues what people have built with it — distilled patterns extracted from real working realms, each with a minimal example.gts you can adapt.
Patterns are indexed by user intent, not by class hierarchy. Find the pattern that matches the outcome the user described, then read its README.md + example.gts.
example.gts files.patterns/<slug>/README.md for when/why/insight/gotchas, then patterns/<slug>/example.gts for the code.boxel, boxel-design, boxel-ui-guidelines). A reserved-but-unextracted slug list lives in references/pattern-backlog.md — do not chase planned patterns; fall back to core skills instead.Adding or promoting a pattern? The folder shape, README template, naming conventions, validated: ladder, promotion bar, and host-command audit all live in references/pattern-authoring.md. Read it before touching the tree.
Ready patterns below can be read and adapted. Each has patterns/<slug>/README.md; most also have a separate patterns/<slug>/example.gts. A few are README-with-inline-recipe — the worked code lives in fenced blocks inside the README itself, marked (README-only) in the list below.
Start here for any new card:
theme-first-workflow+cardinfo-override-titletogether form the recommended "step 0" for every new CardDef. The theme workflow decides whether Boxel defaults are sufficient or a specific Theme is wanted; it does not require a Theme link. Skipping these decisions is the most common cause of cards that "look wrong" or have blank titles.
app-card-home-with-search (README-only) — The home CardDef for any card family: prefersWideFormat = true + one @context.searchResultsComponent section per CardDef, live-updating. Build this whenever you build 2+ related CardDefs.show-card-list-with-views — Generic CardsGrid that takes Query + realms + a view name (card / strip / grid) and renders via @context.searchResultsComponent (entry-rooted, live by default). The lower-level building block used inside app-card-home-with-search.show-list-prefer-prerendered — The cost decision for any card that lists cards: render the cheap prerendered @context.searchResultsComponent stream, and reserve the instance-hydrating getters (getCards / getCardCollection / store.search) for rows you genuinely read or mutate — scoped to the current realm. Read this before writing the query for a browse/feed/roster view.show-count-tiles-from-query — Dashboard count tiles that issue page: { size: 1 } queries and read results.meta.page.total from @context.searchResultsComponent (with @mode='none', since only the count is needed). Use for overview badges, operational signals, inbox counts, and clickable dashboard sections without rendering every matching card.show-table-from-query — Reusable table that takes a Query + realm and renders any cards-of-type as sortable rows. WeakMap field-component caching.show-runtime-markdown-html — Render BFM/markdown to HTML at runtime in isolated/embedded templates via MarkdownField + <@fields.body />.show-wiki-links — Turn [[Page Name]] text inside rendered MarkdownField output into clickable links that resolve against a self-referential relatedPages = linksToMany(() => WikiPage) relationship and call viewCard.show-filedef-audio-player — Durable audio playback from a realm MP3/WAV/OGG file using linksTo(FileDef) and optional linksTo(ImageDef) cover art. Use this instead of storing blob:, data:, base64, or MP3 bytes in card JSON; source is the A Million Dreams FileDef audio example.show-pdf-annotations-filedef — PDF.js viewer/annotation pattern updated for FileDef-backed PDFs: linksTo(FileDef) for the .pdf, CDN PDF.js worker setup, text-layer selection, and normalized highlight bounds in annotationData.pick-rating — Editable star-rating FieldDef with full/half/empty read display, atom + embedded formats, and @set(new RatingsSummary(...)) writeback.pick-typed-sort — SortMenu dropdown + typed SortOption interface + exported Sort constants. Replaces ad-hoc string sort keys.attach-remote-image (README-only) — Image field accepting an uploaded ImageDef OR an external URL via the pair-of-fields convention (linksTo(ImageDef) + URL field). Critical: prevents the realm-bricking external-URL-in-links.self bug (Cardinal Rule 12). See boxel/references/base-field-catalog.md "Image fields — the URL/ImageDef pair pattern".build-planning-cards-trio (README-only) — Stage-0 planning artifacts for any card family: three CardDefs (ArchitecturePlan, DataModelPlan, MicroMockups) whose static isolated templates ARE the plan documents. Without stage 0, fitted views come out pedestrian. See boxel/references/design-playbook.md "Planning before code — Stage 0".theme-first-workflow — Decide whether Boxel defaults are sufficient or a specific Theme is wanted BEFORE writing the card. Link via cardInfo.theme only for the latter; templates reference theme tokens (var(--background), var(--primary), etc.) from line one. The starting step for any new card or app.cardinfo-override-title — Override cardTitle to respect cardInfo.name first, then fall back to a primary field (headline, firstName + lastName, etc.), then to the default. Every CardDef with a natural identifier needs this.build-site-config-with-theme — Multi-page site registry: SiteConfig links to a ThemeCard brand guide and linksToMany(PageConfig) nav entries; page shells compute cardTheme from the site unless overridden by cardInfo.theme.containsmany-sorted-render — Render a containsMany/linksToMany in a non-insertion order without losing the host's field rendering chrome. Sort indexes in the Component, drive {{#each}} with <@fields.notes.[i] />.format-morph-shared-component (README-only) — Assign one Glimmer Component to both static isolated and static edit so the component stays mounted across format flips. CSS transitions on .card--{{@format}} morph the visual without remount. Token-efficiency win when isolated and edit are layout variants of the same content.polymorphic-field-subclass (README-only) — A contains(Shape) slot that holds any subclass of Shape (Circle, Square, Triangle). Swap by assigning new Circle({}) to the model field — first-class, type-safe, persistable. Replaces (model as any).field = value hacks.automate-linked-to-me-lookup — Schema-level query-backed linksToMany (preferred) OR component-level getCards() to materialize inbound references. Two signatures documented.resource-consume-from-context — How to read what @context.getCards / getCard / getCardCollection hand back: they are resources, not promises. Hold one as a class field and render straight off instances / card / cards, gated on isLoading / isLoaded and the error properties. Carries the smell list to check card code against — awaiting a resource, .then on one, copying .instances into @tracked, polling one on a timer, reading one from a constructor. Read this before writing any code that consumes one of the three getters.resource-for-state (README-only) — Wrap third-party library state, legacy kanban column ordering, or any "stateful object that re-runs when args change" in an ember-modify-based-class-resource Resource. Used by older kanban-resource.gts (DndColumn ordering) and chess-game.gts (chess.js wrapper). New kanban boards should use layout-kanban-drag-drop.automate-declared-captures — Self-refreshing capture slots declared as static captures on a CardDef/FileDef: captured server-side on every index, consumed via the reserved @model.captureURLs.<name> getter, and (with useAsThumbnail: true) feeding cardThumbnailURL so grid tiles show the card's real rendering with zero template edits. Use for automatic thumbnails, social/og images, and media poster frames. Prefer this over the imperative siblings whenever the card should always have a current picture of itself.automate-image-steering — Steerable image generator: immutable seed prompt + latest steering command + image lineage attached to OpenRouter multimodal calls, so iterative refinement doesn't lose subject identity. Includes imageHistory/firstImage pinning and restartableTask cancellation.layout-design-board — Parent card = layout shell; each linksTo child renders at a chosen format. Includes the chrome-strip CSS trick.layout-kanban-drag-drop — Persistent kanban board using KanbanPlane from @cardstack/boxel-ui/components: columns + placements data model, fitted child cards, pointer/keyboard drag, ghost/insertion behavior, hidden columns, and WIP limits.layout-3d-card-carousel — @context.searchResultsComponent (@overlays={{false}}) + CSS perspective + per-card --card-index / --total-cards CSS vars for a circular 3D arrangement. Auto-rotate, hover lift, filter-state reactive. The 3D-hero alternative to a flat grid.layout-sectioned-record-with-nav — Long-record card with sticky 220px left nav rail (one button per section, click-to-scroll, active-section highlight) + main content stack of <@fields.<section> @format='embedded' />. Pairs with organize-sensitive-stub-pair for record/stub apps. Requires prefersWideFormat = true.link-discriminated-action-resolver — Type-safe action menu that adapts to which CardDef subtype you have. Adapter classes per subtype + conditional spread for optional actions.link-element-tag-helper — Dynamic HTML tag via the element helper from @cardstack/boxel-ui/helpers.link-onclick-outside — Canonical onClickOutside modifier (50ms-delayed mousedown listener) for popovers and inline editors.link-view-transition — document.startViewTransition + view-transition-name for free morph animations between DOM states. Add/remove items, format flips, list reorders, slide-deck auto-animate. Feature-detect for older browsers.link-flip-card — CSS-only front/back flip primitive: perspective + transform: rotateY(180deg) + backface-visibility: hidden, driven by a single @tracked isFlipped. Flashcards, product reveals, two-sided info cards.link-host-mode-paths — Route clean external URLs (/, /about, /pricing) to specific cards via hostRoutingRules on the RealmConfig card at /realm.json. Public realms only; static paths only; same-realm references.collab-yjs-shared-document (README-only) — Real-time co-editing of a card-backed document (Y.Text code/text pad, or Y.Map structured state like a shared 3D scene) via a Yjs websocket relay. Everyone syncs; a single committer peer holding a realm JWT materializes settled content back into the official card. Includes the seeding rules, read-only role enforcement, and the boundary with ordered commands (scarcity/fairness never goes in a CRDT).integrate-openrouter-image-generation — Preferred image generator. OpenRouter chat completions with modalities: ['image', 'text']; default to Gemini image, use ChatGPT/OpenAI image models when requested; persist bytes with WriteBinaryFileCommand + ImageDef.integrate-one-shot-llm — Single LLM call via OneShotLlmRequestCommand (OpenRouter). System + user prompt + model id → output.integrate-filedef-generated-image — Write generated image bytes with WriteBinaryFileCommand, then link ImageDef / PngDef.integrate-capture-card-format — CaptureTool captures a settled PNG of any saved card at isolated or embedded format (Puppeteer-driven through the prerender pool) and returns a durable served media-cache URL; nothing is written into a realm and only read access is needed. Use for point-in-time snapshots you keep a URL to: documentation, audit/before-after trails. The same pipeline exports a paged PDF — pass type: 'pdf' to the tool, or compose a durable _capture/…?type=pdf URL (add media=print for the card's @page/print CSS) for a printable, always-current document (invoice/report/statement), and render it through the host's SignedCaptureLink/SignedCapture components so private-realm downloads and <object> embeds authorize (@download/@filename save the file under a chosen name). For a card that should always carry a current picture of itself (thumbnails, og images), use automate-declared-captures instead.integrate-thumbnail-card-ai — GenerateThumbnailCommand generates an AI thumbnail via OpenRouter, writes it to a realm, and optionally auto-patches cardInfo.cardThumbnail in one call. Use when you want a designed representation of a card rather than its actual rendering; composes with link-command-menu-item for one-click menu actions.integrate-send-request-via-proxy — Third-party HTTP that needs a key the realm server holds, through the host proxy; public, CORS-open APIs use plain fetch (rules in the pattern).integrate-three-js-via-cdn — Three.js inside a card via ESM CDN. Lifecycle-managed via Glimmer modifier with explicit cleanup. Same modifier shape covers Babylon.js and raw WebGL shaders.integrate-three-js-3mf-fabrication — Raised relief versus flat/flush inlay geometry, cavity overtravel, positive-scale extrusion, welded manifold meshes, and color-mapped component assemblies for 3MF slicers.integrate-leaflet-via-cdn — Leaflet map inside a card. Requires CSS link + explicit container size.integrate-chess-js-via-cdn — chess.js engine + cm-chessboard renderer combo. FEN persistence.integrate-tone-js-via-cdn — Tone.js music toolkit inside a card via <script>-tag CDN load. Polyphonic synths, transports, sequences, effects chains. Same lifecycle shape as integrate-three-js-via-cdn.integrate-web-audio-synthesis — Raw AudioContext for synthesized tones, drums, and UI sound feedback. No library load. Module-singleton context + oscillator + gain envelope; ships click / success / error presets.command-data-resource — Call a host Command reactively from a Glimmer component via commandData<T>. Replaces manual restartableTask + @tracked plumbing.command-with-skill-card-ref — Card kicks off an AI conversation: skill-card URL via import.meta.url, attached cards, UseAiAssistantCommand from @cardstack/boxel-host/tools/ai-assistant.command-typed-with-progress — Command<Input, Output> with a typed progressStep state machine the invoking component reflects in UI.command-optimistic-pipeline — One durable run card per invocation, mutated in place while SaveCardCommand writes are queued fire-and-forget. Use for LLM/image/import pipelines that need fast UI and queryable progress logs.command-atomic-install — Transactional realm install with PlanBuilder + planModuleInstall + planInstanceInstall + ExecuteAtomicOperationsCommand. The canonical catalog-install pattern.link-command-menu-item — Expose a Command as a card menu item via [getMenuItems]. The card-native way to surface card-scoped actions.automate-run-command-cli — Invoke a Command from the shell via npx boxel run-command <spec> --input '{}', pairing with a typed run card for queryable history. Batch jobs, cron, CI gates.For the wider taxonomy (direct call, reactive resource, menu, typed progress, optimistic pipeline, AI processor, multi-turn assistant, CLI script, atomic install) and a single Command class exposed via every mode, see boxel/references/command-invocation-modes.md.
organize-base-class-taxonomy — An empty base CardDef as a query-by-type taxonomy. No kind field needed.organize-variant-field-dispatcher — A FieldDef that swaps among 3–5 edit components by configuration.variant.organize-atomic-field-factory — Factory createOptionSelectField({ options, view }) returning a class extends StringField.organize-resource-class-data-loader — Resource subclass with a boxed constructor ({ ctor, fields }) to side-step Glimmer's {{...}} auto-binding bug.organize-lru-cached-parser — Generic LruCache<K,V> using Map-insertion-order eviction.organize-recursive-fielddef — Self-referential nested structures with @field replies = containsMany(() => CommentThread). The lazy arrow is the required syntax for threaded comments, org charts, file trees, and nested categories.organize-sensitive-stub-pair — Sensitive full record + safe operational stub kept in sync via a projection Command. Full record owns the link to the stub; app surfaces link to the stub. A syncIssues getter surfaces drift in the UI. Use for school/HR records, healthcare charts, any private-vs-public projection.organize-typed-activity-feed — Base FeedEntry CardDef + N specialized subclasses (Academic / Behavioral / Social / …) sharing common chrome. Queries against the base get mixed-type streams; queries against a subclass get filtered streams. Replaces single-Entry-with-giant-kind-enum + conditional rendering shapes.Each patterns/<slug>/ is README.md (when/why/insight/gotchas/recipe) + optionally example.gts (minimal compilable code); (README-only) patterns keep the worked code in the README. READMEs open with validated: frontmatter (linted / source-proven / sketch / deprecated) — treat sketch as a draft and deprecated as a migration pointer. Full template, naming conventions, validation ladder, and promotion bar: references/pattern-authoring.md.
A few skill-tree references aren't catalogued as ready patterns but solve real implementation problems:
boxel/references/container-query-fitted-layout.md. The canonical implementation guide for CSS-only fitted views with a single-root .fit grid querying the host's fitted-card container, six height quanta, pow()-based typography, line-budget math, and the magazine-spread / thumbnail-sidebar width thresholds. Sometimes called "CQ fitted" — searching for that in the patterns dir comes up empty because it lives as a reference. Don't add a duplicate pattern folder; link to the existing reference instead.boxel/references/card-references.md. Cardinal rules for links.self (relative vs absolute, file-extension rules for FileDef-typed relationships, why $REALM and @cardstack/... resolution work differently).boxel/references/command-invocation-modes.md. The taxonomy of how to expose a Command (direct call, reactive resource, card menu item, CLI script, AI invocation, atomic install).boxel-ui-guidelines/references/delegated-render-control.md. The chrome contract + plural-field wrapper trap + divider strategy.For every import path and every integration surface:
references/integration-surfaces.md — Capability-dimension cheatsheet. 10 sections covering base Card APIs, runtime APIs, host commands, Boxel UI, Ember/Glimmer tools, realm-bundled libraries, AI services, ESM CDN libraries, BFM features, and boxel-cli commands. Use this when planning what a card can reach for.references/libraries.md — Import-path-dimension catalogue. Three portable tiers:
@cardstack/base/...).@cardstack/*, @ember/*, @glimmer/*, ember-*).https://esm.run/three, https://esm.sh/leaflet, etc.).When no ready pattern matches, look in the source-realm analyses before reinventing. These live in the familiar-turkey realm — ask the user for the current URLs or grep the realm directly:
These are large reference documents; grep before reading wholesale.
boxel.boxel-design.boxel-ui-guidelines.source-code-editing.boxel-environment.Moved to references/pattern-backlog.md — reserved slugs with no working code. Do not chase them; fall back to source realms or core skills.
patterns/app-card-home-with-search/README.md (opens in a new tab)patterns/attach-remote-image/README.md (opens in a new tab)patterns/automate-declared-captures/README.md (opens in a new tab)patterns/automate-declared-captures/example.gts (opens in a new tab)patterns/automate-image-steering/README.md (opens in a new tab)patterns/automate-image-steering/example.gts (opens in a new tab)patterns/automate-linked-to-me-lookup/README.md (opens in a new tab)patterns/automate-linked-to-me-lookup/example.gts (opens in a new tab)patterns/automate-run-command-cli/README.md (opens in a new tab)patterns/automate-run-command-cli/example.gts (opens in a new tab)patterns/build-planning-cards-trio/README.md (opens in a new tab)patterns/build-site-config-with-theme/README.md (opens in a new tab)patterns/build-site-config-with-theme/example.gts (opens in a new tab)patterns/cardinfo-override-title/README.md (opens in a new tab)patterns/cardinfo-override-title/example.gts (opens in a new tab)patterns/collab-yjs-shared-document/README.md (opens in a new tab)patterns/command-atomic-install/README.md (opens in a new tab)patterns/command-atomic-install/example.gts (opens in a new tab)patterns/command-data-resource/README.md (opens in a new tab)patterns/command-data-resource/example.gts (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
boxel-skills@cardstack-boxel is listed by cardstack/boxel — review the source before installing
npx claudepluginhub cardstack/boxel --plugin boxel-skills27 skills in this plugin
/api-integrationsUse when a card needs data from, or sends data to, a third-party API — "show my GitHub pull requests in a card", "pull my open issues", "a card that calls the weather API with my key", "integrate with Stripe/Twilio/OpenAI", "how often can this card poll", "build a PR inbox". Takes a card author from "I want data from this vendor" to a working card: classifying the integration (no key, a key the workspace shares, the user's own key, a key that can write), choosing a live card or a scheduled pipeline (and why private data takes the pipeline), declaring the `callApi` operations with labels and credential slots, estimating polling cost, and recipes for GitHub (GraphQL, a GitHub App or a read-only fine-grained token, the PR inbox as a pipeline and as a live card), for a plain API key sent in a header, and for images from an AI vendor called with the user's own key (an automation run's own AI requests carry text only). Activates on "third-party API", "vendor API", "integration", "pipeline", "live card", "On a schedule and when the card is opened", "poll", "GitHub API", "GraphQL", `callApi`, `{{userKey}}`, `{{apiKey}}`, "image generation", "AI vendor key", "automation image"./api-keysUse when a card or the AI assistant needs a user's API key, or a key shared into a workspace — "this card needs my GitHub token", "the forecast operation was refused binding-not-approved", "let the user add their key", "share my key with this workspace", "add a key button". Also "sign in to GitHub from this card", "connect my account", "the operation was refused credential-rejected", "the service rejected my key", "should I register a GitHub App or an OAuth App". Covers getting a key from the user only through Boxel's secure window, with the open-secure-window tool: opening it from a card through `@context.toolContext` or from the assistant, its modes (enter a key, replace the key an operation sends, share a key, connect an account through OAuth, approve a card's requests for scheduled pipelines or also for when the card is opened, review what changed in them), passing only the operation the card is blocked on and letting the window gather the card's other operations into one approval, what the tool answers, the blocked-popup fallback, telling the user to check the address bar, what to do when the service rejects a key (stop polling, offer Try again, and Reconnect, which opens the window to replace the key), OAuth clients and connections (when to use a connection rather than a static key, what the card declares, opening connect mode, `credential-rejected` and its reasons, sharing a client into a workspace, and why GitHub takes a GitHub App), and never asking for a credential in the chat or building a form for one. Also covers asking first with `@context.keyReadiness` — the answers (`ready`, `needs-connect`, `needs-approval`, `needs-reapproval`, `needs-admin`, `needs-sign-in`, `rate-limited`, `over-budget`), what a card shows for each and what the secure window can fix, and treating `undefined` as "not known yet" so prerendered HTML never shows Connect. Also covers a call refused for the key owner's limits (`rate-limited`, `over-budget`, `rate-limit-unavailable`): backing off by `retryAfterSeconds` and saying the limit is reached without naming a budget. Activates on "approve", "Allow", "review changes", `needs-approval`, `needs-reapproval`, `open-secure-window`, `OpenSecureWindowTool`, `keyReadiness`, "secure window", "API key", "enter a key", "replace a key", "share a key", "OAuth", "connect", "Reconnect", "GitHub App", `{{userKey}}`, `{{apiKey}}`, `binding-not-approved`, `interactive-use-not-approved`, `anonymous-use-not-approved`, "On a schedule and when the card is opened", "people who aren't signed in", "anonymous cap", `credential-rejected`, `rate-limited`, `over-budget`.