Skip to content

feat(lua-agent-builder): web apps on ui 0.3, lua-ui MCP for components (1.14.0, LUA-1481) - #26

Merged
selcuk-lua merged 2 commits into
mainfrom
selcuk/lua-1481-web-apps-ui-03
Oct 19, 2026
Merged

selcuk-lua merged 2 commits into
mainfrom
selcuk/lua-1481-web-apps-ui-03

Conversation

@selcuk-lua

Copy link
Copy Markdown
Contributor

LUA-1481, part of LUA-1475. Agents that build web app pages now build on the new Lua design and look components up instead of guessing.

What changes

  • lua-ui MCP server: .mcp.json adds lua-ui → https://ui.lua.dev/mcp. It is the public Storybook MCP of @lua-ai-global/ui: read-only, no auth, tools list-all-documentation, get-documentation and get-documentation-for-story. lib/permissions-template.json allows it, and SECURITY.md and the README describe it.
  • lua-skill-builder:
    • Gets the lua-ui tools (both name spellings, as for lua-docs).
    • Its web-app step now says: ui ~0.3 and app-client ~0.1. Look a component up in lua-ui before using it (Page, ListRow, EmptyState, …). Use semantic tokens only, with no palette classes or hex. Write no theme code: app-client applies light/dark, density and the person's accent, so keep only void lua.start(). When a component is newer than the installed ui, name lua apps upgrade <name> for the user.
  • lib/knowledge/web-apps.md:
    • The template stack, a "Look and theme" section and the lua-ui catalog.
    • lua apps upgrade: no code changes from 0.2 to 0.3, look over the pages with lua apps dev, and the gateway restyles apps still on ui < 0.3 until they're rebuilt (ADR 0027).
    • The client API, and two troubleshooting rows.
  • Lints and tests:
    • lint-mcp-config allows the lua.dev host.
    • lint-mcp-refs accepts kebab-case tool names and has a lua-ui registry.
    • lint-permissions and the permissions-mirror test require the lua-ui rule.
    • lint-knowledge-commands knows lua apps upgrade.
  • Release 1.14.0: plugin/package/marketplace versions, the lua-platform MCP stamps and a rebuilt dist/server.js, CHANGELOG, and USER_GUIDE "New in 1.14.0".

Checks

  • npm run lint: 17/17 pass.
  • npm run test:coverage: 68 suites, 2072 tests, thresholds met.
  • mcp/lua-platform build passes.

Notes

  • The tool names come from a live tools/list. They contain hyphens (mcp__plugin_lua-agent-builder_lua-ui__get-documentation), and I haven't yet confirmed in a live Claude Code session that these resolve.
  • lua-architect doesn't get the tools, because it plans and never writes pages.
  • The builder never runs lua apps upgrade itself, so the one-confirmation-per-command rule holds; it names the command for the user.
  • The ui 0.3 / app-client 0.1 template ships from lua-cli 3.55.0.

🤖 Generated with Claude Code

lua-cli 3.55.0 scaffolds pages on @lua-ai-global/ui ~0.3 (the Workspace
enterprise restyle) and app-client ~0.1, which applies the shell's
light/dark, density and accent to <html> itself.

- .mcp.json: the lua-ui server (https://ui.lua.dev/mcp, public Storybook
  catalog of @lua-ai-global/ui); lua-skill-builder gets its three tools,
  the permission template allows the whole (read-only) server
- web-apps.md §2/§4/§9 and lua-skill-builder step 4: no theme code (keep
  void lua.start() only), semantic tokens only, look components up in the
  lua-ui MCP first, Page/ListRow/EmptyState, lua apps upgrade (named for
  the user) when a component is newer than the installed ui, gateway
  restyle of ui < 0.3 apps
- lints: lua.dev remote host, kebab-case MCP tool names, lua-ui registry
  and allow rule, lua apps upgrade
- version 1.14.0 everywhere; dist/server.js rebuilt

Refs LUA-1481.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@selcuk-lua
selcuk-lua requested a review from rares04 October 19, 2026 09:16
rares04
rares04 previously approved these changes Oct 19, 2026

@rares04 rares04 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review — MEDIUM risk

This release adds the remote lua-ui MCP, updates the web-app builder and knowledge guidance for ui 0.3, and bumps the version to 1.14.0. The production gate logic is untouched. The main concerns are a whole-server MCP allow for an unauthenticated remote endpoint and tool names that are not yet confirmed to resolve live. Four changed files were not reviewed.

Major

  • plugins/lua-agent-builder/lib/permissions-template.json:109 — Whole-server allow (mcp__plugin_lua-agent-builder_lua-ui, mcp__lua-ui) for a remote, unauthenticated MCP. Any tool added later would run without a prompt, and lua-docs is explicitly protected against this exact pattern. Allow the three tools individually (plugin and bare spellings), and make lint-permissions and the mirror test enforce that and forbid the whole-server rule.
  • plugins/lua-agent-builder/agents/lua-skill-builder.md:5 — Hyphenated tool names are unverified in a live Claude Code session (admitted in the PR body). If they do not resolve, the builder's mandatory lookup step cannot run and it may guess props. Verify live before merge and add a fallback, for example reading the installed ui package types.

Minor

  • plugins/lua-agent-builder/scripts/lint-mcp-config.mjs:49 — The host regex trusts every *.lua.dev subdomain. Pin the exact hosts.
  • plugins/lua-agent-builder/lib/knowledge/web-apps.md:74 — The "no theme code" guidance assumes app-client 0.1. Older templates (lua-cli 3.42–3.45) install an unpinned app-client that may be 0.0.x, so those pages could lose theming. Gate the guidance on the app-client or lua-cli version.

PR Risk Reviewer — automated senior review of 5fc21b5 · risk: medium · confidence: 0.60

…ed theme guidance

Review round 1 on #26:
- permissions: the ui catalog's three tools are allowed one by one in both
  spellings; lint-permissions and the mirror test require them and forbid a
  whole-server allow rule for any remote (http/sse) server in .mcp.json
- the server key is `ui` (was `lua-ui`), so every composed plugin tool name
  is <= 64 chars (longest: ..._ui__get-documentation-for-story, 61).
  lint-mcp-refs checks raw tool names against ^[A-Za-z0-9_-]{1,64}$ and
  composed names for charset and a 128 ceiling: composed names of 65-69
  chars (lua-docs query_docs_filesystem_lua_cli, lua-platform
  list_primitive_versions) already resolve live, so 64 is not the
  composed limit
- skill builder / web-apps.md: when the ui tools are unavailable, read the
  installed package's exports and dist .d.ts instead of guessing props
- lint-mcp-config pins remote hosts exactly (docs.heylua.ai, ui.lua.dev;
  https, no port, no credentials)
- theme guidance gated on app-client in web/package.json: no theme code on
  0.1+; keep the template's lines on 0.0.x or the copied 3.42-3.45 client
  and recommend lua apps upgrade

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

@rares04 rares04 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review — LOW risk

Previously flagged

  • previously flagged Whole-server allow for a remote MCP — resolved. The three ui tools are now allowed individually in both spellings. lint-permissions and the mirror test forbid whole-server allows for any remote server.
  • previously flagged Hyphenated tool names unverified live — resolved in practice. The builder now falls back to reading the installed ui package. Live confirmation is still outstanding (see Minor).
  • previously flagged Host regex widens trust to all lua.dev subdomains — resolved. The lint now uses an exact-host allowlist with https, no port and no credentials.
  • previously flagged Behavior change for older lua-cli — resolved. Theme guidance is gated on the app-client version, and older apps keep their theme lines.

The new commits fix every prior finding. The production gate logic is untouched, and the permission tightening is enforced by both a lint and a test. Several omitted files limit confidence slightly.

Minor

  • plugins/lua-agent-builder/agents/lua-skill-builder.md:5 — The hyphenated tool names are still unconfirmed in a live session. The fallback makes this non-blocking. Run one live get-documentation call and record the result in the PR.
  • plugins/lua-agent-builder/scripts/lint-mcp-refs.mjs:33 — COMPOSED_MAX of 128 is an unverified sanity ceiling. Do not treat it as proof that a name resolves.

PR Risk Reviewer — automated senior review of 91b80ae · risk: low · confidence: 0.72 · re-review · round 2

@selcuk-lua

Copy link
Copy Markdown
Contributor Author

@rares04 thanks. All four are addressed in 91b80ae.

Major

  1. Per-tool allow. permissions-template.json now lists the three tools individually, in both spellings.
    • lint-permissions requires all six rules. It also fails on any whole-server allow (X, X__*, X*) for any http/sse server in .mcp.json.
    • The permissions-mirror test enforces the same two rules.
  2. Tool names resolve, with a fallback.
    • The server key is now ui, so the names are short: the longest is mcp__plugin_lua-agent-builder_ui__get-documentation-for-story at 61 characters. The bare spelling is mcp__ui__….
    • Hyphens are valid in MCP tool names (^[A-Za-z0-9_-]{1,64}$ per tool). lint-mcp-refs now enforces that on every reported tool and on server keys, and it checks the characters and a sanity length of each composed name.
    • Composed plugin names over 64 already resolve in Claude Code; e.g. mcp__plugin_lua-agent-builder_lua-docs__query_docs_filesystem_lua_cli (69) is in use. So I didn't cap those at 64.
    • Fallback: when the ui tools are unavailable, the skill builder and web-apps.md read web/node_modules/@lua-ai-global/ui (the exports and dist/components/**/<component>.d.ts) instead of guessing props.

Minor
3. Exact hosts. lint-mcp-config parses the URL and requires https, a host of exactly docs.heylua.ai or ui.lua.dev, no port and no credentials. evil.lua.dev fails.
4. Gated theme guidance. It reads web/package.json first.

  • app-client 0.1 or later: no theme code, and lua apps upgrade removes old lines.
  • app-client 0.0.x, or the copied 3.42–3.45 client: keep the template's theme lines and recommend lua apps upgrade <name>.

npm run lint passes. test:coverage: 68 suites, 2073 tests, thresholds met.

@selcuk-lua
selcuk-lua requested a review from rares04 October 19, 2026 09:25
@selcuk-lua

Copy link
Copy Markdown
Contributor Author

@rares04 both minors addressed, with evidence:

  • Live check of the tools and hyphenated names.
    • I called the server directly, as the plugin will (POST https://ui.lua.dev/mcp, JSON-RPC tools/call). list-all-documentation returned the catalog (Welcome, Colors, Tokens, … Button as form-button). get-documentation with {"id":"form-button"} returned the Button docs and stories (import { Button, Icon } from "@lua-ai-global/ui", the Default and Variants stories).
    • Claude Code already resolves hyphenated MCP tool names in a live session. In this session, mcp__plugin_context7_context7__resolve-library-id and mcp__plugin_context7_context7__query-docs are loaded and callable. The plugin's names follow the same shape, and the longest is mcp__plugin_lua-agent-builder_ui__get-documentation-for-story at 61 characters.
  • COMPOSED_MAX. lint-mcp-refs.mjs already says so in its header comment: "COMPOSED_MAX (128) is a sanity ceiling, not a verified Claude Code limit". The proof that the names resolve is the live evidence above, not the constant.

@selcuk-lua
selcuk-lua merged commit c625c10 into main Oct 19, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants