dsh-workstation-spec: Implementing Chrome Workstation UI specifications as DSH tooling

前言

在 DSH 里给某个网站做「工作站版」Chrome 扩展时,外壳布局、Design tokens、组件与验收清单往往要反复查文档或凭记忆拼。规范散在笔记或旧项目里,模型每次从零描述,容易漏项或与既有站点不一致。

下面介绍的 dsh-workstation-spec 把同一套「Chrome 工作站 UI 规范」注册成 Host 侧的两个模型工具:先读规范章节,再取起步模板文件,不必在对话里重写整份 spec,也不注入网页、不改 DSH 界面。

这是什么

dsh-workstation-spec 由维护者 pierrotto12138-code 发布,在 SkillHub 目录中归类为客户端插件。它是一个 Host-only 的 DSH 组合包(bundle):只向当前 profile 注册 workbench_spec 与 workbench_starter,运行时无额外 npm 依赖,不 import @deepseek-ai/* 包。

规范正文在仓库 assets/spec.md;起步模板在 assets/starter/(manifest、station、css、background)。当前 package 版本为 0.2.3,许可 MIT。

核心功能

插件只做两件事,对应两个工具。

工具 作用
workbench_spec 读规范:不带参数返回目录,带 section 返回对应章节
workbench_starter 取起步模板中的单个文件:manifest / station / css / background

规范覆盖范围(据 README):三条铁律、形态选择、布局系统、Design tokens、组件规范、交互、可访问性、工程结构、站点适配流程、评审规则清单、验收清单,以及默认风格(作者复用到各站点时的固定选择,如白底单蓝、扁平侧栏等)。

workbench_spec 章节别名

不带 section 时返回章节目录。常用 section 与章节对应关系如下。

section 章节
intro / rules 三条铁律
form 形态选择
layout 布局系统
tokens / token Design tokens
components 组件规范
interaction 交互
a11y / accessibility 可访问性
structure / engineering 工程结构
adaptation / site 站点适配流程
checklist 规则清单
acceptance 验收清单
style / defaults / preference 默认风格

workbench_starter 文件类型

file 参数取上述四类之一,返回该文件的完整内容,可直接复制到新站点目录。

安装与启用

需要 DSH 0.2.1-rc.5 或同系列 0.2.x(package.json 声明 >=0.2.1-rc.5 <0.3.0),以及 Node.js >= 20。本包没有 prepare / build 脚本,一般不需要在 pnpm-workspace.yaml 里配置 allowBuilds。

从 GitHub 安装

把 <profile> 换成你的 profile 名(例如 web、desktop、tui):

dsh plugin --profile <profile> add github:pierrotto12138-code/dsh-workstation-spec

生产环境建议钉住 commit,避免后续推送改变实际安装内容:

dsh plugin --profile <profile> add github:pierrotto12138-code/dsh-workstation-spec#<commit-sha>

从本地目录或压缩包安装

若已有源码目录或 npm pack 产物,也可本地添加(README 中的示例):

dsh plugin --profile <profile> add ./dsh-workstation-spec

或:

dsh plugin --profile <profile> add ./dsh-workstation-spec-0.2.0.tgz

安装后重启 DSH(新增 bundle 只在启动时读取;启用 HMR 的 profile 会等待重组)。

验证安装

dsh --profile <profile> --dump-config | grep -A2 dsh-workstation-spec

应能看到类似一层配置:

# == dsh-workstation-spec
- id: dsh-workstation-spec
  name: dsh-workstation-spec

典型用法

在工具侧直接调用:

workbench_spec()
workbench_spec(section="layout")
workbench_starter(file="manifest")
workbench_starter(file="station")
workbench_starter(file="css")
workbench_starter(file="background")

在 DSH 对话中的典型流程(README 示例):说明要为某站点做工作站扩展、要完成的具体能力;模型可先调 workbench_spec(section="form") 选形态,再调 workbench_starter(file="manifest") 等取模板,再按规范实现其余逻辑。

适用场景与注意

适合谁:经常在 DSH 里驱动模型为不同站点生成「工作站形态」Chrome 扩展、且希望 UI 与工程结构对齐同一套书面规范的开发者。

运行方式:插件以当前 DSH 进程权限在 Host 侧运行,不注入任何网页。安装前应自行查看仓库源码与 MIT 许可证,确认 bundle 行为符合预期。

卸载:

dsh plugin --profile <profile> remove dsh-workstation-spec

卸载会同时移除 profile 依赖和 dsh.profile.bundles 中的条目。

兼容性摘要(README):DSH >=0.2.1-rc.5 <0.3.0(实测 0.2.1-rc.5);Node.js >= 20;无运行时依赖;无构建步骤。

结尾

dsh-workstation-spec 把工作站 UI 规范与起步模板收进两个模型工具,适合在 DSH 里做站点工作站扩展时先对齐规范、再抄模板外壳。社区目录页与源码仓库如下,细节以 README 与 assets/spec.md 为准。

  • 目录页:https://www.skillhub.cn/plugins/pierrotto12138-code/dsh-workstation-spec
  • GitHub:https://github.com/pierrotto12138-code/dsh-workstation-spec
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye