跳到正文
cccskills
免费在 GitHub 公开中文介绍

solid

用于以Solid 2实现、迁移、审查和测试OpenClaw界面,涵盖状态管理、迁移期间与Lit的共存、菜单与对话框、性能检查及界面测试。

原文查看原文说明

Write, refactor, review, or test Solid 2 UI in OpenClaw (Control UI, plugin views, Canvas hosts), including state ownership, native custom elements, overlays, testing, performance, and lessons learned.

AI 评分100分/ 100查看安装方法

适用场景

  • 将Lit界面迁移至Solid 2
  • 审查状态管理与界面更新
  • 实现插件界面和对话框
  • 测试界面行为与外观

中文介绍

功能

使用Solid 2实现、迁移、审查和测试OpenClaw的Control UI、插件界面及Canvas A2UI hosts。技能说明负责管理状态的TypeScript代码与界面读取的数据各自承担什么职责,也涵盖迁移过程中仍保留Lit时的衔接。内容包括保留现有标签和类名的规则、菜单与对话框管理、性能检查及测试方法。

适用场景

适合逐步迁移Lit界面的开发者,以及制作OpenClaw插件界面的人员。还可检查虽能通过编译、却可能影响实际行为的问题,例如更新后立即读取数值、事件处理和异步操作。

使用示例

  • “将这个Lit组件迁移到Solid 2,保留现有标签和类名。”
  • “审查状态管理和事件处理,并整理所需测试。”

注意事项

以OpenClaw特有的结构及Solid 2为前提。需检查ui/AGENTS.md和目标package.json中固定的版本。Solid 1的API不能直接沿用。若修改外观,需运行pnpm ui:parity或检查修改前后的截图。

本介绍由 AI(OpenAI Codex)根据公开的 SKILL.md 撰写。准确的规格请查看下方原文。

客观评估

AI 仅根据 SKILL.md 的内容,从 4 个方面进行了评估。星标数和热度不计入评估。

指令清晰度能否看出何时使用、做什么
A良好明确列出Control UI等目标界面,以及Solid 2实现、审查和测试用途。
步骤具体性步骤、输入输出和示例是否具体
A良好提供状态归属规则、组件示例、测试辅助函数及截图检查要求。
安全性发送数据、删除文件、执行命令等是否有说明
A良好要求保留标签、类名和测试断言,并检查修改前后的截图。
安装难易度所需工具和 API 密钥是否少且有说明
A良好明确列出Solid所需固定版本及编辑前应阅读的本地资料。

总分按每项 A=25 分、B=15 分、C=5 分相加。 由 AI(OpenAI Codex)于 2026年10月19日 评估。仅供参考,安装前请同时查看原文。

如果您认为评估有误,请申请复核

请写明哪一项有误以及原因。无需登录。我们会对照 SKILL.md 重新评估,并在此处更新结果。

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

包含的文件(10)

  • SKILL.md8.3 KB
  • references/components.md4.1 KB
  • references/idioms.md21.3 KB
  • references/lessons.md12.0 KB
  • references/overlays.md4.2 KB
  • references/performance.md2.1 KB
  • references/plugins.md1.2 KB
  • references/refactor-checklist.md10.7 KB
  • references/state-and-ownership.md4.5 KB
  • references/testing.md4.5 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Solid 2 in OpenClaw

The Control UI and plugin views (extensions/x, extensions/workboard) render with Solid 2 (solid-js, @solidjs/web, @solidjs/signals, compiled by @solidjs/vite-plugin/@solidjs/compiler). Lit and Web Awesome are removed from these surfaces; new code is Solid only. The Canvas hosts also use Solid, but the sandboxed upstream A2UI v0.8 catalog retains its separate @a2ui/lit dependency.

Read ui/AGENTS.md first; its state-ownership rules apply to Solid unchanged. Use the exact installed Solid pins from the owning package.json: the runtime and compiler are 2.0.0-rc.14, and @solidjs/vite-plugin is 3.0.0-next.49. solid-js and @solidjs/* are exempt from the repository's seven-day release-age gate (Peter, 2026-10-11); third-party Solid ecosystem packages remain subject to it.

Rules that keep the UI correct

Before your first edit, read the installed ui/node_modules/solid-js/CHEATSHEET.md, especially its "What changed from 1.x" list. It is the rc.14 API contract, written as a guard against React and Solid 1 priors, the two dominant bug sources. For new code or a Solid audit, then read idioms and lessons; to refactor or review existing code, also use the refactor checklist. Check solid-js/types/client/flow.d.ts and the installed @solidjs/signals / @solidjs/web types when choosing an API. rc.14 has no createAsync: asynchronous values are ordinary computations returning promises or async iterables.

  1. Domain owners stay plain TypeScript. The Gateway store, capabilities, lib/sessions/*, caches, persistence, and mutation authority keep synchronous mutate-then-read semantics. Solid 2 writes become visible only after a microtask flush, so authoritative state never lives in a signal. → state and ownership
  2. Components consume projections from ui/src/lib/reactive/ (one per owner and scope, never a second store) and useApplication() for the application context. Add a thin adapter only with its first production caller; subscribe to ordered events directly.
  3. Host tags and classes survive. A component renders its existing openclaw-* tag as a plain host element in light DOM; CSS and E2E select it. Never rename a tag or a class. → components
  4. One implementation per registered tag. Native custom elements and Solid callers share one renderer through defineSolidBridge in ui/src/lib/solid-bridge.ts. Use its returned component in JSX so the host has one lifecycle owner. → components
  5. One renderer per DOM region, and one lifecycle owner per overlay surface. → overlays
  6. Derive, don't synchronize. createMemo before createSignal; no copies of owner state; no defensive guards for states the owner already excludes. Prefer smaller code with fewer owners.
  7. Replace controller lifecycles at their owner. Follow the controller-to-Solid recipe, including its worked example. Delete the class and host adapter wiring together; do not wrap a controller in revision signals as the final design.

Component skeleton

An illustrative component (the tag is an example): it renders its host tag, reads an owner through a projection, and derives instead of copying state.

import { createMemo, Show } from "solid-js";
import { useApplication } from "../lib/reactive/context.ts";
import { projectAgents } from "../lib/reactive/domain-capabilities.ts";

export function AgentCount(props: { compact?: boolean }) {
  const app = useApplication();
  // Reads through to the synchronous owner; disposed with this component's owner.
  const agents = projectAgents(app.agents);
  // Never destructure props: reads must stay reactive.
  const count = createMemo(() => agents.read().agentsList?.agents.length ?? 0);
  return (
    <openclaw-agent-count class={["agent-count", { "agent-count--compact": props.compact }]}>
      <Show when={count() > 0} fallback={<span class="muted">—</span>}>
        <span>{count()}</span>
      </Show>
    </openclaw-agent-count>
  );
}

Use jsxImportSource: "@solidjs/web" and its JSX types, not Solid 1's solid-js/web.

Traps that compile but break

  • on:x, attr:x, bool:x, classList, and use: are gone in Solid 2; they compile to literal attributes or no-ops (lint flags them). prop: is the only namespace left.
  • Events are camelCase (onClick). Dashed custom events need the exact dash, such as onSession-change, or a listen(...) ref factory.
  • Native event bindings bind once: dispatch through a stable callback that reads the current handler prop. Runtime spreads, including dynamic elements, can update handlers.
  • A read right after a write sees the old value until flush(). Don't write-then-read in handlers; derive.
  • Reactive reads after the first await in an async memo are untracked, and async memos get no AbortSignal.
  • Ref callbacks run unowned: onCleanup inside them does nothing.
  • ARIA enumerations are typed strings: aria-pressed={pressed() ? "true" : "false"}, never a boolean.
  • Solid 1 APIs (createResource, onMount, mergeProps, Context.Provider) don't carry over: use async computations, onSettled, merge, and the context component itself.
  • Writing a signal or store from a memo, an effect compute phase, or a component body throws in dev. untrack doesn't exempt it (the guard checks the owner); derive instead, or write from a handler, onSettled, or effect apply.
  • Class strings built with template literals or .filter(Boolean).join(" ") lose composable reactivity: use class={["base", { active: active() }]}.
  • createRenderEffect is for render-phase runtime bindings, and flush() in production code usually hides a write-then-read: feature code uses createEffect and derivations.

More, each with its root cause: lessons learned.

Testing

mountSolid, waitForSolid/flush, renderSolidRef, and the Solid application-context provider live in ui/src/test-helpers/. .test.tsx files are discovered. Keep assertions when you replace a harness. Visual changes need inspected, sanitized before/after screenshots. Follow the assigned campaign's compute budget. → testing

References

TopicRead when
idiomschoosing a primitive, derivations, props, lifecycle, stores, keys, async, context, diagnostics
refactor checklistrefactoring or reviewing existing Solid: measurable smells, replacements, before/after
componentswriting components, native custom-element hosts, JSX bindings, events, refs, styles
state and ownershiptouching owners, projections, async reads, lifetimes, parking, chat render lifecycle
overlaysmenus, popovers, tooltips, dialogs, focus, positioning, the platform floor
testingunit, browser, E2E, WebKit, parity, retention suites
performancestartup bundle, lazy loading, render budgets
pluginsbuilding a plugin's Control UI view in Solid
lessons learnedbefore a new kind of change; most entries cost a failed CI run to learn

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

1password

免费有简介AI 评分 100分

检查1Password命令行工具的安装和认证,将已保存的密码或API密钥传入命令及配置。支持桌面应用集成、服务账号和交互式登录,并先验证访问权限。

  • 安装1Password命令行工具
  • 将API密钥传入命令
  • 在CI中使用服务账号认证
openclaw/openclaw39.2万2026年10月18日 更新

acp-router

免费有简介AI 评分 80分

将提交给OpenClaw的自然语言请求转交给Claude Code等外部编程智能体,通过ACP或acpx启动、继续会话,并保留对话上下文。

  • 在讨论串中启动Claude Code
  • 继续外部智能体的现有工作
  • 通过acpx直接传递指令
openclaw/openclaw39.2万2026年10月18日 更新

add-model-provider

免费有简介AI 评分 100分

为OpenClaw添加模型服务商,并通过实际回复验证连接。凭据以环境变量或文件引用的形式配置,同时验证设置并报告测试结果。

  • 为OpenClaw添加模型服务商
  • 通过引用配置认证凭据
  • 确认模型能返回实际回复
openclaw/openclaw39.2万2026年10月18日 更新

agent-transcript

免费有简介AI 评分 90分

将AI代理的工作日志整理为可附在GitHub拉取请求或议题中的记录,筛选相关内容、移除敏感信息,并支持预览及经单独授权后的发布。

  • 为拉取请求整理代理工作记录
  • 从本地日志提取相关请求和结果
  • 预览已移除敏感信息的记录
openclaw/openclaw39.2万2026年10月18日 更新

apple-notes

免费有简介AI 评分 100分

通过代理管理macOS上的Apple Notes笔记,支持创建、查看、搜索、编辑和删除,在文件夹之间移动笔记,并将选定笔记导出为HTML或Markdown。

  • 创建带标题的笔记
  • 按文件夹筛选或模糊搜索笔记
  • 编辑笔记并整理文件夹
openclaw/openclaw39.2万2026年10月18日 更新

apple-reminders

免费有简介AI 评分 70分

通过Mac查看、添加和编辑Apple Reminders中带截止时间的待办事项,管理列表并完成或删除任务,整理在iPhone或iPad上查看的个人任务。

  • 查看今天和已逾期的任务
  • 添加带截止日期的个人待办事项
  • 整理iPhone或iPad上的任务
openclaw/openclaw39.2万2026年10月18日 更新

查看 openclaw 的全部技能

报告此技能的问题