Skip to content

stark-ai-de/agent-skills / plugins/stark-ai-developer/skills/drawio-diagrams

drawio-diagrams

Verified

Create, edit, review, or export editable draw.io diagrams. Use when the user needs .drawio architecture, flow, sequence, network, or other technical diagrams; not data plots or artistic images.

FileKindSize
SKILL.mdskill md13.6 KB
agents/openai.yamlconfig1.3 KB
assets/openai-icon.pngbinary56.4 KB
references/delivery.mdmarkdown11.5 KB
references/design-profiles.mdmarkdown13.6 KB
references/diagram-type-playbook.mdmarkdown12.1 KB
references/examples/animation-invalid.drawioother1.3 KB
references/examples/animation-off.drawioother1.3 KB
references/examples/animation-on.drawioother1.4 KB
references/examples/animation-static-dependency.drawioother1.3 KB
references/examples/architecture-icons.drawioother6.7 KB
references/examples/compressed-page-before.drawioother1.1 KB
references/examples/crowded-routing-before.drawioother6.3 KB
references/examples/example-broken.drawioother861 B
references/examples/example-clean.drawioother2.0 KB
references/examples/example-comment-broken.drawioother311 B
references/examples/example-contrast-broken.drawioother1.3 KB
references/examples/example-doctype-broken.drawioother301 B
references/examples/example-processing-instruction-broken.drawioother308 B
references/examples/existing-edit-after.drawioother2.6 KB
references/examples/existing-edit-before.drawioother1.9 KB
references/examples/icon-catalog-smoke.drawioother4.2 KB
references/examples/multi-page.drawioother3.4 KB
references/icon-catalog.mdmarkdown26.0 KB
references/layout-readability.mdmarkdown6.6 KB
references/routing-and-simplification.mdmarkdown6.9 KB
references/theming-dark-mode.mdmarkdown7.0 KB
references/toolset-setup.mdmarkdown10.3 KB
references/verification-checklist.mdmarkdown10.1 KB
references/workflow-details.mdmarkdown14.9 KB
references/xml-authoring.mdmarkdown9.3 KB
scripts/lib/transactional-render-output.mjsscript20.2 KB
scripts/open-drawio-url.mjsscript3.0 KB
scripts/preflight-drawio-xml.mjsscript2.1 KB
scripts/probe-drawio-toolset.mjsexecutablescript24.7 KB
scripts/rasterize-themed-svg.mjsscript20.3 KB
scripts/render-drawio.mjsexecutablescript47.6 KB
scripts/search-shapes.mjsexecutablescript7.0 KB
scripts/validate-drawio-diagram-rules.mjsscript35.8 KB
scripts/validate_drawio.pyexecutablescript80.3 KB

scripts/open-drawio-url.mjs

View on GitHub
#!/usr/bin/env node
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import zlib from "node:zlib";
import { spawnSync } from "node:child_process";

function usage() {
  return [
    "Usage: node scripts/open-drawio-url.mjs path/to/file.drawio [--open] [--print-only]",
    "",
    "Builds an app.diagrams.net #create URL from a .drawio file using Node built-ins.",
    "By default the script prints the URL only. Use --open to open it in the default browser.",
  ].join("\n");
}

function isWsl() {
  try {
    return /microsoft|wsl/i.test(fs.readFileSync("/proc/version", "utf8"));
  } catch {
    return false;
  }
}

function buildUrl(xml) {
  const compressed = zlib.deflateRawSync(encodeURIComponent(xml)).toString("base64");
  const payload = encodeURIComponent(
    JSON.stringify({ type: "xml", compressed: true, data: compressed }),
  );
  return `https://app.diagrams.net/?grid=0&pv=0&border=10&edit=_blank#create=${payload}`;
}

function writeShortcut(url) {
  const shortcutPath = path.join(os.tmpdir(), `drawio-${Date.now()}.url`);
  fs.writeFileSync(shortcutPath, `[InternetShortcut]\r\nURL=${url}\r\n`, "utf8");
  return shortcutPath;
}

function wslpath(filePath) {
  const result = spawnSync("wslpath", ["-w", filePath], { encoding: "utf8" });
  if (result.status !== 0) {
    throw new Error(`wslpath failed: ${(result.stderr || result.stdout || "").trim()}`);
  }
  return result.stdout.trim();
}

function openUrl(url) {
  if (process.platform === "darwin") {
    return spawnSync("open", [url], { stdio: "inherit" });
  }
  if (process.platform === "win32") {
    const shortcut = writeShortcut(url);
    return spawnSync("cmd.exe", ["/c", "start", "", shortcut], { stdio: "inherit" });
  }
  if (isWsl()) {
    const shortcut = writeShortcut(url);
    return spawnSync("cmd.exe", ["/c", "start", "", wslpath(shortcut)], {
      stdio: "inherit",
    });
  }
  return spawnSync("xdg-open", [url], { stdio: "inherit" });
}

function main() {
  const args = process.argv.slice(2);
  if (args.includes("--help") || args.includes("-h")) {
    console.log(usage());
    process.exit(0);
  }

  const input = args.find((arg) => !arg.startsWith("-"));
  if (!input) {
    console.error(usage());
    process.exit(2);
  }

  const shouldOpen = args.includes("--open");
  const inputPath = path.resolve(input);
  if (!fs.existsSync(inputPath)) {
    console.error(`Input not found: ${inputPath}`);
    process.exit(2);
  }

  const xml = fs.readFileSync(inputPath, "utf8");
  const url = buildUrl(xml);
  console.log(url);
  console.error(`Local file: ${inputPath}`);
  console.error(`URL length: ${url.length}`);
  if (url.length > 32768) {
    console.error(
      "Warning: URL is large; browsers may reject it. Use the .drawio file fallback if opening fails.",
    );
  }

  if (shouldOpen) {
    const result = openUrl(url);
    if (result.error) {
      console.error(`Open command failed: ${result.error.message}`);
      process.exit(1);
    }
    if (result.status !== 0) process.exit(result.status ?? 1);
  }
}

main();
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall