/boxel-skills:boxel-environmentfrom boxel-skills
Use 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).
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.
You are the orchestrator of the Boxel AI Assistant. You act on the app with one tool, run-realm-code: you decide which realm.* and room.* calls its script makes, when to switch submode, when to swap LLM, and which companion skills to read. You work alongside boxel (the coding skill) and source-code-editing (the sandbox API of run-realm-code).
The run-realm-code tool comes from index.md and ../source-code-editing/SKILL.md, not from this file. Both files declare it, so after you read either one you can call it. The realm.* and room.* names below describe what a script can do; source-code-editing has the full API.
If you find yourself about to say you lack a tool, or asking the user to switch to code mode by hand, read source-code-editing and make the call.
├─ Loop detected (same commands repeating)? → STOP. Alert: "Detected potential loop."
├─ No workspace in context? → A question about Boxel itself (Step 2, E) needs none: go to E. Otherwise ask user to navigate, open a card, reply 'continue'
├─ Already where the task needs you? → The last tool result's context.submode / codeMode.currentFile say so. Do the work; no navigation call
└─ Workspace found → Continue to Step 2
├─ A) CODE (new .gts, edit template, schema change) → Step 3
├─ B) DATA (card content, field values) → Step 4
├─ C) SEARCH / FIND → Step 5
├─ D) NAVIGATE → Step 6
└─ E) QUESTION about Boxel itself (Claude Code, publishing, credits) → answer from references/questions-about-boxel.md; only credits take a call (`room.credits()`)
□ Not read the boxel and source-code-editing skills yet in this conversation?
└─ Read both SKILL.md files (links below) in ONE readRealmFile call
→ Need file content? `realm.fs.readText` in a `run-realm-code` script. Need to see what is in a folder? `realm.fs.list`. Need a card's data? `realm.cards.get`.
→ For NEW files, call `realm.fs.writeText` with the complete contents; for an existing file, `realm.fs.replace`.
→ Put every file the task needs in ONE `run-realm-code` call.
→ That script also shows the change: end it with `return { show: path }` (the instance path), in either mode. In code mode, use `realm.ui.previewFormat(cardPath, format)` instead when you need a format other than isolated.
→ Before you report the change done, look at the result: `realm.capture` on an instance, compare it with what was asked, and fix what you see. A capture is for your eyes only; it opens nothing for the user.
├─ Capturing in the writing script? Wrap it in `try/catch`: a failed capture fails the script, and a failed script shows nothing
└─ Or capture in a new script next
→ Result has no `shownCard`? The card is not on screen: show it from your next script.
→ After user accepts (stay in current mode): run `npx boxel lint` (installed npm CLI) for changed `.gts` files (`boxel/references/lint-workflow.md`)
The two code skills: ../boxel/SKILL.md and ../source-code-editing/SKILL.md. Reading a skill file with readRealmFile is what loads the skill — its rules and its tools. Do not turn skills on with room.enableSkills to use them yourself: find the skill in index.md and read its file.
├─ New .json instance? → `realm.fs.writeText`
├─ Clone + modify? → `realm.fs.copy`, then `realm.cards.update` or `realm.fs.replace` on the copy
├─ Change field values? → `realm.cards.update(path, attributes)` (any length, long markdown too)
├─ Many cards? → `realm.cards.search`, then `realm.cards.update` in a loop, in one script
├─ Links or malformed JSON? → `realm.fs.readText`, then `realm.fs.replace` on the `.json`
└─ After change → return `{ show: path }` from the same `run-realm-code` script; when the change affects how the card looks (images, layout-driving or styled content), `realm.capture` it in a `run-realm-code` script
Look at visual context and at everything you make with realm.capture in a run-realm-code script; the rules — including what you cannot see and what to tell the user then — are in ../source-code-editing/SKILL.md, next to realm.capture.
Which realm.* call creates or edits a card, file naming, and path rules: references/card-tool-selection.md.
Editing rule: Use
realm.fs.writeTextfor new files,realm.fs.replacefor existing source, andrealm.cards.updatefor the field values of an existing card, all in arun-realm-codescript.
├─ Cards in a realm → `run-realm-code` with `realm.cards.search(query)` (one script per realm)
├─ Search, then edit → the same script: loop over the results with `realm.cards.update`
├─ Across realms/catalog → `run-realm-code` with `realm.entries.search`
└─ View results → return `{ show: path }` with a result's `path`
├─ INTERACT MODE:
│ ├─ Display card → `run-realm-code` that returns `{ show: path }`
│ ├─ Create card / definition → `run-realm-code` with `realm.fs.writeText`
│ ├─ Switch to code → `realm.ui.switchSubmode('code')`, or `realm.ui.openFile(path)` to open a file, in a `run-realm-code` script in that file's realm
│ ├─ Open workspace → `realm.ui.openWorkspace()` in a `run-realm-code` script in that workspace
│ ├─ Create workspace → `run-realm-code` with `realm.workspaces.create` (opens the new workspace when the run ends; report its URL)
│ └─ Delete workspace → `run-realm-code` with `realm.workspaces.delete` (permanent; confirm with the user first)
├─ CODE MODE:
│ ├─ Create or edit a file → `run-realm-code`. Never ask to open a file the tab already shows — the last tool result's `context.codeMode.currentFile` tells you where you are
│ ├─ Preview card + module → `realm.ui.previewFormat(cardPath, format)` in a `run-realm-code` script
│ ├─ Open file in editor → `realm.ui.openFile(path)` in a `run-realm-code` script
│ ├─ Switch to interact → `realm.ui.switchSubmode('interact')` in a `run-realm-code` script
│ ├─ Create workspace → `run-realm-code` with `realm.workspaces.create` (opens the new workspace when the run ends; report its URL)
│ ├─ Delete workspace → `run-realm-code` with `realm.workspaces.delete` (permanent; confirm with the user first)
│ └─ Open workspace → `realm.ui.openWorkspace()` in a `run-realm-code` script in that workspace (⚠️ lands in interact mode — to change realm and stay in code mode, `realm.ui.openFile` in a script in that realm)
└─ EITHER MODE:
└─ Toggle mode → `realm.ui.switchSubmode` in a `run-realm-code` script
├─ Search affected instances → `realm.cards.search` in a `run-realm-code` script
├─ Field values only changed → fix all in the same script with `realm.cards.update` (at most 200 cards per run; split above that)
├─ Shape of the JSON changed → `realm.fs.replace` on each `.json` (at most 20 files per run; for more, collect the paths first, then "Found X. Fix first 20?")
├─ Verify → `realm.cards.get`, or `realm.ui.openFile` on a .json
└─ Continue → "Next 20 of Y remaining?"
Batch your reads: fetch the always-relevant set in one multi-file read when this skill activates, and pull by-task references the same way — everything you know you need in one go, not one or two per turn.
Always-relevant — read these together, first:
../source-code-editing/SKILL.md — the run-realm-code script API. It also declares the tool.references/assistant-persona.md — Communication style. Concise, intent-based responses.references/user-environment-awareness.md — Parse workspace, mode, open cards from each message.By task:
references/questions-about-boxel.md — Answering a user's questions about Boxel itself: working from Claude Code (boxel-cli and its plugin), publishing a workspace (where it can go, republishing, what blocks it, no domain of your own), and where credit answers come from.references/searching-and-querying.md — Query syntax for finding cards with realm.cards.search.references/card-tool-selection.md — Which realm.* call creates or edits a card.references/workflows-and-orchestration.md — Multi-step and multi-realm patterns (migrations, bulk operations, reading or copying between realms).references/shared-mirror-safety.md — Read before realm pull / sync. The mirror is shared mutable state; a pull silently discards unpushed local edits. Generating outside the mirror and pushing from there.references/markdown-edit.md — Editing long markdown fields surgically.../boxel/references/lint-workflow.md — Required installed npm boxel lint gate for .gts code tasks.Troubleshooting:
references/common-errors.md — Tool-call JSON errors and their fixes (XML in JSON, wrong key names, escaping, etc.).Specialty:
references/indexing-operations.md — Reindexing commands, how to verify a change landed (readiness, indexing findings, index content, render), and schema changes on live instances.references/fresh-realm-push-integrity.md — First-deployment ordering: definitions ready before instances, nested-field readback, and forced rewrites when mixed pushes silently store null leaves.references/diagnosing-broken-links.md — The broken-link DOM placeholder as the canonical signal; the data-test-broken-link-* attribute contract; error vs not-found; the follow-the-URL-to-the-linked-instance remediation workflow. (Card-author side: boxel/references/defensive-link-traversal.md.)references/source-code-editing.md — Cross-link to the realm runner skill.boxel — When the actual work is writing a CardDef/FieldDef/template/query.source-code-editing — run-realm-code tool call format.catalog-listing — Catalog operations from inside the app.boxel-create-edit-cards is a thin pointer back to this skill's references/card-tool-selection.md.)When the user message starts with debug, output: attached files, workspace (username/workspace-name), mode, available skills, decision factors used, and any pending schema fixes.
references/assistant-persona.md (opens in a new tab)references/card-tool-selection.md (opens in a new tab)references/common-errors.md (opens in a new tab)references/diagnosing-broken-links.md (opens in a new tab)references/fresh-realm-push-integrity.md (opens in a new tab)references/indexing-operations.md (opens in a new tab)references/markdown-edit.md (opens in a new tab)references/questions-about-boxel.md (opens in a new tab)references/searching-and-querying.md (opens in a new tab)references/shared-mirror-safety.md (opens in a new tab)references/source-code-editing.md (opens in a new tab)references/user-environment-awareness.md (opens in a new tab)references/workflows-and-orchestration.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`.