adspecs 0.1.28 → 0.1.30

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.
Files changed (45) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.qoder-plugin/plugin.json +1 -1
  4. package/.workbuddy-plugin/plugin.json +24 -0
  5. package/CHANGELOG.md +13 -0
  6. package/CLAUDE.md +14 -8
  7. package/INSTALL.md +85 -5
  8. package/README.md +33 -10
  9. package/bin/adspecs.js +8 -7
  10. package/hooks/hooks.json +2 -2
  11. package/hooks/platform.js +22 -11
  12. package/package.json +4 -2
  13. package/scripts/postinstall.js +79 -36
  14. package/scripts/sync-version.js +11 -1
  15. package/skills/adspecs-adversarial-review/SKILL.md +1 -0
  16. package/skills/adspecs-analyze/SKILL.md +1 -0
  17. package/skills/adspecs-architecture-planning/SKILL.md +1 -0
  18. package/skills/adspecs-biz-blueprint/SKILL.md +555 -554
  19. package/skills/adspecs-clarify/SKILL.md +1 -0
  20. package/skills/adspecs-constitution/SKILL.md +1 -0
  21. package/skills/adspecs-export-word/SKILL.md +499 -498
  22. package/skills/adspecs-front-prototype/SKILL.md +1 -0
  23. package/skills/adspecs-front-spec/SKILL.md +1 -0
  24. package/skills/adspecs-front-tasks/SKILL.md +1 -0
  25. package/skills/adspecs-git-commit/SKILL.md +1 -0
  26. package/skills/adspecs-git-initialize/SKILL.md +1 -0
  27. package/skills/adspecs-new-requirement/SKILL.md +1 -0
  28. package/skills/adspecs-plan/SKILL.md +1 -0
  29. package/skills/adspecs-prd/SKILL.md +1 -0
  30. package/skills/adspecs-prd-to-demo/SKILL.md +1 -0
  31. package/skills/adspecs-save-session/SKILL.md +179 -178
  32. package/skills/adspecs-tasks/SKILL.md +1 -0
  33. package/skills/adspecs-update-status/SKILL.md +1 -0
  34. package/skills/adspecs-utest/SKILL.md +1 -0
  35. package/skills/adspecs-write-planning-report/SKILL.md +1 -0
  36. package/skills/adspecs-write-roadmap/SKILL.md +1 -0
  37. package/skills/adspecs-write-sow/SKILL.md +1 -0
  38. package/skills/grill-me/SKILL.md +1 -0
  39. package/skills/playwright-cli/SKILL.md +1 -0
  40. package/skills/playwright-trace/SKILL.md +1 -0
  41. package/skills/project-init/SKILL.md +1 -0
  42. package/skills/sie-front-code-review/SKILL.md +1 -0
  43. package/skills/wiki-update/SKILL.md +233 -232
  44. package/src/commands/plugin.js +376 -61
  45. package/src/commands/update.js +5 -1
@@ -10,7 +10,7 @@
10
10
  {
11
11
  "name": "adspecs",
12
12
  "description": "AI Coding研发协同开发插件",
13
- "version": "0.1.28",
13
+ "version": "0.1.30",
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.28",
5
+ "version": "0.1.30",
6
6
  "author": {
7
7
  "name": "Qingwen Chen",
8
8
  "email": "cqinwn@qq.com",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "adspecs",
3
3
  "displayName": "adspecs AI 工程规范驱动开发插件",
4
- "version": "0.1.28",
4
+ "version": "0.1.30",
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": {
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "adspecs",
3
+ "displayName": "adspecs AI 工程规范驱动开发插件",
4
+ "version": "0.1.30",
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
+ "workbuddy-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
+ }
package/CHANGELOG.md CHANGED
@@ -1 +1,14 @@
1
1
  # 版本历史
2
+
3
+ ## v0.1.30 (2026-07-31)
4
+
5
+ ### 新增
6
+ - **WorkBuddy 平台支持**:新增 `.workbuddy-plugin/plugin.json`,支持 WorkBuddy 原生插件机制
7
+ - `platform.js` 增加 WorkBuddy 平台检测(`CODEBUDDY_PLUGIN_ROOT` / `WORKBUDDY_SESSION_ID`)
8
+ - `plugin.js` 新增 `installForWorkBuddy` / `uninstallWorkBuddy` 安装卸载逻辑
9
+ - 所有 30 个 SKILL.md 补 `agent_created: true` 以兼容 WorkBuddy 的 skill_manage 机制
10
+
11
+ ### 修改
12
+ - `hooks.json` PostToolUse matcher 增加 `Edit`(与 `SearchReplace` 并存,适配 WorkBuddy 工具名)
13
+ - `package.json` files 追加 `.workbuddy-plugin/`,keywords 增加 `workbuddy`
14
+ - README / INSTALL / CLAUDE 文档更新三平台说明
package/CLAUDE.md CHANGED
@@ -4,9 +4,9 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
4
4
 
5
5
  ## Project Overview
6
6
 
7
- **adspecs AI Plugin** — a Claude Code plugin for ECP (Enterprise Cloud Platform) full-lifecycle AI-driven development. Provides 19 skills (slash commands) covering requirements, SOW authoring, system design, task breakdown, unit testing, code review, feature status tracking, and wiki sync.
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`)
9
+ - **Plugin name**: `adspecs` (see `.claude-plugin/plugin.json` / `.qoder-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)
@@ -16,7 +16,9 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
16
16
 
17
17
  ```
18
18
  adspecs/
19
- ├── .claude-plugin/ # Plugin metadata (plugin.json, marketplace.json)
19
+ ├── .claude-plugin/ # Plugin metadata for Claude Code
20
+ ├── .qoder-plugin/ # Plugin metadata for Qoder
21
+ ├── .workbuddy-plugin/ # Plugin metadata for WorkBuddy
20
22
  ├── .adspecs/ # Plugin runtime config, templates, scripts & extensions (copied to target projects)
21
23
  │ ├── templates/ # 21 standard document templates (PRD, system design, etc.)
22
24
  │ ├── extensions/ # Extension configs (git hooks, etc.)
@@ -96,7 +98,7 @@ Skills check for `.adspecs/extensions.yml` in the target project root, supportin
96
98
 
97
99
  ## Hooks System
98
100
 
99
- Hooks are configured in `hooks/hooks.json` and run as Node.js scripts. A shared platform detection module (`hooks/platform.js`) provides cross-platform compatibility between Claude Code and Qoder:
101
+ Hooks are configured in `hooks/hooks.json` and run as Node.js scripts. A shared platform detection module (`hooks/platform.js`) provides cross-platform compatibility between Claude Code, Qoder, and WorkBuddy:
100
102
 
101
103
  | Event | Script | Purpose |
102
104
  | ------------------------------------------------- | ------------------------- | ----------------------------------------------------------------------------------------- |
@@ -113,9 +115,9 @@ Hooks are configured in `hooks/hooks.json` and run as Node.js scripts. A shared
113
115
 
114
116
  ### Platform Detection (`hooks/platform.js`)
115
117
 
116
- - Detects platform via `ADSPECS_PLATFORM` env var, or platform-specific env vars (`CLAUDE_PLUGIN_ROOT` / `QODER_PLUGIN_ROOT`)
117
- - State directory: `.claude/` for Claude Code, `.qoder/` for Qoder
118
- - Tool output files: reads `CLAUDE_TOOL_OUTPUT_FILES` or `QODER_TOOL_OUTPUT_FILES`
118
+ - Detects platform via `ADSPECS_PLATFORM` env var, or platform-specific env vars (`CLAUDE_PLUGIN_ROOT` / `QODER_PLUGIN_ROOT` / `CODEBUDDY_PLUGIN_ROOT`)
119
+ - State directory: `.claude/` for Claude Code, `.qoder/` for Qoder, `.workbuddy/` for WorkBuddy
120
+ - Tool output files: reads `CLAUDE_TOOL_OUTPUT_FILES`, `QODER_TOOL_OUTPUT_FILES`, or `CODEBUDDY_TOOL_OUTPUT_FILES`
119
121
  - Output protocol: unified `hookSpecificOutput.additionalContext` JSON stdout format
120
122
 
121
123
  ## Path Configuration
@@ -221,5 +223,9 @@ claude plugins install adspecs --scope user|project
221
223
  # Qoder: CLI install
222
224
  adspecs plugin install --platform qoder --scope user|project
223
225
 
224
- # Qoder: Manual — ensure .qoder-plugin/plugin.json is accessible to Qoder
226
+ # WorkBuddy: CLI install
227
+ adspecs plugin install --platform workbuddy --scope user|project
228
+
229
+ # WorkBuddy (via CodeBuddy CLI)
230
+ codebuddy plugin install /path/to/adspecs --scope user
225
231
  ```
package/INSTALL.md CHANGED
@@ -22,7 +22,58 @@ adspecs 的编码阶段依赖 `superpowers` 插件提供的 `subagent-driven-dev
22
22
  /plugin install superpowers@superpowers-marketplace
23
23
  ```
24
24
 
25
- > **注意**:Qoder 平台无需安装 superpowers,adspecs 的 Skills 在 Qoder 中可独立运行。
25
+ > **注意**:Qoder / WorkBuddy 平台无需安装 superpowers,adspecs 的 Skills 在 Qoder / WorkBuddy 中可独立运行。
26
+
27
+ ---
28
+
29
+ ## 在 WorkBuddy 中安装
30
+
31
+ adspecs 通过 `.workbuddy-plugin/plugin.json` 提供 WorkBuddy 原生插件支持。
32
+
33
+ ### 方式 A:CLI 自动安装(推荐)
34
+
35
+ ```bash
36
+ # 全局安装 adspecs CLI
37
+ npm install -g adspecs
38
+
39
+ # 注册为 WorkBuddy 插件(自动检测平台)
40
+ adspecs plugin install --platform workbuddy
41
+
42
+ # 或指定项目级安装
43
+ adspecs plugin install --platform workbuddy --scope project
44
+ ```
45
+
46
+ ### 方式 B:通过 CodeBuddy CLI 安装
47
+
48
+ WorkBuddy 共享 CodeBuddy 的插件基础设施,可直接使用 CodeBuddy CLI:
49
+
50
+ ```bash
51
+ # 从本地目录安装(开发测试用)
52
+ codebuddy plugin install /path/to/adspecs --scope user
53
+
54
+ # 或从 Git 仓库安装
55
+ codebuddy plugin install https://gitee.com/yuebon/adspecs --scope user
56
+ ```
57
+
58
+ ### 方式 C:手工配置(无 CLI 时)
59
+
60
+ 编辑 `~/.workbuddy/settings.json`,在 `enabledPlugins` 中添加:
61
+
62
+ ```json
63
+ {
64
+ "enabledPlugins": {
65
+ "adspecs@local": true
66
+ }
67
+ }
68
+ ```
69
+
70
+ 确保 WorkBuddy 可访问 adspecs 技能目录后重启。
71
+
72
+ ### 卸载
73
+
74
+ ```bash
75
+ adspecs plugin uninstall --platform workbuddy --scope project
76
+ ```
26
77
 
27
78
  ---
28
79
 
@@ -181,14 +232,43 @@ claude plugins update adspecs --scope project
181
232
 
182
233
  ---
183
234
 
184
- ## 跨平台环境变量
235
+ ## 跨平台支持
236
+
237
+ ### 平台自动检测
238
+
239
+ adspecs 通过 `hooks/platform.js` 模块自动检测运行环境,无需手动配置:
185
240
 
186
- adspecs hooks 支持通过环境变量控制平台行为:
241
+ | 检测方式 | 说明 |
242
+ |----------|------|
243
+ | `ADSPECS_PLATFORM` 环境变量 | 显式指定平台(优先级最高) |
244
+ | `CLAUDE_PLUGIN_ROOT` 环境变量 | Claude Code 自动注入 |
245
+ | `QODER_PLUGIN_ROOT` 环境变量 | Qoder 自动注入 |
246
+ | `CODEBUDDY_PLUGIN_ROOT` 环境变量 | WorkBuddy / CodeBuddy 自动注入 |
247
+
248
+ ### 环境变量
187
249
 
188
250
  | 环境变量 | 说明 | 可选值 |
189
251
  |----------|------|--------|
190
- | `ADSPECS_PLATFORM` | 显式指定运行平台 | `claude` / `qoder` |
252
+ | `ADSPECS_PLATFORM` | 显式指定运行平台 | `claude` / `qoder` / `workbuddy` |
191
253
  | `CLAUDE_PLUGIN_ROOT` | Claude Code 注入的插件根路径 | 自动 |
192
- | `QODER_PLUGIN_ROOT` | Qoder 注入的插件根路径(如适用) | 自动 |
254
+ | `QODER_PLUGIN_ROOT` | Qoder 注入的插件根路径 | 自动 |
255
+ | `CODEBUDDY_PLUGIN_ROOT` | WorkBuddy/CodeBuddy 注入的插件根路径 | 自动 |
193
256
 
194
257
  通常无需手动设置,平台会自动注入。若 hooks 执行异常,可尝试设置 `ADSPECS_PLATFORM=qoder`。
258
+
259
+ ### Hooks 系统
260
+
261
+ adspecs 的 hooks 脚本(`hooks/*.js`)已适配双平台,通过统一的 `platform.js` 模块获取:
262
+
263
+ - 平台类型(`claude` / `qoder` / `workbuddy`)
264
+ - 状态目录(`.claude/` / `.qoder/` / `.workbuddy/`)
265
+ - 工具输出文件路径
266
+
267
+ hooks 配置位于 `hooks/hooks.json`,支持以下事件:
268
+
269
+ | 事件 | 说明 |
270
+ |------|------|
271
+ | `SessionStart` | 会话启动时注入上下文 |
272
+ | `PreCompact` | 上下文压缩前保存提醒 |
273
+ | `PostToolUse` | 文件变更后追踪队列 |
274
+ | `Stop` | 会话结束时建议操作 |
package/README.md CHANGED
@@ -2,20 +2,24 @@
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/adspecs)](https://www.npmjs.com/package/adspecs)
4
4
  [![npm downloads](https://img.shields.io/npm/dt/adspecs)](https://www.npmjs.com/package/adspecs)
5
+ [![Platform](https://img.shields.io/badge/platform-Claude%20Code%20%7C%20Qoder%20%7C%20WorkBuddy-blueviolet)](#安装)
5
6
 
6
7
  ---
7
8
 
8
9
  ## 简介
9
10
 
10
- AdSpecs 是一个基于 Claude Code AI 工程研发协同插件,提供:
11
+ AdSpecs 是一个支持 **Claude Code**、**Qoder** **WorkBuddy** 三平台的 AI 工程研发协同插件,提供:
11
12
 
12
13
  - **21 个 Skill**(Slash 命令) — 覆盖需求分析、架构规划、系统设计、任务拆解、单元测试、代码审查、文档导出、Wiki 同步
13
14
  - **CLI 工具** — `adspecs init` 一键脚手架、`adspecs plugin install` 插件注册、`adspecs doctor` 环境检查
14
15
  - **21 个标准文档模板** — 需求 / 设计 / 任务 / 测试 / 评审 / 架构全覆盖
15
- - **多技术栈参考** — ECP Java 后端、Vue 3 前端、Ant Design React 前端、Python 后端等 11 套参考工程
16
+ - **多技术栈参考** — Java 后端、Vue 3 前端、Ant Design React 前端、Python 后端等 11 套参考工程
17
+ - **三平台支持** — 原生兼容 Claude Code、Qoder 和 WorkBuddy,自动检测运行环境
16
18
  - **npm 分发** — `npm install -g adspecs` 即装即用
17
19
 
18
- 本插件需配合 [`superpowers`](https://github.com/anthropics/claude-plugins-official) 插件(提供 TDD、子代理驱动开发等通用 Skill)一起使用。
20
+ > **平台依赖说明**:
21
+ > - **Claude Code**:需配合 [`superpowers`](https://github.com/anthropics/claude-plugins-official) 插件(提供 TDD、子代理驱动开发等通用 Skill)一起使用
22
+ > - **Qoder / WorkBuddy**:adspecs 的 Skills 可独立运行,无需额外依赖
19
23
 
20
24
  ---
21
25
 
@@ -30,6 +34,7 @@ adspecs/
30
34
  ├── skills/ # 21 个 Skill 定义
31
35
  ├── .claude-plugin/ # Claude Code 插件清单
32
36
  ├── .qoder-plugin/ # Qoder 插件清单
37
+ ├── .workbuddy-plugin/ # WorkBuddy 插件清单
33
38
  ├── .adspecs/
34
39
  │ ├── templates/ # 21 个标准文档模板
35
40
  │ ├── extensions/ # 扩展配置(git hooks 等)
@@ -344,12 +349,25 @@ Skill 支持通过 `.adspecs/paths.json` 自定义输出目录:
344
349
 
345
350
  详细安装说明见 [INSTALL.md](./INSTALL.md)。
346
351
 
352
+ ### Claude Code
353
+
354
+ ```bash
355
+ npm install -g adspecs
356
+ adspecs plugin install # 用户级(默认)
357
+ adspecs plugin install --scope project # 项目级
358
+ ```
359
+
360
+ ### Qoder
361
+
347
362
  ```bash
348
- # 安装
349
363
  npm install -g adspecs
350
- adspecs plugin install # 用户级(默认)
351
- adspecs plugin install --scope project # 项目级
364
+ adspecs plugin install --platform qoder # 用户级
365
+ adspecs plugin install --platform qoder --scope project # 项目级
366
+ ```
367
+
368
+ ### 通用命令
352
369
 
370
+ ```bash
353
371
  # 升级
354
372
  npm install -g adspecs@latest
355
373
 
@@ -363,15 +381,20 @@ adspecs plugin uninstall --scope project
363
381
  ## 常见问题
364
382
 
365
383
  **Q1:adspecs 与 superpowers 的关系?**
366
- adspecs 提供领域专属 Skill(需求、设计、模板、规范),superpowers 提供通用 AI 工程 Skill(TDD、子代理、调试)。两者分工协作,**编码阶段必须同时安装**。
384
+ adspecs 提供领域专属 Skill(需求、设计、模板、规范),superpowers 提供通用 AI 工程 Skill(TDD、子代理、调试)。
385
+ - **Claude Code**:两者分工协作,编码阶段必须同时安装
386
+ - **Qoder**:adspecs 可独立运行,无需 superpowers
367
387
 
368
388
  **Q2:用户级和项目级安装可以共存吗?**
369
389
  可以,项目级优先于用户级(就近原则)。个人开发选用户级,团队协作选项目级。
370
390
 
371
- **Q3:安装后 Skill 未生效?**
391
+ **Q3:Claude Code 和 Qoder 可以同时使用吗?**
392
+ 可以。adspecs 通过 `.claude-plugin/` 和 `.qoder-plugin/` 分别提供两个平台的插件配置,互不干扰。使用 `--platform` 参数指定目标平台即可。
393
+
394
+ **Q4:安装后 Skill 未生效?**
372
395
  1. 执行 `/plugins` 查看 adspecs 是否在已加载列表
373
- 2. 重启 Claude Code
374
- 3. 检查安装 scope 对应的目录是否存在
396
+ 2. 重启 Claude Code 或 Qoder
397
+ 3. 检查安装 scope 对应的目录是否存在(`.claude-plugin/` 或 `.qoder-plugin/`)
375
398
 
376
399
  **Q4:如何升级?**
377
400
  ```bash
package/bin/adspecs.js CHANGED
@@ -13,7 +13,7 @@ const program = new Command();
13
13
 
14
14
  program
15
15
  .name('adspecs')
16
- .description('adspecs — AI first 工程规范驱动开发 CLI')
16
+ .description('adspecs — AI First 工程规范驱动开发 CLI')
17
17
  .version(pkg.version, '-v, --version', '输出版本号');
18
18
 
19
19
  // ============ init 命令 ============
@@ -44,13 +44,13 @@ program
44
44
  // ============ plugin 命令组 ============
45
45
  const pluginCmd = program
46
46
  .command('plugin')
47
- .description('AI 平台插件管理(支持 Claude Code / Qoder)');
47
+ .description('AI 平台插件管理(支持 Claude Code / Qoder / WorkBuddy)');
48
48
 
49
49
  pluginCmd
50
50
  .command('install')
51
51
  .description('注册当前 adspecs 为 AI 平台插件')
52
52
  .option('--scope <scope>', '安装范围: user|project', 'user')
53
- .option('--platform <platform>', '目标平台: claude|qoder(默认自动检测)')
53
+ .option('--platform <platform>', '目标平台: claude|qoder|workbuddy(默认自动检测)')
54
54
  .action(async (options) => {
55
55
  try {
56
56
  const pluginCmd = require('../src/commands/plugin');
@@ -66,7 +66,7 @@ pluginCmd
66
66
  .command('uninstall')
67
67
  .description('从 AI 平台中卸载 adspecs 插件')
68
68
  .option('--scope <scope>', '卸载范围: user|project', 'user')
69
- .option('--platform <platform>', '目标平台: claude|qoder(默认自动检测)')
69
+ .option('--platform <platform>', '目标平台: claude|qoder|workbuddy(默认自动检测)')
70
70
  .action(async (options) => {
71
71
  try {
72
72
  const pluginCmd = require('../src/commands/plugin');
@@ -116,9 +116,10 @@ program.addHelpText('after', `
116
116
  $ adspecs init --mode simple # 快速初始化(交互选择其余参数)
117
117
  $ adspecs init --non-interactive # 完全非交互(使用默认值)
118
118
  $ adspecs init --project-name "我的项目" --mode full --front-demo antd
119
- $ adspecs plugin install # 注册为 AI 平台插件(自动检测平台)
120
- $ adspecs plugin install --platform qoder # 注册为 Qoder 插件
121
- $ adspecs plugin install --platform claude # 注册为 Claude Code 插件
119
+ $ adspecs plugin install # 注册为 AI 平台插件(自动检测平台)
120
+ $ adspecs plugin install --platform qoder # 注册为 Qoder 插件
121
+ $ adspecs plugin install --platform claude # 注册为 Claude Code 插件
122
+ $ adspecs plugin install --platform workbuddy # 注册为 WorkBuddy 插件
122
123
  $ adspecs plugin install --scope project # 仅注册到当前项目
123
124
  $ adspecs plugin uninstall --scope project # 从当前项目卸载
124
125
  $ adspecs doctor # 检查环境依赖
package/hooks/hooks.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "_comment": "跨平台 Hook 配置 — 同时支持 Claude Code 和 Qoder。${CLAUDE_PLUGIN_ROOT} 由平台在加载插件时注入(Qoder 兼容此变量或设置 ADSPECS_PLATFORM=qoder)。",
2
+ "_comment": "跨平台 Hook 配置 — 同时支持 Claude Code、QoderWorkBuddy。${CLAUDE_PLUGIN_ROOT} 由平台在加载插件时注入(所有平台兼容此变量或设置 ADSPECS_PLATFORM=claude|qoder|workbuddy)。",
3
3
  "hooks": {
4
4
  "SessionStart": [
5
5
  {
@@ -48,7 +48,7 @@
48
48
  }
49
49
  },
50
50
  {
51
- "matcher": "Write|SearchReplace",
51
+ "matcher": "Write|Edit|SearchReplace",
52
52
  "hooks": [
53
53
  {
54
54
  "type": "command",
package/hooks/platform.js CHANGED
@@ -7,10 +7,11 @@
7
7
  * 同时支持 Claude Code 和 Qoder 两种 AI 编码平台。
8
8
  *
9
9
  * 检测优先级:
10
- * 1. 环境变量 ADSPECS_PLATFORM 显式指定('claude' | 'qoder')
11
- * 2. Qoder 特征环境变量(QODER_PLUGIN_ROOT 等)
12
- * 3. Claude Code 特征环境变量(CLAUDE_PLUGIN_ROOT 等)
13
- * 4. 默认回退到 claude(向后兼容)
10
+ * 1. 环境变量 ADSPECS_PLATFORM 显式指定('claude' | 'qoder' | 'workbuddy'
11
+ * 2. WorkBuddy 特征环境变量(CODEBUDDY_PLUGIN_ROOT 等)
12
+ * 3. Qoder 特征环境变量(QODER_PLUGIN_ROOT 等)
13
+ * 4. Claude Code 特征环境变量(CLAUDE_PLUGIN_ROOT 等)
14
+ * 5. 默认回退到 claude(向后兼容)
14
15
  */
15
16
 
16
17
  const path = require('path');
@@ -19,26 +20,31 @@ const path = require('path');
19
20
 
20
21
  /**
21
22
  * 检测当前运行的 AI 平台
22
- * @returns {'claude'|'qoder'}
23
+ * @returns {'claude'|'qoder'|'workbuddy'}
23
24
  */
24
25
  function detectPlatform() {
25
26
  // 1. 显式指定
26
27
  var explicit = (process.env.ADSPECS_PLATFORM || '').toLowerCase();
27
- if (explicit === 'qoder' || explicit === 'claude') {
28
+ if (explicit === 'qoder' || explicit === 'claude' || explicit === 'workbuddy') {
28
29
  return explicit;
29
30
  }
30
31
 
31
- // 2. Qoder 特征
32
+ // 2. WorkBuddy 特征(CodeBuddy 内核注入的环境变量)
33
+ if (process.env.CODEBUDDY_PLUGIN_ROOT || process.env.WORKBUDDY_SESSION_ID) {
34
+ return 'workbuddy';
35
+ }
36
+
37
+ // 3. Qoder 特征
32
38
  if (process.env.QODER_PLUGIN_ROOT || process.env.QODER_SESSION_ID) {
33
39
  return 'qoder';
34
40
  }
35
41
 
36
- // 3. Claude Code 特征
42
+ // 4. Claude Code 特征
37
43
  if (process.env.CLAUDE_PLUGIN_ROOT || process.env.CLAUDE_SESSION_ID) {
38
44
  return 'claude';
39
45
  }
40
46
 
41
- // 4. 默认回退
47
+ // 5. 默认回退
42
48
  return 'claude';
43
49
  }
44
50
 
@@ -56,7 +62,7 @@ var PLATFORM = detectPlatform();
56
62
  */
57
63
  function getPluginRoot(hooksDir) {
58
64
  // 平台环境变量优先
59
- var envRoot = process.env.CLAUDE_PLUGIN_ROOT || process.env.QODER_PLUGIN_ROOT;
65
+ var envRoot = process.env.CLAUDE_PLUGIN_ROOT || process.env.QODER_PLUGIN_ROOT || process.env.CODEBUDDY_PLUGIN_ROOT;
60
66
  if (envRoot) {
61
67
  return path.resolve(envRoot);
62
68
  }
@@ -86,6 +92,9 @@ function getStateDir(projectRoot) {
86
92
  if (PLATFORM === 'qoder') {
87
93
  return path.join(projectRoot, '.qoder');
88
94
  }
95
+ if (PLATFORM === 'workbuddy') {
96
+ return path.join(projectRoot, '.workbuddy');
97
+ }
89
98
  return path.join(projectRoot, '.claude');
90
99
  }
91
100
 
@@ -95,11 +104,13 @@ function getStateDir(projectRoot) {
95
104
  * 获取工具输出文件列表(PostToolUse 时由平台注入)
96
105
  * - Claude Code: CLAUDE_TOOL_OUTPUT_FILES
97
106
  * - Qoder: QODER_TOOL_OUTPUT_FILES 或 CLAUDE_TOOL_OUTPUT_FILES(兼容)
107
+ * - WorkBuddy: CODEBUDDY_TOOL_OUTPUT_FILES 或 CLAUDE_TOOL_OUTPUT_FILES(兼容)
98
108
  *
99
109
  * @returns {string} 换行分隔的文件路径列表
100
110
  */
101
111
  function getToolOutputFiles() {
102
112
  return (
113
+ process.env.CODEBUDDY_TOOL_OUTPUT_FILES ||
103
114
  process.env.QODER_TOOL_OUTPUT_FILES ||
104
115
  process.env.CLAUDE_TOOL_OUTPUT_FILES ||
105
116
  ''
@@ -130,7 +141,7 @@ function outputContext(eventName, contextText) {
130
141
  // ── 导出 ──────────────────────────────────────────────────
131
142
 
132
143
  module.exports = {
133
- /** 当前检测到的平台: 'claude' | 'qoder' */
144
+ /** 当前检测到的平台: 'claude' | 'qoder' | 'workbuddy' */
134
145
  platform: PLATFORM,
135
146
  detectPlatform: detectPlatform,
136
147
  getPluginRoot: getPluginRoot,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adspecs",
3
- "version": "0.1.28",
3
+ "version": "0.1.30",
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
+ ".workbuddy-plugin/",
14
15
  ".adspecs/",
15
16
  "skills/",
16
17
  "hooks/",
@@ -30,7 +31,7 @@
30
31
  "test": "node --test src/**/*.test.js",
31
32
  "postinstall": "node scripts/postinstall.js",
32
33
  "prepublishOnly": "node scripts/prepublish-check.js",
33
- "version": "node scripts/sync-version.js && git add .claude-plugin/plugin.json .claude-plugin/marketplace.json .qoder-plugin/plugin.json",
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",
34
35
  "sync-version": "node scripts/sync-version.js"
35
36
  },
36
37
  "dependencies": {
@@ -43,6 +44,7 @@
43
44
  "adspecs",
44
45
  "claude-code",
45
46
  "qoder",
47
+ "workbuddy",
46
48
  "plugin",
47
49
  "scaffold",
48
50
  "cli",