BuilderIO/agent-native / .agents/skills/design-editor-repro
design-editor-repro
VerifiedReproduce and verify Design editor issues against the application itself.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 2.2 KB |
| harness-recipes.md | markdown | 1.2 KB |
| harness/dlib.mjs | script | 27.1 KB |
| harness/doctor.mjs | script | 3.1 KB |
| harness/harness-env.mjs | script | 5.1 KB |
| harness/lock.mjs | script | 1.9 KB |
| harness/osmouse-linuxexecutable | script | 1.7 KB |
| harness/osmouse.swift | script | 3.7 KB |
| harness/sheet.mjs | script | 3.1 KB |
| harness/shot.mjs | script | 2.6 KB |
| harness/start-dev.shexecutable | script | 1.6 KB |
| reference/fixing.md | markdown | 947 B |
| reference/input-and-osmouse.md | markdown | 938 B |
| reference/performance.md | markdown | 1.0 KB |
| reference/tests-and-blast-radius.md | markdown | 719 B |
| reference/verification.md | markdown | 578 B |
| scripts/clip.mjs | script | 4.2 KB |
| scripts/copy-design.mjs | script | 7.2 KB |
harness/sheet.mjs
View on GitHub// Lays several screenshots out as one labelled image, so one Read replaces
// many: a clip's frames as a contact sheet, or one issue's evidence side by
// side (clip | production before | local after).
//
// node .agents/skills/design-editor-repro/harness/sheet.mjs "<title>" "<label>=<image>" ["<label>=<image>" ...]
//
// In a script:
// import { sheet } from "<repo>/.agents/skills/design-editor-repro/harness/sheet.mjs";
// const path = await sheet("flip export", [{ label: "Clip", image }, { label: "Local after", image }]);
import { readFileSync } from "node:fs";
import { extname } from "node:path";
import { pathToFileURL } from "node:url";
import { LAUNCH, SHOTS_DIR, chromium } from "./harness-env.mjs";
const MIME = {
".png": "image/png",
".jpg": "image/jpeg",
".jpeg": "image/jpeg",
".webp": "image/webp",
};
const escapeHtml = (s) =>
String(s).replace(
/[&<>"]/g,
(c) => ({ "&": "&", "<": "<", ">": ">", '"': """ })[c],
);
const slug = (s) => s.replace(/[^A-Za-z0-9._-]+/g, "-").replace(/^-|-$/g, "");
/** Writes a JPEG under SHOTS_DIR (or `out`) and returns its path. */
export async function sheet(
title,
cells,
{ columns = Math.min(cells.length, 4), cellWidth = 480, out } = {},
) {
const figures = cells
.map((c) => {
const mime = MIME[extname(c.image).toLowerCase()] ?? "image/png";
const data = readFileSync(c.image).toString("base64");
const caption = c.caption
? `<div class="cap">${escapeHtml(c.caption)}</div>`
: "";
return `<figure><figcaption>${escapeHtml(c.label)}</figcaption><img src="data:${mime};base64,${data}">${caption}</figure>`;
})
.join("");
const html = `<!doctype html><html><head><style>
body{margin:0;background:#fff;font:13px system-ui,sans-serif;color:#111}
h1{margin:0;padding:10px 12px;font-size:15px}
main{display:grid;grid-template-columns:repeat(${columns},${cellWidth}px);gap:10px;padding:0 12px 12px}
figure{margin:0;border:1px solid #ddd;border-radius:6px;overflow:hidden}
figcaption{padding:6px 8px;background:#f4f4f5;font-weight:600}
img{display:block;width:100%}
.cap{padding:6px 8px;color:#444}
</style></head><body><h1>${escapeHtml(title)}</h1><main>${figures}</main></body></html>`;
const browser = await chromium.launch(LAUNCH);
try {
const page = await browser.newPage({
viewport: { width: columns * (cellWidth + 10) + 14, height: 300 },
});
await page.setContent(html, { waitUntil: "load" });
const path = out ?? `${SHOTS_DIR}/${slug(title)}.jpg`;
await page.screenshot({ path, fullPage: true, type: "jpeg", quality: 82 });
return path;
} finally {
await browser.close();
}
}
if (
process.argv[1] &&
import.meta.url === pathToFileURL(process.argv[1]).href
) {
const [title, ...pairs] = process.argv.slice(2);
if (!title || pairs.length === 0) {
console.error(
'usage: sheet.mjs "<title>" "<label>=<image>" ["<label>=<image>" ...]',
);
process.exit(2);
}
const cells = pairs.map((pair) => {
const i = pair.indexOf("=");
return { label: pair.slice(0, i), image: pair.slice(i + 1) };
});
console.log(`sheet: ${await sheet(title, cells)} (open it with Read)`);
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |