Skip to content

krusty93/relego / .agents/skills/impeccable

impeccable

Flagged

Use when the user wants to design, redesign, shape, critique, audit, polish, clarify, distill, harden, optimize, adapt, animate, colorize, extract, or otherwise improve a frontend interface. Covers websites, landing pages, dashboards, product UI, app shells, components, forms, settings, onboarding, and empty states. Handles UX review, visual hierarchy, information architecture, cognitive load, accessibility, performance, responsive behavior, theming, anti-patterns, typography, fonts, spacing, layout, alignment, color, motion, micro-interactions, UX copy, error states, edge cases, i18n, and reusable design systems or tokens. Also use for bland designs that need to become bolder or more delightful, loud designs that should become quieter, live browser iteration on UI elements, or ambitious visual effects that should feel technically extraordinary. Not for backend-only or non-UI tasks.

FileKindSize
SKILL.mdskill md10.4 KB
agents/impeccable_asset_producer.tomlconfig9.7 KB
agents/impeccable_documenter.tomlconfig3.2 KB
agents/impeccable_finish_reviewer.tomlconfig13.5 KB
agents/impeccable_manual_edit_applier.tomlconfig6.9 KB
agents/openai.yamlconfig235 B
reference/adapt.mdmarkdown10.1 KB
reference/adapt.native.mdmarkdown3.8 KB
reference/android.mdmarkdown4.0 KB
reference/animate.mdmarkdown5.1 KB
reference/audit.mdmarkdown7.7 KB
reference/audit.native.mdmarkdown8.2 KB
reference/bolder.mdmarkdown3.5 KB
reference/clarify.mdmarkdown4.5 KB
reference/colorize.mdmarkdown4.4 KB
reference/craft-floor.mdmarkdown5.4 KB
reference/craft.mdmarkdown555 B
reference/critique.mdmarkdown44.6 KB
reference/degraded/asset-producer.mdmarkdown9.9 KB
reference/degraded/documenter.mdmarkdown3.3 KB
reference/degraded/finish-reviewer.mdmarkdown13.6 KB
reference/degraded/manual-edit-applier.mdmarkdown7.0 KB
reference/delight.mdmarkdown3.6 KB
reference/distill.mdmarkdown5.6 KB
reference/doctor.mdmarkdown5.3 KB
reference/document.mdmarkdown26.9 KB
reference/extract.mdmarkdown3.4 KB
reference/harden.mdmarkdown8.3 KB
reference/hooks.mdmarkdown12.8 KB
reference/init.mdmarkdown11.2 KB
reference/ios.mdmarkdown3.7 KB
reference/layout.mdmarkdown5.0 KB
reference/live-setup.mdmarkdown7.2 KB
reference/live.mdmarkdown35.0 KB
reference/new-work.mdmarkdown43.1 KB
reference/onboard.mdmarkdown7.6 KB
reference/operate.mdmarkdown4.0 KB
reference/optimize.mdmarkdown7.4 KB
reference/overdrive.mdmarkdown9.0 KB
reference/polish.mdmarkdown5.5 KB
reference/quieter.mdmarkdown4.8 KB
reference/routing.mdmarkdown2.8 KB
reference/shape.mdmarkdown3.5 KB
reference/typeset.mdmarkdown5.1 KB
reference/visualize.mdmarkdown16.3 KB
scripts/command-metadata.jsonconfig7.7 KB
scripts/concept-seed.mjsscript38.7 KB
scripts/context-signals.mjsscript13.7 KB
scripts/context.mjsscript63.6 KB
scripts/critique-storage.mjsscript8.3 KB
scripts/detect-csp.mjsscript6.6 KB
scripts/detect.mjsscript620 B
scripts/detector/browser/injected/index.mjsscript89.0 KB
scripts/detector/cli/main.mjsscript18.5 KB
scripts/detector/design-system.mjsscript48.5 KB
scripts/detector/detect-antipatterns-browser.jsscript388.1 KB
scripts/detector/detect-antipatterns.mjsscript1.8 KB
scripts/detector/engines/browser/detect-url.mjsscript15.8 KB
scripts/detector/engines/regex/detect-text.mjsscript52.1 KB
scripts/detector/engines/static-html/css-cascade.mjsscript44.9 KB
scripts/detector/engines/static-html/detect-html.mjsscript13.0 KB
scripts/detector/engines/visual/screenshot-contrast.mjsscript6.4 KB
scripts/detector/findings.mjsscript766 B
scripts/detector/node/file-system.mjsscript7.6 KB
scripts/detector/profile/profiler.mjsscript4.4 KB
scripts/detector/registry/antipatterns.mjsscript27.2 KB
scripts/detector/rules/checks.mjsscript248.7 KB
scripts/detector/shared/color.mjsscript23.0 KB
scripts/detector/shared/constants.mjsscript4.6 KB
scripts/detector/shared/fonts.mjsscript852 B
scripts/detector/shared/inline-ignores.mjsscript6.0 KB
scripts/detector/shared/page.mjsscript252 B
scripts/doctor.mjsscript11.3 KB
scripts/embed-prompt.mjsscript7.7 KB
scripts/generate-image.mjsscript11.2 KB
scripts/hook-admin.mjsscript30.9 KB
scripts/hook-before-edit.mjsscript19.6 KB
scripts/hook-lib.mjsscript100.5 KB
scripts/hook.mjsscript2.7 KB
scripts/lib/artifact-schema.mjsscript3.8 KB
scripts/lib/composition-catalog.mjsscript10.0 KB
scripts/lib/concept-catalog.mjsscript19.4 KB
scripts/lib/design-parser.mjsscript26.8 KB
scripts/lib/impeccable-config.mjsscript21.8 KB
scripts/lib/impeccable-paths.mjsscript4.9 KB
scripts/lib/is-generated.mjsscript2.4 KB
scripts/lib/live-path-globs.mjsscript847 B
scripts/lib/open-system-browser.mjsscript848 B
scripts/lib/provider.mjsscript327 B
scripts/lib/roll-selection.mjsscript17.4 KB
scripts/lib/staleness-deep.mjsscript20.9 KB
scripts/lib/staleness-notice.mjsscript6.5 KB
scripts/lib/staleness.mjsscript22.9 KB
scripts/lib/surface-briefs.mjsscript6.0 KB
scripts/lib/target-args.mjsscript1.1 KB
scripts/lib/target-slug.mjsscript1.0 KB
scripts/lib/template-extensions.mjsscript5.3 KB
scripts/live-accept.mjsscript35.0 KB
scripts/live-browser-dom.jsscript4.2 KB
scripts/live-browser-ignores.jsscript10.1 KB
scripts/live-browser-session.jsscript3.2 KB
scripts/live-browser.jsscript490.4 KB
scripts/live-commit-manual-edits.mjsscript39.9 KB
scripts/live-complete.mjsscript4.7 KB
scripts/live-copy-edit-agent.mjsscript32.7 KB
scripts/live-discard-manual-edits.mjsscript1.6 KB
scripts/live-inject.mjsscript17.2 KB
scripts/live-insert.mjsscript9.8 KB
scripts/live-manual-edit-evidence.mjsscript11.6 KB
scripts/live-poll.mjsscript15.8 KB
scripts/live-resume.mjsscript6.0 KB
scripts/live-server.mjsscript67.9 KB
scripts/live-status.mjsscript2.6 KB
scripts/live-target.mjsscript934 B
scripts/live-wrap.mjsscript38.2 KB
scripts/live.mjsscript12.6 KB
scripts/live/accept-css.mjsscript22.0 KB
scripts/live/accept-verify.mjsscript2.7 KB
scripts/live/browser-script-parts.mjsscript3.6 KB
scripts/live/completion.mjsscript1.4 KB
scripts/live/event-validation.mjsscript9.4 KB
scripts/live/frameworks/astro.mjsscript1.7 KB
scripts/live/frameworks/detect-utils.mjsscript2.1 KB
scripts/live/frameworks/index.mjsscript5.7 KB
scripts/live/frameworks/journal.mjsscript7.0 KB
scripts/live/frameworks/nextjs.mjsscript1.7 KB
scripts/live/frameworks/nuxt.mjsscript5.1 KB
scripts/live/frameworks/script-src.mjsscript699 B
scripts/live/frameworks/static-html.mjsscript656 B
scripts/live/frameworks/sveltekit.mjsscript1.8 KB
scripts/live/frameworks/tag-strategy.mjsscript10.6 KB
scripts/live/frameworks/tanstack-start.mjsscript1.6 KB
scripts/live/frameworks/vite-generic.mjsscript1.3 KB
scripts/live/generation-preflight.mjsscript5.8 KB
scripts/live/insert-ui.mjsscript15.3 KB
scripts/live/instructions.mjsscript12.9 KB
scripts/live/manual-apply.mjsscript34.1 KB
scripts/live/manual-edit-routes.mjsscript14.6 KB
scripts/live/manual-edits-buffer.mjsscript5.0 KB
scripts/live/poll-lanes.mjsscript759 B
scripts/live/project-ignores.mjsscript6.3 KB
scripts/live/roots.mjsscript20.4 KB
scripts/live/session-store.mjsscript22.4 KB
scripts/live/source-lock.mjsscript3.6 KB
scripts/live/source-search.mjsscript4.2 KB
scripts/live/svelte-ast.mjsscript38.2 KB
scripts/live/svelte-component.mjsscript51.1 KB
scripts/live/sveltekit-adapter.mjsscript10.7 KB
scripts/live/tanstack-adapter.mjsscript9.1 KB
scripts/live/ui-surfaces.mjsscript3.5 KB
scripts/live/vocabulary.mjsscript7.0 KB
scripts/modern-screenshot.umd.jsscript28.6 KB
scripts/palette.mjsscript55.5 KB
scripts/pin.mjsscript6.5 KB
scripts/serve-question.mjsscript118.9 KB
scripts/surface-brief.mjsscript2.5 KB

scripts/live/frameworks/journal.mjs

View on GitHub
/**
 * Crash-safe injection journal.
 *
 * Injection writes into the user's source tree: generated components, a Nuxt
 * client plugin, marker blocks inside a layout, a patched CSP meta tag. The
 * clean path removes all of it on stop. The unclean paths do not:
 *
 *   - the dev server is SIGKILLed, so `--remove` never runs;
 *   - the project changes shape between start and stop (a nuxt.config appears,
 *     a package.json is edited), so detection resolves a different framework
 *     and the old framework's artifacts are nobody's business;
 *   - stop runs from a different directory than start did.
 *
 * So every inject records what it wrote to `.impeccable/live/inject-journal.json`
 * before the next one runs, and both inject and `--remove` reconcile that
 * record against the tree.
 *
 * **The journal is a claim of ownership, not a to-do list.** Healing an
 * artifact only ever removes what still carries our marker; a generated file
 * the user has since replaced, or a layout they have since un-patched by hand,
 * is dropped from the journal untouched.
 *
 * **Path resolution is appRoot-relative.** Live entry scripts chdir onto the
 * roots manifest (`enterLiveRoot`) before doing anything, so a journal written
 * by a session started in the app root is found by a stop issued from any
 * directory inside the repo.
 */

import fs from 'node:fs';
import path from 'node:path';
import { PATCH_UNDOERS } from './index.mjs';

export const INJECT_JOURNAL_VERSION = 1;
export const INJECT_JOURNAL_RELPATH = '.impeccable/live/inject-journal.json';

export function injectJournalPath(cwd = process.cwd()) {
  return path.join(cwd, ...INJECT_JOURNAL_RELPATH.split('/'));
}

export function readInjectJournal(cwd = process.cwd()) {
  const file = injectJournalPath(cwd);
  let raw;
  try {
    raw = JSON.parse(fs.readFileSync(file, 'utf-8'));
  } catch {
    return null;
  }
  if (!raw || typeof raw !== 'object' || !Array.isArray(raw.artifacts)) return null;
  return raw;
}

export function clearInjectJournal(cwd = process.cwd()) {
  try { fs.unlinkSync(injectJournalPath(cwd)); } catch { /* already gone */ }
}

function writeInjectJournal(cwd, journal) {
  const file = injectJournalPath(cwd);
  fs.mkdirSync(path.dirname(file), { recursive: true });
  fs.writeFileSync(file, JSON.stringify(journal, null, 2) + '\n', 'utf-8');
  return file;
}

/**
 * Record the artifacts an injection just wrote. Replaces any previous record:
 * callers heal first (see healInjectJournal), so nothing survivable is lost.
 */
export function recordInjection(cwd = process.cwd(), { framework, port, artifacts = [] } = {}) {
  if (!artifacts.length) {
    clearInjectJournal(cwd);
    return null;
  }
  return writeInjectJournal(cwd, {
    version: INJECT_JOURNAL_VERSION,
    appRoot: path.resolve(cwd),
    framework: framework || null,
    port: Number.isFinite(Number(port)) ? Number(port) : null,
    pid: process.pid,
    recordedAt: new Date().toISOString(),
    artifacts,
  });
}

