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/shot.mjs

View on GitHub
import { mkdirSync } from "node:fs";

import { SHOTS_DIR } from "./harness-env.mjs";

/**
 * Per-interaction capture. The point is not to save files — it is to make the
 * evidence cheap enough that there is no excuse for a claim without it, and to
 * return the paths so the report can cite them.
 *
 *   const cap = shots("drag-into-col");
 *   await cap.app(page, "before");
 *   ...gesture...
 *   const paths = await cap.app(page, "after");
 *   // then OPEN paths with the Read tool. Saving is not looking.
 */
const safe = (part) =>
  String(part)
    .replace(/[^A-Za-z0-9._-]+/g, "-")
    .replace(/^\.+/, "");

export function shots(rawTag, dir = SHOTS_DIR) {
  const tag = safe(rawTag);
  mkdirSync(dir, { recursive: true });
  const taken = [];
  const record = (p) => {
    taken.push(p);
    return p;
  };
  return {
    taken,
    /** Whole editor viewport. */
    async app(page, phase = "") {
      const p = `${dir}/${tag}${phase ? `-${safe(phase)}` : ""}-app.png`;
      await page.screenshot({ path: p });
      return record(p);
    },
    /** Just the rendered screen, cropped to the first sizeable iframe. */
    async screen(page, phase = "") {
      const p = `${dir}/${tag}${phase ? `-${safe(phase)}` : ""}-screen.png`;
      const frame = page.locator("iframe").first();
      await frame
        .screenshot({ path: p })
        .catch(() => page.screenshot({ path: p }));
      return record(p);
    },
    /** One node, cropped from its rect inside the iframe. */
    async node(page, nodeId, phase = "") {
      const clip = await page.evaluate((id) => {
        for (const f of document.querySelectorAll("iframe")) {
          const d = f.contentDocument;
          if (!d) continue;
          const el = d.querySelector(`[data-agent-native-node-id="${id}"]`);
          if (!el) continue;
          const fr = f.getBoundingClientRect();
          const s = fr.width / d.documentElement.clientWidth;
          const r = el.getBoundingClientRect();
          const pad = 12;
          return {
            x: Math.max(0, fr.x + r.x * s - pad),
            y: Math.max(0, fr.y + r.y * s - pad),
            width: r.width * s + pad * 2,
            height: r.height * s + pad * 2,
          };
        }
        return null;
      }, nodeId);
      const p = `${dir}/${tag}-${safe(nodeId)}${phase ? `-${safe(phase)}` : ""}.png`;
      await page.screenshot({ path: p, ...(clip ? { clip } : {}) });
      return record(p);
    },
    /** Paste into the report so every finding carries its evidence. */
    report() {
      return taken.map((p) => `      ${p}`).join("\n");
    },
  };
}
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