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

@userface/engine

v0.1.0

Published

AI-native UI infrastructure: analyze components, generate contracts (face.json), compose UI (ui@1), validate, and render — via CLI, MCP, or SDK.

Readme

@userface/engine

AI-native UI infrastructure: give your AI agent real component contracts so it stops hallucinating props.

The problem

You ask an AI agent to "build a settings page." It invents prop names, nests interactive elements inside each other, ignores your design system. You spend more time fixing than you'd spend writing from scratch.

What this does

Userface Engine sits between AI code generation and your UI components. Instead of guessing, the agent uses real contracts.

  • Registry — scans your project, discovers components, reads face.json contracts
  • Validation — 15 rules checking a11y, structure, and contract compliance (0-100 score)
  • Composition — validates ui@1 documents (nesting, required props, unknown types)
  • Codegen — materializes ui@1 into React JSX, Vue SFC, or HTML
  • Contract Diffs — detects breaking changes between face.json versions
  • MCP Server — 8 tools exposed via Model Context Protocol for AI-IDE integration
  • State Matrix — generates all meaningful visual states for a component

Quick Start

# Install
npm install @userface/engine

# Set up your project (auto-detect framework, generate configs)
npx userface connect

# Or just start the MCP server directly
npx userface-engine mcp-serve

After setup, restart your AI-IDE. The agent discovers your components through MCP.

CLI

# Scan all components → registry with props
npx userface-engine registry scan ./src/components

# Validate quality (score + violations + fix hints)
npx userface-engine validate ./src/components/Button --mode fast

# Validate ui@1 composition structure
npx userface-engine composition-validate dashboard.ui.json

# Generate React JSX from ui@1
npx userface-engine materialize settings.ui.json --framework react

# Detect breaking changes in contracts
npx userface-engine diff --base v1/face.json --head v2/face.json

# Analyze a single component
npx userface-engine analyze ./src/components/Button

# Generate visual states
npx userface-engine states ./src/components/Button

# SSR smoke test + a11y audit
npx userface-engine test --dir ./src/components

# Start MCP server for AI-IDE
npx userface-engine mcp-serve

All commands output JSON to stdout. Logs go to stderr.

MCP Tools

8 tools via Model Context Protocol (JSON-RPC 2.0 over stdin/stdout):

| Tool | What it does | |------|-------------| | component_list | List all components with props, types, and metadata | | component_analyze | Deep analysis of a single component | | component_validate | Quality gate: score + violations + fix hints | | composition_validate | Validate ui@1 document structure and contracts | | ui_materialize | Generate React/Vue/HTML from ui@1 | | component_states | Generate all visual states for a component | | component_test | SSR smoke test + a11y audit | | component_render | Render with specific props |

Cursor Setup

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "userface": {
      "command": "npx",
      "args": ["userface-engine", "mcp-serve"]
    }
  }
}

face.json — Component Contracts

A machine-readable description of what a component accepts:

{
  "name": "Button",
  "props": {
    "variant": {
      "type": "enum",
      "options": ["default", "destructive", "outline", "ghost"],
      "default": "default"
    },
    "size": {
      "type": "enum",
      "options": ["default", "sm", "lg", "icon"],
      "default": "default"
    },
    "disabled": { "type": "boolean", "default": false },
    "children": { "type": "node", "required": true }
  }
}

The registry reads these contracts and exposes them to the AI agent. No more guessing.

ui@1 — Declarative Composition

{
  "version": "ui@1",
  "root": {
    "type": "Panel",
    "props": { "title": "Settings" },
    "children": [
      { "type": "Input", "props": { "label": "Name", "value": { "$ref": "user.name" } } },
      { "type": "Button", "props": { "type": "submit" }, "children": ["Save"] }
    ]
  }
}

materialize turns this into real React JSX. composition-validate checks it against your registry.

Included Packs

Recipe Packs

5 B2B ui@1 templates: Dashboard, CRUD Table, Form, Settings, List-Detail.

Base Policy Pack

15 rules: a11y (button-type, input-label, img-alt), structural (modal-onclose, no-nested-interactive), contract (no-props, excessive-props, select-options).

System Prompts

AI-IDE instructions: prompts/cursor-rules.md, prompts/claude-prompt.md, prompts/generic-prompt.md.

Known Limitations

  • Prop extraction: The regex extractor returns 0 props for complex patterns (forwardRef + ComponentPropsWithoutRef). Write face.json manually or use the ts-morph extractor on the server.
  • SSR test: Returns empty results for components without extractable props (use face.json).
  • Framework support: React is primary. Vue and Svelte SSR adapters exist but are less tested.

GitHub Action

  with:
    components-dir: src/components
    fail-on: error

License

MIT