Skip to content

gaia-research/gaia-skill-tree / .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 md21.9 KB
agents/impeccable_asset_producer.tomlconfig8.1 KB
agents/impeccable_manual_edit_applier.tomlconfig6.9 KB
agents/openai.yamlconfig235 B
reference/adapt.mdmarkdown9.9 KB
reference/animate.mdmarkdown10.2 KB
reference/audit.mdmarkdown7.1 KB
reference/bolder.mdmarkdown6.4 KB
reference/brand.mdmarkdown10.3 KB
reference/clarify.mdmarkdown10.4 KB
reference/codex.mdmarkdown6.8 KB
reference/colorize.mdmarkdown13.3 KB
reference/craft.mdmarkdown11.7 KB
reference/critique.mdmarkdown38.6 KB
reference/delight.mdmarkdown9.6 KB
reference/distill.mdmarkdown5.6 KB
reference/document.mdmarkdown27.3 KB
reference/extract.mdmarkdown3.4 KB
reference/harden.mdmarkdown8.4 KB
reference/hooks.mdmarkdown7.4 KB
reference/init.mdmarkdown12.7 KB
reference/interaction-design.mdmarkdown6.4 KB
reference/layout.mdmarkdown8.5 KB
reference/live.mdmarkdown58.5 KB
reference/onboard.mdmarkdown7.6 KB
reference/optimize.mdmarkdown7.4 KB
reference/overdrive.mdmarkdown8.9 KB
reference/polish.mdmarkdown12.7 KB
reference/product.mdmarkdown3.7 KB
reference/quieter.mdmarkdown4.8 KB
reference/shape.mdmarkdown11.3 KB
reference/typeset.mdmarkdown13.9 KB
scripts/cleanup-deprecated.mjsscript8.9 KB
scripts/command-metadata.jsonconfig7.8 KB
scripts/context-signals.mjsscript7.9 KB
scripts/context.mjsscript9.7 KB
scripts/critique-storage.mjsscript8.8 KB
scripts/design-parser.mjsscript218 B
scripts/detect-csp.mjsscript6.6 KB
scripts/detect.mjsscript620 B
scripts/detector/browser/injected/index.mjsscript67.2 KB
scripts/detector/cli/main.mjsscript9.5 KB
scripts/detector/design-system.mjsscript24.1 KB
scripts/detector/detect-antipatterns-browser.jsscript187.9 KB
scripts/detector/detect-antipatterns.mjsscript1.6 KB
scripts/detector/engines/browser/detect-url.mjsscript8.6 KB
scripts/detector/engines/regex/detect-text.mjsscript22.8 KB
scripts/detector/engines/static-html/css-cascade.mjsscript32.9 KB
scripts/detector/engines/static-html/detect-html.mjsscript8.9 KB
scripts/detector/engines/visual/screenshot-contrast.mjsscript6.4 KB
scripts/detector/findings.mjsscript363 B
scripts/detector/node/file-system.mjsscript6.7 KB
scripts/detector/profile/profiler.mjsscript4.4 KB
scripts/detector/registry/antipatterns.mjsscript16.9 KB
scripts/detector/rules/checks.mjsscript98.3 KB
scripts/detector/shared/color.mjsscript4.4 KB
scripts/detector/shared/constants.mjsscript4.1 KB
scripts/detector/shared/page.mjsscript252 B
scripts/hook-admin.mjsscript22.8 KB
scripts/hook-before-edit.mjsscript16.2 KB
scripts/hook-lib.mjsscript54.7 KB
scripts/hook.mjsscript2.0 KB
scripts/impeccable-paths.mjsscript3.8 KB
scripts/is-generated.mjsscript2.2 KB
scripts/lib/design-parser.mjsscript25.2 KB
scripts/lib/impeccable-config.mjsscript21.0 KB
scripts/lib/impeccable-paths.mjsscript3.8 KB
scripts/lib/is-generated.mjsscript2.2 KB
scripts/live-accept.mjsscript29.6 KB
scripts/live-browser-dom.jsscript4.2 KB
scripts/live-browser-session.jsscript3.2 KB
scripts/live-browser.jsscript395.7 KB
scripts/live-commit-manual-edits.mjsscript41.1 KB
scripts/live-complete.mjsscript2.9 KB
scripts/live-completion.mjsscript969 B
scripts/live-copy-edit-agent.mjsscript28.2 KB
scripts/live-discard-manual-edits.mjsscript1.6 KB
scripts/live-event-validation.mjsscript269 B
scripts/live-inject.mjsscript21.1 KB
scripts/live-insert-ui.mjsscript15.3 KB
scripts/live-insert.mjsscript8.9 KB
scripts/live-manual-edit-evidence.mjsscript11.4 KB
scripts/live-manual-edits-buffer.mjsscript5.0 KB
scripts/live-poll.mjsscript13.2 KB
scripts/live-resume.mjsscript4.4 KB
scripts/live-server.mjsscript87.2 KB
scripts/live-session-store.mjsscript10.4 KB
scripts/live-status.mjsscript2.1 KB
scripts/live-svelte-component.mjsscript27.2 KB
scripts/live-sveltekit-adapter.mjsscript9.1 KB
scripts/live-ui-core.mjsscript5.4 KB
scripts/live-wrap.mjsscript35.1 KB
scripts/live.mjsscript8.3 KB
scripts/live/browser-script-parts.mjsscript1.7 KB
scripts/live/completion.mjsscript969 B
scripts/live/event-validation.mjsscript6.2 KB
scripts/live/insert-ui.mjsscript15.3 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/session-store.mjsscript10.4 KB
scripts/live/svelte-component.mjsscript27.2 KB
scripts/live/sveltekit-adapter.mjsscript9.1 KB
scripts/live/ui-core.mjsscript5.4 KB
scripts/live/vocabulary.mjsscript3.2 KB
scripts/modern-screenshot.umd.jsscript28.6 KB
scripts/palette.mjsscript56.9 KB
scripts/pin.mjsscript6.0 KB

scripts/live-insert.mjs

View on GitHub
/**
 * CLI helper: find an anchor element in source and splice an insert-variant
 * wrapper before or after it (no original variant — net-new content).
 *
 * Usage:
 *   node live-insert.mjs --id SESSION_ID --count N --position after \
 *     --classes "hero" --tag section [--file path]
 */

import fs from 'node:fs';
import path from 'node:path';
import { isGeneratedFile } from './is-generated.mjs';
import {
  buildSearchQueries,
  findElement,
  findAllElements,
  filterByText,
  findFileWithQuery,
  detectCommentSyntax,
  detectStyleMode,
  buildCssAuthoring,
  buildCssSelectorPrefixExamples,
} from './live-wrap.mjs';
import {
  buildSvelteComponentCssAuthoring,
  scaffoldSvelteComponentInsertSession,
  shouldUseSvelteComponentInjection,
} from './live-svelte-component.mjs';

const INSERT_POSITIONS = new Set(['before', 'after']);

export function isInsertPosition(value) {
  return INSERT_POSITIONS.has(value);
}

export function computeInsertLine(startLine, endLine, position) {
  return position === 'before' ? startLine : endLine + 1;
}

export function buildInsertWrapperLines({ id, count, indent, commentSyntax, isJsx }) {
  const styleContents = isJsx ? 'style={{ display: "contents" }}' : 'style="display: contents"';
  const attrs =
    'data-impeccable-variants="' + id + '" ' +
    'data-impeccable-mode="insert" ' +
    'data-impeccable-variant-count="' + count + '" ' +
    styleContents;

  if (isJsx) {
    return [
      indent + '<div ' + attrs + '>',
      indent + '  ' + commentSyntax.open + ' impeccable-variants-start ' + id + ' ' + commentSyntax.close,
      indent + '  ' + commentSyntax.open + ' Variants: insert below this line ' + commentSyntax.close,
      indent + '  ' + commentSyntax.open + ' impeccable-variants-end ' + id + ' ' + commentSyntax.close,
      indent + '</div>',
    ];
  }

  return [
    indent + commentSyntax.open + ' impeccable-variants-start ' + id + ' ' + commentSyntax.close,
    indent + '<div ' + attrs + '>',
    indent + '  ' + commentSyntax.open + ' Variants: insert below this line ' + commentSyntax.close,
    indent + '</div>',
    indent + commentSyntax.open + ' impeccable-variants-end ' + id + ' ' + commentSyntax.close,
  ];
}

function argVal(args, flag) {
  const idx = args.indexOf(flag);
  return idx !== -1 && idx + 1 < args.length ? args[idx + 1] : null;
}

function resolveElementMatch({ lines, queries, tag, text }) {
  if (text) {
    const candidates = [];
    for (const q of queries) {
      const all = findAllElements(lines, q, tag);
      for (const c of all) {
        if (!candidates.some((x) => x.startLine === c.startLine)) candidates.push(c);
      }
      if (candidates.length === 1) break;
    }
    if (candidates.length === 0) return { error: 'element_not_found' };
    if (candidates.length === 1) return { match: candidates[0] };
    const filtered = filterByText(candidates, lines, text);
    if (filtered.length === 1) return { match: filtered[0] };
    if (filtered.length === 0) return { match: candidates[0] };
    return { error: 'element_ambiguous', candidates: filtered };
  }

  for (const q of queries) {
    const match = findElement(lines, q, tag);
    if (match) return { match };
  }
  return { error: 'element_not_found' };
}

export async function insertCli() {
  const args = process.argv.slice(2);

  if (args.includes('--help') || args.includes('-h')) {
    console.log(`Usage: node live-insert.mjs [options]

Find an anchor element in source and splice an insert-variant wrapper.

Required:
  --id ID            Session ID for the variant wrapper
  --count N          Number of expected variants (1-8)
  --position POS     before | after (relative to the anchor element)

Element identification (at least one required):
  --element-id ID    HTML id attribute of the anchor element
  --classes A,B,C    Comma-separated CSS class names
  --tag TAG          Tag name (div, section, etc.)
  --query TEXT       Fallback: raw text to search for

Optional:
  --file PATH        Source file to search in (skips auto-detection)
  --text TEXT        Anchor textContent for disambiguation (~80 chars)

Output (JSON):
  { mode: "insert", file, position, insertLine, commentSyntax, styleMode, styleTag, cssAuthoring }`);
    process.exit(0);
  }

  const id = argVal(args, '--id');
  const count = parseInt(argVal(args, '--count') || '3', 10);
  const position = argVal(args, '--position');
  const elementId = argVal(args, '--element-id');
  const classes = argVal(args, '--classes');
  const tag = argVal(args, '--tag');
  const query = argVal(args, '--query');
  const filePath = argVal(args, '--file');
  const text = argVal(args, '--text');

  if (!id) { console.error('Missing --id'); process.exit(1); }
  if (!position) { console.error('Missing --position (before | after)'); process.exit(1); }
  if (!isInsertPosition(position)) { console.error('Invalid --position: ' + position); process.exit(1); }
  if (!elementId && !classes && !query) {
    console.error('Need at least one of: --element-id, --classes, --query');
    process.exit(1);
  }

  const queries = buildSearchQueries(elementId, classes, tag, query);
  const genOpts = { cwd: process.cwd() };

  let targetFile = filePath;
  if (!targetFile) {
    for (const q of queries) {
      targetFile = findFileWithQuery(q, process.cwd(), genOpts);
      if (targetFile) break;
    }
    if (!targetFile) {
      let generatedHit = null;
      for (const q of queries) {
        generatedHit = findFileWithQuery(q, process.cwd(), { ...genOpts, includeGenerated: true });
        if (generatedHit) break;
      }
      console.error(JSON.stringify({
        error: generatedHit ? 'element_not_in_source' : 'element_not_found',
        fallback: 'agent-driven',
        hint: 'See "Handle fallback" in live.md.',
      }));
      process.exit(1);
    }
  } else if (isGeneratedFile(targetFile, genOpts)) {
    console.error(JSON.stringify({
      error: 'file_is_generated',
      fallback: 'agent-driven',
      file: path.relative(process.cwd(), path.resolve(process.cwd(), targetFile)),
    }));
    process.exit(1);
  }

  const content = fs.readFileSync(targetFile, 'utf-8');
  const lines = content.split('\n');
  const resolved = resolveElementMatch({ lines, queries, tag, text });

  if (resolved.error === 'element_ambiguous') {
    console.error(JSON.stringify({
      error: 'element_ambiguous',
      fallback: 'agent-driven',
      file: path.relative(process.cwd(), targetFile),
      candidates: resolved.candidates.map((c) => ({
        startLine: c.startLine + 1,
        endLine: c.endLine + 1,
      })),
    }));
    process.exit(1);
  }
  if (!resolved.match) {
    console.error(JSON.stringify({ error: 'element_not_found', fallback: 'agent-driven' }));
    process.exit(1);
  }

  const { startLine, endLine } = resolved.match;
  const commentSyntax = detectCommentSyntax(targetFile);
  const styleMode = detectStyleMode(targetFile);
  const isJsx = commentSyntax.open === '{/*';
  const spliceIndex = computeInsertLine(startLine, endLine, position);
  const relTargetFile = path.relative(process.cwd(), targetFile).split(path.sep).join('/');

  if (shouldUseSvelteComponentInjection(targetFile)) {
    const session = scaffoldSvelteComponentInsertSession({
      id,
      count,
      sourceFile: relTargetFile,
      insertLine: spliceIndex + 1,
      position,
      anchorStartLine: startLine + 1,
      anchorEndLine: endLine + 1,
      anchorLines: lines.slice(startLine, endLine + 1),
      cwd: process.cwd(),
    });
    console.log(JSON.stringify({
      mode: 'insert',
      position,
      file: session.manifestFile,
      sourceFile: relTargetFile,
      previewMode: 'svelte-component',
      componentDir: session.componentDir,
      propContract: session.propContract,
      insertLine: 1,
      sourceInsertLine: spliceIndex + 1,
      anchorStartLine: startLine + 1,
      anchorEndLine: endLine + 1,
      commentSyntax,
      styleMode: 'svelte-component',
      styleTag: null,
      cssSelectorPrefixExamples: [],
      cssAuthoring: buildSvelteComponentCssAuthoring(count),
    }));
    return;
  }

  const indent = lines[spliceIndex]?.match(/^(\s*)/)?.[1]
    ?? lines[startLine]?.match(/^(\s*)/)?.[1]
    ?? '';

  const wrapperLines = buildInsertWrapperLines({
    id,
    count,
    indent,
    commentSyntax,
    isJsx,
  });

  const newLines = [
    ...lines.slice(0, spliceIndex),
    ...wrapperLines,
    ...lines.slice(spliceIndex),
  ];
  fs.writeFileSync(targetFile, newLines.join('\n'), 'utf-8');

  const insertLine = spliceIndex + 3;

  console.log(JSON.stringify({
    mode: 'insert',
    position,
    file: relTargetFile,
    insertLine: insertLine + 1,
    commentSyntax,
    styleMode: styleMode.mode,
    styleTag: styleMode.styleTag,
    cssSelectorPrefixExamples: buildCssSelectorPrefixExamples(styleMode.mode, count),
    cssAuthoring: buildCssAuthoring(styleMode, count),
  }));
}

const _running = process.argv[1];
if (_running?.endsWith('live-insert.mjs') || _running?.endsWith('live-insert.mjs/')) {
  insertCli();
}
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