dsh-plugin-template
开发工具 活跃维护

dsh-plugin-template

exoticknight/dsh-plugin-template

轻量级插件模板,附带AI一句提示操作手册,支持通过自然语言创建、发布与列出插件,无需手动搭建脚手架,一键生成完整代码与配置,简化从开发到上线的全流程。

3
Stars 标星
0
Forks 分支
3
Watchers 关注
0
Open Issues
JavaScript
主要语言
Apache-2.0
开源协议
187 KB
仓库大小
1 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:exoticknight/dsh-plugin-template
git clone https://github.com/exoticknight/dsh-plugin-template.git
git clone git@github.com:exoticknight/dsh-plugin-template.git
README.md main
# DSH 插件模板 **一句话交给 AI,从想法到上架一个 DeepSeek Harness 插件。** 建仓、初始化、构建、测试、CI、npm 与 GitHub 发布、插件目录收录,全部准备好,并写成 AI 能照着执行的手册。 [![Use this template](https://img.shields.io/badge/Use_this_template-2ea44f?style=for-the-badge&logo=github)](https://github.com/new?template_name=dsh-plugin-template&template_owner=exoticknight) [![CI](https://github.com/exoticknight/dsh-plugin-template/actions/workflows/ci.yml/badge.svg)](https://github.com/exoticknight/dsh-plugin-template/actions/workflows/ci.yml) [![License](https://img.shields.io/github/license/exoticknight/dsh-plugin-template)](https://raw.githubusercontent.com/exoticknight/dsh-plugin-template/main/LICENSE) [![Maintained with RED](https://img.shields.io/badge/maintained_with-RED-C1121F)](https://github.com/exoticknight/red) 简体中文 | [English](https://github.com/exoticknight/dsh-plugin-template/blob/main/README.en.md)

30 秒上手

把下面这句话发给 Claude Code、Codex、Cursor 或任何编程 agent,把功能换成你想要的:

用 https://github.com/exoticknight/dsh-plugin-template 建一个 DSH 插件 dsh-foo,
功能是……,发布到 npm。

agent 会创建你的仓库、完成初始化、实现功能、配置 GitHub 和 npm、发布第一个版本,再帮你提交到插件目录。只有登录 npm、首次发布这类必须由你本人完成的步骤,它才会停下来问你。

从一句话到上架

flowchart LR
  A["一句话需求"] --> B["建仓 + 初始化<br/>00-init"]
  B --> C["实现功能<br/>pnpm verify"]
  C --> D["GitHub 配置<br/>10-github"]
  D --> E["npm 首发<br/>20-npm"]
  E --> F["推 tag 发布<br/>30-release"]
  F --> G["目录收录 + badge<br/>50-listings"]

每一步都有一份 playbook:写明目标、前置条件、可以直接执行的命令和完成标准。之后的升级、发版和维护也按同样的方式进行。

你会得到

