CtrlK
BlogDocsLog inGet started
Tessl Logo
SkillPublic

ui-eng-vision-orchestrator

High-level orchestrator for managing multi-pass migration of Chrome DevTools legacy components to the modern UI engineering vision (UI.Widget & Lit-html).

Quality

68%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Passed

No findings from the security scan

Fix and improve this skill with Tessl

tessl review fix ./.agents/skills/ui-eng-vision-orchestrator/SKILL.md
SKILL.md
Quality
Evals
Security

UI Engineering Vision Orchestrator: Meta-Skill Instructions

This meta-skill acts as the central coordinator for modernizing legacy Chrome DevTools views into declarative UI.Widget components based on lit-html, managing a multi-pass sequential CL pipeline to ensure each code modification is small, testable, and highly reviewable.

Refer to ui_engineering.md for general principles.


🛑 Critical Constraints & Forbidden Actions

  1. NEVER Break the Build: Code must compile and tests must pass at all steps. If you change a class API or method signature, you MUST update its usage in the same CL to maintain stability.
  2. Strict Intermediate Stability: Do not leave the code in a broken state between passes.
  3. No Beautification of Adjacent Code: Do NOT fix unrelated typos, formatting issues, or lint warnings in code you aren't actively migrating.
  4. No Monolithic Refactors: Do NOT batch Lit conversion and Widget Promotion in the same pass (except for small < 150 LOC leaf widgets). Keep CLs small and focused.

1. Migration Philosophy & Plan-Validate-Execute Pattern

  1. The Plan-Validate-Execute Principle: For each target file, the orchestrator must first generate a structured migration_plan.md listing the exact transformations, file targets, and subskills allocated for each pass.
  2. User Acceptance Gate: The orchestrator must halt execution and present the migration plan to the user. No code modification, subskill loading, or CL staging can occur until the user explicitly accepts the plan.
  3. No Assumptions on Inheritance: Do not assume the class hierarchy in a file matches older patterns or generic examples. Always perform a structure analysis of the active file first and adapt the plan to the actual, current code.
  4. Reusable vs. Single-Use Web Components Gate:
    • Reusable UI primitives (front_end/ui/components/**, front_end/ui/kit/** — shared buttons, menus, dialogs, links, badges, or trees reused across panels) must remain custom elements (HTMLElement). Do not migrate them to UI.Widget or DEFAULT_VIEW.
    • Single-use custom elements (extends HTMLElement or LitElement under front_end/panels/**/components/ used solely for encapsulation in one feature or panel) should migrate to UI.Widget + DEFAULT_VIEW + @scope to (devtools-widget > *).
  5. Hybrid Files/Multiple Classes: Files may contain multiple classes in different states of modernization (e.g., one partially migrated class and one fully legacy class). If the file being migrated contains several classes, the migration needs to be done separately for each class, starting with the leaves and going up the dependency chain. Propose modifications only for classes with actual violations.
  6. Coupling Analysis: Always check the integration files (e.g., sidebar files, parent panel files) where the target class is instantiated to see if there are any direct .element or .contentElement couplings. If found, include the decoupling of these references in the plan.
  7. Neighboring Component Reference: Inspect neighboring modernized files of the same archetype (e.g., DOMStorageItemsView.ts or KeyValueStorageItemsView.ts for storage-like components) to find proven patterns for toolbar and data-grid configurations.
  8. The Narrow Bridge Principle: Keep code modifications tightly scoped to a single responsibility per CL. Do not combine technology migrations (e.g., converting imperative DOM to Lit-html) with base class refactoring in the same diff.
  9. Strict Intermediate Stability: The code must compile and work correctly, and all tests must pass after each step. You MUST update usages if you change APIs.
  10. Establish Comprehensive Guardrails First: Ensure both logic tests (verifying presenter interactions and state updates) and screenshot tests (verifying layout/styling) exist before rewriting code. If coverage is missing, scaffold it first.
  11. Pre-flight Clarification: Before starting, verify if the task is underspecified or ambiguous. If so, point this out and ask for clarifications before proceeding.
  12. Step Sizing (~35–200 LOC Target, <= 350 Ceiling) & 100% Live-Code Rule: Aim for ~35–200 LOC in-place CLs (small < 150 LOC leaf widgets may complete in one CL), and keep every CL at or under 350 changed lines (insertions + deletions). Every CL must execute 100% of its new view and presenter code in production, remove the imperative code it replaces, and include unit tests covering that behavior in the same CL. Never create a CL that adds an unused DEFAULT_VIEW or *_VIEW export, defers unit tests to a follow-up test-only CL, or defers imperative dead-code removal to a cleanup-only tail CL. The agent must stop and report back after each step or substep to allow verification.
  13. Context Hygiene via Subagents: To keep the main conversation context clean and focused on high-level orchestration, prefer delegating intense execution tasks (like running tests, debugging compilations, or processing independent classes in parallel) to specialized subagents.
  14. Cross-Repo Runtime Coupling Check (legacy_test_runner & blink/web_tests): Before converting TypeScript private fields/methods to ES #private or removing widget properties (e.g., .tabbedPane, .sidebarPaneStack, .threadsSidebarPane, .searchInputElement), search both front_end/legacy_test_runner/**/*.js and Chromium's third_party/blink/web_tests/http/tests/devtools/**/*.js (which run on dtf_linux_rel CQ via blink_web_tests and reflectively access private members in untyped JS). Keep accessed members as TypeScript private with a // Accessed in web_tests / legacy_test_runner comment, or migrate the web_tests first in a dedicated CL.
  15. Strict CL Splitting Rules:
    • Live Split Patterns (<= 350 Lines): When a migration exceeds 350 lines, split using one of three live-code patterns: (a) one live class or low-fanout shared helper per CL (leaf-to-root, wired to callers and tested immediately), (b) 2-pass Local Lit in performUpdate() -> UI.Widget + DEFAULT_VIEW promotion (Pass 1 renders Lit templates live in performUpdate(), removes imperative DOM, and tests behavior; Pass 2 promotes to DEFAULT_VIEW and createViewFunctionStub tests), or (c) vertical UI compartment slices (migrating one toolbar, settings pane, split pane, or formatter batch end-to-end per CL).
    • Separate Infrastructure & Shared-Helper CLs: Keep shared ui/legacy, ui/kit, or UI.UIUtils changes (e.g., converting a low-fanout helper like UI.UIUtils.maybeCreateNewBadge to return LitTemplate across its callers, or adding an HTML-native ID/attribute API to <devtools-menu>) in separate, preceding CLs rather than inlining helper internals or adding ref(...) workarounds at call sites. Always verify with cog_api.py diff before uploading that no changes from later commits leaked into earlier infrastructure CLs.
    • CL Descriptions & Bug Trailers Across Stacks: Carry the target Buganizer issue ID across every CL in a split stack (Bug: <id> on intermediate CLs, Fixed: <id> only on the final complete CL). Write descriptive <= 72-character subject lines stating what each CL changes functionally, without pass or step numbers (Pass 1:, (2/6)) in the subject line.
    • Standalone CSS @scope CLs: Migrating a Light DOM widget includes ensuring its stylesheet is wrapped in @scope to (devtools-widget > *) (removing the file from the @devtools/no-unscoped-light-dom-styles burndown list in eslint.config.mjs once scoped). Always land this in a small, standalone CSS CL separate from logic, template, or widget-promotion CLs for bisectability, with screenshot baselines established beforehand.

2. Multi-Pass Execution Lifecycle

Plan Generation (Gated)

  • Actions:
    1. Verify if the task is underspecified or ambiguous. If so, ask for clarifications first.
    2. Scan the target file to determine size, complexity, legacy elements (e.g., ReportView, ToolbarButton, DataGrid, TreeOutline), and actual class inheritance. Deconstruct the file mentally (or in the plan) into Business Logic (state, event handlers) and Rendering Logic (DOM creation, CSS classes). Reference code elements by Name (not line numbers) to ensure the plan remains valid as the codebase evolves. Check if the class dependencies have been migrated to the ui eng vision or not. If the file contains multiple classes, plan the migration separately for each class, starting with the leaves and going up the dependency chain.
    3. Check the files depending on this file, to understand how the code in this file is being used.
    4. Dynamic Ordering Decision: Determine whether to run Logic Consolidation first or Local lit-html rendering first:
      • Option A (Logic First): Choose this if the component has a complex, nested state model or highly coupled event-handlers. Consolidating the state variables and defining the ViewInput interface first provides a clean data contract, making the subsequent template conversion highly deterministic.
      • Option B (Technology First): Choose this if the component has a relatively simple state flow but massive, deeply nested imperative DOM construction. Converting the layout to declarative Lit templates first (using temporary inline or local state) makes it much easier to isolate and group the remaining state updates afterward.
    5. Generate a migration_plan.md using the Structured Plan Template below.
    6. Halt execution and print the formatted plan in Markdown to the chat. Wait for user approval.

📝 Structured Plan Template

The plan you generate MUST follow this structure:

# Migration Plan: [FileName.ts]

## 📊 Current State
- **Hybrid File**: [Yes/No]
- **Classes Found**: [ClassA, ClassB]
- **Strategy Selection**: [Option A (Logic First) | Option B (Tech First)]

## 🛠️ Passes Checklist
- [ ] **Pass 0: Baseline & Safety Scaffolding**
  - Assigned to: `ui-eng-vision-test-scaffolder`
- [ ] **Pass 0.5: Privatize & Dead-Code Cleanup**
  - Mechanical prefactor: convert TypeScript `private` to ES `#private` and remove dead code
- [ ] **Pass 0.75: Light DOM CSS @scope Wrapping (Standalone CL)**
  - Ensure stylesheet is wrapped in `@scope to (devtools-widget > *)` and remove entry from the `@devtools/no-unscoped-light-dom-styles` burndown list in `eslint.config.mjs`
- [ ] **Pass 1: Logic Consolidation**
  - Assigned to: `ui-eng-vision-logic-consolidator`
- [ ] **Pass 2: Lit-HTML Rendering**
  - Assigned to: `ui-eng-vision-local-lit-renderer`
- [ ] **Pass 3: Widget Promotion**
  - Assigned to: `ui-eng-vision-widget-promoter`

Baseline & Safety Scaffolding

  • Trigger Condition: User explicitly says "I accept the plan" or equivalent.
  • Subskill to Import/Delegate: ui-eng-vision-test-scaffolder (Delegate to a subagent to encapsulate verbose test logs)
  • Actions:
    1. Verify existing test coverage. Propose and add missing logic tests for interactions and screenshot tests for visual validation to avoid regressions.
    2. Pay extra attention not to skip this step.

Privatize & Dead-Code Cleanup (Pass 0.5)

  • Trigger Condition: Baseline tests green.
  • Actions:
    1. Perform the Cross-Repo Runtime Coupling Check against legacy_test_runner and blink_web_tests first.
    2. Convert internal TypeScript private fields/methods to ES #private (except those reflectively accessed by web tests).
      • Remove the target file from the @devtools/prefer-private-class-members ignore list in eslint.config.mjs (never combine a top-level inline /* eslint-disable @devtools/prefer-private-class-members */ with an eslint.config.mjs ignore entry, because eslint --fix strips the inline disable while the rule is off in eslint.config.mjs).
      • Run ./dt lint <file> to apply the AST autofixer, then manually convert cross-instance other.m() calls and rewrite this.#fn = this.#fn.bind(this) to arrow properties (#fn = (): void => { ... }). Preserve TypeScript private with // eslint-disable-next-line @devtools/prefer-private-class-members only for Object.create prototypes or legacy *TestRunner.js / blink/web_tests hooks.
    3. Identify and remove unused dead code, redundant containers, or obsolete split widgets in a dedicated prefactor CL so mechanical renames don't clutter logic and view CLs.
    4. Verify that all tests and lints pass and stage this prefactor CL before proceeding to logic consolidation.

Light DOM CSS @scope Wrapping (Pass 0.75 / Standalone CSS CL)

  • Trigger Condition: Baseline tests green (screenshot baselines established).
  • Actions:
    1. Wrap the Light DOM widget's stylesheet in @scope to (devtools-widget > *).
    2. Remove the file from the @devtools/no-unscoped-light-dom-styles burndown list in eslint.config.mjs.
    3. Verify zero visual regressions against screenshot goldens and land this in a small, standalone CL separate from logic, template, and widget-promotion CLs for bisectability.

Logic Consolidation

  • Trigger Condition: Pass 0.5 staged (or baseline tests green if 0.5 skipped).
  • Subskill to Import/Delegate: ui-eng-vision-logic-consolidator (Delegate to a subagent to maintain focus)
  • Actions:
    1. Extract manual elements, constructor DOM configurations, and imperative updates into private update helper methods with structured state-passing.

Local Lit-HTML Rendering (Technology Migration)

  • Trigger Condition: Previous pass staged.
  • Subskill to Import/Delegate: ui-eng-vision-local-lit-renderer (Delegate to a subagent for isolated template generation)
  • Actions:
    1. Migrate imperative elements to declarative templates (using component mapping rules defined inside the subskill) and render them locally within the existing view.

Widget Promotion (Architectural Bridge)

  • Trigger Condition: Both local template rendering and logic consolidation staged.
  • Subskill to Import/Delegate: ui-eng-vision-widget-promoter (Delegate to a subagent for final architectural cleanup)
  • Actions:
    1. Promote view classes to modern UI.Widget classes, hook up performUpdate() delegates, export the default view layout, and clean up legacy wrappers.

3. Incremental Multi-CL Playbook for Complex Tree & List Widgets (UI.TreeOutline → <devtools-tree>)

For complex widgets with deeply nested item hierarchies, custom tree element subclasses, or inline editing (such as NavigatorView or SearchResultsPane), monolithic migrations introduce high review friction and regression risk. Decompose the work into a 4-phase sequence of small, self-contained CLs (~50–250 lines of diff each):

Phase 0: Safety Net, Cleanup & Latent Bug Fixes (Independent CLs)

  1. Dead-Code Removal: Remove dead helper methods, unused getters, and obsolete container references in an initial standalone CL.
  2. Implementation-Decoupled Tests: Add structural and interaction unit tests whose DOM assertions route through small local test helpers (dumpTree(), findTreeItem(), activateRow(), openContextMenuOnRow()) rather than scattering direct tree-outline element queries across tests.
  3. Screenshot Baselines: Add assertScreenshot(...) golden tests covering critical visual states (grouping modes, icons/badges, selection, dimmed items) to establish baselines that catch visual regressions independently of the underlying widget engine.
  4. Targeted Bug Fixes: If test scaffolding uncovers latent bugs in existing logic, fix them in dedicated bugfix CLs before refactoring.

Phase 1: Decouple Custom Item Subclasses One Concern per CL (Bug: <id>)

  1. Sorting & Comparators: Move sorting functions from item elements to presenter data nodes.
  2. Row Event Handlers: Move row event handlers (hover, context menu, drag, rename triggers) to presenter methods.
  3. Icon & Action Templates: Convert imperative leading/trailing icons, badges, and action buttons into module-level Lit template helpers, removing view-layer refresh methods (updateTrailingIcons(), updateIcon()) from presenter nodes once state moves to DEFAULT_VIEW.
  4. State Tracking in Presenter: Track selection, expansion (WeakSet), and lazy population in the presenter via tree events rather than overriding TreeElement.onpopulate() or onselect().
  5. Remove Custom Subclasses: Delete custom TreeElement subclasses one class per CL, using plain UI.TreeOutline.TreeElement instances paired with a WeakMap<TreeElement, Node> bridge and computing presenter node state (title, tooltip, badges) independently of TreeElement creation.

