npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

smart-ui-validator

v0.5.2

Published

CLI and local Studio for deterministic UI generation, validation, bounded implementation handoff, reporting, and governed memory.

Readme

smart-ui-validator

Command-line interface for Smart UI Validator's two independent workflows:

  • deterministic validation and bounded repair of an existing React or Angular UI; and
  • repository-free generation of standalone HTML/CSS from a local SVG or PNG.

The package also contains Smart UI Studio, a local browser interface for both workflows. Studio is bundled inside this CLI package rather than published as a separate service or package.

Requirements

  • Node.js 22.16 or newer.
  • Network access during first-time setup if the pinned Chromium revision is not already cached.
  • A React or Angular target and running route only for validation/repair.
  • A dedicated local workspace for generation and Studio state.
  • An explicit React/Angular repository root only when Studio Validate UI is enabled.

No standalone SQLite installation or database service is required. Agent Memory uses Node's embedded SQLite support and remains optional.

Installation

npm install --save-dev [email protected]
npx smart-ui --help

The package deliberately has no browser-downloading postinstall hook. Installing JavaScript dependencies must not unexpectedly download a large binary or fail only because a proxy is offline.

Existing UI validation and repair

Provision and verify the target environment:

npx smart-ui setup --target .
npx smart-ui doctor --target .
npx smart-ui inspect --target . --json

setup uses the Playwright installation code shipped with this package's exact core dependency. It downloads the matching Chromium revision only when the browser cannot already launch, then repeats a real launch canary. Add --agent-memory only to exercise the optional embedded-SQLite persistence canary. A readiness failure exits with code 4.

Normalize local evidence and validate a running route:

npx smart-ui design normalize \
  --image /absolute/project/reference.svg \
  --out /absolute/project/.smart-ui/design-contract.json \
  --artifacts /absolute/project/.smart-ui/artifacts

npx smart-ui validate \
  --target /absolute/project \
  --design /absolute/project/.smart-ui/design-contract.json \
  --route http://127.0.0.1:4173/component

Use validate-matrix for configured viewports/states and fix for approval-bounded repairs. Repair writes are limited to exact target-relative paths from configuration or --allow-write; configured commands require an exact executable/argument allowlist. Smart UI retains deterministic screenshots, diffs, overlays, findings, a RunRecord, and an offline report, and rolls back rejected proposals.

For a substantial implementation authored by an agent or human, use validate-ui prepare and validate-ui review. The persistent task pins the route, evidence, repository inspection, and exact writable files; review creates an immutable attempt, and task accept records the explicit decision.

SVG-to-HTML generation

This workflow does not inspect or modify an application repository and does not require Figma, MCP, a model, or a running application.

npx smart-ui generate \
  --workspace /absolute/svg-workspace \
  --design /absolute/svg-workspace/screen.svg \
  --output /absolute/svg-workspace/generated/screen \
  --mode hybrid \
  --layout responsive

The workspace is never inferred from common path ancestors. Without --output, only the unique immutable artifact run, offline report, and reproducible ZIP are retained. An explicit output must be a new empty directory inside the workspace. --dry-run --json sanitizes and inspects without producing a deliverable.

For agent- or human-authored standalone output, use generation prepare, author only the task's exact proposal manifest, then run generation review and task accept. This persistent flow does not invoke a model or require MCP; a connected MCP agent can submit to the same task contract.

Modes are exact, hybrid, and semantic; layouts are fixed, responsive, and component. Source-viewport fidelity is measured separately from narrow responsive robustness. The result contains index.html, styles.css, deterministic evidence, uncertainties, findings, hashes, provenance, and an immutable GenerationRecord.

Smart UI Studio

Studio is the local visual interface for standalone SVG/PNG generation and bounded validation of an explicitly configured React/Angular target. It is not a hosted backend, model host, or remote collaboration service.

Studio initializes a dedicated workspace automatically. From a repository checkout it defaults to <cwd>/.studio-workspace (inside the MCP root), so its default connected-agent handoff — powered by the smart-ui MCP server — works with no flags:

npx smart-ui studio

Pass --workspace to use an explicit dedicated directory, or to initialize/verify without starting:

npx smart-ui studio --workspace /absolute/smart-ui-studio --init-only
npx smart-ui studio --workspace /absolute/smart-ui-studio --health-check --json
npx smart-ui studio --workspace /absolute/smart-ui-studio --open
npx smart-ui studio \
  --workspace /absolute/smart-ui-studio \
  --target /absolute/react-or-angular-repository \
  --open
npx smart-ui studio --review-task /absolute/task.json --open

Studio binds only to 127.0.0.1, starts headless unless --open is explicit, and never lets page JavaScript select or widen a filesystem root. Start with --target <absolute-repository> to enable Validate UI. Both work types use Work type, Inputs, Preferences and boundaries, Handoff, and Review. They share bounded SVG/PNG upload and upload-or-paste context controls. Validate UI stages its design upload inside the target only long enough for core task intake, then removes staging; repository writes remain exact and target-relative.

--retention-hours defaults to 24 hours. Runs are recoverable after restart and can be deleted one at a time from the UI. Local Studio storage is plaintext, telemetry is off, and no credentials are collected.

More documentation

Run smart-ui --help for every command and option. The repository README provides complete workflow examples and expectations; see architecture, MCP, security, and operations for the underlying contracts and boundaries.