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.

srcdefectstransition-defects.md

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

Transition defects — detection & report shape

Read when changing the detectors in src/defects/ — transitions (intervals + kind), jank, flicker, dithering, and analyze (the orchestrator) — or the report schema in types.ts. This is the answer to "how do we optimally check flaws in transitions, and how do we show them in the JSON report."

Find the transition first, then judge it

A defect outside a transition is noise; a transition is where smoothness is meaningful. transitionIntervals finds maximal runs of frames where geometry or opacity is changing, then each run is scored. Two disambiguations keep the motion detector honest:

  • Motion is a whole-box translation in both screen and page coordinates. Pure scroll translates the box in only one space, so smooth scrolling never reads as motion or jank.
  • A size change alone is never motion. Motion is measured from the shift two opposite edges share in the same direction, not from the top-left corner — so a width/height change (top-left-, bottom-right-, or centre-anchored) has zero translation and reads as a resize, never motion (and so never jank).

Each interval is typed move | resize | fade | composite.

Each defect from the source that can actually see it

Defect Source Rule
layout-shift PerformanceObserver layout-shift Read the entry; never recompute CLS. Keep sources touching a survivor; skip hadRecentInput (user-initiated). severity = entry value.
flicker per-frame opacity/visibility A clean fade is monotonic; flicker reverses. Flag ≥2 visibility toggles within 100ms (detectFlicker).
jank per-frame geometry + frame timing Inside a motion interval: dropped frame (dt > 1.5×budget) or teleport (jump > max(8px, 3×median)). severity from jank ratio + max jump (scoreJank).
dithering sub-rect pixel noise In a geometrically static region: high-frequency pixelNoise over consecutive frames (detectDithering). Driver supplies pixelNoise; null when no diff was taken.

The report shows the transition timeline, not just the flaws

The schema extends the base spec so a reviewer sees intended motion and its defects:

  • transitions[] — one entry per interval: kind, window, smoothness (smooth | janky | flicker | shift), a quality score, metrics, and the defects ids that occurred within it. Defects and transitions cross-reference.
  • defects[] — each carries id, testid/selector/segment linkage, normalized severity (0-1), a window, a metrics object exposing the raw numbers behind the severity (auditable and deterministic), and a human detail.
  • elements[].impactMode — ["paints"], ["layout"], or both.
  • elements[].label — the auto-detected element's role "name" (e.g. nav "Main"), else its CSS selector. Elements are auto-detected, so this is how a reader recognizes one; the precise selector is kept alongside.

The lean compact output (the CLI default, compact.ts) distils this: it coalesces defects, keeps a curated metrics per defect (the 1-2 numbers that matter for the type) and quality per transition, hoists the per-type fix into a single top-level hints map, and joins each element's label onto the defects/transitions that name it. --full keeps the faithful schema above.

See examples/sample-report.json for a worked (compact) output and examples/sample-recording.json for its input.

Determinism

No Date.now() / randomness in scoring; numbers are rounded at fixed precision and pixelThreshold / frameBudgetMs are explicit inputs, so re-running the analysis on the same recording yields byte-identical JSON. The analyzer.test.ts suite locks each detector to a synthetic timeline.

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