Skip to content

nexu-io/openmotion / library/design/skills/web-clone

web-clone

Unverified

网站复刻 / 克隆方法论。USE WHEN 用户说 复刻网站、克隆网站、clone website、抄个站、仿站、 照着这个站做一个、reproduce site、还原某个网页效果、把这个站搬下来改成我的、 复刻某个交互/WebGL/Canvas/Three.js 效果。提供「先拿真源码 → 判路径 → 逆向拆解 → 搭工程 → 替换内容」的可移植决策树,覆盖静态站 / React-Vue-Next 内容站 / WebGL-Canvas 重前端站三大分支,并强制核对任何 AI 二手分析里的可执行代码。

FileKindSize
LICENSEother1.1 KB
SKILL.mdskill md20.8 KB
references/assessment.mdmarkdown3.5 KB
references/complex-playbooks.mdmarkdown2.3 KB
references/deliverables.mdmarkdown4.9 KB
references/design-dna.mdmarkdown11.4 KB
references/effect-extraction.mdmarkdown5.2 KB
references/marbles-case.mdmarkdown3.3 KB
references/reverse-engineering.mdmarkdown3.5 KB
references/static-mirror.mdmarkdown4.8 KB
scripts/asset-harvest.mjsexecutablescript14.4 KB
scripts/audit-clone.mjsexecutablescript11.0 KB
scripts/compare-recon.mjsexecutablescript10.8 KB
scripts/dna-scaffold.mjsscript11.6 KB
scripts/init-clone.mjsexecutablescript3.4 KB
scripts/interaction-probe.mjsscript12.2 KB
scripts/lib/playwright-loader.mjsexecutablescript5.1 KB
scripts/lib/system-browser.mjsscript19.4 KB
scripts/mirror-site.mjsscript6.2 KB
scripts/network-capture.mjsexecutablescript4.2 KB
scripts/od-preview-rewrite.mjsscript5.6 KB
scripts/recon-site.mjsexecutablescript16.4 KB
scripts/route-crawl.mjsscript7.8 KB
scripts/sourcemap-hunt.mjsexecutablescript3.6 KB
scripts/visual-diff.mjsexecutablescript5.8 KB

scripts/sourcemap-hunt.mjs

View on GitHub
#!/usr/bin/env node
import fs from "node:fs";
import path from "node:path";
import crypto from "node:crypto";

function usage() {
  console.log(`Usage:
  node scripts/sourcemap-hunt.mjs --recon original-recon.json --out RECON/sourcemaps [--all-external]

Finds sourceMappingURL hints in discovered JavaScript bundles and tries to download source maps.
`);
}

function parseArgs(argv) {
  const out = { recon: "", outDir: "RECON/sourcemaps", allExternal: false };
  for (let i = 0; i < argv.length; i += 1) {
    const arg = argv[i];
    if (arg === "--help" || arg === "-h") out.help = true;
    else if (arg === "--recon") out.recon = argv[++i] || "";
    else if (arg === "--out") out.outDir = argv[++i] || "RECON/sourcemaps";
    else if (arg === "--all-external") out.allExternal = true;
    else throw new Error(`Unexpected argument: ${arg}`);
  }
  return out;
}

function collectScripts(recon) {
  const scripts = new Set();
  for (const capture of recon.captures || []) {
    for (const script of capture.signals?.scripts || []) {
      if (/^https?:\/\//i.test(script)) scripts.add(script);
    }
  }
  return Array.from(scripts);
}

function fileNameFor(url, suffix = "") {
  const parsed = new URL(url);
  const base = path.basename(parsed.pathname).replace(/[^a-z0-9._-]+/gi, "-").slice(0, 90) || "bundle.js";
  const hash = crypto.createHash("sha1").update(url).digest("hex").slice(0, 10);
  return `${base}-${hash}${suffix}`;
}

function resolveMapUrl(scriptUrl, mapHint) {
  if (!mapHint) return `${scriptUrl}.map`;
  if (mapHint.startsWith("data:")) return "";
  return new URL(mapHint, scriptUrl).toString();
}

async function fetchText(url) {
  const response = await fetch(url, {
    headers: {
      "user-agent": "web-clone-skill/1.0 sourcemap-hunt",
      "accept": "*/*",
    },
  });
  if (!response.ok) throw new Error(`${response.status} ${response.statusText}`);
  return response.text();
}

try {
  const args = parseArgs(process.argv.slice(2));
  if (args.help || !args.recon) {
    usage();
    process.exit(args.help ? 0 : 1);
  }

  const recon = JSON.parse(fs.readFileSync(args.recon, "utf8"));
  const originHost = recon.url ? new URL(recon.url).hostname : "";
  const scripts = collectScripts(recon).filter((script) => args.allExternal || new URL(script).hostname === originHost);
  const outDir = path.resolve(args.outDir);
  fs.mkdirSync(outDir, { recursive: true });

  const results = [];
  for (const scriptUrl of scripts) {
    const entry = { scriptUrl, status: "unknown", mapUrl: "", mapFile: "", error: "" };
    try {
      const js = await fetchText(scriptUrl);
      const hint = js.match(/[#@]\s*sourceMappingURL=([^\s*]+)/)?.[1] || "";
      entry.mapUrl = resolveMapUrl(scriptUrl, hint);
      if (!entry.mapUrl) {
        entry.status = "inline-or-data-map";
        results.push(entry);
        continue;
      }
      const mapText = await fetchText(entry.mapUrl);
      const mapFile = path.join(outDir, fileNameFor(entry.mapUrl, ".map"));
      fs.writeFileSync(mapFile, mapText);
      entry.mapFile = mapFile;
      entry.status = "ok";
    } catch (error) {
      entry.status = "error";
      entry.error = error.message;
    }
    results.push(entry);
  }

  const manifest = {
    source: args.recon,
    url: recon.url,
    allExternal: args.allExternal,
    scriptCount: scripts.length,
    mapCount: results.filter((item) => item.status === "ok").length,
    results,
  };
  const manifestFile = path.join(outDir, "sourcemap-manifest.json");
  fs.writeFileSync(manifestFile, `${JSON.stringify(manifest, null, 2)}\n`);
  console.log(manifestFile);
} catch (error) {
  console.error(`sourcemap-hunt failed: ${error.message}`);
  process.exit(1);
}
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 197kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall