Skip to content

BuilderIO/agent-native / .agents/skills/design-editor-repro

design-editor-repro

Verified

Reproduce and verify Design editor issues against the application itself.

FileKindSize
SKILL.mdskill md2.2 KB
harness-recipes.mdmarkdown1.2 KB
harness/dlib.mjsscript27.1 KB
harness/doctor.mjsscript3.1 KB
harness/harness-env.mjsscript5.1 KB
harness/lock.mjsscript1.9 KB
harness/osmouse-linuxexecutablescript1.7 KB
harness/osmouse.swiftscript3.7 KB
harness/sheet.mjsscript3.1 KB
harness/shot.mjsscript2.6 KB
harness/start-dev.shexecutablescript1.6 KB
reference/fixing.mdmarkdown947 B
reference/input-and-osmouse.mdmarkdown938 B
reference/performance.mdmarkdown1.0 KB
reference/tests-and-blast-radius.mdmarkdown719 B
reference/verification.mdmarkdown578 B
scripts/clip.mjsscript4.2 KB
scripts/copy-design.mjsscript7.2 KB

harness/doctor.mjs

View on GitHub
// Checks the harness can do its job:  node .agents/skills/design-editor-repro/harness/doctor.mjs
// PASS: go on. WAIT (exit 75): the dev server is still starting or compiling;
// run it again. FAIL (exit 1): report the line and its screenshot, and stop.
import { action, api, newDesign, openEditor } from "./dlib.mjs";
import {
  BASE,
  CDP_URL,
  FUSION,
  PROD_BASE,
  SHOTS_DIR,
  TEST_ACCOUNT,
  describeEnv,
} from "./harness-env.mjs";

const results = [];
const check = async (name, fn, { required = true } = {}) => {
  console.error(`doctor: ${name}…`);
  const started = Date.now();
  try {
    const detail = await fn();
    results.push(
      `PASS  ${name}${detail ? `: ${detail}` : ""} (${Math.round((Date.now() - started) / 1000)}s)`,
    );
    return true;
  } catch (err) {
    const status = err.wait ? "WAIT" : required ? "FAIL" : "WARN";
    results.push(`${status}  ${name}: ${err.message.split("\n")[0]}`);
    return false;
  }
};

async function answers(url, timeoutMs, hint = "") {
  const deadline = Date.now() + timeoutMs;
  let last = "no response";
  while (Date.now() < deadline) {
    const res = await fetch(url, {
      signal: AbortSignal.timeout(5000),
      redirect: "manual",
    }).catch((e) => e);
    if (res instanceof Response && res.status < 500)
      return `HTTP ${res.status}`;
    last = res instanceof Response ? `HTTP ${res.status}` : res.message;
    await new Promise((r) => setTimeout(r, 2000));
  }
  throw Object.assign(new Error(`${url} not answering (${last})${hint}`), {
    wait: FUSION,
  });
}

await check(
  FUSION ? "branch browser" : "your Chrome on :9222 (physical input only)",
  () =>
    answers(
      `${CDP_URL}/json/version`,
      FUSION ? 30000 : 3000,
      FUSION ? "" : ". Start Chrome with --remote-debugging-port=9222",
    ),
  { required: false },
);
const up = await check("dev server", () =>
  answers(
    `${BASE}/`,
    FUSION ? 45000 : 10000,
    FUSION
      ? ""
      : ". Start it: .agents/skills/design-editor-repro/harness/start-dev.sh",
  ),
);
if (up && (await check("local login", async () => (await api()).dispose()))) {
  await check("editor opens a design", async () => {
    let d;
    try {
      d = await openEditor(await newDesign("Harness doctor"));
    } catch (err) {
      throw Object.assign(err, {
        wait: err.compiling || err.name === "TimeoutError",
      });
    }
    const shot = `${SHOTS_DIR}/doctor-editor.png`;
    await d.page.screenshot({ path: shot });
    await d.close();
    const ctx = await api();
    await action(ctx, "delete-design", { id: d.designId }).catch(() => {});
    await ctx.dispose();
    return shot;
  });
}
await check(
  "test account",
  async () => {
    if (!TEST_ACCOUNT)
      throw new Error("DESIGN_TEST_EMAIL / DESIGN_TEST_PASSWORD not set");
    await (await api(PROD_BASE, TEST_ACCOUNT)).dispose();
    return TEST_ACCOUNT.email;
  },
  { required: false },
);

console.log(describeEnv());
console.log(results.join("\n"));
if (results.some((r) => r.startsWith("FAIL"))) process.exit(1);
if (results.some((r) => r.startsWith("WAIT"))) {
  console.log(
    "Still starting or compiling: run the doctor again. Do not work around it.",
  );
  process.exit(75);
}
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: 322kUpdated Claude CodeCodexVerifiedInstall
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 198kUpdated Claude CodeCodexVerifiedInstall