Consolidates manual DOM creation, updates, and constructors into private helper methods and structured state interfaces.
65%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./.agents/skills/ui-eng-vision-logic-consolidator/SKILL.mdThis subskill extracts manual layout building, attribute modifications, and rendering loops out of the constructor and scattered event handlers, consolidating them into private helper methods with explicit data contracts.
Identify UI updates Creation:
element.createChild('div'), document.createElement,
element.appendChild).render.Isolate Update and Draw Operations:
#updateSummaryBar(...) or #createEditorToolbar(...)).pageSize,
modified during buttons clicks) into centralized functions like
onPageSizeChanged.Define the State Interface:
Identify the class state and ensure it is captured in the private member variables, e.g.
#entries: Entry[];
#canGoBack: boolean;
#canGoForward: boolean;
#staleWarningVisible: boolean;Replace direct mutations of UI with updates to these #private member
variables, then trigger a single consolidated update path:
this.#updateUI()) that updates existing
element references in place (inlining if there are only one or two
update helpers). Do not call this.performUpdate() synchronously
on state updates.this.requestUpdate().Extract/Consolidate Rendering Operations:
If Logic First (imperative constructor DOM remains), route all UI
mutations through private #update*() helpers. Never define
override performUpdate() calling render(..., this.contentElement)
while imperative constructor DOM on this.contentElement still exists,
because instantiateWidget() calls requestUpdate() automatically and
prepends duplicate DOM nodes and IDs alongside the constructor children.
If Lit First (Lit template already exists), make sure there's a single master call to Lit render inside performUpdate. The master template might include calls to the helper functions e.g.
render(html`
<div class="specific-view">
<span>View Title</span>
${this.renderOverviewSection()}
</div>
`, this.contentElement);Minimize Diffs (Safety Rule):
No Write-Only State Fields in Prefactor CLs:
#state fields in a logic-consolidation CL that are only
written to in that CL and only read in the next CL's DEFAULT_VIEW.#render... helper) or introduce them in the CL that actually adds
DEFAULT_VIEW.Extract Imperative #renderSubtreeContent() Helpers:
#renderFooContent()
helper in Pass 1 (while keeping the outer container imperative) minimizes
the Pass 2/3 diff when converting #renderFooContent() to
renderFooContent(input: ViewInput): LitTemplate.Preserve Imperative Cleanup Calls:
#tabbedLocationHeader with #debuggerSidebarTabbedLocation), preserve
imperative cleanup calls like splitWidget.uninstallResizer(...) until the
imperative container itself is removed.Wait for confirmation:
Before reporting back or committing, re-read the instructions and verify:
performUpdate(): Did I avoid synchronous performUpdate() calls on state updates and avoid render(..., this.contentElement) while imperative constructor DOM remains?ChromeDevTools/devtools-frontend
9d90722
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.