[English](README.md) · [简体中文](README.zh.md) # dsh-user-experience [![awesome · DSH plugin](https://awesome-dsh-plugin.com/badge.svg)](https://awesome-dsh-plugin.com) > DeepSeek Harness(DSH)UX 走查插件:**让 AI 模拟目标用户,在开发阶段提前发现用户体验问题,并给出具体优化建议。** > > 能力边界:支持 React + TypeScript / React + JavaScript / Vue 3、CSS/布局分析;当前 Harness 会话能够打开项目时,可进一步获取浏览器证据。 🎉 已收录至 [awesome-dsh-plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin)。 现有自动化检查(axe、Lighthouse)只能校验绝对规则——对比度够不够、有没有 alt。但体验问题的本质是**相对的**:删除前的二次确认,对偶尔操作的用户是保护,对每天处理上百条记录的操作员是损耗。脱离了"给谁用","体验问题"无法定义。 本插件把**目标用户画像(Persona)**作为每条结论的依据。项目里还没有画像时,会从 README 和路由先猜一版草稿——没有设置命令。AI 会以这些目标用户的视角模拟使用过程,在**开发阶段**提前发现体验问题,并给出具体、可定位、可复核的优化建议,而不是等上线后再收集用户反馈。 **它是流水线,不是命令行工具。**直接说话,或者改完前端代码即可。不用学 `/ux`。报告卡片优先展示用户关心的信息(哪个页面、出了什么事、严不严重),技术细节折叠在后面、一键复制给 AI。判定也不用敲 ID:点按钮,或者直接说「第 2 条不成立」「三级以下全部忽略」。 ## 在 Harness 中安装 在 DeepSeek Harness 中输入: > 在 DeepSeek Harness 上安装用户体验插件:`dsh plugin --profile web add dsh-user-experience@0.4.2` 也可以直接执行: ```sh dsh plugin --profile web add dsh-user-experience@0.4.2 ``` 请写明确版本号,不要用 `@latest`:pnpm 11 会压住 24 小时内发布的新版本,`@latest` 在新 profile 上可能解析不到任何东西。更新的版本见 [npm 版本列表](https://www.npmjs.com/package/dsh-user-experience?activeTab=versions)。 安装成功后刷新页面即可,不必重启。仅当市场提示无法热加载时,再重启或重新加载 `web` profile。安装前请阅读下方[安全提示](#安装)。 ### 从旧的 `github:` 安装升级 `dsh plugin add github:DietCokewithSugar/dsh-user-experience` **已经不能用了**。仓库不再提交 `lib/`,所以 Git 检出的目录里没有构建产物,而 pnpm 默认拦截构建步骤。市场会报: ``` 安装失败: dsh-user-experience — nothing installable: the plugin(s) need a build step (blocked by default, see allowBuilds) or ship no prebuilt artifacts ``` 导出日志里会写明用的是 Git spec: ``` [warn] install: github:DietCokewithSugar/dsh-user-experience: removed uninstallable pieces (no dsh manifest or missing build artifacts): dsh-user-experience [error] install: github:DietCokewithSugar/dsh-user-experience: nothing installable survived validation ``` 改用包名安装 —— 注意**前面没有 `github:`**: ```sh dsh plugin --profile web add dsh-user-experience@0.4.2 ``` 如果市场仍然解析到 Git ref,说明 profile 在复用旧条目,清理一遍: 1. 删掉 profile 的 `package.json` 里 `"dsh-user-experience": "github:DietCokewithSugar/…"` 那一行; 2. 把该 profile 的 `node_modules` **和** `pnpm-lock.yaml` 一起删掉。lockfile 会把旧的 Git 解析结果钉死,只删依赖行不够; 3. 重新执行安装命令。 Windows 上可以这样定位 profile 的清单文件: ```powershell Get-ChildItem -Path $env:APPDATA,$env:LOCALAPPDATA,$env:USERPROFILE -Recurse -Filter package.json -Depth 6 -ErrorAction SilentlyContinue | Where-Object { (Get-Content $_.FullName -Raw -ErrorAction SilentlyContinue) -match 'dsh-user-experience' } | Select-Object FullName ``` ## 界面预览 走查报告先用简单清晰的语言说明观察到的现象及其对用户的影响: ![安装后在 Harness 中显示的 UX 走查报告卡片](docs/images/ux-report-card.png) 直接说话就能走查。没有画像时,先猜 1–3 个用户,问一句再开始: ![用自然语言发起走查,并确认目标用户画像](docs/images/ux-natural-language.png) 确认问题属实后,卡片会提供一份可复制给其他 AI 的任务 Prompt。它只描述观察到的现象,不预设代码改法;同时提醒 AI 先阅读完整项目上下文,并明确允许修改界面文案: ![确认 UX 问题后出现复制给 AI 的任务 Prompt 按钮](docs/images/ux-confirmed-prompt.png) 改完前端代码,走查自己跑——不问画像、不打断写代码。只有一级 / 二级问题才会出声: ![改完代码后自动走查,不打断开发](docs/images/ux-auto-scan.png) 多级证据会显示在技术细节中,视觉与交互结论都能追溯到对应截图、DOM 测量或任务步骤: ![包含 rendered 与 static 证据等级的 UX 报告](docs/images/ux-multi-evidence.png) 报告卡片和确认流程可以跟随开发者使用的语言(下图为英文): ![包含 interactive 证据的英文 UX 报告卡片](docs/images/ux-english-report.png) --- ## 支持的输入与证据 | 支持 | 解析引擎 | |---|---| | React + TypeScript(.ts / .tsx) | TypeScript 编译器 API(TSX) | | React + JavaScript(.js / .jsx) | 同一引擎,.js 也可能含 JSX,统一按 TSX 解析 | | Vue 3(.vue SFC) | `@vue/compiler-sfc` 拆分 + `@vue/compiler-dom` 模板 AST;`