Phase 2: Persistent <devtools-prompt> & <devtools-tree> Swap (Bug: <id>)

  1. Persistent <devtools-prompt ?editing>: Migrate inline renaming or editing (UI.InplaceEditor) to a persistent <devtools-prompt ?editing> in its own CL, updating E2E tests waiting on .being-edited to wait on devtools-prompt[editing].
  2. Test-Helper Prep CL: If front_end/legacy_test_runner/** or blink_web_tests walk internal tree elements, update test helpers to flush innerView.performUpdate() and flushPendingUpdatesForTesting() after expanding nodes.
  3. <devtools-tree> Swap: Replace TreeOutlineInShadow with <devtools-tree autofocus> in DEFAULT_VIEW without widening front_end/ui/legacy/Treeoutline.ts contracts. Host editable <devtools-prompt ?editing> rows in a child UI.Widget (${widget(...)}) so <devtools-tree>'s light-DOM MutationObserver does not re-clone the row and blur the active input. Use asynchronous this.requestUpdate() across all presenter methods and remove /* eslint-disable @devtools/no-imperative-dom-api */.

Phase 3: Pure Lifecycle, INJECT DI & Final Polish (Fixed: <id> on Final CL Only)

  1. Non-Destructive Lifecycle: Move model, workspace, and setting subscriptions from constructor() into wasShown() / willHide(), reconciling incremental changes that occurred while hidden rather than calling reset() and wiping open folders or selection on every re-show.
  2. Universe Dependency Injection: When Universe dependencies are used, add static override readonly INJECT and the standard MVP constructor (element?: HTMLElement, [...]: WidgetDependencies, view: View = DEFAULT_VIEW) (omit the WidgetDependencies parameter when INJECT is empty).
  3. Private Fields & Completeness: Convert remaining TypeScript private members to #private (after verifying they are not reflectively accessed in legacy_test_runner or blink/web_tests), and mark Fixed: <id> on this final CL.

4. Definition of Done & Bug: vs Fixed: Completeness Gate

[!WARNING] A clean @devtools/no-imperative-dom-api ESLint run does NOT prove a UI Eng Vision migration is complete. The rule does not flag extends UI.TreeOutline.TreeElement subclasses, new MyTreeElementSubclass(...), UI.InplaceEditor, unchained createIcon() calls (for example, passed directly to this.setLeadingIcons([icon])), or unattached new UI.{TabbedPane,TextPrompt,FilterBar} instances (when not attached to this.element or this.contentElement). Conversely, non-UI.Widget helper classes that own this.element or this.contentElement are flagged. To inspect suppressed violations despite a file-level disable, run from the devtools-frontend root: vpython3 third_party/node/node.py --output node_modules/eslint/bin/eslint.js --no-inline-config --rule '@devtools/no-imperative-dom-api: error' -f json <file>

Before closing a UI Eng Vision migration issue with Fixed: <id>, verify every requirement below. If any item remains incomplete, use Bug: <id> and address it in a follow-up CL:

  1. No Legacy Widgets: Zero references to UI.TreeOutline, TreeElement subclasses, UI.ListControl, UI.ListWidget, or UI.InplaceEditor.
  2. Standard MVP Constructor: Constructor accepts element?: HTMLElement as its first parameter, receives [...]: UI.Widget.WidgetDependencies<typeof MyWidget> as parameter #2 only when static override readonly INJECT is non-empty, and accepts an injectable view: View = DEFAULT_VIEW last.
  3. Widget Update Lifecycle: Renders exclusively via override performUpdate(): void and this.requestUpdate() (no custom #renderView() bypasses or synchronous performUpdate() calls in presenter methods).
  4. Non-Destructive Listener Lifecycle: External model and setting listeners are attached in wasShown() and detached symmetrically in willHide(), preserving populated UI state across hide/show cycles.
  5. Declarative Primitives: Uses <devtools-tree>, <devtools-list>, persistent <devtools-prompt ?editing>, ?hidden=${...} exclusively (without .hidden classes), and declarative autofocus for default focus.
  6. ES Private Fields & Config Cleanup: Uses ECMAScript #private fields and methods for all internal members not on Object.create prototypes or accessed by legacy_test_runner / blink/web_tests, removes the file from the @devtools/prefer-private-class-members ignore list in eslint.config.mjs, and passes ./dt lint <file>.
Repository

ChromeDevTools/devtools-frontend

Path

.agents/skills/ui-eng-vision-orchestrator/SKILL.md

Last updated
First committed

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.