agentleFS
snowzhaozhjsnowzhaozhj/claude-devtools-rs/.claude/skills/ts-ui-compare/SKILL.md

ts-ui-compare

Skill1 starsChanged 6 months agoMITView on GitHub

对比原版 TS renderer 组件(`../claude-devtools/src/renderer/`)与 Rust 版 Svelte 组件(`ui/src/`)的功能 / 样式 / 交互差距,输出差异报告 + 移植建议。**仅**用户显式 `/ts-ui-compare <组件名>` 时触发——模型不能自主调用,因为这是一个需要逐文件细读的开销大动作,且 CLAUDE.md 已默认 UI 改动"优先对齐原版"(feedback_align_with_original 记忆),通常不需要专门跑这个 skill 才能知道方向。

The file

Files
SKILL.md

ts-ui-compare

只在用户显式调用时跑——这是个慢、读多、写少的对比 skill,平时改 UI 直接 grep 原版即可。

输入

一个组件 / 功能名,例如 Sidebar、BaseItem、ToolViewer、SearchBar。 无参数时列出可对比的组件清单(下方映射表)。

路径约定

  • Rust 版前端:/Users/zhaohejie/RustroverProjects/Project/claude-devtools-rs/ui/src/
  • 原版 renderer:/Users/zhaohejie/RustroverProjects/claude-devtools/src/renderer/
  • 原版 shared utils:/Users/zhaohejie/RustroverProjects/claude-devtools/src/shared/utils/

常见组件映射(持续维护——发现漂移就更新表格)

功能原版 TS (renderer/)Rust 版 Svelte (ui/src/)
Sidebarcomponents/sidebar/components/Sidebar.svelte
Session itemcomponents/sidebar/SessionItem.tsxcomponents/Sidebar.svelte(内嵌)
BaseItemcomponents/session/BaseItem.tsxcomponents/BaseItem.svelte
Tool viewerscomponents/session/tools/components/tool-viewers/
Session detailcomponents/session/routes/SessionDetail.svelte
Searchcomponents/search/components/SearchBar.svelte + CommandPalette.svelte
Settingscomponents/settings/routes/SettingsView.svelte
Notificationscomponents/notifications/routes/NotificationsView.svelte
Context panelcomponents/context/components/ContextPanel.svelte + DirectoryTree.svelte
Tab systemcomponents/layout/TabBar.tsxcomponents/TabBar.svelte
Dashboardcomponents/dashboard/(若有)routes/DashboardView.svelte
Content sanitizershared/utils/contentSanitizer.tslib/toolHelpers.ts
Markdown renderrenderer/utils/markdown*.tslib/render.ts
Diff viewercomponents/diff/components/DiffViewer.svelte
Subagent cardcomponents/subagent/components/SubagentCard.svelte

若表中没有精确匹配,用 Glob 和 Grep 按关键词搜索两侧。若搜出来的 Rust 版路径与上表不一致,在报告里指出并建议更新本 skill 的映射表——port 后 UI 已重构多轮,表会漂移。

工作步骤

  1. 定位两侧文件:根据映射表或搜索找到原版和 Rust 版的对应文件。若 Rust 版不存在,明确标注"未实现"。
  2. 读取并对比:
    • 原版:读取组件结构(props、state、子组件、事件处理、样式)
    • Rust 版:读取对应 Svelte 组件
    • 对比功能差异、样式差异、交互差异
  3. 输出报告(≤ 600 字):
# ts-ui-compare: <组件名>

**原版**:<文件路径列表>
**Rust 版**:<文件路径>(或"未实现")

## 功能对比
| 功能 | 原版 | Rust 版 | 状态 |
|------|------|---------|------|
| ... | ... | ... | OK / 缺失 / 部分 |

## 样式差异
- <具体差异,带行号引用>

## 移植建议
- <优先级排序的具体建议>
- <可直接移植的代码片段或逻辑>

硬性约束

  • 只读:不改任何文件
  • 每个对比项必须基于实际读取的文件,不要凭记忆
  • 引用文件时带行号区间
  • 若用户没给组件名,列出映射表让用户选
  • 发现映射表漂移:在报告末尾用"⚠️ 映射表过期"标注,让用户决定是否更新本 SKILL.md

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.