Skip to content

ZenUml/conf-app / .claude/skills/find-macros-on-page

find-macros-on-page

Verified

List ZenUML (and other) macros on any Confluence page in render order, with their customContentId, type, title, and ADF localId — and fetch a chosen macro's stored body (DrawIO XML / Mermaid / PlantUML / ZenUML DSL / OpenAPI). Two operations, one skill. Use whenever investigating a customer page, locating which macro to inspect/reproduce, correlating "the third diagram on page X" to a specific customContentId, or extracting a stored macro source for rebuild. Triggers on "what macros are on this page", "find the macro at <URL>", "fetch the macro source", "extract macro XML", "rebuild this customer's macro", or any starting step of a customer-page investigation.

FileKindSize
SKILL.mdskill md8.9 KB
scripts/fetch-source-snippet.jsscript2.2 KB
scripts/fetch.mjsscript3.3 KB
scripts/list.mjsscript5.3 KB
scripts/snippet.jsscript2.4 KB

scripts/fetch-source-snippet.js

View on GitHub
// Fetch a macro's stored body via the Confluence v2 API and return it parsed.
// Paste into Playwright MCP `browser_evaluate` or claude-in-chrome
// `javascript_tool` after navigating to ANY page on the same tenant. Uses
// page cookies — no API token required.
//
// IMPORTANT: replace `<CC_ID>` below with the customContentId (a string).
//   `find-macros-on-page`'s snippet returns these.
//
// Returns: { ok, contentType, title, body: { diagramType, graphXml | code | spec, ... } }
//
// Notes:
//   - Works for arbitrary body sizes via Playwright MCP (no proxy filter).
//   - Via claude-in-chrome, the proxy may block base64-shaped output. If so,
//     stash on `window.__macroBody`, focus the tab, and `navigator.clipboard
//     .writeText(window.__macroBody)` — then `pbpaste > file` on the host.

(async () => {
  const CC_ID = "<CC_ID>"; // e.g. "6445039617"
  if (CC_ID === "<CC_ID>") return { err: "replace <CC_ID> with the customContentId before evaluating" };

  const r = await fetch(`/wiki/api/v2/custom-content/${CC_ID}?body-format=raw`, { credentials: "include" });
  if (!r.ok) return { err: `HTTP ${r.status} on /custom-content/${CC_ID}`, detail: await r.text() };
  const j = await r.json();

  const raw = j.body?.raw?.value;
  let body = null;
  let parseErr = null;
  try { body = JSON.parse(raw); } catch (e) { parseErr = String(e); }

  // For quick visual inspection, summarise body without spilling huge strings.
  const summary = {};
  if (body) {
    for (const k of Object.keys(body)) {
      const v = body[k];
      if (typeof v === "string") summary[k] = { type: "string", len: v.length, first120: v.slice(0, 120) };
      else summary[k] = v;
    }
  }

  // Stash full body on window for follow-up steps (clipboard, save, etc.)
  window.__macroBody = raw;
  window.__macroBodyParsed = body;

  return {
    ok: true,
    contentType: (j.type || "").split(":").pop(),
    title: j.title,
    rawLen: raw?.length ?? 0,
    parseErr,
    summary,
    // The full body is on window.__macroBody / window.__macroBodyParsed.
    // Return it inline only if small enough that the proxy filter is unlikely to bite.
    full: raw && raw.length < 4000 ? body : null,
  };
})();
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall