用法与结构
August 20, 2026 · View on GitHub
README 是门面,这里是完整操作手册。
完整用法
# ① 生成
node scripts/scaffold.mjs my-plugin --name dsh-my-plugin --description "What it does." --author You
# 可组合:--template ts|webui · --desktop(跨环境 Desktop 骨架)· --beautify(预留 README 门面目录)
# ② 静态检查(合规 + 五维评分 + 安全扫描 + 榜单预估)
node scripts/check.mjs my-plugin --excellent --scan --recommend
# ③ 运行级实测(先 pack 再装 tarball,一次性 DSH_HOME,不碰真实配置)
node scripts/test.mjs my-plugin --expect-marker "dsh-my-plugin.*plugin ready"
# ④ 发布前闭环:把运行级证据喂回检查,过优秀门禁
node scripts/test.mjs my-plugin --json > report.json
node scripts/check.mjs my-plugin --test-report report.json --excellent
安装本 skill 到全局(让任意会话可用):cp -R dsh-plugin-developer ~/.agents/skills/dsh-plugin-developer。test.mjs 需要 dsh 在 PATH,随机端口自动避开 3080。
命令全集
scaffold.mjs:--name/--description/--author/--license/--template bundle|ts|webui/--no-tool/--desktop/--beautify/--verifycheck.mjs:--excellent(五维评分 ≥B 门禁) /--scan(MKT 静态安全审查) /--recommend(dsh-recommend 公式预估,--no-recommend-online离线) /--build(产物检查) /--test-report report.json(喂入运行级证据)test.mjs:--expect-marker "regex"(证明 apply 真跑) /--json(输出结构化报告) /--keep(保留临时 DSH_HOME 便于排障)
结构速览
dsh-plugin-developer/
├── SKILL.md # 主指令(加载入口:心智模型 → 工作流 → 规范 → 自检;开头附英文总览)
├── README.md # 门面(中文宣传首页,细节链接到 docs/ 与 references/)
├── README.en.md # 门面英文版(skills.sh 国际读者)
├── docs/ # 细节文档(self-check.md 证据 / usage.md 手册)
├── references/ # 8 份规范:spec / market / checklist / ui-frontend / desktop / security-scanning / readme-beautify / sources
├── scripts/ # scaffold.mjs · check.mjs · test.mjs
├── examples/ # tool-excellent(旗舰合规样例)· hello-good(JS bundle)· hello-bad(负向夹具)
├── assets/readme/ # 门面资产(hero.svg · mechanism.svg · bg-hero.jpg 可选封面底图)
└── evals/ # skill 测试用例(含「优秀级市场收录」用例)
联动设计技能
均在本机 ~/.agents/skills/:beautify-github-readme(README 门面)、design-taste-frontend(反模板美学)、frontend-design(设计主导)、web-design-guidelines(UI 合规审计)。
门面资产怎么用
hero.svg/mechanism.svg:纯 SVG 正文图(GitHub 会剥掉 SVG 内的图片引用,所以正文图必须是矢量自足的,不引用外图);本 skill 自检用的两幅即遵循同一铁律,可作构图范本。bg-hero.jpg$:**可选**封面底图(\text{ImageGen} 生成的浅色渐变,无文字无主体,仅作背景)。要当成仓库社交预览图/封面:把 \text{jpg} 换成 1280 \times 720 的 \text{PNG} 取名 $social-preview.png放仓库根(GitHub 社交预览约定;仓库根没有时用assets/readme/hero.svg也不差)。注意 jpg 不能嵌入正文 SVG(GitHub 会剥),所以它只是「可选封面底图」,不是正文图。- 生成新背景:本会话可直接用 ImageGen(如「极浅的蓝紫渐变、无文字、无物体、适合做 GitHub 封面背景」),生成后放进
assets/readme/并注明用途。