adspecs 0.1.31 → 0.1.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,7 @@
10
10
  {
11
11
  "name": "adspecs",
12
12
  "description": "AI Coding研发协同开发插件",
13
- "version": "0.1.31",
13
+ "version": "0.1.32",
14
14
  "source": "./",
15
15
  "author": {
16
16
  "name": "Qingwen Chen",
@@ -2,7 +2,7 @@
2
2
  "name": "adspecs",
3
3
  "displayName": "adspecs AI Plugin",
4
4
  "description": "AI first工程规范驱动开发插件",
5
- "version": "0.1.31",
5
+ "version": "0.1.32",
6
6
  "author": {
7
7
  "name": "Qingwen Chen",
8
8
  "email": "cqinwn@qq.com",
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "adspecs",
3
+ "displayName": "adspecs AI 工程规范驱动开发插件",
4
+ "version": "0.1.32",
5
+ "description": "AI-first specification-driven development plugin for ECP platform full-lifecycle development",
6
+ "descriptionZh": "AI优先的工程规范驱动开发插件,覆盖需求分析、PRD、系统设计、任务拆解、TDD、代码评审、Wiki同步全流程",
7
+ "author": {
8
+ "name": "Qingwen Chen",
9
+ "email": "cqinwn@qq.com"
10
+ },
11
+ "homepage": "https://gitee.com/yuebon/adspecs",
12
+ "repository": "https://gitee.com/yuebon/adspecs",
13
+ "logo": "./assets/avatar.svg",
14
+ "keywords": [
15
+ "codebuddy-plugin",
16
+ "adspecs",
17
+ "spec-driven",
18
+ "tdd"
19
+ ],
20
+ "category": "developer-tools",
21
+ "skills": "./skills/",
22
+ "hooks": "./hooks/hooks.json",
23
+ "defaultEnabled": true
24
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "adspecs",
3
3
  "displayName": "adspecs AI 工程规范驱动开发插件",
4
- "version": "0.1.31",
4
+ "version": "0.1.32",
5
5
  "description": "AI-first specification-driven development plugin for ECP platform full-lifecycle development",
6
6
  "descriptionZh": "AI优先的工程规范驱动开发插件,覆盖需求分析、PRD、系统设计、任务拆解、TDD、代码评审、Wiki同步全流程",
7
7
  "author": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "adspecs",
3
3
  "displayName": "adspecs AI 工程规范驱动开发插件",
4
- "version": "0.1.31",
4
+ "version": "0.1.32",
5
5
  "description": "AI-first specification-driven development plugin for ECP platform full-lifecycle development",
6
6
  "descriptionZh": "AI优先的工程规范驱动开发插件,覆盖需求分析、PRD、系统设计、任务拆解、TDD、代码评审、Wiki同步全流程",
7
7
  "author": {
package/CLAUDE.md CHANGED
@@ -6,7 +6,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
6
6
 
7
7
  **adspecs AI Plugin** — a Claude Code / Qoder / WorkBuddy plugin for ECP (Enterprise Cloud Platform) full-lifecycle AI-driven development. Provides 30 skills (slash commands) covering requirements, SOW authoring, system design, task breakdown, unit testing, code review, feature status tracking, and wiki sync.
8
8
 
9
- - **Plugin name**: `adspecs` (see `.claude-plugin/plugin.json` / `.qoder-plugin/plugin.json` / `.workbuddy-plugin/plugin.json`)
9
+ - **Plugin name**: `adspecs` (see `.claude-plugin/plugin.json` / `.qoder-plugin/plugin.json` / `.codebuddy-plugin/plugin.json` / `.workbuddy-plugin/plugin.json`)
10
10
  - **Author**: Qingwen Chen
11
11
  - **License**: Apache 2.0
12
12
  - **Language**: Chinese (all documentation, templates, and skill instructions are in Chinese)
@@ -18,7 +18,8 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
18
18
  adspecs/
19
19
  ├── .claude-plugin/ # Plugin metadata for Claude Code
20
20
  ├── .qoder-plugin/ # Plugin metadata for Qoder
21
- ├── .workbuddy-plugin/ # Plugin metadata for WorkBuddy
21
+ ├── .codebuddy-plugin/ # Plugin metadata for WorkBuddy (CodeBuddy format)
22
+ ├── .workbuddy-plugin/ # Plugin metadata for WorkBuddy (legacy, backward compat)
22
23
  ├── .adspecs/ # Plugin runtime config, templates, scripts & extensions (copied to target projects)
23
24
  │ ├── templates/ # 21 standard document templates (PRD, system design, etc.)
24
25
  │ ├── extensions/ # Extension configs (git hooks, etc.)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adspecs",
3
- "version": "0.1.31",
3
+ "version": "0.1.32",
4
4
  "description": "AI first 工程规范驱动开发插件 — 支持 npm 安装和 CLI 初始化",
5
5
  "bin": {
6
6
  "adspecs": "bin/adspecs.js"
@@ -11,6 +11,7 @@
11
11
  "src/",
12
12
  ".claude-plugin/",
13
13
  ".qoder-plugin/",
14
+ ".codebuddy-plugin/",
14
15
  ".workbuddy-plugin/",
15
16
  ".adspecs/",
16
17
  "skills/",
@@ -31,7 +32,7 @@
31
32
  "test": "node --test src/**/*.test.js",
32
33
  "postinstall": "node scripts/postinstall.js",
33
34
  "prepublishOnly": "node scripts/prepublish-check.js",
34
- "version": "node scripts/sync-version.js && git add .claude-plugin/plugin.json .claude-plugin/marketplace.json .qoder-plugin/plugin.json .workbuddy-plugin/plugin.json",
35
+ "version": "node scripts/sync-version.js && git add .claude-plugin/plugin.json .claude-plugin/marketplace.json .qoder-plugin/plugin.json .codebuddy-plugin/plugin.json .workbuddy-plugin/plugin.json",
35
36
  "sync-version": "node scripts/sync-version.js"
36
37
  },
37
38
  "dependencies": {
@@ -5,10 +5,11 @@
5
5
  * 版本同步脚本
6
6
  *
7
7
  * 在 `npm version <type>` 时自动执行(通过 preversion 钩子)。
8
- * 将 package.json 的新版本同步到四套插件清单文件:
8
+ * 将 package.json 的新版本同步到五套插件清单文件:
9
9
  * - .claude-plugin/plugin.json
10
10
  * - .claude-plugin/marketplace.json
11
11
  * - .qoder-plugin/plugin.json
12
+ * - .codebuddy-plugin/plugin.json
12
13
  * - .workbuddy-plugin/plugin.json
13
14
  *
14
15
  * 也可手动运行:`npm run sync-version`
@@ -87,6 +88,15 @@ function main() {
87
88
  updated.push(`.workbuddy-plugin/plugin.json (${old} → ${newVersion})`);
88
89
  }
89
90
 
91
+ // 5. .codebuddy-plugin/plugin.json — 始终与 package.json 保持版本一致
92
+ const cbPlugin = readJson('.codebuddy-plugin/plugin.json');
93
+ if (cbPlugin && cbPlugin.version !== newVersion) {
94
+ const old = cbPlugin.version;
95
+ cbPlugin.version = newVersion;
96
+ writeJson('.codebuddy-plugin/plugin.json', cbPlugin);
97
+ updated.push(`.codebuddy-plugin/plugin.json (${old} → ${newVersion})`);
98
+ }
99
+
90
100
  if (updated.length === 0) {
91
101
  console.log('✅ 所有清单版本已一致,无需更新');
92
102
  } else {
@@ -34,7 +34,7 @@ function getPluginName(platform) {
34
34
  if (platform === 'qoder') {
35
35
  manifestDir = '.qoder-plugin';
36
36
  } else if (platform === 'workbuddy') {
37
- manifestDir = '.workbuddy-plugin';
37
+ manifestDir = '.codebuddy-plugin';
38
38
  } else {
39
39
  manifestDir = '.claude-plugin';
40
40
  }
@@ -121,7 +121,7 @@ function checkCodebuddyCli() {
121
121
  * 若 CLI 不可用则回退为手工配置 enabledPlugins
122
122
  */
123
123
  async function installForWorkBuddy(pluginName, scope) {
124
- const workbuddyManifest = path.join(PLUGIN_DIR, '.workbuddy-plugin', 'plugin.json');
124
+ const workbuddyManifest = path.join(PLUGIN_DIR, '.codebuddy-plugin', 'plugin.json');
125
125
  if (!fs.existsSync(workbuddyManifest)) {
126
126
  throw new Error(`未找到 WorkBuddy 插件清单: ${workbuddyManifest}`);
127
127
  }
@@ -523,7 +523,19 @@ async function uninstallWorkBuddy(pluginName, scope) {
523
523
  }
524
524
  }
525
525
 
526
- // 2. settings.json 移除
526
+ // 2. 移除 marketplace 目录级清单 (.codebuddy-plugin/marketplace.json)
527
+ const catalogDir = path.join(localMarketplaceDir, '.codebuddy-plugin');
528
+ if (fs.existsSync(catalogDir)) {
529
+ try {
530
+ fs.rmSync(catalogDir, { recursive: true, force: true });
531
+ console.log(chalk.green(' ✅ 已移除 marketplace 清单'));
532
+ cleaned = true;
533
+ } catch (err) {
534
+ console.log(chalk.yellow(` ⚠ 移除 marketplace 清单失败: ${err.message}`));
535
+ }
536
+ }
537
+
538
+ // 3. 从 settings.json 移除
527
539
  if (fs.existsSync(settingsPath)) {
528
540
  let settings = {};
529
541
  try { settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8')); } catch (_e) { /* use default */ }
@@ -545,7 +557,7 @@ async function uninstallWorkBuddy(pluginName, scope) {
545
557
  }
546
558
  }
547
559
 
548
- // 3. 从 known_marketplaces.json 移除 local marketplace
560
+ // 4. 从 known_marketplaces.json 移除 local marketplace
549
561
  if (fs.existsSync(knownMarketplacesPath)) {
550
562
  let knownMarketplaces = {};
551
563
  try { knownMarketplaces = JSON.parse(fs.readFileSync(knownMarketplacesPath, 'utf8')); } catch (_e) { /* use default */ }
package/src/utils.js CHANGED
@@ -98,8 +98,9 @@ function copyDirRecursive(src, dest, excludeDirs) {
98
98
  * 手工方式完成完整注册,无需 codebuddy CLI:
99
99
  * 1. 创建 ~/.workbuddy/plugins/marketplaces/local/ 目录
100
100
  * 2. 创建 junction 链接(或回退复制)指向插件目录
101
- * 3. known_marketplaces.json 中注册 local marketplace
102
- * 4. 在 settings.json enabledPlugins 中启用插件
101
+ * 3. 生成 marketplace 目录级清单 (.codebuddy-plugin/marketplace.json)
102
+ * 4. 在 known_marketplaces.json 中注册 local marketplace
103
+ * 5. 在 settings.json 的 enabledPlugins 中启用插件
103
104
  *
104
105
  * @param {string} pluginDir - adspecs 插件根目录
105
106
  * @param {string} [pluginName='adspecs'] - 插件名称
@@ -135,7 +136,7 @@ function registerWorkBuddyPlugin(pluginDir, pluginName) {
135
136
  } catch (_symlinkErr) {
136
137
  // junction 创建失败 → 回退为复制关键目录
137
138
  fs.mkdirSync(pluginLinkPath, { recursive: true });
138
- const entriesToCopy = ['.workbuddy-plugin', 'skills', 'hooks', 'references', 'commands'];
139
+ const entriesToCopy = ['.codebuddy-plugin', '.workbuddy-plugin', 'skills', 'hooks', 'references', 'commands'];
139
140
  for (const entry of entriesToCopy) {
140
141
  const srcPath = path.join(pluginDir, entry);
141
142
  if (!fs.existsSync(srcPath)) continue;
@@ -155,7 +156,23 @@ function registerWorkBuddyPlugin(pluginDir, pluginName) {
155
156
  }
156
157
  }
157
158
 
158
- // 3. 注册 local marketplace
159
+ // 3. 生成 marketplace 目录级清单(.codebuddy-plugin/marketplace.json)
160
+ // WorkBuddy 扫描器需要此文件才能发现 marketplace 中的插件
161
+ const catalogDir = path.join(localMarketplaceDir, '.codebuddy-plugin');
162
+ fs.mkdirSync(catalogDir, { recursive: true });
163
+ const pkg = getPkg();
164
+ safeWriteJson(path.join(catalogDir, 'marketplace.json'), {
165
+ name: 'local',
166
+ description: 'Local plugins',
167
+ plugins: [{
168
+ name: pluginName,
169
+ source: './' + pluginName,
170
+ version: pkg.version,
171
+ description: pkg.description
172
+ }]
173
+ });
174
+
175
+ // 4. 注册 local marketplace
159
176
  let knownMarketplaces = safeReadJson(knownMarketplacesPath, {});
160
177
  const now = new Date().toISOString();
161
178
 
@@ -172,7 +189,7 @@ function registerWorkBuddyPlugin(pluginDir, pluginName) {
172
189
  };
173
190
  safeWriteJson(knownMarketplacesPath, knownMarketplaces);
174
191
 
175
- // 4. 启用插件
192
+ // 5. 启用插件
176
193
  let settings = safeReadJson(settingsPath, {});
177
194
  if (!settings.enabledPlugins) settings.enabledPlugins = {};
178
195
  settings.enabledPlugins[`${pluginName}@local`] = true;