Skip to content

dvy1987/agent-loom / .agents/skills/design-review

design-review

Verified

Review a built frontend against its chosen direction, catch drift back to generic AI defaults, enforce state coverage, ethical patterns, UX heuristics, and polish, and check contrast with APCA (not the legacy WCAG ratio). Produces specific, prioritized fixes — never vibes-based feedback. Works with pasted screenshots or Playwright MCP automated capture. Load when the user asks to review a UI, audit a design, check if a frontend looks generic or vibecoded, evaluate visual quality or polish, says "review this UI", "is this design good", "audit my frontend", "does this feel like [product]", "design QA", or when frontend-design routes here. Sub-skill of frontend-design.

scripts/apca.mjs

View on GitHub
#!/usr/bin/env node
// APCA contrast (APCA-W3 0.1.9 constants). Perceptual; accurate on dark themes + thin type.
// Usage:
//   node apca.mjs "#1A1A1A" "#FAFAF7"        -> prints Lc for text=#1A1A1A on bg=#FAFAF7
//   node apca.mjs --check pairs.json          -> [{ "name":"body", "text":"#..", "bg":"#..", "min":75 }]
// Targets: body Lc>=75, large/bold Lc>=45, non-text UI Lc>=30.

const mainTRC = 2.4;
const Rco = 0.2126729, Gco = 0.7151522, Bco = 0.072175;
const normBG = 0.56, normTXT = 0.57, revTXT = 0.62, revBG = 0.65;
const blkThrs = 0.022, blkClmp = 1.414, scale = 1.14;
const loOffset = 0.027, deltaYmin = 0.0005, loClip = 0.1;

function hexToRgb(hex) {
  const h = hex.replace("#", "").trim();
  const full = h.length === 3 ? h.split("").map((c) => c + c).join("") : h;
  if (full.length !== 6 || /[^0-9a-fA-F]/.test(full)) throw new Error(`bad hex: ${hex}`);
  return [0, 2, 4].map((i) => parseInt(full.slice(i, i + 2), 16));
}

function sRGBtoY([r, g, b]) {
  const lin = (v) => Math.pow(v / 255, mainTRC);
  return Rco * lin(r) + Gco * lin(g) + Bco * lin(b);
}

export function apca(textHex, bgHex) {
  let txtY = sRGBtoY(hexToRgb(textHex));
  let bgY = sRGBtoY(hexToRgb(bgHex));
  txtY = txtY > blkThrs ? txtY : txtY + Math.pow(blkThrs - txtY, blkClmp);
  bgY = bgY > blkThrs ? bgY : bgY + Math.pow(blkThrs - bgY, blkClmp);
  if (Math.abs(bgY - txtY) < deltaYmin) return 0;
  let out;
  if (bgY > txtY) {
    const sapc = (Math.pow(bgY, normBG) - Math.pow(txtY, normTXT)) * scale;
    out = sapc < loClip ? 0 : sapc - loOffset;
  } else {
    const sapc = (Math.pow(bgY, revBG) - Math.pow(txtY, revTXT)) * scale;
    out = sapc > -loClip ? 0 : sapc + loOffset;
  }
  return Math.round(out * 100 * 10) / 10;
}

const args = process.argv.slice(2);
if (args[0] === "--check" && args[1]) {
  const fs = await import("node:fs");
  const pairs = JSON.parse(fs.readFileSync(args[1], "utf8"));
  let failed = 0;
  for (const p of pairs) {
    const lc = Math.abs(apca(p.text, p.bg));
    const min = p.min ?? 75;
    const ok = lc >= min;
    if (!ok) failed++;
    console.log(`${ok ? "PASS" : "FAIL"}  Lc ${lc}  (min ${min})  ${p.name ?? ""}  ${p.text} on ${p.bg}`);
  }
  console.log(`\n${failed === 0 ? "All pairs pass." : `${failed} pair(s) FAILED.`}`);
  process.exit(failed === 0 ? 0 : 1);
} else if (args.length >= 2) {
  console.log(`Lc ${apca(args[0], args[1])}  (text ${args[0]} on bg ${args[1]})`);
} else {
  console.log('Usage: node apca.mjs "#text" "#bg"   |   node apca.mjs --check pairs.json');
  process.exit(1);
}
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: 471kUpdated 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: 471kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 471kUpdated 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