# Skills

Give your AI assistant deep knowledge of WebJs UI components, blocks, and patterns.

Source: https://webjs.dev/ui/docs/skills

WebJs gives AI assistants like Claude Code project-aware context about WebJs UI without a separate skill to install. Every app ships a read-only MCP server whose `ui` tool lists the kit and returns any component's exact structure, so your AI assistant knows how to find, install, compose, and customize components and blocks using the correct APIs and patterns for your app.

For example, you can ask your AI assistant to:

- *"Add a login form with email and password fields."*
- *"Create a settings page with a form for updating profile information."*
- *"Add a confirmation dialog before deleting a project."*
- *"Install the login block and wire it to a sign-in action."*

The assistant asks the kit for a component's structure rather than guessing it, so it writes correct code on the first try.

---

## Install

An app created with `webjs create` already has everything: an `AGENTS.md` that opens with the WebJs brief, a `CLAUDE.md` that points Claude Code at it, and the MCP server registered in `.claude.json`. For an app that was not scaffolded, register the server yourself (below).

---

## What's Included

### Project Context

The components live in your app under `components/ui`, so the assistant edits your copy as freely as code it wrote itself, and `init` is how the kit comes to exist in a fresh app. For the resolved configuration it can run `npx @webjsdev/ui info`.

### CLI Commands

`init`, `add`, `list`, `view`, `diff` and `lint`. Resolution is local-first, and `add` leaves a class-helper component's worked example out of the file, which `view` brings back.

### Blocks

Before hand-writing a login or signup page, an app sidebar shell, a dashboard, a data table or a chart, the assistant lists the blocks and installs the closest one, then binds a server action to its form.

### Composition and Theming

The two tiers (class helpers on native elements, and custom elements that own their ARIA), the primitives each screen state calls for (`empty`, `field`, `spinner`), the design tokens the helpers render against, and the opt-in design-system linter.

### MCP Server

The read-only WebJs MCP server's `ui` tool, which answers the same questions as the CLI in one call. A scaffolded app registers the server in its `.claude.json`:

```json title=".claude.json"
{
  "mcpServers": {
    "webjs": {
      "type": "stdio",
      "command": "npx",
      "args": ["@webjsdev/mcp"]
    }
  }
}
```

With no arguments the `ui` tool returns the component inventory (tier, helper signatures, npm dependencies) and the block and chart names grouped by category. `type` and `category` list one kind with descriptions. `name` returns one component's helpers, paste-ready example and accessibility notes, or one block's description, dependencies, install command and files, with `source: true` adding the sources.

---

## How It Works

1. **Project detection.** The assistant reads `AGENTS.md` and calls the MCP `init` tool, which names the `ui` tool as the place to look before writing a view.
2. **Structure on demand.** Instead of guessing a component's markup, the assistant asks the MCP `ui` tool or runs `npx @webjsdev/ui view <name>` and pastes the accessible structure it returns.
3. **Pattern enforcement.** The assistant follows the kit's composition rules: class helpers on real native elements, custom elements only where state matters, `field` for forms, semantic color tokens, and a `<form action=${importedAction}>` for every write.
4. **Block discovery.** Before writing a page shell, the assistant lists the blocks and installs the closest one, then edits it.

```bash
npx @webjsdev/ui list --type block
```

## Learn More

- [CLI](https://webjs.dev/ui/docs/cli): full CLI command reference
- [Blocks](https://webjs.dev/ui/docs/blocks): find, preview and install a ready-made view
- [Theming](https://webjs.dev/ui/docs/theming): CSS variables and customization
- [Registry](https://webjs.dev/ui/docs/registry): building and publishing custom registries
- [AI-first development](https://webjs.dev/docs/ai-first): how WebJs works with AI agents
