Barefootjs

From piconic-ai/barefootjs · View interactive version

Barefootjs is an AI agent skill from the GitHub repository piconic-ai/barefootjs. Build, inspect, and debug UI components using @barefootjs/cli. Use when: creating/editing/reviewing components, investigating signal dependencies, debugging reactive updates, scaffolding new components, or looking up component APIs.

How to use this skill

Skill file

Component Development Skill

Build UI components using @barefootjs/cli for component discovery, scaffolding, testing, and signal inspection.

Setup

Ensure the CLI is available. If the project doesn't already have it installed:

npx @barefootjs/cli --help

Or install it as a dev dependency:

npm install -D @barefootjs/cli
# or
bun add -d @barefootjs/cli

Once installed, use npx @barefootjs/cli (or bunx @barefootjs/cli) to run commands.

Version requirement: debug profile (below) requires @barefootjs/cli >= 0.11.0 — the release that introduced the reactive profiler. The other commands work on earlier versions. Check with npx @barefootjs/cli --version.

Workflow

  1. npx @barefootjs/cli search <query> — Find components and docs by name/category/tags
  2. npx @barefootjs/cli docs <component> — Get props, examples, accessibility info
  3. npx @barefootjs/cli guide <topic> — Read framework docs (signals, compiler constraints, etc.)
  4. npx @barefootjs/cli gen component <name> <comp...> — Generate skeleton + basic IR test
  5. Implement the component
  6. Run tests — Verify compilation
  7. npx @barefootjs/cli gen test <name> — Regenerate richer IR test
  8. Run tests — Final verification
  9. Create previews and run npx @barefootjs/cli preview <name> — Visual preview in browser
  10. Ask the user to check the browser for visual/interaction verification

Signal Inspection & Debugging

Use these commands to understand and debug a component's reactive structure. Most analysis is static (from the IR) and runs no code; the one exception is debug profile --scenario, which mounts and measures a real run.

`npx @barefootjs/cli debug graph <component>`

Show the signal dependency graph for a component. Use this before modifying a stateful component to understand its reactive structure: which signals exist, what memos depend on them, and which DOM nodes are bound.

`npx @barefootjs/cli debug trace <component> <signal|memo>`

Reverse-lookup: trace the full propagation path from a signal/memo to every DOM binding it affects. Use this to answer "why does this DOM node update?" or to verify that a signal change reaches the expected targets.

`npx @barefootjs/cli debug signals <component>`

Show a signal initialization trace: every signal, its initial value, and its effect bindings. Useful for verifying that signals are wired correctly in a newly written or modified component.

`npx @barefootjs/cli debug fallbacks <component>`

Surface fallback-wrapped expressions emitted by Solid-style wrap-by-default. Use this to find candidates for createMemo refactor — places where the compiler couldn't statically prove reactivity and fell back to wrapping.

`npx @barefootjs/cli debug profile <component>`

Reactive performance profiler — find wasted reactive work (re-runs that produce nothing, fan-out that fires too widely, multi-write turns that could batch()). Every finding maps back to a source line. Requires @barefootjs/cli >= 0.11.0. Three modes:

When to use inspection

Previews

Previews provide visual preview with full hydration support.

File location

ui/components/ui/__previews__/<name>.previews.tsx

Format

Each export function becomes a separate preview. PascalCase names are auto-converted to display titles (e.g., WithLabel → "With Label").

"use client"

import { ComponentName } from '../component-name'

/** Default usage */
export function Default() {
  return <ComponentName />
}

/** Show a specific variant or state */
export function WithProps() {
  return <ComponentName variant="outline" disabled />
}

Guidelines

Rules

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.