/loxihart-design:shipping-cowork-live-artifactsfrom loxihart-design
Use whenever the user says "make this a live artifact", "make my [thing] a live artifact", "add file upload to my artifact", "add a zip import suite", "let me upload PDFs/docx/spreadsheets to this" — even if "live artifact" isn't said and an HTML file is just attached with a ship/persist instruction. Also triggers on: add PDF/DOCX/XLSX parsing to an artifact, batch zip import, keep the artifact self-contained (no CDN), smoke-test an artifact before shipping, headless Playwright check on an HTML artifact. Not for scaffolding a new React/shadcn artifact from scratch (use web-artifacts-builder) or FlashFusion dashboards (use building-flashfusion-live-artifacts).
Ships in loxihart-design. 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.
None: SKILL.md is the whole skill.
Persist a self-contained HTML file as a Cowork live artifact via
SendUserFile → create_artifact (first time) / update_artifact (after
that). If the file assumes claude.ai-artifact-only browser APIs
(window.storage, unauthenticated fetch to api.anthropic.com), flag that
assumption explicitly — it is unverified in the Cowork runtime. When asked to
add real document parsing (PDF/DOCX/XLSX/ZIP), inline the parser libraries at
build time via npm + direct file splicing rather than pasting megabytes of
minified code through your own context, and smoke-test the result headlessly
with Playwright and generated fixtures before shipping.
Does the artifact already exist as a file (uploaded or previously built)?
├─ Yes → read it fully first (Read tool). Note any window.storage / raw
│ fetch("https://api.anthropic.com/...") calls — flag them (see
│ "The Unverified Runtime Assumption" below), don't silently assume
│ they work.
└─ No, building from scratch with React/shadcn/routing → use
web-artifacts-builder instead. This skill is for persisting/extending
an existing self-contained single-file artifact.
Is this the first time this artifact is being persisted?
├─ Yes → SendUserFile → mcp__remote-devices__create_artifact (id, file_uuid,
│ description)
└─ No, it already exists as a Cowork artifact → SendUserFile →
mcp__remote-devices__update_artifact (id, file_uuid, update_summary)
— list_artifacts first if you don't already know the id.
Does the request add new capability (parsing, uploads, new panels)?
├─ Small/CSS/markup/logic change → Edit tool, str_replace, targeted diffs
└─ Needs a real parser library (PDF, DOCX, XLSX, ZIP, etc.)
└─ See "Adding Real Parsers Without Breaking Self-Containment" below
Before delivering:
└─ Run the headless Playwright smoke test (see below) with generated
fixtures. Report exactly what was verified and what wasn't — don't
imply full coverage from a partial test.
User: "make this a live artifact" (with an HTML file attached)
SendUserFile, then create_artifact with a
kebab-case id and a description of what the tool does.User: "I need you to include upload feature where I can upload pdfs, docx, markdown, .txt, spreadsheets, csv, .jsx, .json... Include a separate suite where I can upload a zip from device and." (message cuts off)
file.text() /
TextDecoder directly — zero new dependencies.User: "can u make my punch list thing a live artifact and let me upload docs too" Same flow as above, casually phrased — trigger on it exactly the same way. → Outcome: no separate handling needed for casual phrasing; same two flows apply.
Should trigger:
1. "make this a live artifact" (HTML file attached)
2. "can u turn my [x] into a live artifact real quick"
3. "add PDF and zip upload to my artifact"
4. "keep it self-contained, no CDN — inline whatever library you need"
5. "smoke-test this artifact before you send it back"
Should NOT trigger:
1. "build me a dashboard artifact from scratch with shadcn" (→ web-artifacts-builder —
scaffolding new, not persisting/extending an existing self-contained file)
2. "update the FlashFusion control center panel" (→ building-flashfusion-live-artifacts —
brand-specific artifact, its own skill)
3. "review this PR for bugs" (→ auditing-logic / code-auditor — review, not shipping)
Write(path, htmlContent) // build/edit in the workspace first
SendUserFile({ files: [path], status: "normal" }) // → returns file_uuid
mcp__remote-devices__create_artifact({ // first time only
id: "kebab-case-slug",
file_uuid: "<from above>",
description: "What it does and where its data comes from"
})
// later edits:
mcp__remote-devices__update_artifact({
id: "kebab-case-slug",
file_uuid: "<new file_uuid from a fresh SendUserFile call>",
update_summary: "What changed in this update"
})
To read an existing artifact's current HTML before editing it further, use
device_stage_files with artifact_ids: ["<id>"], then Read the staged
copy — don't reconstruct it from memory.
Files built for claude.ai's artifact sandbox often use two APIs that are not standard browser APIs:
window.storage.get(key, immediate) / .set(key, value, immediate) — a
host-provided KV store, not localStorage.fetch("https://api.anthropic.com/v1/messages", ...) with no
Authorization header — the host sandbox is expected to intercept and
authenticate the request.Whether Cowork's create_artifact-rendered sandbox provides the same two
shims was not verified in the source session for this skill, despite
asking directly. Treat this as an open question every time, not a known
fact:
hasStorageApi() guard) rather than crashing.Many hand-built artifacts deliberately avoid CDN dependencies ("nothing outside this file can break the tool"). Preserve that property when adding PDF/DOCX/XLSX/ZIP support by inlining the parser libraries at build time instead of fetching them at runtime.
Do not paste multi-hundred-KB minified library code through your own model context via the Edit tool. Install and splice with direct file I/O:
mkdir -p libbuild && cd libbuild && npm init -y >/dev/null
npm install pdfjs-dist@3 mammoth xlsx jszip --no-audit --no-fund
Then splice with a Python script that reads/writes files on disk directly (the library text never has to pass through your reasoning tokens):
def safe(code): # escape literal "</script" so it can't close the tag early
return code.replace("</script", "<\\/script")
block = (
"<script>\n" + safe(jszip) + "\n</script>\n" +
"<script>\n" + safe(xlsx) + "\n</script>\n" +
"<script>\n" + safe(mammoth) + "\n</script>\n" +
"<script>\n" + safe(pdfjs) + "\n</script>\n" +
'<script type="text/plain" id="pdfWorkerSrc">\n' + safe(pdf_worker) + "\n</script>\n"
)
html = html.replace(marker, block + marker, 1) # insert right before the main <script>
Per-library integration notes:
pdf.worker.min.js
in a non-executing <script type="text/plain" id="pdfWorkerSrc">, then at
init time: new Blob([workerText], {type:"application/javascript"}) →
URL.createObjectURL(blob) → pdfjsLib.GlobalWorkerOptions.workerSrc = url.
Extract text with doc.getPage(n).getTextContent(), join .items[].str.mammoth.extractRawText({arrayBuffer}).value — no
worker needed, browser build only.XLSX.read(arrayBuffer, {type:"array"}), then
XLSX.utils.sheet_to_csv(wb.Sheets[name]) per sheet name. Use
xlsx.full.min.js, not .core.min.js, for broader codepage support.await JSZip.loadAsync(arrayBuffer), then
Object.values(zip.files).filter(f => !f.dir), entry.async("arraybuffer")
per entry — reuse the same per-file extraction routing recursively.Approximate inlined sizes (v3 pdfjs-dist, current npm as of this writing): pdf.min.js ~320KB, pdf.worker.min.js ~1.1MB, mammoth.browser.min.js ~640KB, xlsx.full.min.js ~880KB, jszip.min.js ~100KB. Total addition: ~3MB. That's fine for a local desktop artifact; don't reach for the CDN option just to save file size unless the user says so — it trades away the reliability property the original file was built around.
The pre-installed Chromium is under a versioned subdirectory — don't guess the path, find it first:
find /opt/pw-browsers/chromium* -maxdepth 2 -iname "*chrome*"
# → /opt/pw-browsers/chromium-1194/chrome-linux/chrome (version number varies)
npm install playwright --no-audit --no-fund
const { chromium } = require('./node_modules/playwright');
const browser = await chromium.launch({
executablePath: '/opt/pw-browsers/chromium-<version>/chrome-linux/chrome',
args: ['--no-sandbox']
});
const page = await browser.newPage();
const errors = [];
page.on('pageerror', e => errors.push('pageerror: ' + e.message));
page.on('console', m => { if (m.type() === 'error') errors.push('console.error: ' + m.text()); });
await page.goto('file://' + path.resolve('artifact.html'));
await page.setInputFiles('#fileInput', [path.resolve('fixture.txt')]); // simulate a real upload
// assert on page.locator(...).innerText(), typeof window.<global>, etc.
Generate binary-format fixtures instead of sourcing real files — it's faster and you control exactly what's being tested:
xlsx package's own XLSX.writeFile().[Content_Types].xml
_rels/.rels + word/document.xml is enough for mammoth to read it.Report the verification honestly: which formats were round-tripped end-to-end vs. which only had "library loaded, API present" checked (e.g. no real PDF fixture = pdf.js verified to load, not verified to extract).
</script inside inlined library code closes your wrapper tag
early. Escape it to <\/script before splicing, or the page silently
truncates mid-library and everything after breaks with no clear error./opt/pw-browsers/ is versioned — hardcoding
a guessed path fails; find/ls it first.Edit tool requires a prior Read of that exact path in this
session, even if you already read the same content from a different
path (e.g. an upload dir vs. a workspace copy) — read the copy you're
about to edit, not just the original.MAX_INPUT_CHARS-style truncation constants tuned for pasted text may
be too small once file uploads are added — a whole PDF can dwarf a
hand-typed paste. Reconsider the constant, and say so explicitly rather
than leaving it silently mismatched to the new feature.create_artifact or a follow-up
update_artifact, and used the correct one.window.storage, unauthenticated
fetch to api.anthropic.com) flagged as an unverified runtime assumption
— not silently assumed to work, not silently assumed to fail.SendUserFile → mcp__remote-devices__create_artifact /
update_artifact is the documented Cowork flow for persisting HTML as a
live, revisitable artifact — Cowork system prompt, <persisted_artifacts>.GlobalWorkerOptions.workerSrc is a standard
offline-embedding technique for pdf.js — verified working in a live headless
Playwright run (worker src resolved to a blob: URL, zero console errors).fetch to
api.anthropic.com and provides window.storage the same way claude.ai's
artifact sandbox does is unverified — flagged, not confirmed, in the
session this skill was extracted from.xlsx.full.min.js, mammoth.browser.min.js, pdf.min.js +
pdf.worker.min.js, and jszip.min.js were installed via npm and
round-tripped real/generated fixtures (txt, csv, json, xlsx, docx, zip)
with zero console errors in a headless Chromium run performed directly in
the source session.window.storage or the Anthropic API
doesn't need the runtime-assumption flag at all — don't add it reflexively
to every artifact, only ones that actually use those APIs.! This skill recommends inlining parsers to preserve a "no external dependency" design philosophy, while also adding ~3MB to the artifact — the tradeoff (reliability vs. size) should be surfaced to the user, not resolved unilaterally, unless a prior tool failure genuinely blocks asking. ! "Don't guess the missing half of a cut-off instruction" is in tension with "don't infinite-retry a broken clarifying-question tool." Resolution used in the source session: build both plausible interpretations as separate UI actions instead of picking one, when that's structurally cheap to do.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub krosebrook/loxihart-skills --plugin loxihart-design19 skills in this plugin
/advanced-ux-patternsComprehensive UX best practices including accessibility (WCAG 2.2), interaction patterns, user research methods, and usability principles. Use when designing user interfaces, conducting UX audits, or implementing accessible, user-centered designs. Also triggers on WCAG, ARIA, keyboard navigation, screen reader, focus trap, focus management, touch targets, usability testing, heuristic evaluation, card sorting, tree testing, NPS, SUS, form design, navigation patterns, mobile UX, design handoff, cognitive load, information architecture, dark patterns, skeleton screen, error states, reduced motion, dark mode accessibility, component states, error recovery, or any request to audit, improve, spec, or review a user interface — even casually. If UI is involved, use this skill./advanced-visual-designAdvanced visual design techniques including typography systems, color theory, grid-based layouts, visual hierarchy, and composition principles. Use when creating high-quality visual designs, establishing design foundations, or implementing sophisticated design systems. Also triggers on type scale, font pairing, color palette, HSL color, 8-point grid, 12-column layout, visual hierarchy, whitespace, composition, rule of thirds, golden ratio, dark mode design, optical adjustments, or easing curves. Even if someone says "make this look professional" or "set up my design foundations" — use this skill./applying-web-design-standardsApplies web design standards covering typography systems, color theory, grid layouts, design tokens, component library architecture, responsive CSS, and performance optimization. Use when the user mentions: type scale, font pairing, color palette, HSL color, 8-point grid, design tokens, component API, Storybook, Style Dictionary, atomic design, responsive layout, mobile-first, Core Web Vitals, CSS Grid, Flexbox, container queries, pre-launch audit. Does NOT activate for Kyle-specific branded builds — use executing-branded-frontends or managing-design-briefs instead./auditing-cross-app-experiencesAudit, shape, redesign, animate, harden, test, and ship an existing application or frontend with evidence-bound UX, accessibility, performance, security, and release checks. Invoke for all requests to improve a site's design, usability, motion, responsiveness, mobile experience, onboarding, dashboard, 3D game view, or production readiness. Preserve existing product intent and release holds./building-flashfusion-live-artifactsBuilds, patches, and registers the FlashFusion Agent Control Center as a Cowork live artifact — void-dark dashboard with semi-transparent blur panels, live Supabase data, and per-panel Demo fallback. Use when the user mentions: build the FlashFusion artifact, rebuild the control center, add a panel to the dashboard, the artifact is broken, update FlashFusion dashboard, patch the agent dashboard, fix the live connection, update brand tokens, ff artifact, ff dashboard, agent control panel, agent control center, demo mode artifact, approval queue panel, HITL queue dashboard, live agent view, ChaosClubCo dashboard. Fires on dashboard or control-center requests in the FlashFusion context even when FlashFusion or artifact is not named. PERSONAL lane only — never run on LOXIHART tasks.
/building-parallax-scroll-effectsBuilds scroll-linked motion effects — depth-layer parallax, sticky pinning, scroll-triggered reveals, horizontal scroll-jacking, pointer/mouse parallax, scale-on-scroll, velocity-aware marquees, and native CSS scroll-driven animation (animation-timeline) — with performance and accessibility handled from the first line of code, not bolted on after. Use when the user asks for parallax scrolling, scroll animations, scroll-triggered effects, depth on scroll, sticky sections, pinned sections, horizontal scroll sections, scroll-jacking, mouse or pointer parallax, animate on scroll, reveal on scroll, scroll-linked motion, or a landing page/hero that should "feel alive" while scrolling. Covers four implementation stacks — vanilla CSS/JS, native CSS scroll-timelines, GSAP ScrollTrigger, and Motion (the library formerly named Framer Motion) for React — and picks between them by tradeoff, not by default. Check this before writing any scroll-linked animation, even a single fade-in-on-scroll.