Skip to content

feat(subagents): add ui-designer builtin preset and template chip - #292

Merged
vastsa merged 2 commits into
vastsa:mainfrom
muzimu217:feat/ui-designer-preset
Sep 13, 2026
Merged

vastsa merged 2 commits into
vastsa:mainfrom
muzimu217:feat/ui-designer-preset

Conversation

@muzimu217

Copy link
Copy Markdown
Contributor

What

Adds a fifth builtin subagent, ui-designer, as a "start from template" chip next to Explorer / Code reviewer / Test runner / Fixer.

The delegate takes one interface task with its brief and returns a working, browser-checked implementation — the same kind of self-contained, delegable phase fixer covers (ADR 0089), for the case where the main agent hands off visual work instead of doing it inline at full context cost. The prompt distills a UI-delivery workflow: preserve the project's established design system (existing tokens outrank the delegate's own taste), write a small design contract when none exists (semantic tokens, 4px/8px rhythm, Do/Don't rules), implement the whole interaction including every reachable state, keep motion purposeful with reduced-motion variants, and verify the rendered result in BrowserPreview at desktop and mobile widths before reporting. The report follows the existing <summary>/<changes>/<verification> convention. It is adapted from the author's open-source UI Design Agent Kit, reworked for the delegate's tool set and the no-user-mid-run delegate model.

  • Tools: Read, Glob, Grep, BrowserPreview, Bash, Edit, Write at maxTurns: 80 — write-capable like fixer, plus BrowserPreview so it can check its own rendered output. BrowserPreview is already in SUBAGENT_ASSIGNABLE_TOOLS and the host-side tool vocabulary; no host (Rust) change.
  • Lockstep: SUBAGENT_PRESETS (shared, the editor's starter values) and BUILTIN_SUBAGENT_DOCUMENTS (agent-runtime, the prompt the sidecar loads) carry identical name/description/tools/maxTurns/body — verified field-by-field by script. The hyphenated id resolves through the editor's catalog map (presetUiDesignerName / presetUiDesignerDesc) with copy in all eight locales.
  • Spec pairs updated (en + zh-CN): the settings sheet section (chip row + catalog map), the runtime catalog list / maxTurns table / write-capable wording (correcting the stale "only writable builtin" phrasing), and E2E-142's precondition list.

Deliberately not changed

  • The four existing presets' copy, tools and turn caps are untouched; the blank chip stays last.
  • decisions-log.md keeps its historical D201 "four builtins" wording — it records the decision as made at the time.
  • No new runtime code path: the preset is data for the same parser, merge order and SubagentRun lifecycle as the other builtins (catalog cap 16 leaves headroom at five).

Verification

  • Lockstep check: scripted field-by-field comparison of the shared preset vs the builtin document (name, description, tools, maxTurns, body) — all equal.
  • pnpm -r test green on the final HEAD: desktop 1463, agent-runtime 363, shared 498, plugin-sdk 224, i18n 23 (8-locale catalog parity), agent-host 34, plugin-devkit 46 — 0 failures. Updated tests: shared presets (five ids; Edit/Write granted only to fixer + ui-designer), agent-runtime builtin parse (five names; mutating = [fixer, ui-designer]; BrowserPreview present), desktop source-contract test (preset id list, tools/maxTurns, body spot-check).
  • desktop typecheck, lint, docs:check (77 en/zh pairs) green. No Rust change.
  • Live app check: launched the desktop app from this branch and opened Settings → Subagents → New — the UI designer chip renders in the template row, and picking it pre-fills name, description, all seven tools, max turns 80 and the prompt body (verified via CDP with screenshot).

E2E disposition per AGENTS §15 (fork PR):

E2E: NOT RUN
Suite: no listed suite drives the New-subagent template row end to end
Reason: renderer Settings surface; the delegate itself runs the unchanged SubagentRun path shared by all builtins
Alternative validation: unit + source-contract tests above, plus the CDP-driven live check of the template row (chip renders, form pre-fills)
Remaining risk: none beyond the existing builtin delegation path — the preset adds data, not new runtime behavior

muzimu217 and others added 2 commits September 13, 2026 01:18
Add a fifth builtin subagent, ui-designer, distilled from the UI Design
Agent Kit methodology: preserve the project's established design system
(or write a small design contract when none exists), implement the whole
interaction including every reachable state, keep motion purposeful with
reduced-motion variants, and verify the rendered result in BrowserPreview
before reporting.

The preset grants Read, Glob, Grep, BrowserPreview, Bash, Edit and Write
at 80 max turns, ships in lockstep in SUBAGENT_PRESETS (shared, UI starter
values) and BUILTIN_SUBAGENT_DOCUMENTS (agent-runtime, the prompt the
sidecar loads), gains the hyphenated-id catalog entry
(presetUiDesignerName / presetUiDesignerDesc) across all eight locales,
and updates the en/zh spec pairs for the settings sheet, the runtime
catalog and the E2E-142 preconditions.

@vastsa vastsa left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Reviewed the refreshed head 396becc. The ui-designer preset preserves the existing builtin/user precedence and permission model; the landing test correction now covers all five builtins and the designer capability contract. Isolated current-main validation passed Agent Runtime 363/363, Shared 498/498, Desktop 1494/1494, docs locale checks, smoke E2E 18/18 with 2 live-model cases skipped without a key, and subagents E2E 19/19. Required JS, Rust, and docs checks are green.

@vastsa
vastsa merged commit 68d91f8 into vastsa:main Sep 13, 2026
3 of 4 checks passed
@muzimu217

Copy link
Copy Markdown
Contributor Author

Thank you for the isolated validation and the approval — glad the preset landed cleanly alongside the precedence/permission model. Noted on the verification numbers (Agent Runtime 363/363, Shared 498/498, Desktop 1494/1494, smoke 18/18 + subagents 19/19).

Two market prototype PRs (#285, #290) received your boundary/semantics findings; fixes are starting now and will come back with per-point evidence before re-requesting review.

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