From 766d3eb0b04029228636e21b19ce45c084e09ddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E8=B1=AA=20=E5=B7=A6?= <13277619896@163.com> Date: Wed, 28 Oct 2026 12:41:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20DeepSeek=20Harness=20?= =?UTF-8?q?=E5=B8=82=E5=9C=BA=E6=BA=90=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - package.json 声明 dsh.bundle 与 dsh 引擎范围,供 DSH 作为 bundle 安装 - cordis.patch.yml 与 lib/index.js 注册只指向本包 skills 目录的技能提供方 - index.json 提供 format 1 市场索引,DSH 可通过索引地址发现并安装 - README 补充 DSH 安装方式与三处版本号的同步说明 --- .claude-plugin/plugin.json | 2 +- README.md | 21 +++++++++++++++++-- cordis.patch.yml | 10 ++++++++++ index.json | 40 +++++++++++++++++++++++++++++++++++++ lib/index.js | 37 ++++++++++++++++++++++++++++++++++ package.json | 41 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 148 insertions(+), 3 deletions(-) create mode 100644 cordis.patch.yml create mode 100644 index.json create mode 100644 lib/index.js create mode 100644 package.json diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index c449f80..e266c48 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "engineering-conventions", "description": "通用工程协作约定:动手前先找现成实现、公共代码改动先对齐、改实现同轮改文档、最小验证、长任务报进度、规范提交信息。", - "version": "1.0.0", + "version": "1.1.0", "author": { "name": "左林豪" }, diff --git a/README.md b/README.md index 9e77e15..51ba7bb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # 工程协作约定 -一套与具体工具无关的 AI 编码协作约定,适用于任何 AI 编码助手(Claude Code、Codex、Copilot 等)与人工协作的场景。 +一套与具体工具无关的 AI 编码协作约定,适用于任何 AI 编码助手(Claude Code、Codex、Copilot、DeepSeek Harness 等)与人工协作的场景。 内容涵盖:动手前先找现成实现、公共代码与多文件改动先对齐、改实现同轮改文档、最小验证、长时间任务汇报进度、规范的提交信息与代码文风。 @@ -9,9 +9,22 @@ | 文件 | 说明 | |---|---| | `skills/engineering-conventions/SKILL.md` | 约定正文:工作方式、动手前先对齐、执行与验证、上下文成本、Git、代码文风 | +| `index.json` | DeepSeek Harness 市场索引(format 1) | +| `package.json`、`cordis.patch.yml`、`lib/index.js` | DeepSeek Harness bundle 声明与技能提供方接线 | +| `.claude-plugin/plugin.json` | Claude Code 插件清单 | `SKILL.md` 是纯 Markdown,可以直接阅读,也可以作为任意 AI 助手的指令文件(system prompt、规则文件、技能条目都适用)。 +## 在 DeepSeek Harness 中安装 + +DSH 不自带任何市场源,需要在 Plugins 页开启实验功能 “Custom plugin indexes”,然后在 Discover → Add index source 里填索引地址: + +``` +https://www.zlhhh.com/ZLH/engineering-conventions/raw/branch/main/index.json +``` + +索引条目按 git commit 固定版本安装,版本号与 commit 记录在 `index.json` 的 `versions` 中。 + ## 作为 Claude Code 插件安装 本仓库同时符合 Claude Code 插件格式(`.claude-plugin/plugin.json` + `skills/`),需要时可直接装成插件: @@ -25,7 +38,11 @@ claude plugin install engineering-conventions@engineering-conventions ## 版本 -插件版本在 `.claude-plugin/plugin.json` 的 `version` 字段,改动技能内容后手动递增。 +同一份版本号记在三处,改动技能内容后一起递增: + +- `package.json` 的 `version`(DSH bundle) +- `.claude-plugin/plugin.json` 的 `version`(Claude Code 插件) +- `index.json` 里的 `versions` 条目(DSH 市场索引,需同时更新 `commit` 为提交后的完整 SHA 与 `publishTimestamp`) ## 许可 diff --git a/cordis.patch.yml b/cordis.patch.yml new file mode 100644 index 0000000..04069fd --- /dev/null +++ b/cordis.patch.yml @@ -0,0 +1,10 @@ +# DeepSeek Harness bundle:注册一个只指向本包 skills 目录的技能提供方。 +# skills 根目录绑定在已安装包的位置(profile loader 的 baseUrl),不依赖进程工作目录, +# 因此 SKILL.md 中相对 skills 目录的引用在安装后仍然有效。 +- insert: + - id: engineering-conventions-skill-filesystem + name: '@deepseek-ai/dsh-skill-filesystem' + config: + providerName: engineering-conventions + includeDefaultRoots: false + bundledSkillDir: !!js process.getBuiltinModule('node:path').join(process.getBuiltinModule('node:path').dirname(process.getBuiltinModule('node:module').createRequire(baseUrl).resolve('engineering-conventions/package.json')), 'skills') diff --git a/index.json b/index.json new file mode 100644 index 0000000..f295225 --- /dev/null +++ b/index.json @@ -0,0 +1,40 @@ +{ + "format": 1, + "title": { "en": "zlh-agent-market", "zh": "左林豪的习惯约定" }, + "description": { + "en": "Reusable working conventions for AI coding agents.", + "zh": "给 AI 编码助手用的通用协作约定。" + }, + "plugins": [ + { + "name": "engineering-conventions", + "title": { "en": "Engineering conventions", "zh": "工程协作约定" }, + "description": { + "en": "Look for existing implementations first, align before touching shared code, update docs in the same change, verify minimally, report progress on long tasks, write structured commit messages.", + "zh": "先找现成实现、公共代码改动先对齐、改实现同轮改文档、最小验证、长任务报进度、规范提交信息。" + }, + "author": "左林豪", + "homepage": "https://www.zlhhh.com/ZLH/engineering-conventions", + "repository": { + "url": "https://www.zlhhh.com/ZLH/engineering-conventions" + }, + "metadata": { + "keywords": ["engineering", "conventions", "workflow", "git"] + }, + "versions": [ + { + "version": "1.1.0", + "publishTimestamp": 1793145600, + "source": { + "type": "git", + "url": "https://www.zlhhh.com/ZLH/engineering-conventions", + "commit": "0000000000000000000000000000000000000000" + }, + "engines": { + "dsh": ">=0.2.0-rc.2" + } + } + ] + } + ] +} diff --git a/lib/index.js b/lib/index.js new file mode 100644 index 0000000..5046922 --- /dev/null +++ b/lib/index.js @@ -0,0 +1,37 @@ +// DeepSeek Harness bundle 入口。 +// 两种接线方式互斥: +// - 启动路径:cordis.patch.yml 直接插入技能提供方那一行,本模块不会被加载; +// - 热安装(profile 工具对本包调用 loader.create):本模块作为插件自行挂载同一个提供方, +// 无需重启即可让随包技能生效。 +import { dirname, join } from 'node:path'; +import { fileURLToPath } from 'node:url'; + +export const name = 'engineering-conventions'; + +const PROVIDER = '@deepseek-ai/dsh-skill-filesystem'; + +export function apply(ctx, config = {}) { + const skillRoot = config.bundledSkillDir + ?? join(dirname(fileURLToPath(import.meta.url)), '..', 'skills'); + ctx.effect(() => { + let entryId; + let disposed = false; + void ctx.loader.create({ + name: PROVIDER, + config: { + providerName: 'engineering-conventions', + includeDefaultRoots: false, + bundledSkillDir: skillRoot, + }, + }).then((id) => { + if (disposed) ctx.loader.remove(id); + else entryId = id; + }).catch((error) => { + console.error(`Failed to load ${PROVIDER} for ${name}.`, error); + }); + return () => { + disposed = true; + if (entryId) ctx.loader.remove(entryId); + }; + }); +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..3212d88 --- /dev/null +++ b/package.json @@ -0,0 +1,41 @@ +{ + "name": "engineering-conventions", + "version": "1.1.0", + "description": "通用工程协作约定技能:先找现成实现、公共代码改动先对齐、改实现同轮改文档、最小验证、规范提交信息。", + "license": "MIT", + "type": "module", + "main": "./lib/index.js", + "exports": { + ".": "./lib/index.js", + "./package.json": "./package.json" + }, + "files": [ + "lib", + "cordis.patch.yml", + "skills", + "README.md", + "LICENSE" + ], + "keywords": [ + "dsh-plugin", + "deepseek-harness", + "agent-skill", + "engineering", + "conventions", + "workflow", + "git" + ], + "engines": { + "dsh": ">=0.2.0-rc.2" + }, + "repository": { + "type": "git", + "url": "git+https://www.zlhhh.com/ZLH/engineering-conventions.git" + }, + "homepage": "https://www.zlhhh.com/ZLH/engineering-conventions", + "dsh": { + "bundle": { + "patch": "./cordis.patch.yml" + } + } +}