一键导入
ui-eng-vision-local-lit-renderer
Migrates legacy imperative DOM construction to local declarative Lit-html templates rendered inside existing containers.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Migrates legacy imperative DOM construction to local declarative Lit-html templates rendered inside existing containers.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when migrating Chromium layout tests to DevTools unit tests
Use when starting a new task, creating a branch, switching branches, managing branches, creating and uploading CLs, handling stacked changes, or checking release and roll status in the DevTools Gerrit-based workflow. ALWAYS use this instead of running standard git checkout/switch commands for branch creation.
Reproduce and investigate flakiness in a test.
Refactor user-facing UIStrings and localization comments in a DevTools module folder according to UX writing guidelines (child task of b/40799900). Use when simplifying wording, checking sentence case, or improving L10n comments in UIStrings for a specific folder or issue. Don’t use for general code changes or non-UIStrings files.
Consolidates manual DOM creation, updates, and constructors into private helper methods and structured state interfaces.
High-level orchestrator for managing multi-pass migration of Chrome DevTools legacy components to the modern UI engineering vision (UI.Widget & Lit-html).
| name | ui-eng-vision-local-lit-renderer |
| description | Migrates legacy imperative DOM construction to local declarative Lit-html templates rendered inside existing containers. |
| allowed-tools | code_search open_urls |
This subskill converts consolidated imperative DOM construction helper methods into reactive, declarative Lit-html templates, rendering them locally inside the existing element containers.
Conserve Abstraction Topology:
Determine Render Lifecycle per Layer:
performUpdate() to execute
the main lit render call, and use this.requestUpdate() to queue
updates.update() or scheduleUpdate()) and invoke render() directly inside
that method. Do not introduce Widget lifecycle methods
(performUpdate) on classes that do not inherit them.Import Modern Templating:
Import the Lit rendering system inside the view module:
import {html, render, nothing} from '../../ui/lit/lit.js';
Modern Component Mapping:
Local Modular Renders:
appendField or createChild on a parent layout),
prefer local modular renders (rendering templates individually into
each container) to preserve the legacy layout framework. Do not force a
monolithic template if doing so violates the existing topology.Resolve TypeScript Type Friction:
Element. Lit's render()
function expects HTMLElement | DocumentFragment.as HTMLElement or update its class property type definition from Element
to HTMLElement to satisfy the TypeScript compiler.render(this.template(), this.containerField as HTMLElement);Delegate to Unmigrated Rendering Engines:
HTMLElement or Element instances directly. Treat unmigrated utilities as "black boxes" that generate DOM, and embed their output in standard template expressions: htmlHandle Asynchronous DOM Updates:
.then() callback), render the parent container or a placeholder
template first. Once the data is retrieved, execute a local render()
inside the callback targeting the specific sub-container.Template Factorization Strategies:
nothing: Use Lit's nothing sentinel instead of empty
strings '' or empty templates for conditional rendering.LitTemplate. This avoids
monoliths, preserves readability, and reuses template cache strategies.Visual Parity and Accessibility:
span to
div) or drop class names during template translation, as CSS may
depend on them.<devtools-button>) defaults may not match legacy appearance.
Explicitly bind .data=${{variant: Buttons.Button.Variant.OUTLINED}}
(or appropriate variant) rather than relying on defaults.ARIAUtils.markAsAlert()) to native ARIA
attributes in the template (e.g., role="alert", aria-live="polite").Render Templates Syntax & Code Movement:
// clang-format off and // clang-format on to prevent clang-format from
corrupting template indentation.Wait for confirmation: