Index of every page on this site: llms.txt
All skills
tale-project avatar

/visual-aspect-analyzer

@02b23bc
by Taletale-project/tale47 stars
10
Run it yourself

Run this as the FINAL review step once you have finished a UI change you can load in a browser — it is the visual-regression gate, run once at the end (not after every edit), and the change is not done until it reports `score: 100`. It drives a real browser over the page, auto-detects its relevant elements (no selectors), labels each by ARIA role + accessible name, and reports which changed the rendered frame, what each is anchored to (screen/page/ancestor), and what transition defects (layout-shift, flicker, jank, dithering) occurred, with a 0–100 score. Run `bun src/analyze-cli.ts <url>` for a lean JSON report (`--full` for the faithful record). Also read before resolving what an element is anchored to, or editing the instrument, analysis, or element auto-detection in this directory.

  • 73 files
  • 505.3 KB
  • Updated 4 months ago
  • GitHub
Use this Skill: https://skilld.dev/gh/tale-project/tale/visual-aspect-analyzer

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

examplesrun.md

≈1.1k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Running the analyzer

Turnkey CLI (live url → report) — the agent path

bun install
bunx playwright install chromium   # one-time browser download

# Analyze a live page — the instrument auto-detects its relevant elements
bun src/analyze-cli.ts https://example.com

No build step — Bun runs the TypeScript directly and bundles the in-page instrument in memory. Everything that improves results is on by default: pixel capture (dithering + the paint counterfactual) and auto-scroll (lazy content + CLS) always run.

  • stdout is the lean, AI-optimized JSON report — coalesced defects, rounded numbers, no noise (pipe it, save it, parse it). --full swaps in the faithful Report. Redirect stdout with your shell to save it to a file.
  • The health summary (score, worst defects, hints) always prints to stderr, so stdout stays pure JSON.
  • The only flag is --full (the faithful Report). There are no selectors — the instrument auto-detects the page's relevant elements (scored component roots + media + active elements) and labels each by its role "name".
  • With no browser installed it prints the install command and exits non-zero.
  • Every run reports an audit block (discovered, capped). A purely-decorative static element with no role, interactivity, media, or component-name hint carries no signal and so may not be auto-detected — give it a role/recognizable class/data-* if you need it.

Offline (no browser): re-analyze a recording

bun src/cli.ts examples/sample-recording.json          # lean compact report
bun src/cli.ts examples/sample-recording.json --full   # the faithful Report

sample-recording.json is a four-frame session where #promo grows and pushes footer down; the compact sample-report.json shows footer as source: "affected", affectedBy: ["va-block"], a coalesced layout-shift defect with its metrics (a top-level hints map carries the per-type fix), and the footer's move transition marked smoothness: "shift" with a quality score (92/100). It's a whole-page audit (note the audit block), so each element carries a label from its ARIA role + accessible name — here banner "Promo" and contentinfo "Site footer" — shown alongside the precise selector. Each element also carries its settled to box ([left, top, width, height], page coords) and a from box — here #promo grows in place and footer's box slides down — so you get the position and bounding box, not just that it moved. --full keeps the raw start/end box in both coordinate spaces under bounds. Transitions with enough frames also carry an easing label (linear/ease-in/ease-out/ease-in-out) approximating how the element moves; the footer's two-frame jump here is too abrupt to classify, so it has none.

Embedding the driver

Any Playwright-shaped page satisfies the structural PageLike (the repo's Browserbase browse tooling works too — no hard Playwright dependency):

import { buildInstrumentBundle } from '../src/bundle';
import { analyzeSession } from '../src/driver';

const report = await analyzeSession(page, {
  url: 'https://example.com/',
  instrumentBundle: await buildInstrumentBundle(), // Bun bundles it in memory
  keyframes: 5,
  settleMs: 200,
  capturePixels: true,
  interact: async (p) => {
    await p.evaluate('window.scrollTo(0, 1200)');
  },
});

analyzeSession injects the instrument on every navigation (so it survives full reloads), drives keyframe sweeps, captures screenshots for the pixel pipeline, pulls __VA.dump(), validates it, and returns the Report.

Verifying

  • bun test — the analysis engine, the instrument (happy-dom), and the pixel helpers.
  • bun run typecheck — strict, no-any gate.
  • bun run e2e — drives tests/fixtures/*.html in real Chromium under auto-detection and asserts the report: fixed nav → screen anchor, promo → affected footer + layout-shift, cascade → affected items (absolute #floating not), overlay → flicker, canvas → dithering, spa → two segments, transparent veil → paint counterfactual. Skips cleanly when no browser is installed.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 02b23bc. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 4 months ago

README badge

README badge for tale-project/tale/visual-aspect-analyzer