javen-wangjunren/elementor-website-skill / elementor-widget-pipeline
elementor-widget-pipeline
Verified把确认版模块 HTML、整页 HTML 中指定的 Section,或合格的简单强参考模块,以克制字段实现为 Elementor Widget。用于新增或迁移单个已确认 Widget,并消费标准或加强设计评审上下文,验证同视口保真、完整状态、快速反向操作、编辑器重渲染和多实例;不重新设计或评分,不用于批量整页、旧 Widget 排错、主题开发或发布。
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 7.8 KB |
| agents/interface.yaml | config | 1.2 KB |
| agents/openai.yaml | config | 457 B |
| evals/route-cases.md | markdown | 6.1 KB |
| evals/semantic_config.json | config | 1.7 KB |
| evals/trigger_cases.json | config | 1.8 KB |
| references/implementation-checklist.md | markdown | 5.7 KB |
| references/reference-led-fast-path.md | markdown | 3.3 KB |
| references/registration-baseline.md | markdown | 3.7 KB |
| references/spec-card-template.md | markdown | 3.8 KB |
| references/verification-checklist.md | markdown | 4.0 KB |
| templates/widget-css.css | other | 442 B |
| templates/widget-js.js | script | 2.3 KB |
| templates/widget-php.php | script | 1.3 KB |
references/implementation-checklist.md
View on GitHub# 实现清单
先确认字段卡,再执行本清单。Confirmed HTML Path 以确认 HTML 为依据;Fast Path 以用户确认的参考解释为依据。模板只提供 Elementor 接线骨架。
## PHP
- `get_name()` 与确认版 Canonical Module Slug 完全一致;`get_title()` 使用对应的可读标题。
- 实现 `get_name()`、`get_title()`、`get_icon()`、`get_categories()` 和 `get_keywords()`;`get_icon()` 追加项目 marker class,分类只包含项目分类,关键词包含项目基础词与当前模块语义词。
- 实现 `get_style_depends()`,handle 与插件入口和真实 CSS 文件一致。
- 只有确认存在 JS 交互时才实现 `get_script_depends()`。
- `register_controls()` 只输出用户确认的字段;默认不创建 `TAB_STYLE`。
- 只有字段卡确认运营需要局部覆盖时才创建 `TAB_STYLE`;颜色和字体 Control 使用 Elementor `global` 参数绑定 Style Contract 指定角色。
- Repeater 只包含确认的子字段、真实默认项和合理的 `title_field`。
- `render()` 使用 `get_settings_for_display()`;Confirmed HTML Path 不随意改变确认稿结构和类名,Fast Path 不超出已确认的参考解释发明结构。
- 文本用 `esc_html()`,属性用 `esc_attr()`,URL 用 `esc_url()`;只有确认允许的富文本才使用 `wp_kses_post()`。
- 空字段按字段卡决定隐藏、保留占位或使用默认值,不临时发明行为。
- 只有交互模块才在根节点加入实例标识和 JS 所需 `data-*`。
## CSS
- CSS 根类允许增加项目 CSS Prefix,但必须保留完整 Canonical Module Slug,并与确认设计稿对应。
- 所有选择器位于唯一模块命名空间内,例如 `.rd-xxx` 或 `.mml-xxx`。
- 不污染 `:root`、`body`、`.container`、裸 `h1-h6/p/a/button` 或 `.elementor-*`。
- padding、背景、容器宽度、颜色、Typography、圆角和响应式值来自确认 HTML,或 Fast Path 已确认的参考解释与现有页面上下文;通用模板不提供固定视觉默认值。
- 字体、颜色和基础视觉遵守 Confirmed Style Contract:可继承时使用 `inherit`;合同列明 Elementor CSS Variable 时使用该变量,并紧邻提供对应 Design System fallback。
- 网站已经加载正确字体时继承;否则把缺失的网站级能力报告给用户,不修改 Site Settings、主题或在单个 Widget 中重复加载。
- 独立新风格只能写在当前 Widget Wrapper 内,并在字段卡中标记 `isolated-local-exception`;不得写回全局合同。
- 避免全局 reset,补齐 hover、focus、长内容、空内容和目标断点。
- Hover、Focus、Active/Selected、Disabled 与已确认的 Success/Warning/Error 按 Style Contract 的角色和 fallback 实现;Focus 不能只依赖颜色,也不能被 `overflow` 或动画裁掉。
## JS(仅交互模块)
- 根节点使用唯一 `data-*` 标识,并以实例为范围查询元素。
- 用 dataset 标记防止同一 DOM 重复初始化。
- 同页多个 Widget 实例互不共享可变状态或选择器结果。
- 普通前台在 `DOMContentLoaded` 后初始化。
- 在 `elementor/frontend/init` 后注册 `frontend/element_ready/<widget-name>.default`。
- Elementor 编辑器替换为新 DOM 时可以初始化新实例。
- 每个实例保存自己的 Observer、AbortController/监听、Timer、RAF、视频状态与 cleanup;重初始化前先清理旧实例。
- 使用目标 Elementor 版本可用的销毁生命周期完成 teardown;没有可靠 Hook 时避免常驻全局资源,并让 RAF/Timer/Observer callback 在 `root.isConnected === false` 时自终止。
- Layer 2 一次命中后及时 `unobserve`;Layer 3 不创建多个独立 RAF 循环。页面隐藏、实例离屏或 Reduced Motion 时停止连续任务。
- 只有字段卡包含 `ADVANCED MOTION` 时才处理第三方 Runtime。使用 GSAP 时在插件入口统一注册固定版本的 GSAP/已批准插件,Widget 通过 `get_script_depends()` 声明 handle,不重复加载或在实例脚本中重复注册。
- Advanced Motion 的 GSAP 选择器限定在当前根节点;每个实例保存 context、timeline 和 ScrollTrigger,重初始化前执行对应 `revert/kill`。Elementor 编辑器替换 DOM、删除 Widget 或页面结束时完成 teardown;无可靠销毁 Hook 时回调检测 `root.isConnected` 并自终止。
- 视频只播放当前可见实例中的当前视频,其他视频暂停;保留 poster 与移动端降级。
- 支持键盘操作、必要的 ARIA 状态、Touch 等价路径和 `prefers-reduced-motion`;核心内容不依赖 JS 初始化后才可见。
- 状态切换支持快速重复与动画中反向操作,打开/关闭从当前视觉状态继续,最终只保留一个正确状态;不得残留重复 Timer、Observer、类名或 ARIA 值。
- 禁止劫持滚轮、全局改写滚动、向 `document/body` 添加无法清理的状态,或让多个 Widget 实例共享可变状态。
## 插件入口
- 已有插件只增加当前资源、文件引入和 Widget 注册,不覆盖其他组件。
- Swiper 只在确认模块本身是 Carousel/Touch Slider 时注册;Lottie 只承载已确认素材。两者不得被当作通用 Layer 3 运行库,项目已有 Motion 时继承而不叠加 GSAP。
- 已有插件缺少共享编辑器角标资产时,按项目配置最小补齐 editor-only CSS 的注册与加载,不把角标样式混入前台资源。
- 无现有插件时停止实现,转交 `elementor-site-initialize`;初始化完成后再继续。
- 不在主题 `functions.php` 或模板中加入 Widget 注册代码。
- 发现需要改变页面概念、信息主次、核心构图、媒体用途或 Motion Purpose 时停止并返回上游,不在 PHP/CSS 阶段重新设计。
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |