Skip to content

JasonColapietro/suede-creator-skills / skills/suede-seo-audit

suede-seo-audit

Verified

Audit technical access, intent, metadata, links, schema, generative search, copy, E-E-A-T, and topic architecture with A-F lanes and exact fixes. Use when asked to "audit this site for SEO", investigate traffic or indexation problems, or produce a scored report. Includes offline source-review tools. NOT FOR: a quick promotion grade (use suede-visibility-grader), AI crawler and citation measurement (use suede-ai-seo), or conversion-path changes (use suede-site-alchemy).

scripts/lib/offline-reports.mjs

View on GitHub
import { lstat, mkdir, mkdtemp, realpath, rename, rm, writeFile } from "node:fs/promises";
import path from "node:path";

export function markdownText(value) {
  return String(value ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;")
    .replace(/[\\`*_\[\]()!|]/g, (char) => `&#${char.charCodeAt(0)};`).replace(/[\r\n]+/g, " ");
}

function within(candidate, root) {
  const rel = path.relative(root, candidate);
  return rel === "" || (!rel.startsWith(`..${path.sep}`) && rel !== ".." && !path.isAbsolute(rel));
}

async function physicalPath(target) {
  const tail = [];
  let current = path.resolve(target);
  while (true) {
    try { return path.join(await realpath(current), ...tail.reverse()); }
    catch (error) {
      if (error.code !== "ENOENT") throw error;
      tail.push(path.basename(current));
      const parent = path.dirname(current);
      if (parent === current) throw error;
      current = parent;
    }
  }
}

// New directories only. Report output may live in ignored reports/ or outside
// the repository; resolve existing ancestors before mkdir to protect source.
export async function writeOfflineReports(output, files, repoRoot) {
  const destination = path.resolve(output);
  const root = path.resolve(repoRoot);
  const allowed = path.join(root, "reports");
  const safe = (target, protectedRoot, reportRoot) => {
    if (within(target, protectedRoot) && (!within(target, reportRoot) || target === reportRoot)) {
      throw new Error("Offline reports cannot overwrite source; choose a new reports/ subdirectory or an external directory");
    }
  };
  safe(destination, root, allowed);
  safe(await physicalPath(destination), await realpath(root), path.join(await realpath(root), "reports"));
  try { await lstat(destination); throw new Error(`Output already exists: ${destination}`); }
  catch (error) { if (error.code !== "ENOENT") throw error; }
  const entries = Object.entries(files);
  if (!entries.length || entries.some(([name, contents]) => !/^[a-z0-9][a-z0-9_.-]*$/i.test(name) || typeof contents !== "string")) {
    throw new Error("Offline reports require plain filenames and text contents");
  }
  const parent = path.dirname(destination);
  await mkdir(parent, { recursive: true });
  const scratch = await mkdtemp(path.join(parent, ".seo-review-"));
  try {
    for (const [name, contents] of entries) await writeFile(path.join(scratch, name), contents, { flag: "wx" });
    await rename(scratch, destination);
  } catch (error) { await rm(scratch, { recursive: true, force: true }); throw error; }
  return destination;
}
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall