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

rafters

v0.0.64

Published

Design Intelligence CLI. Scaffold tokens, import existing shadcn/Tailwind v4 sources, add components, and serve an MCP server so AI agents read decisions instead of guessing.

Readme

rafters

Design Intelligence CLI. Encodes a designer's judgment into queryable data so AI agents read decisions instead of guessing at colors, spacing, hierarchy.

rafters.studio

60+ components across React, Astro, and Web Components. Triple-target parity from one design system — the same Button, Card, Dialog, Combobox, Editor, etc. as a React component, an Astro component, AND a Web Component element class. Component code is installed into your project via rafters add (shadcn-style copy), not imported as a dependency, so you own and can fork what ships.

Composite manifests sit above components. A composite is a designer-authored JSON manifest that bundles components into reusable patterns (login-form, copy-button, heading, paragraph) with designer intent baked in: solves, appliesWhen, do/never rules, cognitive load rating, I/O contracts, and a typed block tree. Agents query the composite registry via MCP and assemble pre-made decisions instead of inventing new ones.

Quick Start

pnpm dlx rafters init

init detects your framework, reads your existing CSS (shadcn or Tailwind v4 @theme blocks), and produces a complete token system that imports your brand decisions and derives the rest mathematically.

What init does

On the first run against an existing project, init runs an import flow that lifts brand decisions out of your CSS into the token system. Every step emits a discrete event you can read with --agent:

  • Pre-generation base detection — reads --spacing / --spacing-base, --radius / --radius-base, --text-base / --font-size-base, --ring-width / --focus-ring-width and threads them into the token generator BEFORE construction. The cascade flows correctly from the first generation; derived namespaces (spacing scale, shadow numerics, radius scale, focus tokens) all match the imported base.
  • Color import — walks :root semantic declarations (--primary, --background, etc.) AND @theme { ... } multi-palette blocks (Tailwind v4 brand palette convention). Detects ramps (palette-0 through palette-950), runs a designer-driven role-walk in interactive mode or auto-assigns in --agent mode.
  • Font role-walk — detects every font family loaded by the source (@import url(google fonts), @font-face, named --font-* declarations) and assigns each to a typography role (font-heading, font-body, font-code). Custom fonts that don't fit a canonical role become their own tokens (font-aurabesh, font-mydisplay, etc.) so consumers can reference them via Tailwind utilities.
  • Motion is intentionally untouched — rafters' motion system is research-backed (perceptual response curves, cognitive thresholds, reduced-motion accommodations); arbitrary --duration-base declarations in source are NOT auto-applied. Use rafters set motion-duration-base ... if you specifically need to override.

Modes

pnpm dlx rafters init              # Interactive prompts for role assignments
pnpm dlx rafters init --agent      # Non-interactive; auto-assigns; emits JSON events
pnpm dlx rafters init --rebuild    # Regenerate output files from existing .rafters/tokens
pnpm dlx rafters init --reset      # Re-run generators from defaults, replacing tokens

Detected frameworks

Next.js, Vite, Remix, React Router, Astro, Web Components, vanilla.

Export formats

| Format | File | Default | Description | |--------|------|---------|-------------| | Tailwind CSS | rafters.css | Yes | CSS custom properties with @theme | | TypeScript | rafters.ts | Yes | Type-safe constants with JSDoc intelligence | | DTCG JSON | rafters.json | No | W3C Design Tokens standard format | | Standalone CSS | rafters.standalone.css | No | Pre-built, no Tailwind required |

Requires Tailwind v4. Tailwind v3 projects are rejected.

Other commands

rafters add [components...]

Add components from the rafters registry to your project.

pnpm dlx rafters add button dialog    # Add specific components
pnpm dlx rafters add --list           # List available components
pnpm dlx rafters add --overwrite      # Replace existing files

Each component carries embedded design intelligence (cognitive load, accessibility, do/never guidance, variant patterns). Dependencies resolve automatically.

rafters set <name> <value>

Override a token value with a recorded reason. The previous value and the why-gate land as userOverride metadata so future agents can read your intent.

pnpm dlx rafters set spacing-base 0.5rem --reason "denser layout for data-heavy UI"

rafters mcp

Start the MCP server for AI agent access via stdio transport.

pnpm dlx rafters mcp

rafters studio

Launch Studio for visual token editing.

pnpm dlx rafters studio

MCP tools

Four tools for agent ASSEMBLY (not design). Token design lives in Studio; import lives in rafters init. Agents read pre-made decisions; they do not author them.

rafters_composite

Query composites by ID, search term, or category. Returns designer intent (solves, appliesWhen, do/never), I/O rules, and block structure.

{ "id": "login-form" }        // Get a specific composite
{ "query": "form" }           // Fuzzy search across composites
{ "category": "typography" }  // Filter

rafters_pattern

Design pattern guidance by querying composites. Search by what the page or section SOLVES.

{ "solves": "authentication" }
{ "solves": "data entry" }
{ "query": "navigation" }

Returns composites with usagePatterns (do/never), cognitive load, and intent.

rafters_rule

Query validation rules or create new ones. Rules are named patterns composites apply to inputs.

{}                    // List all rules
{ "name": "email" }   // Get a specific rule

Built-in: required, email, password, url, credentials.

rafters_component

Full intelligence for a specific component: cognitive load, accessibility level, variants, sizes, do/never.

{ "name": "button" }

Architecture

Four layers, stacked:

  • Tokens — primitive design values (color OKLCH, spacing scale, radius, typography, motion, focus, shadow, depth, elevation, breakpoints). 13 namespaces; dependency graph with human override tracking. Override a base (spacing-base, radius-base, font-size-base) and dependents recompute. Override a leaf and the override anchors the subtree.
  • Primitives — 62 framework-agnostic building blocks (clipboard, focus-trap, portal, roving-focus, selection, serializer, slot, token-sheet, typeahead, etc.). Headless behaviors components compose against.
  • Components — 60+ React + 71 Astro + 32 Web Component element classes. Triple-target parity. Each component carries embedded intelligence metadata: cognitive load rating, accessibility level, do/never, variant semantics, attention economics. Installed into your project via rafters add — you own the code.
  • Composites — designer-authored JSON manifests that bundle components into reusable patterns (login-form, copy-button, heading, paragraph, etc.). Each manifest carries solves, appliesWhen, usagePatterns (do/never), cognitiveLoad, I/O contracts, and a typed block tree. The composite owns the variant/size decisions — agents render blocks verbatim instead of choosing aesthetics.

When a designer overrides a computed value, the system records the reason. Agents read the why before they read the what.

Project structure

.rafters/
  config.rafters.json         # Framework paths and export settings
  tokens/
    color.rafters.json
    spacing.rafters.json
    typography.rafters.json
    radius.rafters.json
    shadow.rafters.json
    focus.rafters.json
    motion.rafters.json
    depth.rafters.json
    elevation.rafters.json
    breakpoint.rafters.json
    semantic.rafters.json
    fill.rafters.json
    typography-composite.rafters.json
  output/
    rafters.css               # Tailwind v4 CSS variables
    rafters.ts                # TypeScript constants

Requirements

  • Node.js ≥ 24.12.0
  • Tailwind CSS v4
  • React ≥ 19.0.0 (when using React components)

License

MIT