Skip to content

AI agents

Wire your agent to the library's knowledge base, manifest, markup check, MCP server and ESLint plugin.

On this page

Most component libraries leave a coding agent to guess. It reads a prop name off a blog post from two majors ago and writes markup that looks plausible. The mistake surfaces at runtime, or never: an unknown prop in Vue is an attribute.

bitboss-ui ships four things instead:

  • a knowledge base written for agents
  • a manifest of every component's real surface
  • a check that validates your markup and stylesheets against that manifest
  • an MCP server your agent can query directly

One command sets up all of it, and every install keeps it current.

When an agent works around the library, or hits a bug, it should report it with one request and keep its workaround. See Reporting problems and ideas.

Why this exists

Three failure modes cost the most, and each has a tool aimed at it.

Invented props. An agent writes color="primary" because every other library has one. v3 removed color from checkboxes, radios, switches, sliders, ratings, avatars, icons and spinners. Nothing throws; the attribute lands on the DOM node and does nothing. The same goes for names borrowed from elsewhere: toast.success(), v-model:open on a dialog, variant="danger".

Stale API. Training data is full of v2 and of earlier 3.0 betas. showClose, allowWriting, noDataText and type on BbIcon all read as current and are all wrong.

Right component, wrong situation. BbTag and a multiple BbSelect look interchangeable until you notice one is for values the user invents.

Point your agent at it

The agent setup runs by itself. npx bitboss-ui@beta setup, the one command on Installation, adds a postinstall to your package.json:

package.json
{
    "scripts": {
        "postinstall": "bitboss-ui update --no-install || exit 0"
    }
}

From then on every install, on every machine, and every dev server start keeps the agent files current. On an app that was set up by hand, add that line, or run the same refresh once:

bash
npx bitboss-ui update --no-install

It always writes a marked block in AGENTS.md, read by Codex, Cursor, Copilot, Zed, Windsurf, Junie, Roo, Amp, Kiro and most other agents. The rest of the file is yours.

For each agent tool the repo already shows (a committed .cursor/, .mcp.json, .vscode/, …), it also registers the MCP server in that tool's project config and installs the bitboss-ui skill where it looks for skills. A tool found only on your machine, in your home folder or in the terminal's environment, writes nothing into the repo. The install prints one line instead, once per version, with the command that sets it up:

bash
npx bitboss-ui update --no-install --agent claude

Run it for each agent tool your team uses, and commit what it writes. --agent repeats, or takes a comma-separated list; --all writes every tool it knows. Nothing is removed when a tool is not found, so a teammate's setup adds theirs.

Files your team owns are edited only by npx bitboss-ui setup and by npx bitboss-ui update run by hand, never by an install or a dev start:

  • a marked @AGENTS.md import in CLAUDE.md (Claude Code reads AGENTS.md only when there is no CLAUDE.md) and in GEMINI.md;
  • vueCompilerOptions.checkUnknownComponents: true in your tsconfig, so a mistyped or removed component is a type error (in Nuxt it tells you where to set it instead);
  • the editor hints in .vscode/settings.json.

After upgrading from an earlier beta, run npx bitboss-ui update --no-install once by hand so those files are current.

Every write merges rather than overwrites: your own lines in AGENTS.md and the other MCP servers you have configured survive. The files carry no version, so an upgrade rewrites them only when their text changes. Commit them, and restart your agent once. update also deletes the .cursor/rules/bitboss-ui.mdc, .windsurf/rules/bitboss-ui.md and .github/copilot-instructions.md block that ai-init used to write, since those agents read AGENTS.md: commit the deletions. Some starters (Laravel's vue starter kit) git-ignore AGENTS.md, CLAUDE.md, .claude, .cursor and .mcp.json; un-ignore them, or your teammates never get the pointers.

To turn it off:

  • ai: false in the build plugin stops all of it, the .vscode/ hints and the tsconfig flag included. The next install or update removes what the setup wrote, for everyone.
  • BITBOSS_UI_AI=0 in one machine's environment skips the setup there and removes nothing.

Installs and dev starts also skip CI, a Vitest run and a folder outside a git repository, and an install never fails because of it. Write ai as a literal: the command line reads it from your config as text.

npx bitboss-ui update, without --no-install, also installs the newest release on your channel and prints what broke since the version you had.

What the agent reads

The knowledge base lives at node_modules/bitboss-ui/dist/ai/, exported as bitboss-ui/ai. It is a hop map, not one large document. The agent opens the router, then one contract or recipe, and loads a few kilobytes instead of the whole catalogue.

The route an agent takes:

  • guides/ai-router.md: start here. Which file to open next, in what order.
  • guides/agent-contract.md: the hard rules, before any code is written.
  • guides/component-picker.md: which component fits a need, and the markup that means one already exists.

One contract per thing:

  • <Component>.md: one per component, with props, events, slots, v-model and pt parts.
  • composables/<name>.md: one per composable, such as useToast, useConfirm or useBbFormField.
  • source/<Component>.md: the component's full implementation (template, types, CSS). Only for rebuilding chrome the library does not ship.

Data for scripts and tools:

  • components.json: the machine-readable API surface of every component, plus the public types.
  • design-tokens.json: the --bb-* tokens as data, covering colours, radius, type and spacing.
  • changelog.json: every breaking change since v2, with the version that shipped it.

Playbooks and the rest:

  • guides/*.md: cross-cutting playbooks on coherence, options and items, forms, passthrough.
  • recipes/{vue,nuxt,inertia}/: whole-page shapes, one file per platform.
  • guides/migration/: the v2 upgrade, the class renames between 3.0 betas, and v3-beta-tooling.md for scripts that parse these files.
  • index.md: the full catalogue. A last resort, not a first stop.

If the agent can only fetch URLs, the same knowledge base is hosted. Give it one of these:

  • https://llms-bitboss-ui.bitboss.it/dist/llms-medium.txt: about 260 KB, the rules, setup, component picker, design language and catalogue in one request. Fetch this one if the agent takes only one.
  • https://llms-bitboss-ui.bitboss.it/llms.txt: a 27 KB index of every document.
  • https://llms-bitboss-ui.bitboss.it/dist/llms-full.txt: everything concatenated, about 6 MB, for bulk ingestion only.

Installed, the three files resolve as bitboss-ui/llms.txt, bitboss-ui/llms-medium.txt and bitboss-ui/llms-full.txt.

components.json is not a side artifact. Every API table on this site is generated from it. The guides around the tables are written by hand, but the surface you read here comes from the file an agent reads.

Whole pages from a recipe

A recipe is a whole page the library composes for you: the files, the reasons behind them and the keyboard map, for Vue, Nuxt and Inertia. They live in node_modules/bitboss-ui/dist/ai/recipes/{vue,nuxt,inertia}/, and the MCP server lists them (list_recipes, get_recipe). An agent copies a recipe whole and adapts it, so ask for the page by name: "build the settings area from the settings-workspace recipe".

The set covers the screens apps rebuild most: a records workspace, a record form, a settings area, a wizard, an upload center, an approvals inbox, inline editing, onboarding, a transfer list. Start with layout-scaffold: the page shell, the peek stack and the selection dock the others import. Every recipe page owns one focusable <h1> and sets the page title, so your router hook (vue-router afterEach, Inertia's navigate, Nuxt's page:finish) can move the focus to the new page's heading.

A rich-text editor

The library ships no rich-text editor. The rich-text-editor recipe builds one on Tiptap as a field of your own app, RichTextField, that reads like BbTextInput: the same label, box, focus ring, errors and message row, and it joins a BbForm like any field. Its toolbar is icon-only BbButtons with one Tab stop. The colours come from the --bb-* tokens, so a theme and dark mode follow on their own.

It is layered. The core field comes first, then one file per add-on:

  • links, edited in a BbPopover (Mod+K);
  • @-mentions and a / slash menu, drawn as the library's list;
  • image upload through a BbDropzone, with paste and drop taking the same upload;
  • tables, with their own toolbar group;
  • a character counter that follows BbTextarea's.

Drop an add-on by deleting its file and its line in extensions.ts; its toolbar button and slash command go with it. Tiptap stays your own dependency, installed and upgraded by you:

bash
npm i @tiptap/core @tiptap/pm @tiptap/vue-3 @tiptap/starter-kit @tiptap/extensions @tiptap/extension-mention @tiptap/suggestion @tiptap/extension-image @tiptap/extension-table

The v-model is HTML by default, or ProseMirror JSON with format="json". Sanitise it on the server either way.

Checking the markup

The check validates Bb* markup in your .vue and .md files against the installed manifest, not against a copy of the rules. You are checked against the version you actually have:

bash
# every .vue and .md below this directory
npx bitboss-ui check
# one directory; prefer it to a quoted glob
npx bitboss-ui check src
# only the files git reports changed: the fast loop after an edit
npx bitboss-ui check --changed
# findings as JSON, for a CI annotation step
npx bitboss-ui check --json
# also list what the app still builds by hand (report-only)
npx bitboss-ui check --idioms

A finding names the file, the line and the fix:

text
[bitboss-ui] check FAILED — 2 finding(s) across 1 file(s):

  src/CustomerForm.vue
    ✗ line 6: prop `color` is not in BbButton's API
    ✗ line 7: prop `show-close` was removed from BbDialog; use `hideClose`
      hint: ai/guides/migration/components/bb-dialog.md

It exits non-zero on findings, which makes it a CI step. It also exits non-zero when an explicit path matches nothing, so a typo in a CI path cannot validate zero files and pass. What it reports, grouped:

AreaFindings
Markupunknown or removed props, v-model targets, events and slots, also on a <component :is> that renders library components; a retired component or slot, with the release that retired it; a variant from another library (unknown-variant: danger on BbAlert); href or method on a component that ignores them
Accessibilityan icon-only BbButton or BbBadge, or a BbProgress, with no accessible name (nameless-control)
Itemsobject items with neither a label nor a text key and no item-text (object-items-without-text); an item-text / item-value that restates the default (redundant-item-accessor, a warning); a dropdown, tab or breadcrumb item still spelled key / text (renamed-item-field); a dropdown row in a selectable group with no value (missing-value) or a selectable group with no id (missing-id); a BbTable column keyed like one of its own slots (reserved-key)
Formsv-model on a BbForm (form-v-model: it takes :model); two fields on one path, a row in a v-for with no name, rules a schema will ignore, a string rule nothing registers
Integrationa Bb* tag the file never imports, which renders empty (unimported-component); a trigger in a BbDropdown's default slot, which opens nothing (dropdown-default-slot); a BbCollapsible toggle with no aria-expanded (collapsible-trigger-aria); a v-model on a reactive() const (reactive-v-model); a portal name nothing declares (unknown-portal); a v-bb-dialog / v-bb-off-canvas or context id no dialog declares (unknown-dialog)
Your componentsa wrapper that declares Bb*Props and never passes some of them on (wrapper-drops-props): a caller's disabled or pt goes nowhere; Preset components shows the fix
Stylesheetsa selector on a .bb-* class the library no longer renders (unknown-class, renamed-class), a token or local nothing reads (inert-token, inert-local), a hand-imported styles.css
Importsthe retired bitboss-ui/validated entrypoint, an import from inside dist/, a Pt* type the package does not export

npx bitboss-ui check --fix applies the automatic migrations to your .vue files first (renamed props, slots and pt keys, inverted booleans, retired imports), then reports what is left for you. It needs eslint and vue-eslint-parser installed. The check respects eslint-disable comments, so a finding you silenced on purpose does not fail CI.

Around an upgrade, judge your code against the new version before you install it, then list what broke since the version you were on:

bash
# before installing: which of your files the new version breaks
npm pack bitboss-ui@beta && tar -xzf bitboss-ui-*.tgz
npx bitboss-ui check --manifest package/dist/ai/components.json

# after installing: every break since the version you had
# (the one npm ls bitboss-ui printed before the upgrade)
npx bitboss-ui changelog --since <old-version>

Do not name your own components Bb…; use your app's prefix. If you already have one, the check leaves it alone when it can see it is yours (imported from a local file, or a .vue in your components/ directories) and prints a single local-bb-component warning. allowComponents, in the build plugin, is only for a component registered globally, where no import shows:

vite.config.ts
bitbossUi({ allowComponents: ['BbRichEditor'] });

Write it as a literal array: the check reads it from the config as text.

The MCP server

The MCP server answers the same questions as the files in dist/ai/, as tool calls: an agent asks for one component or one list of changes instead of opening files.

ToolAnswers
search_docs"How do I…": the guide or component section that answers it, old names included
search_components, get_componentThe catalogue, then one component: every prop, event, slot and pt part. Also resolves type names and renamed v2 or beta names
get_guide, list_guides, get_composableA playbook or a composable's contract
list_recipes, get_recipeWhole-page shapes for Vue, Nuxt and Inertia
get_css_surfaceA component's styling hooks: the pt part first, then the class
list_tokensThe design tokens and their values
list_changesThe breaking changes between two versions, class renames included
validateThe markup check, on a snippet
report_issueSends a report to the maintainers, the one tool that writes anything (see Reporting)

You never start the server yourself. The agent setup registers it, and the agent launches it on demand. Restart the agent once after the first setup so it picks the server up. Each agent gets an entry in its own file:

FileAgent
.mcp.jsonClaude Code
.cursor/mcp.jsonCursor
.vscode/mcp.jsonVS Code and GitHub Copilot
.codex/config.tomlCodex
.gemini/settings.jsonGemini CLI
.devin/mcp_config.jsonWindsurf (Devin Desktop)
.zed/settings.jsonZed

Junie, Roo Code, Amp, Kiro and Antigravity get theirs too. Agents whose MCP config is global only (Cline, JetBrains AI Assistant, the GitHub Copilot coding agent) get instructions in the AGENTS.md block instead: the agent registers the server in its own settings after asking you. Nothing is written outside the project.

The entry runs the installed binary, node node_modules/bitboss-ui/bin/bitboss-ui.mjs mcp, not npx. That way it cannot fetch anything from the registry and always answers from the version in your node_modules. The path is relative to the project, so commit these files and the server works for your teammates too:

.mcp.json
{
    "mcpServers": {
        "bitboss-ui": {
            "command": "node",
            "args": ["node_modules/bitboss-ui/bin/bitboss-ui.mjs", "mcp"]
        }
    }
}

The server needs nothing else installed: the MCP SDK it runs on ships inside the package. It is also optional. It only reads node_modules/bitboss-ui/dist/ai/, so an agent pointed at dist/ai/guides/ai-router.md has the same knowledge.

Catching it in the editor

The library ships an ESLint plugin, so the same manifest checks run while typing rather than at review. The recommended preset is an array: spread it. It parses <script setup lang="ts"> once @typescript-eslint/parser is installed.

bash
npm i -D @typescript-eslint/parser
eslint.config.js
import vue from 'eslint-plugin-vue';
import tsParser from '@typescript-eslint/parser';
import bitbossUi from 'bitboss-ui/eslint-plugin';

export default [
    ...vue.configs['flat/recommended'],
    { files: ['**/*.ts'], languageOptions: { parser: tsParser } },
    {
        files: ['**/*.vue'],
        languageOptions: { parserOptions: { parser: tsParser } },
    },
    ...bitbossUi.configs.recommended,
];

Without the TypeScript parser, every .vue file with a TS script block fails to parse, and no rule runs on it at all. eslint --fix applies the registered v2 renames and polarity flips; a "did you mean" hint is never applied for you.

Like the check, it reads a <component :is> that names library components: an attribute one of them removed is an error.

Beyond unknown props, slots and events, recommended flags the mistakes that render without complaint:

  • an icon-only button with no accessible name (require-accessible-name)
  • method on a BbButton with no href (require-partner-prop)
  • a string rule in rules that nothing registers (no-unregistered-rule)
  • a v-model on a BbForm (form-model)
  • a trigger in a BbDropdown's default slot (dropdown-default-slot)
  • a Bb* tag the file never imports (no-unimported-component)
  • a BbCollapsible toggle with no aria-expanded (collapsible-trigger-aria)
  • a v-model on a reactive() const (no-reactive-v-model)
  • a portal name, or a dialog id, nothing declares (portal-names)
  • an import from bitboss-ui/validated (no-retired-entrypoint)
  • a var(--bb-…) token the library does not declare (no-unknown-token, a warning)
  • a v2 :reverse="false" (no-reverse-false)
  • a dropdown, tab or breadcrumb item still spelled key / text (no-renamed-item-field, which rewrites it)
  • an item-text / item-value that restates the default (no-redundant-item-accessor, a warning it fixes)

Keep explicit imports. With checkUnknownComponents (the setup sets it), a mistyped or removed component becomes a type error instead of an empty space on the page.

The shortest reliable setup is npx bitboss-ui@beta setup, the recommended ESLint config and npx bitboss-ui check in CI. Add MCP when the agent can use tools; keep the file-based knowledge pointers either way, because they remain available to every agent and in offline work.