From 26340b54fec7b9d73da04331abfdbed16c59ee4a Mon Sep 17 00:00:00 2001 From: Naffah Abdulla Rasheed Date: Sun, 15 Nov 2026 08:15:12 +0000 Subject: [PATCH 1/2] Ship Laravel Boost guidelines and skills in both packages Laravel Boost reads resources/boost/ from the npm packages an app depends on directly. @javaabu/onu gets a guideline and the javaabu-onu skill, which scripts/boost.mjs generates from the Claude Code plugin's skill so there is one source. @javaabu/onu-mcp gets a guideline, the javaabu-onu-mcp skill and an llms.txt. CI checks every published package ships them. Co-Authored-By: Claude Opus 5.5 --- .changeset/laravel-boost.md | 6 ++ .github/workflows/ci.yml | 2 + .gitignore | 2 + AGENTS.md | 1 + docs/guides/ai-assistants.md | 18 ++++ packages/onu-mcp/llms.txt | 26 ++++++ packages/onu-mcp/package.json | 2 + .../resources/boost/guidelines/core.blade.php | 10 ++ .../boost/skills/javaabu-onu-mcp/SKILL.md | 36 ++++++++ packages/onu/package.json | 4 +- .../resources/boost/guidelines/core.blade.php | 12 +++ scripts/boost.mjs | 91 +++++++++++++++++++ 12 files changed, 209 insertions(+), 1 deletion(-) create mode 100644 .changeset/laravel-boost.md create mode 100644 packages/onu-mcp/llms.txt create mode 100644 packages/onu-mcp/resources/boost/guidelines/core.blade.php create mode 100644 packages/onu-mcp/resources/boost/skills/javaabu-onu-mcp/SKILL.md create mode 100644 packages/onu/resources/boost/guidelines/core.blade.php create mode 100644 scripts/boost.mjs diff --git a/.changeset/laravel-boost.md b/.changeset/laravel-boost.md new file mode 100644 index 00000000..c15b2939 --- /dev/null +++ b/.changeset/laravel-boost.md @@ -0,0 +1,6 @@ +--- +"@javaabu/onu": patch +"@javaabu/onu-mcp": patch +--- + +Ship Laravel Boost guidelines and skills in `resources/boost/` (`javaabu-onu`, `javaabu-onu-mcp`), and an `llms.txt` in `@javaabu/onu-mcp`. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 656e3896..f58390de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,6 +52,8 @@ jobs: run: pnpm build:web - name: Docs cover every component run: node scripts/check-docs.mjs + - name: Boost guidelines, skills and llms.txt + run: node scripts/boost.mjs --check - name: Licences run: node scripts/check-licenses.mjs - name: Audit diff --git a/.gitignore b/.gitignore index 71c22fff..a5fbae10 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,5 @@ test-results /packages/onu/docs/ /packages/onu/llms.txt /packages/onu/llms-full.txt +# Generated by scripts/boost.mjs from plugins/onu/skills/onu/SKILL.md +/packages/onu/resources/boost/skills/ diff --git a/AGENTS.md b/AGENTS.md index dab625a7..da0f57b1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -14,6 +14,7 @@ Onu (`@javaabu/onu`) is Javaabu's React UI library: shadcn/ui (Radix base) and T | `web` | Docs and demo site: `src/showcase//.demo.tsx`, `src/pages//.page.tsx` | | `docs` | Markdown docs, one page per component (`docs//.md`) | | `scripts/llms.mjs` | Builds `llms.txt`, `llms-full.txt` and `docs/*.md` for AI assistants from `docs/` | +| `scripts/boost.mjs` | Copies the plugin skill into the package for Laravel Boost; `--check` checks each package ships its Boost files | | `e2e`, `figma` | Playwright tests and the Next.js server-rendering fixture (`e2e/nextjs`), Figma plugin | ## Commands diff --git a/docs/guides/ai-assistants.md b/docs/guides/ai-assistants.md index dfa47bf6..1fd6c10b 100644 --- a/docs/guides/ai-assistants.md +++ b/docs/guides/ai-assistants.md @@ -61,6 +61,24 @@ Other clients (Cursor's `.cursor/mcp.json`, VS Code's `.vscode/mcp.json`, Claude Set `ONU_DOCS_DIR` to read the docs from another folder. +# Laravel Boost + +In a Laravel app, [Laravel Boost](https://laravel.com/docs/boost) picks Onu up by itself. Both packages ship a Boost guideline and skill in `resources/boost/`, which Boost reads from the npm packages the app depends on directly: + +| Package | Guideline | Skill | +| --- | --- | --- | +| `@javaabu/onu` | Use Onu for UI, read `llms.txt`, logical (RTL) utilities | `javaabu-onu`: load the rules, pick components from the index, read each page, check your work | +| `@javaabu/onu-mcp` | Call `onu_get_rules`, then `onu_get_doc` per component | `javaabu-onu-mcp`: when and how to use each MCP tool | + +Install the package, then run Boost's installer, and choose the guidelines and skills when it asks: + +```bash +npm install @javaabu/onu +php artisan boost:install +``` + +The guideline goes into the app's `AGENTS.md` / `CLAUDE.md`, and the skill into its skills folder. Run `php artisan boost:update` after upgrading Onu so they match the new version. `@javaabu/onu-mcp` is usually run with `npx`; add it to `devDependencies` too if you want Boost to install its guideline and skill. + # Claude Code plugin The Onu repository is a Claude Code plugin marketplace. The `onu` plugin adds a skill that tells Claude to load the rules and read each component's page before using it, and sets up the MCP server: diff --git a/packages/onu-mcp/llms.txt b/packages/onu-mcp/llms.txt new file mode 100644 index 00000000..0ac54319 --- /dev/null +++ b/packages/onu-mcp/llms.txt @@ -0,0 +1,26 @@ +# @javaabu/onu-mcp + +> A Model Context Protocol server that gives AI assistants the docs of Onu (`@javaabu/onu`), Javaabu's React UI library, and the rules for writing Onu code. It reads the docs of the `@javaabu/onu` installed in the project (`node_modules/@javaabu/onu/docs`, looked up from the folder the assistant runs in and its parents), and falls back to the docs it was published with. + +Paths are relative to this file. In a project, that's node_modules/@javaabu/onu-mcp/. + +## Rules + +- Call `onu_get_rules` once before writing Onu code, and follow the rules over habits from other UI kits. +- Search (`onu_search_docs`) or list (`onu_list_components`) before writing a component yourself: Onu probably has it. +- Call `onu_get_doc` for each component before using it. Use the import from the page's first code block and only the props in its Props table. +- Run it with `npx -y @javaabu/onu-mcp` (stdio). `ONU_DOCS_DIR` points it at another docs folder. + +## Tools + +- `onu_get_rules`: the rules for writing Onu code: setup, imports, forms with Laravel validation, Thaana and RTL, theming, icons, accessibility. Also the resource `onu://rules`. +- `onu_list_components`: every docs page by section, with a one-line description; `section` lists one section. +- `onu_get_doc`: a page as Markdown, by component name (`PasswordInput`), file name or path. +- `onu_search_docs`: searches every page, e.g. `"date range laravel"`; `limit` caps the results. + +## Docs + +- [README](README.md): tools and setup for Claude Code, Cursor, VS Code and Claude Desktop +- [Boost skill](resources/boost/skills/javaabu-onu-mcp/SKILL.md): how an assistant should use the tools +- [AI assistants](https://github.com/Javaabu/onu/blob/main/docs/guides/ai-assistants.md): every way to give an assistant Onu's docs, including Laravel Boost +- [Onu's llms.txt](https://onu.on-forge.com/llms.txt): the rules and every Onu component, hook and guide diff --git a/packages/onu-mcp/package.json b/packages/onu-mcp/package.json index fd3cb709..6668e030 100644 --- a/packages/onu-mcp/package.json +++ b/packages/onu-mcp/package.json @@ -34,6 +34,8 @@ "files": [ "dist", "data", + "resources", + "llms.txt", "README.md" ], "engines": { diff --git a/packages/onu-mcp/resources/boost/guidelines/core.blade.php b/packages/onu-mcp/resources/boost/guidelines/core.blade.php new file mode 100644 index 00000000..949c2865 --- /dev/null +++ b/packages/onu-mcp/resources/boost/guidelines/core.blade.php @@ -0,0 +1,10 @@ +{{-- + @javaabu/onu-mcp guidelines for AI code assistants + + Maintained by: Javaabu (https://javaabu.com) +--}} + +## Onu MCP server (`@javaabu/onu-mcp`) + +- This project has the Onu MCP server, which serves the docs of the installed `@javaabu/onu`. When writing UI with Onu, call `onu_get_rules` once, then `onu_get_doc` for each component before using it. +- Always activate the `javaabu-onu-mcp` skill when looking up Onu components or their props. diff --git a/packages/onu-mcp/resources/boost/skills/javaabu-onu-mcp/SKILL.md b/packages/onu-mcp/resources/boost/skills/javaabu-onu-mcp/SKILL.md new file mode 100644 index 00000000..714cb6f7 --- /dev/null +++ b/packages/onu-mcp/resources/boost/skills/javaabu-onu-mcp/SKILL.md @@ -0,0 +1,36 @@ +--- +name: javaabu-onu-mcp +description: Look up Onu (@javaabu/onu) components, props and rules with the Onu MCP server's tools (onu_get_rules, onu_list_components, onu_get_doc, onu_search_docs). Use whenever the project has @javaabu/onu-mcp and the task writes or changes React UI with Onu, or asks which Onu component or prop to use. +license: MIT +metadata: + author: Javaabu +--- + +# Looking up Onu with the MCP server + +`@javaabu/onu-mcp` serves the docs of the `@javaabu/onu` installed in the project, so its answers match that version. Use it instead of guessing props from other UI kits. + +## Tools + +| Tool | Use it to | +| --------------------- | ------------------------------------------------------------------------------ | +| `onu_get_rules` | Load the rules for writing Onu code. Call it once, before writing any Onu code | +| `onu_list_components` | See every page by section with a one-line description; `section` lists one | +| `onu_search_docs` | Find the component for a need, e.g. `"date range laravel"` or `"thaana input"` | +| `onu_get_doc` | Read a page by component name (`PasswordInput`), file name or path | + +The rules are also the resource `onu://rules`. + +## How to use them + +1. Call `onu_get_rules` and follow the rules over habits from other UI kits. +2. Before writing a component yourself, search (`onu_search_docs`) or list (`onu_list_components`): Onu probably has it. +3. Call `onu_get_doc` for each component before using it. Use the import from the page's first code block and only the props in its **Props** table, and follow its **Accessibility** notes. + +## When the tools aren't available + +Read the same docs from the package: the rules and the index are in `node_modules/@javaabu/onu/llms.txt`, and each page is at `node_modules/@javaabu/onu/docs//.md`. The `javaabu-onu` skill (shipped with `@javaabu/onu`) covers writing the code. + +## Setup, if the server isn't configured + +Claude Code: `claude mcp add --scope project --transport stdio onu -- npx -y @javaabu/onu-mcp`. Other clients: `{ "mcpServers": { "onu": { "command": "npx", "args": ["-y", "@javaabu/onu-mcp"] } } }`. Set `ONU_DOCS_DIR` to read the docs from another folder. diff --git a/packages/onu/package.json b/packages/onu/package.json index 8c75e51e..c70ce95c 100644 --- a/packages/onu/package.json +++ b/packages/onu/package.json @@ -36,6 +36,7 @@ "docs", "llms.txt", "llms-full.txt", + "resources", "README.md" ], "exports": { @@ -94,8 +95,9 @@ "./fonts-optional.css": "./src/styles/fonts-optional.css" }, "scripts": { - "build": "vite build && node scripts/build-types.mjs && pnpm llms", + "build": "vite build && node scripts/build-types.mjs && pnpm llms && pnpm boost", "llms": "node ../../scripts/llms.mjs --out .", + "boost": "node ../../scripts/boost.mjs", "build:types": "node scripts/build-types.mjs", "test": "vitest run", "test:watch": "vitest", diff --git a/packages/onu/resources/boost/guidelines/core.blade.php b/packages/onu/resources/boost/guidelines/core.blade.php new file mode 100644 index 00000000..e1610e44 --- /dev/null +++ b/packages/onu/resources/boost/guidelines/core.blade.php @@ -0,0 +1,12 @@ +{{-- + @javaabu/onu guidelines for AI code assistants + + Maintained by: Javaabu (https://javaabu.com) +--}} + +## Onu (`@javaabu/onu`) + +- This project builds its React UI with Onu (`@javaabu/onu`), Javaabu's component library on shadcn/ui and Tailwind CSS v4, installed from npm. Don't copy shadcn/ui components into the project or add another UI kit next to it. +- Always activate the `javaabu-onu` skill when adding or changing React pages, forms, tables, layouts or components. +- The rules for writing Onu code, and the docs of the installed version, are in `node_modules/@javaabu/onu/llms.txt`. Read a component's page there before using it, and use only the props it lists. +- Pages run in Dhivehi (right to left): use logical utilities (`ms-`, `pe-`, `start-`, `text-start`), never `left`/`right`. diff --git a/scripts/boost.mjs b/scripts/boost.mjs new file mode 100644 index 00000000..cc9d9e52 --- /dev/null +++ b/scripts/boost.mjs @@ -0,0 +1,91 @@ +#!/usr/bin/env node +/** + * Laravel Boost (https://laravel.com/docs/boost) reads guidelines and skills from + * resources/boost/ in the npm packages a Laravel app depends on directly, and adds + * them to the app's AGENTS.md / CLAUDE.md and skills folder on `boost:install`. + * + * The Onu skill is written once, for the Claude Code plugin + * (plugins/onu/skills/onu/SKILL.md). This copies it into the package as + * packages/onu/resources/boost/skills/javaabu-onu/SKILL.md (generated, not in git), + * named like the other Javaabu packages' skills. + * + * node scripts/boost.mjs # write the package skill (part of the package build) + * node scripts/boost.mjs --check # fail if a published package doesn't ship its Boost + * # guideline, skill and llms.txt (CI, after the build) + */ +import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from "node:fs" +import path from "node:path" + +const root = path.resolve(import.meta.dirname, "..") +const pluginSkill = path.join(root, "plugins/onu/skills/onu/SKILL.md") +const packageSkill = path.join(root, "packages/onu/resources/boost/skills/javaabu-onu/SKILL.md") + +/** The plugin skill with Boost's name and the metadata the other Javaabu skills carry. */ +function boostSkill() { + const source = readFileSync(pluginSkill, "utf8") + const match = /^---\r?\n([\s\S]*?)\r?\n---\r?\n/.exec(source) + if (!match || !/^name: onu$/m.test(match[1])) { + throw new Error(`${path.relative(root, pluginSkill)} must start with front matter containing "name: onu".`) + } + const frontMatter = match[1].replace(/^name: onu$/m, "name: javaabu-onu") + const generated = + "\n" + return `---\n${frontMatter}\nlicense: MIT\nmetadata:\n author: Javaabu\n---\n\n${generated}${source.slice(match[0].length)}` +} + +/** Problems with a published package's AI files; an empty list when it ships them all. */ +function problems(dir) { + const pkg = JSON.parse(readFileSync(path.join(dir, "package.json"), "utf8")) + if (pkg.private) return [] + const found = [] + const files = pkg.files ?? [] + const shipped = (file) => files.some((entry) => file === entry || file.startsWith(`${entry}/`)) + const guideline = "resources/boost/guidelines/core.blade.php" + const skills = path.join(dir, "resources/boost/skills") + const skillFiles = existsSync(skills) + ? readdirSync(skills).map((name) => `resources/boost/skills/${name}/SKILL.md`) + : [] + + for (const file of ["llms.txt", guideline]) { + if (!existsSync(path.join(dir, file))) found.push(`${file} is missing`) + else if (!shipped(file)) found.push(`${file} is not in "files"`) + } + if (!skillFiles.length) found.push("resources/boost/skills//SKILL.md is missing") + for (const file of skillFiles) { + if (!shipped(file)) found.push(`${file} is not in "files"`) + const name = path.basename(path.dirname(file)) + const text = existsSync(path.join(dir, file)) ? readFileSync(path.join(dir, file), "utf8") : "" + if (!new RegExp(`^---\\r?\\nname: ${name}\\r?\\ndescription: .+`, "m").test(text)) { + found.push(`${file} needs front matter starting with "name: ${name}" and a description`) + } + } + // Boost compiles guidelines with Blade: {{ }} and @directives would run instead of showing. + if (existsSync(path.join(dir, guideline))) { + const text = readFileSync(path.join(dir, guideline), "utf8") + .replace(/\{\{--[\s\S]*?--\}\}/g, "") + .replace(/`[^`\n]*`/g, "") + if (/\{\{|\{!!|(^|\s)@(?!javaabu\/)[a-z]+/m.test(text)) { + found.push(`${guideline} has Blade syntax outside backticks`) + } + } + return found.map((problem) => `${pkg.name}: ${problem}`) +} + +if (process.argv.includes("--check")) { + const expected = boostSkill() + const all = readdirSync(path.join(root, "packages"), { withFileTypes: true }) + .filter((entry) => entry.isDirectory()) + .flatMap((entry) => problems(path.join(root, "packages", entry.name))) + if (existsSync(packageSkill) && readFileSync(packageSkill, "utf8") !== expected) { + all.push("@javaabu/onu: the Boost skill differs from plugins/onu/skills/onu/SKILL.md; run node scripts/boost.mjs") + } + if (all.length) { + console.error(all.join("\n")) + process.exit(1) + } + console.log("Every package ships its Boost guideline, skill and llms.txt.") +} else { + mkdirSync(path.dirname(packageSkill), { recursive: true }) + writeFileSync(packageSkill, boostSkill()) + console.log(`Wrote ${path.relative(root, packageSkill)}`) +} From 59bbe1948f7ccea103f42c833c02b97ee4540674 Mon Sep 17 00:00:00 2001 From: Naffah Abdulla Rasheed Date: Sun, 15 Nov 2026 09:50:30 +0000 Subject: [PATCH 2/2] Release v0.3.0 Co-Authored-By: Claude Opus 5.5 --- .changeset/laravel-boost.md | 6 ------ figma/plugin/code.js | 2 +- packages/onu-mcp/CHANGELOG.md | 6 ++++++ packages/onu-mcp/package.json | 2 +- packages/onu/CHANGELOG.md | 6 ++++++ packages/onu/package.json | 2 +- plugins/onu/.claude-plugin/plugin.json | 2 +- 7 files changed, 16 insertions(+), 10 deletions(-) delete mode 100644 .changeset/laravel-boost.md diff --git a/.changeset/laravel-boost.md b/.changeset/laravel-boost.md deleted file mode 100644 index c15b2939..00000000 --- a/.changeset/laravel-boost.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@javaabu/onu": patch -"@javaabu/onu-mcp": patch ---- - -Ship Laravel Boost guidelines and skills in `resources/boost/` (`javaabu-onu`, `javaabu-onu-mcp`), and an `llms.txt` in `@javaabu/onu-mcp`. diff --git a/figma/plugin/code.js b/figma/plugin/code.js index 4bf6c8ef..5daab2d4 100644 --- a/figma/plugin/code.js +++ b/figma/plugin/code.js @@ -2,7 +2,7 @@ (function() { //#region ../packages/onu/package.json - var version = "0.2.1"; + var version = "0.3.0"; //#endregion //#region ../tokens.json diff --git a/packages/onu-mcp/CHANGELOG.md b/packages/onu-mcp/CHANGELOG.md index 342a0a59..bd83ddfc 100644 --- a/packages/onu-mcp/CHANGELOG.md +++ b/packages/onu-mcp/CHANGELOG.md @@ -1,5 +1,11 @@ # @javaabu/onu-mcp +## 0.3.0 + +### Minor Changes + +- 26340b5: Ship Laravel Boost guidelines and skills in `resources/boost/` (`javaabu-onu`, `javaabu-onu-mcp`), and an `llms.txt` in `@javaabu/onu-mcp`. + ## 0.2.1 No changes in this release. diff --git a/packages/onu-mcp/package.json b/packages/onu-mcp/package.json index 6668e030..6063bfb7 100644 --- a/packages/onu-mcp/package.json +++ b/packages/onu-mcp/package.json @@ -1,6 +1,6 @@ { "name": "@javaabu/onu-mcp", - "version": "0.2.1", + "version": "0.3.0", "description": "MCP server for Onu (@javaabu/onu): gives AI assistants the component docs and the rules for writing Onu code.", "license": "MIT", "author": { diff --git a/packages/onu/CHANGELOG.md b/packages/onu/CHANGELOG.md index e2015201..67c1bf3e 100644 --- a/packages/onu/CHANGELOG.md +++ b/packages/onu/CHANGELOG.md @@ -1,5 +1,11 @@ # @javaabu/onu +## 0.3.0 + +### Minor Changes + +- 26340b5: Ship Laravel Boost guidelines and skills in `resources/boost/` (`javaabu-onu`, `javaabu-onu-mcp`), and an `llms.txt` in `@javaabu/onu-mcp`. + ## 0.2.1 ### Patch Changes diff --git a/packages/onu/package.json b/packages/onu/package.json index c70ce95c..ae142d80 100644 --- a/packages/onu/package.json +++ b/packages/onu/package.json @@ -1,6 +1,6 @@ { "name": "@javaabu/onu", - "version": "0.2.1", + "version": "0.3.0", "description": "Javaabu's React UI component library: shadcn/ui based, RTL and Dhivehi first, Thaana keyboard input, one-variable theming.", "license": "MIT", "author": { diff --git a/plugins/onu/.claude-plugin/plugin.json b/plugins/onu/.claude-plugin/plugin.json index 9b3e4bd0..ea970e68 100644 --- a/plugins/onu/.claude-plugin/plugin.json +++ b/plugins/onu/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "onu", "description": "Build UI with Onu (@javaabu/onu): the rules for writing Onu code, and the component docs through the Onu MCP server.", - "version": "0.2.1", + "version": "0.3.0", "author": { "name": "Javaabu Pvt. Ltd.", "url": "https://javaabu.com"