function normalizeRel(cwd, rel) {
  return path.resolve(cwd, String(rel || '')).split(path.sep).join('/');
}

function readIfPresent(abs) {
  try {
    return fs.readFileSync(abs, 'utf-8');
  } catch {
    return null;
  }
}

function pruneEmptyDirs(dir, stopDir) {
  let current = path.resolve(dir);
  const stop = path.resolve(stopDir);
  while (current !== stop && current.startsWith(stop + path.sep)) {
    try {
      if (fs.readdirSync(current).length > 0) return;
      fs.rmdirSync(current);
    } catch {
      return;
    }
    current = path.dirname(current);
  }
}

function insideProject(cwd, abs) {
  const rel = path.relative(path.resolve(cwd), path.resolve(abs));
  return rel !== '' && !rel.startsWith('..') && !path.isAbsolute(rel);
}

function healArtifact(cwd, artifact, undoers) {
  const abs = path.resolve(cwd, artifact.path);
  // The journal is a project-local file, i.e. attacker-writable input in a
  // cloned repo. Never touch anything outside the project tree, whatever the
  // journal claims to own.
  if (!insideProject(cwd, abs)) return { path: artifact.path, action: 'refused_outside_project' };
  const content = readIfPresent(abs);
  if (content === null) return { path: artifact.path, action: 'absent' };

  if (artifact.kind === 'created') {
    // Only reclaim a generated file that still carries our marker; a created
    // artifact with no marker at all is unverifiable and stays untouched.
    if (!artifact.marker || !content.includes(artifact.marker)) {
      return { path: artifact.path, action: 'disowned' };
    }
    try { fs.rmSync(abs, { force: true }); } catch { return null; }
    if (artifact.pruneTo !== undefined) {
      const pruneRoot = path.resolve(cwd, artifact.pruneTo || '.');
      if (insideProject(cwd, pruneRoot) || pruneRoot === path.resolve(cwd)) {
        pruneEmptyDirs(path.dirname(abs), pruneRoot);
      }
    }
    return { path: artifact.path, action: 'removed' };
  }

  if (artifact.kind === 'patched') {
    const markers = Array.isArray(artifact.markers) ? artifact.markers : [];
    // No marker left means the patch is already gone; never run an undo over
    // a file we no longer recognize (the undoers normalize whitespace).
    if (markers.length && !markers.some((marker) => content.includes(marker))) {
      return { path: artifact.path, action: 'disowned' };
    }
    const undo = undoers[artifact.patch];
    if (typeof undo !== 'function') return null;
    const next = undo(content);
    if (next === content) return { path: artifact.path, action: 'disowned' };
    try { fs.writeFileSync(abs, next, 'utf-8'); } catch { return null; }
    return { path: artifact.path, action: 'unpatched' };
  }

  return null;
}

/**
 * Reconcile the journal against the tree.
 *
 * `keep` is the set of paths the current operation legitimately owns — the
 * artifacts an inject is about to (re)write. Everything else in the journal is
 * an orphan of a session that is gone, and gets healed. This keeps a repeat
 * inject byte-idempotent: the artifacts it is about to rewrite are kept, not
 * torn down and rebuilt.
 *
 * Returns `{ healed, kept }`. `healed` lists only artifacts whose file was
 * actually changed or removed, so callers can stay silent when nothing was
 * orphaned. Idempotent: a second call finds an empty journal.
 */
export function healInjectJournal(cwd = process.cwd(), { keep = [], undoers = PATCH_UNDOERS } = {}) {
  const journal = readInjectJournal(cwd);
  if (!journal) return { healed: [], kept: [] };

  const keepSet = new Set(keep.map((rel) => normalizeRel(cwd, rel)));
  const healed = [];
  const kept = [];

  for (const artifact of journal.artifacts) {
    if (!artifact || typeof artifact.path !== 'string') continue;
    if (keepSet.has(normalizeRel(cwd, artifact.path))) {
      kept.push(artifact);
      continue;
    }
    const outcome = healArtifact(cwd, artifact, undoers);
    if (outcome && (outcome.action === 'removed' || outcome.action === 'unpatched')) {
      healed.push(outcome);
    }
  }

  if (kept.length) {
    writeInjectJournal(cwd, { ...journal, artifacts: kept });
  } else {
    clearInjectJournal(cwd);
  }

  return { healed, kept };
}
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