🧩 开箱即用的插件骨架

  • Host 入口运行在 DSH 的 Node 进程中,由 Cordis 挂载,带配置 schema
  • Client 入口运行在 DSH 页面中,打包成 DSH 模块加载器使用的格式;纯服务插件可以一键去掉
  • esbuild 构建:@deepseek-ai/* 由 DSH 提供,插件名和版本号在构建时注入

✅ 不会坏的质量关卡

  • TypeScript strict,契约测试覆盖包元数据、Cordis 挂载与卸载、client 注册
  • 检查 npm 包内容,确保入口文件齐全、源码和测试不会混入
  • 发布前把关:tag 与版本一致、仓库地址正确、没有残留占位符

🚀 一个 tag 完成发布

  • CI 覆盖 Ubuntu / Windows × Node 22.19 / 24
  • npm Trusted Publishing,并自动创建 GitHub Release:按 PR 标签分类变更、标注贡献者,可附加版本重点与升级说明
  • 预发布版本自动走 npm next 通道;每一步都能安全重跑
  • 也可以只发布到 GitHub(--no-npm)

🧪 不污染日常环境的本地调试

  • pnpm dev 把当前源码链接进仓库内的隔离目录 .dsh-dev 并启动 DSH;pnpm smoke 在一次性目录中按用户的方式安装已发布版本并验证。两者都会校验隔离是否生效,绝不改动你日常使用的 DSH

🤖 写给 AI 的操作手册

文件 内容
AGENTS.md 入口:项目事实、规则、按任务选择手册(CLAUDE.md 导入它)
00-init 收集参数、建仓、初始化、首次提交
10-github 仓库元数据、Actions 权限、npm environment、tag 保护、安全功能
20-npm 首次发布、配置 Trusted Publisher、禁止 token 发布
30-release 发布版本、验证、各环节失败后的恢复方法
40-maintain DSH 升级、Node 版本、Dependabot、同步模板更新
50-listings 提交插件目录、跟进状态、添加收录 badge
reference/ 完整检查清单、README 写作规范、插件目录列表、badge 规则

📦 完整的仓库规范

  • Dependabot、Bug 报告模板、中英双语 README、CONTRIBUTING、SECURITY;版本历史统一保存在 GitHub Releases,插件 README 提供链接
  • 使用 RED 管理研究、变更与文档

需要你本人完成的事

手册会让 agent 在这些步骤停下来,交给你操作:

  • npm login 和首次 npm publish(需要你的账号和两步验证码)
  • 在 npmjs.com 上配置 Trusted Publisher
  • 批准以你的名义向插件目录提交收录

其余步骤都由 agent 完成。

其他用法

手动复制,再交给 agent。 点击上方的 Use this template(或 clone 仓库),用 agent 打开后说「初始化这个插件」。

初始化不会设置 DSH 版本门槛:模板的 engines.dsh 和可选 DSH host peer 都是 *。DSH 使用 engines.dsh 判断版本兼容;只有未声明该字段时才回退检查 host peer。本地 pnpm dev:cli 优先安装 npm 上最新的稳定版;如果尚无稳定版,就安装最高 SemVer 的预发布版,不依赖可能滞后的 latest 标签。插件实际可用性仍取决于它使用的 DSH API,请记录并查看兼容性验证结果。

完全手动。 环境要求:Node.js ^22.19.0 || >=24、pnpm、git、已登录的 GitHub CLI;本地测试需要 DSH CLI。

pnpm install
node scripts/init.mjs --name dsh-foo --owner <github-user> \
  --title "Foo" --description "Foo for DeepSeek Harness."
pnpm install
pnpm hooks:install
pnpm verify

然后依次按 10-github、20-npm、30-release、50-listings 操作。

init 参数 | 参数 | 必填 | 含义 | | ---------------- | ---- | ------------------------------------------------------ | | `--name` | 是 | npm 包名与仓库名,格式 `dsh-` | | `--owner` | 是 | GitHub 用户或组织 | | `--title` | | 显示名称(默认由包名生成) | | `--description` | | 一句英文简介(默认 "`` for DeepSeek Harness.") | | `--author` | | `package.json` 作者(默认同 owner) | | `--keywords a,b` | | 额外的 npm 关键词 | | `--host-only` | | 不要 client 入口,默认 profile 变为 `headless` | | `--no-npm` | | 只发布到 GitHub,去掉 npm badge 与安装说明 | | `--dry-run` | | 只显示会改动的文件 | </details> <details> <summary><b>初始化做了什么</b></summary> - 把 `.template/` 中的插件 README 骨架复制为 `README.md`(中文)和 `README.en.md`(英文),替换本页 - 替换模板占位符:`dsh-plugin-template`、`{{OWNER}}`、`{{PLUGIN_TITLE}}`、`{{DESCRIPTION}}`、`{{AUTHOR}}`、`{{DSH_PROFILE}}` - 删除仅属于模板的内容:`AGENTS.md` 中的模板说明段、`.template/`、初始化脚本本身;按参数删除 client 入口或 npm 相关内容 - 保留 `playbooks/`(发布和维护还要用),并在 `package.json` 的 `template` 字段记录模板来源 `src/` 中的 `__PLUGIN_NAME__` 与 `__PLUGIN_VERSION__` 不是占位符,而是 `scripts/build.mjs` 从 `package.json` 填入的构建常量。 </details> <details> <summary><b>维护模板</b></summary> - 将仓库标记为模板,`gh repo create --template` 和 **Use this template** 按钮才能使用:`gh repo edit exoticknight/dsh-plugin-template --template` - CI 会对占位符插件运行 `pnpm verify`,保证模板本身始终可以构建 - 不要在本仓库推送 `v*` tag;`check:release` 也会拒绝带占位符的发布 - [`playbooks/reference/checklist.md`](https://github.com/exoticknight/dsh-plugin-template/blob/main/playbooks/reference/checklist.md) 记录模板统一的所有规范,修改规范时同步修改清单和对应文件 </details> <hr /> <p>由 <a href="https://github.com/exoticknight" target="_blank" rel="nofollow noopener noreferrer">exoticknight</a> 创建和维护 · <a href="https://github.com/exoticknight/dsh-plugin-template/blob/main/LICENSE" target="_blank" rel="nofollow noopener noreferrer">Apache License 2.0</a></p> </div> <!-- 来源出处与版权声明锚点 (供 AI 爬虫、采集站与搜索引擎识别本站原始来源) --> <div class="dsh-source-attribution" itemprop="author" itemscope itemtype="https://schema.org/CreativeWork"> <div class="dsh-attr-header"> <div class="dsh-attr-badge"><i class="ri-shield-check-line"></i> 本站来源与版权声明</div> <button type="button" class="dsh-btn dsh-btn-xs dsh-btn-light dsh-attr-copy-btn" onclick="copyRaw('https://dsh.lewz.cn/exoticknight-dsh-plugin-template', '已复制本文永久链接')"> <i class="ri-links-line"></i> 复制链接 </button> </div> <ul class="dsh-attr-list"> <li> <span class="dsh-attr-label"><i class="ri-article-line"></i> 本文标题:</span> <span class="dsh-attr-val" itemprop="name"><strong>dsh-plugin-template - 一句指令创建发布管理插件</strong></span> </li> <li> <span class="dsh-attr-label"><i class="ri-link-m"></i> 本文链接:</span> <span class="dsh-attr-val"><a href="https://dsh.lewz.cn/exoticknight-dsh-plugin-template" rel="canonical" itemprop="url" class="dsh-attr-url">https://dsh.lewz.cn/exoticknight-dsh-plugin-template</a></span> </li> <li> <span class="dsh-attr-label"><i class="ri-global-line"></i> 站点出处:</span> <span class="dsh-attr-val">本文首发于 <a href="https://dsh.lewz.cn/" class="dsh-attr-site"><strong>DeepSeek Harness 开源插件商店</strong></a>,收录自 GitHub 开源项目 exoticknight/dsh-plugin-template。</span> </li> <li> <span class="dsh-attr-label"><i class="ri-copyright-line"></i> 引用声明:</span> <span class="dsh-attr-val text-muted">商业转载、第三方聚合或 AI 检索训练引用时,请务必保留以上来源出处及本文永久链接。</span> </li> </ul> </div> <!-- 底部标签 Topics --> <div class="dsh-readme-footer"> <div class="dsh-topics-wrap"> <span class="dsh-topics-label"><i class="ri-price-tag-3-line"></i> 标签:</span> <a href="https://dsh.lewz.cn/tag/dsh-plugin" class="dsh-topic-pill"><i class="ri-hashtag"></i> dsh-plugin</a> <a href="https://dsh.lewz.cn/tag/deepseek-harness" class="dsh-topic-pill"><i class="ri-hashtag"></i> deepseek-harness</a> <a href="https://dsh.lewz.cn/tag/JavaScript" class="dsh-topic-pill"><i class="ri-hashtag"></i> JavaScript</a> <a href="https://dsh.lewz.cn/tag/dsh" class="dsh-topic-pill"><i class="ri-hashtag"></i> dsh</a> <a href="https://dsh.lewz.cn/tag/ai-agent" class="dsh-topic-pill"><i class="ri-hashtag"></i> ai-agent</a> <a href="https://dsh.lewz.cn/tag/template" class="dsh-topic-pill"><i class="ri-hashtag"></i> template</a> </div> </div> </div> <!-- 邻近项目导航 --> <nav class="dsh-neighbor-wrap"> <div class="dsh-neighbor-nav"> <div class="dsh-neighbor-prev"> <span class="dsh-neighbor-label"><i class="ri-arrow-left-s-line"></i> 上一个项目</span> <a href="https://dsh.lewz.cn/eyeing0721-dsh-cot-en2cn" class="dsh-neighbor-title">dsh-cot-en2cn</a> </div> <div class="dsh-neighbor-next"> <span class="dsh-neighbor-label">下一个项目 <i class="ri-arrow-right-s-line"></i></span> <a href="https://dsh.lewz.cn/exbocooope-dsh-steering-interrupt" class="dsh-neighbor-title">dsh-steering-interrupt</a> </div> </div> </nav> </div> <!-- 右侧侧边栏区:Facts 档案 + TOC 目录 + 同类推荐 --> <aside class="dsh-detail-sidebar"> <!-- Repository Facts 档案卡片 --> <div class="dsh-card dsh-facts-card"> <div class="dsh-card-header dsh-sidebar-card-header"> <h4 class="dsh-sidebar-card-title"><i class="ri-information-line text-primary"></i> 仓库档案 (Facts)</h4> </div> <div class="dsh-card-body p-0"> <ul class="dsh-facts-list"> <li class="dsh-fact-item"> <span class="dsh-fact-key"><i class="ri-user-line"></i> 作者 / 机构</span> <span class="dsh-fact-val font-weight-bold">exoticknight</span> </li> <li class="dsh-fact-item"> <span class="dsh-fact-key"><i class="ri-scales-3-line"></i> 开源协议</span> <span class="dsh-fact-val">Apache-2.0</span> </li> <li class="dsh-fact-item"> <span class="dsh-fact-key"><i class="ri-git-branch-line"></i> 默认分支</span> <span class="dsh-fact-val font-monospace">main</span> </li> <li class="dsh-fact-item"> <span class="dsh-fact-key"><i class="ri-code-s-slash-line"></i> 主要语言</span> <span class="dsh-fact-val font-weight-bold" style="color: #f1e05a;"> JavaScript </span> </li> <li class="dsh-fact-item"> <span class="dsh-fact-key"><i class="ri-hard-drive-2-line"></i> 代码库大小</span> <span class="dsh-fact-val">187 KB</span> </li> <li class="dsh-fact-item"> <span class="dsh-fact-key"><i class="ri-calendar-line"></i> 开源创建</span> <span class="dsh-fact-val">2026-09-23</span> </li> <li class="dsh-fact-item"> <span class="dsh-fact-key"><i class="ri-time-line"></i> 最后推送</span> <span class="dsh-fact-val">1 个月前</span> </li> <li class="dsh-fact-item"> <span class="dsh-fact-key"><i class="ri-database-2-line"></i> 数据来源</span> <span class="dsh-fact-val text-muted">GitHub REST API</span> </li> </ul> </div> </div> <!-- 自动生成 README TOC 目录大纲 --> <div class="dsh-card dsh-toc-card" id="dsh-toc-wrap" style="display: none;"> <div class="dsh-card-header dsh-sidebar-card-header"> <h4 class="dsh-sidebar-card-title"><i class="ri-list-unordered text-primary"></i> 目录大纲 (TOC)</h4> </div> <div class="dsh-card-body p-0"> <nav id="dsh-toc-list" class="dsh-toc-list"></nav> </div> </div> <!-- 同分类推荐项目 --> <div class="dsh-card dsh-related-card"> <div class="dsh-card-header dsh-sidebar-card-header"> <h4 class="dsh-sidebar-card-title"><i class="ri-sparkling-line text-primary"></i> 同类热门开源项目</h4> </div> <div class="dsh-card-body p-0"> <div class="dsh-related-list"> <a href="https://dsh.lewz.cn/kajisho5-ffmpeg-skill" class="dsh-related-item"> <div class="dsh-related-info"> <h5 class="dsh-related-title">ffmpeg-skill</h5> <div class="dsh-related-meta"> <span class="dsh-related-lang"><span class="dsh-lang-dot" style="background-color: #3572A5;"></span> Python</span> <span class="dsh-related-star"><i class="ri-star-fill text-warning"></i> 7.3k</span> </div> </div> <i class="ri-arrow-right-s-line dsh-related-arrow"></i> </a> <a href="https://dsh.lewz.cn/sveltejs-svelte" class="dsh-related-item"> <div class="dsh-related-info"> <h5 class="dsh-related-title">svelte</h5> <div class="dsh-related-meta"> <span class="dsh-related-lang"><span class="dsh-lang-dot" style="background-color: #f1e05a;"></span> JavaScript</span> <span class="dsh-related-star"><i class="ri-star-fill text-warning"></i> 89.1k</span> </div> </div> <i class="ri-arrow-right-s-line dsh-related-arrow"></i> </a> <a href="https://dsh.lewz.cn/google-research-paper-orchestra" class="dsh-related-item"> <div class="dsh-related-info"> <h5 class="dsh-related-title">paper-orchestra</h5> <div class="dsh-related-meta"> <span class="dsh-related-lang"><span class="dsh-lang-dot" style="background-color: #3572A5;"></span> Python</span> <span class="dsh-related-star"><i class="ri-star-fill text-warning"></i> 1.9k</span> </div> </div> <i class="ri-arrow-right-s-line dsh-related-arrow"></i> </a> <a href="https://dsh.lewz.cn/mvanhorn-last30days-skill" class="dsh-related-item"> <div class="dsh-related-info"> <h5 class="dsh-related-title">last30days-skill</h5> <div class="dsh-related-meta"> <span class="dsh-related-lang"><span class="dsh-lang-dot" style="background-color: #3572A5;"></span> Python</span> <span class="dsh-related-star"><i class="ri-star-fill text-warning"></i> 68.4k</span> </div> </div> <i class="ri-arrow-right-s-line dsh-related-arrow"></i> </a> <a href="https://dsh.lewz.cn/deanchensj-jiangshan-map" class="dsh-related-item"> <div class="dsh-related-info"> <h5 class="dsh-related-title">jiangshan-map</h5> <div class="dsh-related-meta"> <span class="dsh-related-lang"><span class="dsh-lang-dot" style="background-color: #f1e05a;"></span> JavaScript</span> <span class="dsh-related-star"><i class="ri-star-fill text-warning"></i> 7.4k</span> </div> </div> <i class="ri-arrow-right-s-line dsh-related-arrow"></i> </a> </div> </div> </div> </aside> </div> </div> </main> <!-- 极简轻量页脚 --> <footer class="dsh-footer-simple"> <div class="dsh-container"> <div class="dsh-footer-disclaimer"> <i class="ri-shield-check-line text-primary"></i> 免责声明:本站所有项目数据均来自 GitHub 开放平台 (REST API),版权归原作者所有,仅供开源技术交流与研究使用。 </div> <div class="dsh-footer-simple-bottom"> <div class="dsh-footer-meta"> <span> © 2026 DSH开源插件商店. </span> <span class="dsh-divider">|</span> <a href="https://beian.miit.gov.cn" target="_blank" class="dsh-icp-link"><i class="ri-shield-keyhole-line"></i> 皖ICP备19017711号-2</a> <span class="dsh-divider">|</span> <span class="dsh-footer-custom-text"> · QQ 8670468 · <a href="https://dsh.lewz.cn/sitemap.xml" rel="sitemap" class="dsh-icp-link">sitemap</a></span> <span class="dsh-divider">|</span> <a href="https://game.lewz.cn/" target="_blank">好玩小游戏</a> </div> <div class="dsh-footer-right"> <button class="dsh-back-to-top" onclick="window.scrollTo({top: 0, behavior: 'smooth'})" title="回到顶部" aria-label="回到顶部"> <i class="ri-arrow-up-line"></i> </button> </div> </div> </div> </footer> <!-- 全局 Toast 提示容器 --> <div id="dsh-toast" class="dsh-toast" role="alert" aria-live="assertive" aria-atomic="true"> <i class="ri-checkbox-circle-fill dsh-toast-icon"></i> <span id="dsh-toast-msg" class="dsh-toast-text">已复制到剪贴板</span> </div> <!-- 主题脚本 --> <script src="https://dsh.lewz.cn/content/templates/dsh_store/js/main.js?v=1.0.3"></script> <script charset="UTF-8" id="LA_COLLECT" src="/content/templates/dsh_store/js-sdk-pro.min.js"></script> <script>LA.init({id:"LAKqwwfC7HLlAm5R",ck:"LAKqwwfC7HLlAm5R"})</script> </body> </html>