adspecs 0.1.29 → 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.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.qoder-plugin/plugin.json +1 -1
- package/.workbuddy-plugin/plugin.json +24 -0
- package/CHANGELOG.md +13 -0
- package/CLAUDE.md +14 -8
- package/INSTALL.md +57 -4
- package/README.md +5 -4
- package/bin/adspecs.js +8 -7
- package/hooks/hooks.json +2 -2
- package/hooks/platform.js +22 -11
- package/package.json +4 -2
- package/scripts/postinstall.js +79 -36
- package/scripts/sync-version.js +11 -1
- package/skills/adspecs-adversarial-review/SKILL.md +1 -0
- package/skills/adspecs-analyze/SKILL.md +1 -0
- package/skills/adspecs-architecture-planning/SKILL.md +1 -0
- package/skills/adspecs-biz-blueprint/SKILL.md +555 -554
- package/skills/adspecs-clarify/SKILL.md +1 -0
- package/skills/adspecs-constitution/SKILL.md +1 -0
- package/skills/adspecs-export-word/SKILL.md +499 -498
- package/skills/adspecs-front-prototype/SKILL.md +1 -0
- package/skills/adspecs-front-spec/SKILL.md +1 -0
- package/skills/adspecs-front-tasks/SKILL.md +1 -0
- package/skills/adspecs-git-commit/SKILL.md +1 -0
- package/skills/adspecs-git-initialize/SKILL.md +1 -0
- package/skills/adspecs-new-requirement/SKILL.md +1 -0
- package/skills/adspecs-plan/SKILL.md +1 -0
- package/skills/adspecs-prd/SKILL.md +1 -0
- package/skills/adspecs-prd-to-demo/SKILL.md +1 -0
- package/skills/adspecs-save-session/SKILL.md +179 -178
- package/skills/adspecs-tasks/SKILL.md +1 -0
- package/skills/adspecs-update-status/SKILL.md +1 -0
- package/skills/adspecs-utest/SKILL.md +1 -0
- package/skills/adspecs-write-planning-report/SKILL.md +1 -0
- package/skills/adspecs-write-roadmap/SKILL.md +1 -0
- package/skills/adspecs-write-sow/SKILL.md +1 -0
- package/skills/grill-me/SKILL.md +1 -0
- package/skills/playwright-cli/SKILL.md +1 -0
- package/skills/playwright-trace/SKILL.md +1 -0
- package/skills/project-init/SKILL.md +1 -0
- package/skills/sie-front-code-review/SKILL.md +1 -0
- package/skills/wiki-update/SKILL.md +233 -232
- package/src/commands/plugin.js +145 -7
- package/src/commands/update.js +5 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adspecs",
|
|
3
3
|
"displayName": "adspecs AI 工程规范驱动开发插件",
|
|
4
|
-
"version": "0.1.
|
|
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
|
|
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
|
|
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
|
|
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 `
|
|
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
|
-
#
|
|
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
|
|
|
@@ -192,14 +243,16 @@ adspecs 通过 `hooks/platform.js` 模块自动检测运行环境,无需手动
|
|
|
192
243
|
| `ADSPECS_PLATFORM` 环境变量 | 显式指定平台(优先级最高) |
|
|
193
244
|
| `CLAUDE_PLUGIN_ROOT` 环境变量 | Claude Code 自动注入 |
|
|
194
245
|
| `QODER_PLUGIN_ROOT` 环境变量 | Qoder 自动注入 |
|
|
246
|
+
| `CODEBUDDY_PLUGIN_ROOT` 环境变量 | WorkBuddy / CodeBuddy 自动注入 |
|
|
195
247
|
|
|
196
248
|
### 环境变量
|
|
197
249
|
|
|
198
250
|
| 环境变量 | 说明 | 可选值 |
|
|
199
251
|
|----------|------|--------|
|
|
200
|
-
| `ADSPECS_PLATFORM` | 显式指定运行平台 | `claude` / `qoder` |
|
|
252
|
+
| `ADSPECS_PLATFORM` | 显式指定运行平台 | `claude` / `qoder` / `workbuddy` |
|
|
201
253
|
| `CLAUDE_PLUGIN_ROOT` | Claude Code 注入的插件根路径 | 自动 |
|
|
202
254
|
| `QODER_PLUGIN_ROOT` | Qoder 注入的插件根路径 | 自动 |
|
|
255
|
+
| `CODEBUDDY_PLUGIN_ROOT` | WorkBuddy/CodeBuddy 注入的插件根路径 | 自动 |
|
|
203
256
|
|
|
204
257
|
通常无需手动设置,平台会自动注入。若 hooks 执行异常,可尝试设置 `ADSPECS_PLATFORM=qoder`。
|
|
205
258
|
|
|
@@ -207,8 +260,8 @@ adspecs 通过 `hooks/platform.js` 模块自动检测运行环境,无需手动
|
|
|
207
260
|
|
|
208
261
|
adspecs 的 hooks 脚本(`hooks/*.js`)已适配双平台,通过统一的 `platform.js` 模块获取:
|
|
209
262
|
|
|
210
|
-
- 平台类型(`claude` / `qoder`)
|
|
211
|
-
- 状态目录(`.claude/` / `.qoder/`)
|
|
263
|
+
- 平台类型(`claude` / `qoder` / `workbuddy`)
|
|
264
|
+
- 状态目录(`.claude/` / `.qoder/` / `.workbuddy/`)
|
|
212
265
|
- 工具输出文件路径
|
|
213
266
|
|
|
214
267
|
hooks 配置位于 `hooks/hooks.json`,支持以下事件:
|
package/README.md
CHANGED
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/adspecs)
|
|
4
4
|
[](https://www.npmjs.com/package/adspecs)
|
|
5
|
-
[](#安装)
|
|
5
|
+
[](#安装)
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## 简介
|
|
10
10
|
|
|
11
|
-
AdSpecs 是一个支持 **Claude Code** 和 **
|
|
11
|
+
AdSpecs 是一个支持 **Claude Code**、**Qoder** 和 **WorkBuddy** 三平台的 AI 工程研发协同插件,提供:
|
|
12
12
|
|
|
13
13
|
- **21 个 Skill**(Slash 命令) — 覆盖需求分析、架构规划、系统设计、任务拆解、单元测试、代码审查、文档导出、Wiki 同步
|
|
14
14
|
- **CLI 工具** — `adspecs init` 一键脚手架、`adspecs plugin install` 插件注册、`adspecs doctor` 环境检查
|
|
15
15
|
- **21 个标准文档模板** — 需求 / 设计 / 任务 / 测试 / 评审 / 架构全覆盖
|
|
16
16
|
- **多技术栈参考** — Java 后端、Vue 3 前端、Ant Design React 前端、Python 后端等 11 套参考工程
|
|
17
|
-
-
|
|
17
|
+
- **三平台支持** — 原生兼容 Claude Code、Qoder 和 WorkBuddy,自动检测运行环境
|
|
18
18
|
- **npm 分发** — `npm install -g adspecs` 即装即用
|
|
19
19
|
|
|
20
20
|
> **平台依赖说明**:
|
|
21
21
|
> - **Claude Code**:需配合 [`superpowers`](https://github.com/anthropics/claude-plugins-official) 插件(提供 TDD、子代理驱动开发等通用 Skill)一起使用
|
|
22
|
-
> - **Qoder**:adspecs 的 Skills 可独立运行,无需额外依赖
|
|
22
|
+
> - **Qoder / WorkBuddy**:adspecs 的 Skills 可独立运行,无需额外依赖
|
|
23
23
|
|
|
24
24
|
---
|
|
25
25
|
|
|
@@ -34,6 +34,7 @@ adspecs/
|
|
|
34
34
|
├── skills/ # 21 个 Skill 定义
|
|
35
35
|
├── .claude-plugin/ # Claude Code 插件清单
|
|
36
36
|
├── .qoder-plugin/ # Qoder 插件清单
|
|
37
|
+
├── .workbuddy-plugin/ # WorkBuddy 插件清单
|
|
37
38
|
├── .adspecs/
|
|
38
39
|
│ ├── templates/ # 21 个标准文档模板
|
|
39
40
|
│ ├── extensions/ # 扩展配置(git hooks 等)
|
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
|
|
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
|
|
120
|
-
$ adspecs plugin install --platform qoder
|
|
121
|
-
$ adspecs plugin install --platform claude
|
|
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 和
|
|
2
|
+
"_comment": "跨平台 Hook 配置 — 同时支持 Claude Code、Qoder 和 WorkBuddy。${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.
|
|
12
|
-
* 3.
|
|
13
|
-
* 4.
|
|
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.
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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.
|
|
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",
|
package/scripts/postinstall.js
CHANGED
|
@@ -10,10 +10,11 @@
|
|
|
10
10
|
* - `npm install adspecs` (本地) → 作为项目依赖安装
|
|
11
11
|
*
|
|
12
12
|
* 行为:
|
|
13
|
-
* - 检查 AI 平台 CLI 是否可用(Claude Code /
|
|
13
|
+
* - 检查 AI 平台 CLI 是否可用(Claude Code / WorkBuddy)
|
|
14
14
|
* - 检查 adspecs 插件是否已在平台中注册
|
|
15
15
|
* - 若已注册 → 静默重新安装以刷新版本
|
|
16
16
|
* - 若未注册 → 不做任何事(首次安装应由用户主动 `adspecs plugin install`)
|
|
17
|
+
* - Qoder/WorkBuddy IDE 模式无需 CLI 刷新(通过插件清单自动发现)
|
|
17
18
|
*
|
|
18
19
|
* 关键约束:
|
|
19
20
|
* - 绝不能阻断 npm install(所有异常静默吞掉)
|
|
@@ -33,7 +34,7 @@ const timer = setTimeout(() => {
|
|
|
33
34
|
if (timer.unref) timer.unref();
|
|
34
35
|
|
|
35
36
|
try {
|
|
36
|
-
// 1. 检测可用的 AI 平台
|
|
37
|
+
// 1. 检测可用的 AI 平台 CLI
|
|
37
38
|
var hasClaudeCli = false;
|
|
38
39
|
try {
|
|
39
40
|
execSync('claude --version', { stdio: 'ignore', timeout: 1000 });
|
|
@@ -42,9 +43,17 @@ try {
|
|
|
42
43
|
// claude CLI 未安装
|
|
43
44
|
}
|
|
44
45
|
|
|
46
|
+
var hasCodebuddyCli = false;
|
|
47
|
+
try {
|
|
48
|
+
execSync('codebuddy --version', { stdio: 'ignore', timeout: 1000 });
|
|
49
|
+
hasCodebuddyCli = true;
|
|
50
|
+
} catch {
|
|
51
|
+
// codebuddy CLI 未安装
|
|
52
|
+
}
|
|
53
|
+
|
|
45
54
|
// 如果没有任何平台 CLI 可用,静默退出
|
|
46
|
-
// Qoder
|
|
47
|
-
if (!hasClaudeCli) {
|
|
55
|
+
// Qoder / WorkBuddy(IDE 模式)通过插件清单自动发现,无需 CLI 刷新
|
|
56
|
+
if (!hasClaudeCli && !hasCodebuddyCli) {
|
|
48
57
|
process.exit(0);
|
|
49
58
|
}
|
|
50
59
|
|
|
@@ -61,46 +70,80 @@ try {
|
|
|
61
70
|
process.exit(0);
|
|
62
71
|
}
|
|
63
72
|
|
|
64
|
-
//
|
|
65
|
-
|
|
73
|
+
// 读取版本号用于提示
|
|
74
|
+
var pkgVersion = 'unknown';
|
|
66
75
|
try {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
// claude plugins list 命令失败 → 静默退出
|
|
74
|
-
process.exit(0);
|
|
76
|
+
const pkg = JSON.parse(
|
|
77
|
+
fs.readFileSync(path.join(installDir, 'package.json'), 'utf8')
|
|
78
|
+
);
|
|
79
|
+
pkgVersion = pkg.version;
|
|
80
|
+
} catch {
|
|
81
|
+
// ignore
|
|
75
82
|
}
|
|
76
83
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
84
|
+
var refreshedPlatforms = [];
|
|
85
|
+
|
|
86
|
+
// 3. Claude Code — 检查是否已注册,若已注册则刷新
|
|
87
|
+
if (hasClaudeCli) {
|
|
88
|
+
try {
|
|
89
|
+
var installedPlugins = execSync('claude plugins list 2>&1', {
|
|
90
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
91
|
+
timeout: 1000,
|
|
92
|
+
encoding: 'utf8',
|
|
93
|
+
});
|
|
94
|
+
if (installedPlugins.toLowerCase().includes('adspecs')) {
|
|
95
|
+
// 已注册 → 重新安装以刷新版本
|
|
96
|
+
var claudeChild = spawn(
|
|
97
|
+
'claude',
|
|
98
|
+
['plugins', 'install', 'adspecs', '--scope', 'user'],
|
|
99
|
+
{
|
|
100
|
+
stdio: 'ignore',
|
|
101
|
+
detached: true,
|
|
102
|
+
windowsHide: true,
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
claudeChild.on('error', () => {});
|
|
106
|
+
claudeChild.unref();
|
|
107
|
+
refreshedPlatforms.push('Claude Code');
|
|
108
|
+
}
|
|
109
|
+
} catch {
|
|
110
|
+
// claude plugins list 失败 → 静默跳过
|
|
111
|
+
}
|
|
80
112
|
}
|
|
81
113
|
|
|
82
|
-
// 4.
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
114
|
+
// 4. WorkBuddy — 检查 codebuddy CLI 中是否已注册,若已注册则刷新
|
|
115
|
+
if (hasCodebuddyCli) {
|
|
116
|
+
try {
|
|
117
|
+
var wbPlugins = execSync('codebuddy plugin list 2>&1', {
|
|
118
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
119
|
+
timeout: 1000,
|
|
120
|
+
encoding: 'utf8',
|
|
121
|
+
});
|
|
122
|
+
if (wbPlugins.toLowerCase().includes('adspecs')) {
|
|
123
|
+
// 已注册 → 重新安装以刷新版本
|
|
124
|
+
var wbChild = spawn(
|
|
125
|
+
'codebuddy',
|
|
126
|
+
['plugin', 'install', 'adspecs', '--scope', 'user'],
|
|
127
|
+
{
|
|
128
|
+
stdio: 'ignore',
|
|
129
|
+
detached: true,
|
|
130
|
+
windowsHide: true,
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
wbChild.on('error', () => {});
|
|
134
|
+
wbChild.unref();
|
|
135
|
+
refreshedPlatforms.push('WorkBuddy');
|
|
136
|
+
}
|
|
137
|
+
} catch {
|
|
138
|
+
// codebuddy plugin list 失败 → 静默跳过
|
|
90
139
|
}
|
|
91
|
-
|
|
92
|
-
child.on('error', () => {
|
|
93
|
-
// 静默忽略
|
|
94
|
-
});
|
|
95
|
-
child.unref();
|
|
140
|
+
}
|
|
96
141
|
|
|
97
|
-
//
|
|
98
|
-
if (process.stdout.isTTY) {
|
|
99
|
-
const pkg = JSON.parse(
|
|
100
|
-
fs.readFileSync(path.join(installDir, 'package.json'), 'utf8')
|
|
101
|
-
);
|
|
142
|
+
// 输出一行提示(仅当有平台被刷新)
|
|
143
|
+
if (refreshedPlatforms.length > 0 && process.stdout.isTTY) {
|
|
102
144
|
console.log(
|
|
103
|
-
|
|
145
|
+
'\n🔄 adspecs@' + pkgVersion + ' — ' +
|
|
146
|
+
refreshedPlatforms.join(' / ') + ' 插件注册已自动刷新\n'
|
|
104
147
|
);
|
|
105
148
|
}
|
|
106
149
|
} catch {
|
package/scripts/sync-version.js
CHANGED
|
@@ -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
|
+
* - .workbuddy-plugin/plugin.json
|
|
12
13
|
*
|
|
13
14
|
* 也可手动运行:`npm run sync-version`
|
|
14
15
|
*
|
|
@@ -77,6 +78,15 @@ function main() {
|
|
|
77
78
|
updated.push(`.qoder-plugin/plugin.json (${old} → ${newVersion})`);
|
|
78
79
|
}
|
|
79
80
|
|
|
81
|
+
// 4. .workbuddy-plugin/plugin.json — 始终与 package.json 保持版本一致
|
|
82
|
+
const wbPlugin = readJson('.workbuddy-plugin/plugin.json');
|
|
83
|
+
if (wbPlugin && wbPlugin.version !== newVersion) {
|
|
84
|
+
const old = wbPlugin.version;
|
|
85
|
+
wbPlugin.version = newVersion;
|
|
86
|
+
writeJson('.workbuddy-plugin/plugin.json', wbPlugin);
|
|
87
|
+
updated.push(`.workbuddy-plugin/plugin.json (${old} → ${newVersion})`);
|
|
88
|
+
}
|
|
89
|
+
|
|
80
90
|
if (updated.length === 0) {
|
|
81
91
|
console.log('✅ 所有清单版本已一致,无需更新');
|
|
82
92
|
} else {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "adspecs-adversarial-review"
|
|
3
3
|
description: "使用对抗策略对需求文件、系统设计文件和开发任务清单进行一致性与质量审查。支持单文档模式(仅 PRD)和三文档联合模式。引入多个红队角色从不同立场挑战文档中的假设、缺失、矛盾与歧义"
|
|
4
|
+
agent_created: true
|
|
4
5
|
argument-hint: "指定1~3个文档路径。单文档:PRD路径;三文档:PRD路径 系统设计路径 任务清单路径"
|
|
5
6
|
compatibility: "需要 docs/ 目录体系:docs/20-prd(需求)+ docs/30-system-design(系统设计+tasks)+ CLAUDE.md。单文档模式仅需 PRD"
|
|
6
7
|
metadata:
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "adspecs-analyze"
|
|
3
3
|
description: "对 PRD、系统设计文档(_system-design.md)和 tasks.md 进行非破坏性的 ECP 全链路一致性分析。"
|
|
4
|
+
agent_created: true
|
|
4
5
|
argument-hint: "指定功能名或系统设计文档路径,如 M06-01 或 docs/30-system-design/crm/M06-01-销售预测_system-design.md"
|
|
5
6
|
compatibility: "需要 docs/ 目录体系:docs/20-prd(PRD)+ docs/30-system-design(系统设计+tasks)+ CLAUDE.md(ECP 编码宪章)"
|
|
6
7
|
metadata:
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "adspecs-architecture-planning"
|
|
3
3
|
description: "基于自然语言项目/业务描述,支持3种架构规划类型:①功能架构 ②子模块依赖关系 ③统一数据建模(含Mermaid ER图)。用户可选择执行1种、2种或全部3种,后两者依赖功能架构完成"
|
|
4
|
+
agent_created: true
|
|
4
5
|
argument-hint: "描述项目名称、行业领域、核心业务和系统边界,如:华峰铝业CRM平台,覆盖销售全生命周期"
|
|
5
6
|
compatibility: "需要 adspecs 项目结构及 docs/ 目录"
|
|
6
7
|
metadata:
|