review-html-component
GitHub用于审查自定义 HTML Web Components,检查数据流、DOM 生命周期、职责边界、注册机制及可访问性,确保符合 ReactiveElement 规范并识别耦合与状态问题。
触发场景
安装
npx skills add videojs/video.js --skill review-html-component -g -y
SKILL.md
Frontmatter
{
"name": "review-html-component",
"description": "Review custom-element UI without editing code. Use for data flow, markup, styling, transitions, registration, or bundles."
}
HTML component review
Read the implementation, core and DOM contracts, rendered semantics, tests, definition entry, package metadata, relevant design record, and nearest comparable element.
- Trace the source of truth, subscriptions, mutations, and events. Flag duplicated state, upward property writes, hidden coupling, or platform behavior that belongs in core.
- Flag render-affecting DOM mutations outside the
ReactiveElementupdate lifecycle; they bypass scheduling,updateComplete, test observation, and integration behavior. - Check that each element or compound part has a scoped primitive responsibility; flag app or skin composition embedded in it. Require markup for semantics, focus, content, or consumer composition; prefer CSS or pseudo-elements for purely visual structure.
- Review the whole public surface: properties, reflected attributes, events, methods, context, data attributes, CSS custom properties, tag names, and exports. Tie every addition to a concrete consumer, and split independent behavior into another element or controller when the surface is growing around multiple concerns. Flag descendant selectors,
:has(), or other complex selectors introduced by composition as likely evidence of a weak primitive boundary or missingdata-*or CSS custom-property hooks. - Test opt-outs: optional parts can be omitted, author-owned attributes are preserved, styling can be replaced, and optional behavior is not activated by unrelated imports.
- Inspect registration and tree-shaking boundaries. Element classes should not self-register;
define/uimodules should register narrowly throughsafeDefine;package.jsonand build entries must mark only real side effects. - Check connection, disconnection, destruction, upgrade behavior, transition presence and races, cleanup, accessibility, and platform tests. Verify interaction in a browser when focus, keyboard, pointer, timing, or rendered structure matters.
Use packages/html/src/ui/play-button/, packages/html/src/ui/slider/, packages/html/src/define/ui/, packages/html/package.json, and packages/html/vite.config.ts as comparison anchors.
Report findings by severity with the location, affected consumer, evidence, and smallest viable improvement. Separate correctness and contract gaps from optional trade-offs.
Example
Input: “Review the new HTML chapter menu.”
Output: Prioritized findings about ownership, DOM anatomy, events, styling contracts, opt-outs, lifecycle, registration, or bundle boundaries.
版本历史
- 8a0a3d8 当前 2026-10-20 08:03


