/boxel-skills:card-motionfrom boxel-skills
Use when a card should animate: elements entering and leaving, a list or grid rearranging, a tile opening into a detail view, drag and reorder, scroll-linked effects, or several elements moving in a sequenced scene. Covers which of glimmer-motion's patterns to reach for ({{motion}}, <Presence>, layout / layoutId, drag and <ReorderGroup>, scrollProgress / InView) and when to escalate to a <Choreo> timeline, the imports a realm can resolve (motion-dom only through glimmer-motion), the four Glimmer rules that silently stop motion, and the card-specific rules that follow from cards sharing the host's copy of both libraries. Activates on glimmer-motion, @cardstack/choreo, {{motion}}, Presence, layoutId, Choreo, "animate", "transition", "enter/exit animation", "reorder", "parallax", "magic move".
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.
glimmer-motion animates elements; Choreo sequences a whole render pass. Both come from the host — nothing to install.
import { CardDef, Component } from '@cardstack/base/card-api';
import { motion, spring, to } from 'glimmer-motion';
const soft = spring({ visualDuration: 0.4, bounce: 0.2 });
export class Notice extends CardDef {
static isolated = class Isolated extends Component<typeof this> {
<template>
<article
{{motion
initial=(to opacity=0 y=12)
animate=(to opacity=1 y=0)
transition=soft
}}
>
<@fields.cardTitle />
</article>
</template>
};
}
The host hands cards its own copies of both libraries through its module shims:
| Specifier | What it is |
|---|---|
glimmer-motion | The {{motion}} modifier, <Presence>, <LayoutGroup>, <MotionConfig>, <ReorderGroup> / <ReorderItem>, the to / spring / tween / stagger / styles helpers, scrollProgress, InView, viewTransition, and the engine's imperative surface |
glimmer-motion/presence, /layout-group, /motion-config, /reorder/group, /reorder/item | The same components by their own entry points |
@cardstack/choreo | <Choreo>, beacon, at / after, createArming, and the Sprite / Changeset types |
@cardstack/choreo/film | Film (scored, seekable sequences) |
glimmer-motion/test-support, @cardstack/choreo/test-support | Test helpers for .test.gts files (references/testing.md) |
motion-dom is reached only through glimmer-motion. motion-dom, motion and framer-motion do not resolve in a realm. glimmer-motion re-exports the imperative subset a card needs — motionValue (and the MotionValue type), animate, transformValue, styleEffect, frame — and those are the engine's own functions, sharing the frame loop {{motion}} runs on. Do not pull a second copy of Motion from an ESM CDN: it would run its own frame loop and know nothing about the host's layout animations.
Escalation order: element → presence → layout → Choreo.
| The ask sounds like | Pattern | Read |
|---|---|---|
| "fade/slide/scale this in", hover/tap states, keyframes, variants, stagger | {{motion}} with initial / animate / transition | element.md |
| "animate it when it's removed", list add/remove, a panel opening and closing | <Presence> + exit | presence.md |
| "it moved because the layout changed", a filtered grid, a list that re-sorts, a tab indicator, a thumbnail opening into a detail view of the SAME thing | layout=true / layoutId inside a <LayoutGroup> | layout.md |
| drag, swipe-to-dismiss, a reorderable list or grid | drag / <ReorderGroup> | drag-and-reorder.md |
| parallax, a scroll progress bar, reveal-on-scroll | scrollProgress / InView / whileInView | scroll.md |
| "first X, THEN everyone moves, THEN Y"; z-index for the span of a move; one element's motion computed from another's box; flying to a place that must not deform; two views of the card swapping as one Magic Move | <Choreo> timeline (+ {{beacon}}) | choreo.md |
| a deliberate snapshot morph of part of the card | viewTransition(update, element) | view-transitions.md |
The classic wrong reaches:
startViewTransition animates bitmaps, so anything running inside — a demo, a video, a canvas — freezes for the crossfade, and the document-wide form snapshots the host's whole page. layout=true moves the real elements.layoutId to fly an item into a trash can. layoutId morphs one element into another; the bin would stretch into a row. A destination that is a place is a {{beacon}} and <c.Move @to>.setTimeout to sequence animations. That is what <Choreo>'s c.Sequence replaces: its "after" comes from real durations, including a spring's settle time.<Choreo> for one element. One element, no ordering, no cross-element measurement: {{motion}} (or <Presence> if it leaves).boxel-ui-guidelines/references/template-patterns.md (the resting CSS state is the final one). Reach for glimmer-motion when the motion depends on state, interrupts, leaves the DOM, or follows layout.style="…" attribute on a motion element: Glimmer rewrites the whole declaration on re-render and wipes the transform the engine just wrote. Pass styles through the modifier instead.
{{! ✗ }} <div style={{this.accent}} {{motion drag=true}} />
{{! ✓ }} <div {{motion style=(styles background=this.accent) drag=true}} />
(Static styling belongs in <style scoped> as always; this is about values you bind.)border-radius is invisible to the engine, so a layout-animating tile grows with oval corners. Pass radius and shadow through the modifier: {{motion layout=true style=(styles borderRadius='14px')}}.<Presence> yields, not be re-read from state that has already moved on.layout=true and layoutId animate only inside a <LayoutGroup>. The box a layout animation starts from has to be measured before Glimmer changes the DOM, and a <LayoutGroup> above the element measures it on every render. <ReorderGroup> and <Choreo> measure too, and so does <Presence>, but only on a render that adds, removes or reorders its own @items: an item that grows inside a Presence-only list still jumps. A list or grid of layout=true items that reorders, filters or sorts with no group above it jumps instead of gliding, and so does a layoutId hand-off: the outgoing element's box is known only if something measured it before it left. Put the <LayoutGroup> around the {{#each}} in the template that renders the list, so it animates wherever the card renders, and never inside a row or a row card's own template: Glimmer moves a row before it re-renders anything inside it, so a group there measures too late. Key each row by something that stays with it, never by its position: a linked card's id, or an id field a row is given when it is added. key='@index' keeps every element where it is and swaps its content, so nothing moves at all; a key built from a position changes when the rows before it shift, and a row whose key changes is a new element with no earlier box to animate from. @identity breaks the same way when the code replaces a row's object (list[i] = new Item({ … })).
{{! ✗ re-sorts in a single frame: nothing measured the rows before they moved }}
<ul>{{#each this.sorted key='id' as |item|}}<li {{motion layout=true}}>{{item.name}}</li>{{/each}}</ul>
{{! ✓ }}
<LayoutGroup>
<ul>
{{#each this.sorted key='id' as |item|}}
<li {{motion layout=true}}>{{item.name}}</li>
{{/each}}
</ul>
</LayoutGroup>
Every card on the page and the host's own UI run on one instance of each library, so their module-global state is shared: the beacon registry, Choreo's region registry, far matching, the layout scheduler and the global motion speed. The same card can also render twice at once (in two stacks, or isolated in one and embedded in another). So:
<Choreo @id> is looked up host-wide; an id that leaves one <Choreo> region and appears in another in the same render pass far-matches and flies between them; layoutIds pair across the page unless a <LayoutGroup @id> namespaces them. Build them with concat from @ember/helper ((concat @model.id '-trash')), or wrap a card's layoutIds in <LayoutGroup @id={{@model.id}}>. Leave <Choreo @id> off unless something addresses the region.setMotionSpeed slows every animation in the host. A card that wants slow motion for a demo scales its own transitions.<Choreo> around the part of the card that is the scene — the list, the panel — never try to choreograph outside the template.boxel parse rejects decorators inside a static isolated = class {…} expression. Declare the view as its own class and assign it: class InboxView extends Component<typeof Inbox> { @tracked open = false; … }, then static isolated = InboxView;.<MotionConfig @reducedMotion> defaults to "user": under prefers-reduced-motion, transform and layout animation are off while opacity and colour still animate. Don't override it to make a demo "work".{{motion}}: targets, transitions, keyframes, variants, gestures, motion values.<Presence>: exits, modes, the single-conditional-element form.layout, layoutId, <LayoutGroup>.drag, drag controls, <ReorderGroup> / <ReorderItem>, touch rules.scrollProgress, InView, whileInView.<Choreo> scenes, steps and selectors, beacons, nested regions and far matching.viewTransition scoped to the card, and when not to.boxel test.references/choreo.md (opens in a new tab)references/drag-and-reorder.md (opens in a new tab)references/element.md (opens in a new tab)references/layout.md (opens in a new tab)references/presence.md (opens in a new tab)references/scroll.md (opens in a new tab)references/testing.md (opens in a new tab)references/view-transitions.md (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`./boxelUse whenever creating, reading, or editing Boxel cards (.gts files), card instances (.json), fields, templates, queries, or anything in a Boxel realm. Required for any Boxel coding work — covers CardDef, FieldDef, contains/linksTo, templates, formats, queries, and core patterns. Companion skills - boxel-design (visual decisions), boxel-ui-guidelines (template UI), source-code-editing (`run-realm-code` tool), boxel-environment (running the Boxel app)./boxel-create-edit-cardsUse when choosing the realm.* calls in a run-realm-code script that create new cards or edit existing instances from the AI assistant./boxel-designUse when DECIDING a Boxel card's visual language — mood, palette, typography direction, asset direction, one visual signature, the design-playbook process. This is the taste/decision layer. NOT for implementing tokens or CSS inside templates (that's boxel-ui-guidelines) and NOT for creating/editing Theme, StyleReference, or BrandGuide card artifacts (that's boxel-theme-development)./boxel-environmentUse when running, navigating, or orchestrating tasks inside the live Boxel application — switching between Code Mode and Interact Mode, searching and editing cards, indexing, or any operation that drives the Boxel UI, all through `realm.*` and `room.*` calls in a run-realm-code script. Also for a user's questions about using Boxel itself: working from Claude Code or another editor, publishing a workspace, and their credits. Activates for Boxel-app runtime work, not for writing card definitions (see boxel for that).