@zhouhao4221/devflow-skills 0.2.0 → 0.3.1
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/README.md +57 -235
- package/install.js +406 -116
- package/package.json +2 -1
- package/plugins/api/skills/api/SKILL.md +102 -0
- package/plugins/api/skills/api-field-mapper/SKILL.md +95 -0
- package/plugins/api/skills/config/SKILL.md +140 -0
- package/plugins/api/skills/gen/SKILL.md +345 -0
- package/plugins/api/skills/help/SKILL.md +121 -0
- package/plugins/api/skills/import/SKILL.md +95 -0
- package/plugins/api/skills/map/SKILL.md +152 -0
- package/plugins/api/skills/search/SKILL.md +95 -0
- package/plugins/diag/skills/audit/SKILL.md +103 -0
- package/plugins/diag/skills/diag/SKILL.md +41 -0
- package/plugins/diag/skills/diagnose/SKILL.md +167 -0
- package/plugins/diag/skills/init/SKILL.md +142 -0
- package/plugins/diag/skills/stack-analyzer/SKILL.md +150 -0
- package/plugins/pm/skills/ask/SKILL.md +89 -0
- package/plugins/pm/skills/brief/SKILL.md +95 -0
- package/plugins/pm/skills/export/SKILL.md +93 -0
- package/plugins/pm/skills/help/SKILL.md +257 -0
- package/plugins/pm/skills/milestone/SKILL.md +102 -0
- package/plugins/pm/skills/monthly/SKILL.md +111 -0
- package/plugins/pm/skills/plan/SKILL.md +96 -0
- package/plugins/pm/skills/pm/SKILL.md +174 -0
- package/plugins/pm/skills/progress/SKILL.md +113 -0
- package/plugins/pm/skills/report-generator/SKILL.md +104 -0
- package/plugins/pm/skills/risk/SKILL.md +223 -0
- package/plugins/pm/skills/standup/SKILL.md +96 -0
- package/plugins/pm/skills/stats/SKILL.md +158 -0
- package/plugins/pm/skills/weekly/SKILL.md +157 -0
- package/plugins/req/skills/branch/SKILL.md +447 -0
- package/plugins/req/skills/cache/SKILL.md +232 -0
- package/plugins/req/skills/changelog/SKILL.md +187 -0
- package/plugins/req/skills/changelog-generator/SKILL.md +106 -0
- package/plugins/req/skills/code-impact-analyzer/SKILL.md +48 -0
- package/plugins/req/skills/commit/SKILL.md +308 -0
- package/plugins/req/skills/dev/SKILL.md +229 -0
- package/plugins/req/skills/dev-guide/SKILL.md +530 -0
- package/plugins/req/skills/do/SKILL.md +191 -0
- package/plugins/req/skills/done/SKILL.md +95 -0
- package/plugins/req/skills/edit/SKILL.md +187 -0
- package/plugins/req/skills/fix/SKILL.md +300 -0
- package/plugins/req/skills/help/SKILL.md +136 -0
- package/plugins/req/skills/init/SKILL.md +505 -0
- package/plugins/req/skills/issue/SKILL.md +237 -0
- package/plugins/req/skills/issue-guide/SKILL.md +125 -0
- package/plugins/req/skills/migrate/SKILL.md +128 -0
- package/plugins/req/skills/modules/SKILL.md +195 -0
- package/plugins/req/skills/natural-language-dispatcher/SKILL.md +545 -0
- package/plugins/req/skills/new/SKILL.md +172 -0
- package/plugins/req/skills/new-quick/SKILL.md +246 -0
- package/plugins/req/skills/pr/SKILL.md +157 -0
- package/plugins/req/skills/prd/SKILL.md +187 -0
- package/plugins/req/skills/prd-analyzer/SKILL.md +131 -0
- package/plugins/req/skills/prd-edit/SKILL.md +201 -0
- package/plugins/req/skills/projects/SKILL.md +115 -0
- package/plugins/req/skills/quick-fix-guide/SKILL.md +51 -0
- package/plugins/req/skills/release/SKILL.md +300 -0
- package/plugins/req/skills/release-rationale/SKILL.md +213 -0
- package/plugins/req/skills/req/SKILL.md +173 -0
- package/plugins/req/skills/requirement-analyzer/SKILL.md +274 -0
- package/plugins/req/skills/review/SKILL.md +201 -0
- package/plugins/req/skills/review-pr/SKILL.md +699 -0
- package/plugins/req/skills/show/SKILL.md +302 -0
- package/plugins/req/skills/specs/SKILL.md +99 -0
- package/plugins/req/skills/split/SKILL.md +164 -0
- package/plugins/req/skills/status/SKILL.md +184 -0
- package/plugins/req/skills/test/SKILL.md +431 -0
- package/plugins/req/skills/test-guide/SKILL.md +304 -0
- package/plugins/req/skills/test_new/SKILL.md +417 -0
- package/plugins/req/skills/test_regression/SKILL.md +298 -0
- package/plugins/req/skills/update/SKILL.md +131 -0
- package/plugins/req/skills/update-template/SKILL.md +203 -0
- package/plugins/req/skills/upgrade/SKILL.md +178 -0
- package/plugins/req/skills/use/SKILL.md +158 -0
- package/plugins/req/skills/version-bumper/SKILL.md +113 -0
- package/plugins/uat/skills/bug/SKILL.md +153 -0
- package/plugins/uat/skills/init/SKILL.md +88 -0
- package/plugins/uat/skills/new/SKILL.md +131 -0
- package/plugins/uat/skills/report/SKILL.md +48 -0
- package/plugins/uat/skills/run/SKILL.md +78 -0
- package/plugins/uat/skills/uat/SKILL.md +64 -0
- package/plugins/uat/skills/uat-executor/SKILL.md +299 -0
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: upgrade
|
|
3
|
+
description: |
|
|
4
|
+
升级需求 - 将快速修复升级为正式需求
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 升级快速修复为正式需求
|
|
8
|
+
|
|
9
|
+
将 QUICK 快速修复升级为 REQ 正式需求,适用于范围扩大或需要完整评审的场景。
|
|
10
|
+
|
|
11
|
+
## 命令格式
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
/req:upgrade <QUICK-XXX>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 执行流程
|
|
20
|
+
|
|
21
|
+
### 0. 解析存储路径
|
|
22
|
+
|
|
23
|
+
从 `settings.local.json` 读取 `requirementProject`,确定本地路径(`docs/requirements/active|completed`)和全局缓存路径。
|
|
24
|
+
|
|
25
|
+
### 1. 定位源文件
|
|
26
|
+
|
|
27
|
+
优先在本地 active/ 查找 `QUICK-XXX-*.md`,不存在时查缓存;两处都找不到则报错退出。
|
|
28
|
+
|
|
29
|
+
**状态检查**:
|
|
30
|
+
- 已完成的 QUICK 不允许升级(已归档)
|
|
31
|
+
- 仅允许升级 active/ 目录中的需求
|
|
32
|
+
|
|
33
|
+
### 2. 读取源文件内容
|
|
34
|
+
|
|
35
|
+
解析 QUICK 需求的关键信息:
|
|
36
|
+
|
|
37
|
+
读取并解析 QUICK 需求文档,提取:
|
|
38
|
+
- 编号、标题
|
|
39
|
+
- 改动类型、端类型
|
|
40
|
+
- 当前状态
|
|
41
|
+
- 问题描述(现象、期望)
|
|
42
|
+
- 实现方案(涉及文件)
|
|
43
|
+
- 验证方式
|
|
44
|
+
|
|
45
|
+
### 3. 生成新编号
|
|
46
|
+
|
|
47
|
+
格式:`REQ-XXX`(三位数字)。扫描本地和缓存中已有的最大 REQ 编号,取两者较大值 +1。
|
|
48
|
+
|
|
49
|
+
### 4. 内容转换
|
|
50
|
+
|
|
51
|
+
#### 4.1 元信息转换
|
|
52
|
+
|
|
53
|
+
| QUICK 字段 | REQ 字段 | 转换规则 |
|
|
54
|
+
|-----------|---------|---------|
|
|
55
|
+
| 编号 QUICK-XXX | 编号 REQ-XXX | 新生成的编号 |
|
|
56
|
+
| 改动类型 | 类型 | bug修复→后端, 小功能→后端 |
|
|
57
|
+
| 端类型 | 类型 | 后端/前端/全栈 直接映射 |
|
|
58
|
+
| 状态 | 状态 | 见状态映射表 |
|
|
59
|
+
| 模块 | 模块 | 直接复制 |
|
|
60
|
+
| 关联需求 | 关联需求 | 直接复制,新增「升级自 QUICK-XXX」 |
|
|
61
|
+
|
|
62
|
+
**状态映射**:
|
|
63
|
+
|
|
64
|
+
| QUICK 状态 | REQ 状态 |
|
|
65
|
+
|-----------|---------|
|
|
66
|
+
| 草稿 | 草稿 |
|
|
67
|
+
| 方案确认 | 评审通过 |
|
|
68
|
+
| 开发中 | 开发中 |
|
|
69
|
+
| 已完成 | ❌ 不允许升级 |
|
|
70
|
+
|
|
71
|
+
#### 4.2 生命周期转换
|
|
72
|
+
|
|
73
|
+
从 4 阶段扩展为 6 阶段:
|
|
74
|
+
|
|
75
|
+
```markdown
|
|
76
|
+
## 生命周期
|
|
77
|
+
|
|
78
|
+
- [x] 草稿(编写中) ← 根据状态勾选
|
|
79
|
+
- [ ] 待评审
|
|
80
|
+
- [ ] ✅ 评审通过
|
|
81
|
+
- [ ] 开发中
|
|
82
|
+
- [ ] 测试中
|
|
83
|
+
- [ ] 已完成
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
#### 4.3 内容章节转换
|
|
87
|
+
|
|
88
|
+
| QUICK 章节 | REQ 章节 | 转换方式 |
|
|
89
|
+
|-----------|---------|---------|
|
|
90
|
+
| 问题描述.现象 | 需求描述.背景 | 直接复制 |
|
|
91
|
+
| 问题描述.期望 | 需求描述.目标 | 直接复制 |
|
|
92
|
+
| - | 需求描述.价值 | **待补充** |
|
|
93
|
+
| 实现方案.涉及文件 | 文件改动清单 | 按分层重组 |
|
|
94
|
+
| 验证方式 | 测试要点 | 直接复制 |
|
|
95
|
+
| - | 功能清单 | **待补充** |
|
|
96
|
+
| - | 业务规则 | **待补充** |
|
|
97
|
+
| - | 接口需求 | **待补充**(如涉及) |
|
|
98
|
+
| - | 数据模型 | **待补充**(如涉及) |
|
|
99
|
+
| - | 实现步骤 | **待补充** |
|
|
100
|
+
|
|
101
|
+
### 5. 显示转换预览
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
升级预览:QUICK-001 → REQ-007
|
|
105
|
+
|
|
106
|
+
原快速修复:
|
|
107
|
+
编号:QUICK-001
|
|
108
|
+
标题:修复用户登录失败问题
|
|
109
|
+
状态:开发中
|
|
110
|
+
改动:3 个文件
|
|
111
|
+
|
|
112
|
+
新正式需求:
|
|
113
|
+
编号:REQ-007
|
|
114
|
+
标题:修复用户登录失败问题
|
|
115
|
+
类型:后端
|
|
116
|
+
状态:开发中(保持)
|
|
117
|
+
|
|
118
|
+
需补充的章节:
|
|
119
|
+
- 需求描述.价值
|
|
120
|
+
- 功能清单
|
|
121
|
+
- 业务规则
|
|
122
|
+
- 实现步骤
|
|
123
|
+
|
|
124
|
+
原文件处理:
|
|
125
|
+
[ ] 归档到 completed/(保留历史)
|
|
126
|
+
[ ] 直接删除(减少冗余)
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### 6. 用户确认后执行
|
|
131
|
+
|
|
132
|
+
#### 6.1 创建新 REQ 文件
|
|
133
|
+
|
|
134
|
+
使用 requirement-template.md 模板,填充转换后的内容,写入 `docs/requirements/active/<NEW_REQ_ID>-<title>.md`。
|
|
135
|
+
|
|
136
|
+
#### 6.2 处理原 QUICK 文件
|
|
137
|
+
|
|
138
|
+
**归档**:在原文件末尾追加升级标记(含日期和新编号),移动到 completed/。
|
|
139
|
+
**删除**:直接删除源文件。
|
|
140
|
+
|
|
141
|
+
#### 6.3 同步缓存
|
|
142
|
+
|
|
143
|
+
将新 REQ 文件复制到缓存 active/,按用户选择同步处理缓存中的 QUICK 文件(归档或删除)。
|
|
144
|
+
|
|
145
|
+
### 7. 触发需求完善
|
|
146
|
+
|
|
147
|
+
升级完成后,触发 requirement-analyzer 技能补充待填章节:
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
✅ 升级成功!
|
|
151
|
+
|
|
152
|
+
新需求:REQ-007 修复用户登录失败问题
|
|
153
|
+
文件:docs/requirements/active/REQ-007-修复用户登录失败问题.md
|
|
154
|
+
状态:开发中
|
|
155
|
+
|
|
156
|
+
需要补充以下章节:
|
|
157
|
+
1. 需求描述.价值
|
|
158
|
+
2. 功能清单
|
|
159
|
+
3. 业务规则
|
|
160
|
+
4. 实现步骤
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
调用 requirement-analyzer 技能引导完善各章节。
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## 限制条件
|
|
169
|
+
|
|
170
|
+
1. **仅限 active/ 目录**:已完成(completed/)的 QUICK 不能升级
|
|
171
|
+
2. **状态限制**:「已完成」状态的 QUICK 不允许升级
|
|
172
|
+
3. **编号唯一性**:生成的 REQ 编号必须唯一
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## 用户输入
|
|
177
|
+
|
|
178
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: use
|
|
3
|
+
description: |
|
|
4
|
+
切换需求项目 - 将当前仓库绑定到不同的项目
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 切换需求项目
|
|
8
|
+
|
|
9
|
+
将当前仓库绑定到另一个已存在的需求项目。
|
|
10
|
+
|
|
11
|
+
## 命令格式
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
/req:use <project-name>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## 参数
|
|
18
|
+
|
|
19
|
+
- `project-name`: 要切换到的项目名称
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 执行流程
|
|
24
|
+
|
|
25
|
+
### 1. 解析参数
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
目标项目: $ARGUMENTS
|
|
29
|
+
全局缓存路径: ~/.claude-requirements
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### 2. 检查目标项目是否存在
|
|
33
|
+
|
|
34
|
+
检查 `~/.claude-requirements/projects/<project-name>/` 是否存在。
|
|
35
|
+
|
|
36
|
+
**如果项目不存在**:
|
|
37
|
+
- 列出所有可用项目
|
|
38
|
+
- 提示使用 `/req:init` 创建新项目
|
|
39
|
+
|
|
40
|
+
### 3. 读取当前绑定
|
|
41
|
+
|
|
42
|
+
检查当前仓库的 `.claude/settings.json`:
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"requirementProject": "old-project"
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### 4. 更新仓库绑定
|
|
51
|
+
|
|
52
|
+
> 写入规范见 [_storage.md](./_storage.md#settings-文件写入规范)。
|
|
53
|
+
|
|
54
|
+
读取已有 `.claude/settings.json`,合并以下字段后写回(不覆盖已有的 `branchStrategy` 等字段):
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
{
|
|
58
|
+
"requirementProject": "<project-name>",
|
|
59
|
+
"requirementRole": "readonly"
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
> `/req:use` 绑定的仓库默认为 `readonly` 角色,仅从缓存读取需求。如需升级为主仓库,使用 `/req:init <project-name>` 初始化本地存储。
|
|
64
|
+
|
|
65
|
+
### 5. 更新全局索引
|
|
66
|
+
|
|
67
|
+
更新 `~/.claude-requirements/index.json`:
|
|
68
|
+
- 从旧项目的 repos 列表移除当前仓库
|
|
69
|
+
- 添加到新项目的 repos 列表
|
|
70
|
+
|
|
71
|
+
### 6. 项目配置检查
|
|
72
|
+
|
|
73
|
+
绑定完成后检查当前仓库的配置完整性。
|
|
74
|
+
|
|
75
|
+
#### 6.1 CLAUDE.md 架构检查
|
|
76
|
+
|
|
77
|
+
检查 CLAUDE.md 是否包含以下关键词之一:`分层架构`、`目录结构`、`技术栈`、`项目架构`、`Architecture`、`Tech Stack`、`Project Structure`。
|
|
78
|
+
|
|
79
|
+
**缺失时引导**(与 `/req:init` 步骤 8 相同):
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
⚠️ CLAUDE.md 中未检测到项目架构描述
|
|
83
|
+
|
|
84
|
+
/req:dev 需要架构信息来生成实现方案
|
|
85
|
+
|
|
86
|
+
选择项目类型,生成 CLAUDE.md 建议片段:
|
|
87
|
+
|
|
88
|
+
1. Go 后端(Gin + GORM 分层架构)
|
|
89
|
+
2. Java 后端(Spring Boot 分层架构)
|
|
90
|
+
3. 前端项目(React/Vue + TypeScript)
|
|
91
|
+
4. 自定义(生成空白模板,手动填写)
|
|
92
|
+
5. 跳过(稍后手动添加)
|
|
93
|
+
|
|
94
|
+
请选择(1-5):
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
选择后读取 `<plugin-path>/templates/claude-md-snippets/` 对应模板,追加到 CLAUDE.md。
|
|
98
|
+
|
|
99
|
+
#### 6.2 分支策略检查
|
|
100
|
+
|
|
101
|
+
读取 `settings.json` 中的 `branchStrategy` 字段。
|
|
102
|
+
|
|
103
|
+
**未配置时提示**(不阻断):
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
未配置分支策略,/req:dev 将使用默认行为
|
|
107
|
+
建议执行 /req:branch init 配置分支策略
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### 7. 输出结果
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
✅ 已切换到项目 "<project-name>"
|
|
114
|
+
|
|
115
|
+
项目状态:
|
|
116
|
+
- 活跃需求: X 个
|
|
117
|
+
- 已完成: Y 个
|
|
118
|
+
|
|
119
|
+
活跃需求列表:
|
|
120
|
+
| 编号 | 标题 | 状态 |
|
|
121
|
+
|------|------|------|
|
|
122
|
+
| REQ-001 | ... | 开发中 |
|
|
123
|
+
| REQ-002 | ... | 待评审 |
|
|
124
|
+
|
|
125
|
+
使用 /req 查看完整列表
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## 无参数模式
|
|
131
|
+
|
|
132
|
+
当不带参数执行 `/req:use` 时:
|
|
133
|
+
|
|
134
|
+
### 显示当前绑定
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
当前项目: <project-name>
|
|
138
|
+
路径: ~/.claude-requirements/projects/<project-name>/
|
|
139
|
+
|
|
140
|
+
可用命令:
|
|
141
|
+
- /req:use <project-name> 切换到其他项目
|
|
142
|
+
- /req:projects 查看所有项目
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## 错误处理
|
|
148
|
+
|
|
149
|
+
| 错误场景 | 处理方式 |
|
|
150
|
+
|---------|---------|
|
|
151
|
+
| 项目不存在 | 列出可用项目,提示使用 `/req:init` 创建 |
|
|
152
|
+
| 全局缓存未初始化 | 提示先运行 `/req:init <project-name>` |
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## 用户输入
|
|
157
|
+
|
|
158
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: version-bumper
|
|
3
|
+
description: |
|
|
4
|
+
版本号管理助手。仅在执行 /req:release 命令时触发。
|
|
5
|
+
自动检测各插件变更范围,按 semver 规则推导并更新插件版本号和整体版本号。
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# 版本号管理助手
|
|
9
|
+
|
|
10
|
+
仅在 `/req:release` 命令执行时触发,负责在发版前更新 devflow 各插件版本号。
|
|
11
|
+
|
|
12
|
+
## 触发条件
|
|
13
|
+
|
|
14
|
+
仅在 `/req:release` 执行时触发,在 release 流程的步骤 2(确定版本号)之后、步骤 9(生成 changelog)之前执行。
|
|
15
|
+
|
|
16
|
+
## 版本文件
|
|
17
|
+
|
|
18
|
+
| 文件 | 字段 | 当前含义 |
|
|
19
|
+
|------|------|---------|
|
|
20
|
+
| `.claude-plugin/marketplace.json` | `metadata.version` | 整体发布版本,与 git tag 保持一致 |
|
|
21
|
+
| `plugins/req/.claude-plugin/plugin.json` | `version` | req 插件独立版本 |
|
|
22
|
+
| `plugins/pm/.claude-plugin/plugin.json` | `version` | pm 插件独立版本 |
|
|
23
|
+
| `plugins/api/.claude-plugin/plugin.json` | `version` | api 插件独立版本 |
|
|
24
|
+
| `plugins/diag/.claude-plugin/plugin.json` | `version` | diag 插件独立版本 |
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## 工作流程
|
|
29
|
+
|
|
30
|
+
### 1. 读取当前版本
|
|
31
|
+
|
|
32
|
+
用 Read 工具读取所有版本文件,记录各插件当前版本号。
|
|
33
|
+
|
|
34
|
+
### 2. 检测各插件变更文件
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
git diff --name-only <FROM_REF>..HEAD
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
`FROM_REF` 与 release 步骤 2 中一致(平台最新 Release 的 tag,无则最新 git tag,无则仓库首次 commit)。
|
|
41
|
+
|
|
42
|
+
按文件路径前缀归属插件:
|
|
43
|
+
|
|
44
|
+
| 路径前缀 | 归属插件 |
|
|
45
|
+
|---------|---------|
|
|
46
|
+
| `plugins/req/` | req |
|
|
47
|
+
| `plugins/pm/` | pm |
|
|
48
|
+
| `plugins/api/` | api |
|
|
49
|
+
| `plugins/diag/` | diag |
|
|
50
|
+
| 其他(根目录、docs/、.claude/ 等) | 仅影响 marketplace 整体版本 |
|
|
51
|
+
|
|
52
|
+
### 3. 推导各插件 bump 等级
|
|
53
|
+
|
|
54
|
+
对每个有变更的插件,分析其目录下的 commit 信息:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
git log <FROM_REF>..HEAD --pretty=format:"%s" -- plugins/<name>/
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
按最高优先级确定该插件的 bump 等级:
|
|
61
|
+
|
|
62
|
+
| commit 特征 | bump 等级 |
|
|
63
|
+
|------------|---------|
|
|
64
|
+
| `!:` 或 `BREAKING CHANGE` | major |
|
|
65
|
+
| `feat:` / `新功能:` | minor |
|
|
66
|
+
| `fix:` / `perf:` / `refactor:` / `修复:` / `优化:` / `重构:` | patch |
|
|
67
|
+
| `docs:` / `chore:` / `ci:` / `test:` / `build:` | 不 bump(插件功能无变化) |
|
|
68
|
+
|
|
69
|
+
无变更或仅 docs/chore 的插件:保持版本号不变。
|
|
70
|
+
|
|
71
|
+
### 4. 更新 marketplace 整体版本
|
|
72
|
+
|
|
73
|
+
`marketplace.json` 的 `metadata.version` 直接设为 release 步骤 2 推导出的版本号(去掉 `v` 前缀)。
|
|
74
|
+
|
|
75
|
+
示例:release tag `v2.27.0` → `metadata.version` = `"2.27.0"`
|
|
76
|
+
|
|
77
|
+
### 5. 展示版本变更预览
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
版本更新预览:
|
|
81
|
+
|
|
82
|
+
marketplace.json: 2.26.0 → 2.27.0 (与 tag v2.27.0 同步)
|
|
83
|
+
|
|
84
|
+
req: 3.18.0 → 3.19.0 (minor - 新增命令)
|
|
85
|
+
pm: 0.2.0 → 0.2.0 (无变更)
|
|
86
|
+
api: 0.3.0 → 0.3.1 (patch - 修复解析)
|
|
87
|
+
diag: 0.1.0 → 0.1.0 (无变更)
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### 6. 更新版本文件
|
|
91
|
+
|
|
92
|
+
用 Edit 工具更新各 JSON 文件中的 `version`(或 `metadata.version`)字段。仅更新有变更的插件和 marketplace.json。
|
|
93
|
+
|
|
94
|
+
### 7. 暂存版本文件
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
git add .claude-plugin/marketplace.json plugins/req/.claude-plugin/plugin.json \
|
|
98
|
+
plugins/pm/.claude-plugin/plugin.json plugins/api/.claude-plugin/plugin.json \
|
|
99
|
+
plugins/diag/.claude-plugin/plugin.json
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
版本文件的修改会在 release 步骤 10 的统一 commit 中一起提交(`chore(release): prepare <version>`),**不单独提交**。
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## 边界情况
|
|
107
|
+
|
|
108
|
+
| 场景 | 处理 |
|
|
109
|
+
|------|------|
|
|
110
|
+
| 版本号已与 tag 一致 | 跳过该文件,不重复写入 |
|
|
111
|
+
| 插件仅有 docs/chore 变更 | 插件版本不 bump,仅更新 marketplace |
|
|
112
|
+
| 无任何 Release 也无 git tag(首次发版) | FROM_REF 取仓库首次 commit,视所有 commit 为新增,各插件 minor bump |
|
|
113
|
+
| 版本号格式不符合 X.Y.Z | 打印警告并跳过该插件的 bump,不阻塞发版 |
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bug
|
|
3
|
+
description: |
|
|
4
|
+
上报测试失败项 - 将失败场景创建为 Gitea issue
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 上报测试 Bug
|
|
8
|
+
|
|
9
|
+
> **Audience:** QA
|
|
10
|
+
|
|
11
|
+
将最近一次测试的失败场景上报为 Gitea issue。
|
|
12
|
+
|
|
13
|
+
## 命令格式
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
/uat:bug [module]
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 执行流程
|
|
22
|
+
|
|
23
|
+
### 1. 读取配置
|
|
24
|
+
|
|
25
|
+
从 `settings.local.json` 读取:
|
|
26
|
+
- `branchStrategy.repoType`:仓库类型(github / gitea)
|
|
27
|
+
- `branchStrategy.giteaUrl`:Gitea 地址(gitea 时必填)
|
|
28
|
+
- `branchStrategy.giteaToken`:Gitea token(gitea 时必填)
|
|
29
|
+
|
|
30
|
+
### 2. 找到最新报告
|
|
31
|
+
|
|
32
|
+
扫描 `docs/uat/reports/` 找最新报告文件,提取所有 `❌ FAIL` 场景。
|
|
33
|
+
|
|
34
|
+
若无失败项:
|
|
35
|
+
```
|
|
36
|
+
✅ 最近一次测试全部通过,无需上报
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
若无报告文件:
|
|
40
|
+
```
|
|
41
|
+
❌ 未找到测试报告,请先执行 /uat:run
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 3. 展示候选列表并询问
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
发现 3 个需上报场景:
|
|
48
|
+
|
|
49
|
+
❌ 失败(2 个):
|
|
50
|
+
1. S02 密码错误提示
|
|
51
|
+
原因:表单未显示错误信息
|
|
52
|
+
|
|
53
|
+
2. S05 退出登录后跳转
|
|
54
|
+
原因:未跳转到登录页
|
|
55
|
+
|
|
56
|
+
⚠️ Console Error(1 个,功能表现正常但有 JS 异常):
|
|
57
|
+
3. S03 新增客户
|
|
58
|
+
TypeError: Cannot read properties of undefined (reading 'id')
|
|
59
|
+
|
|
60
|
+
是否上报?(y/n/选择编号如 1,2,3)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
用户可选择全部上报、部分上报或取消。
|
|
64
|
+
|
|
65
|
+
### 4. 上报 issue
|
|
66
|
+
|
|
67
|
+
**前置检查**(gitea 仓库):
|
|
68
|
+
- `giteaUrl` 和 `giteaToken` 非空,否则提示:
|
|
69
|
+
```
|
|
70
|
+
❌ 未配置 giteaUrl / giteaToken
|
|
71
|
+
在 settings.local.json 中配置后重试
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**CLI 优先**(与 req 插件保持一致):
|
|
75
|
+
- GitHub:`gh issue create`
|
|
76
|
+
- Gitea:优先 `tea issue create`,不可用时回退 `curl + giteaToken`
|
|
77
|
+
|
|
78
|
+
**上报范围**:`❌ FAIL` 和 `⚠️ PASS(有 console error)` 的场景都纳入上报候选,在步骤 3 展示时分组标注。
|
|
79
|
+
|
|
80
|
+
**issue 正文**:
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
## 测试场景
|
|
84
|
+
- 模块:<module>
|
|
85
|
+
- 场景:S0N <场景名称>
|
|
86
|
+
- 测试日期:YYYY-MM-DD
|
|
87
|
+
- 结果:❌ FAIL / ⚠️ PASS(有 console error)
|
|
88
|
+
|
|
89
|
+
## 失败步骤
|
|
90
|
+
<失败步骤描述,⚠️ PASS 时填「步骤均通过,但有 console error」>
|
|
91
|
+
|
|
92
|
+
## 预期结果
|
|
93
|
+
<预期断言>
|
|
94
|
+
|
|
95
|
+
## 实际结果
|
|
96
|
+
<失败原因,⚠️ PASS 时填「功能表现正常,但 console 有以下报错」>
|
|
97
|
+
|
|
98
|
+
## Console Errors
|
|
99
|
+
<本场景捕获的 console error,无则省略此节>
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
由 /uat:bug 自动生成
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
> 截图不写在正文里,创建 issue 后单独上传(见步骤 5)。
|
|
106
|
+
|
|
107
|
+
### 5. 上传截图附件
|
|
108
|
+
|
|
109
|
+
issue 创建成功后,检查该场景是否有对应截图(`docs/uat/screenshots/` 下匹配场景 ID 的文件)。有则上传,无则跳过。
|
|
110
|
+
|
|
111
|
+
**GitHub**(`repoType=github`):
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
# 获取当前仓库
|
|
115
|
+
REPO=$(gh repo view --json owner,name -q '"\\(.owner.login)/\\(.name)"')
|
|
116
|
+
|
|
117
|
+
# 上传截图到 GitHub,获取可访问 URL
|
|
118
|
+
UPLOAD_RESPONSE=$(curl -s -X POST \
|
|
119
|
+
"https://uploads.github.com/repos/$REPO/issues/assets" \
|
|
120
|
+
-H "Authorization: token $(gh auth token)" \
|
|
121
|
+
-H "Content-Type: image/png" \
|
|
122
|
+
--data-binary "@<截图路径>")
|
|
123
|
+
IMG_URL=$(echo $UPLOAD_RESPONSE | jq -r '.url // empty')
|
|
124
|
+
|
|
125
|
+
# 追加图片评论到 issue
|
|
126
|
+
gh issue comment <issue_number> --body ""
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
若 upload 失败(非 2xx):追加一条评论写明截图本地路径,提示手动上传。
|
|
130
|
+
|
|
131
|
+
**Gitea**(`repoType=gitea`):
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# 上传附件到 issue
|
|
135
|
+
curl -s -X POST "$GITEA_URL/api/v1/repos/$OWNER/$REPO/issues/$ISSUE_NUM/assets" \
|
|
136
|
+
-H "Authorization: token $GITEA_TOKEN" \
|
|
137
|
+
-F "attachment=@<截图路径>"
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
附件上传后 Gitea 自动在 issue 页面展示,无需额外操作。
|
|
141
|
+
|
|
142
|
+
若 `tea` CLI 支持附件上传则优先 `tea`,否则回退 `curl`。
|
|
143
|
+
|
|
144
|
+
### 6. 输出结果
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
✅ 已创建 2 个 issue:
|
|
148
|
+
|
|
149
|
+
#42 [UAT] 用户登录 - S02 密码错误提示 截图已上传
|
|
150
|
+
#43 [UAT] 用户登录 - S05 退出登录后跳转 ⚠ 无截图
|
|
151
|
+
|
|
152
|
+
/uat:run 修复后重新验证
|
|
153
|
+
```
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: init
|
|
3
|
+
description: |
|
|
4
|
+
初始化 UAT 插件 - 创建目录结构并安装 skill 到项目
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 初始化 UAT 插件
|
|
8
|
+
|
|
9
|
+
> **Audience:** Engineer
|
|
10
|
+
|
|
11
|
+
将 uat-executor skill 安装到项目的 `.claude/skills/`,使 Codex 和 Claude 桌面端能在执行测试时自动加载。
|
|
12
|
+
|
|
13
|
+
## 命令格式
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
/uat:init
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 执行流程
|
|
22
|
+
|
|
23
|
+
### 1. 创建目录结构
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
mkdir -p docs/uat/flows
|
|
27
|
+
mkdir -p docs/uat/reports
|
|
28
|
+
mkdir -p docs/uat/screenshots
|
|
29
|
+
mkdir -p .claude/skills/uat-executor
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### 2. 生成 testid 命名约定文档
|
|
33
|
+
|
|
34
|
+
将约定模板复制到项目:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
cp plugins/uat/templates/testid-convention.md docs/uat/testid-convention.md
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
此文件提交到 git,供前端开发参考添加 `data-testid` 属性。
|
|
41
|
+
|
|
42
|
+
### 3. 安装 uat-executor skill
|
|
43
|
+
|
|
44
|
+
将插件源文件复制到项目 skills 目录:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
cp plugins/uat/skills/uat-executor/SKILL.md .claude/skills/uat-executor/SKILL.md
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
若插件路径不存在(说明插件未通过 Claude Code 安装),输出:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
❌ 未找到 uat 插件源文件
|
|
54
|
+
请先通过 devflow 安装 uat 插件后重试
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### 4. 更新 .gitignore
|
|
58
|
+
|
|
59
|
+
检查项目根目录的 `.gitignore`:
|
|
60
|
+
|
|
61
|
+
- 若已包含 `docs/uat/reports/` → 跳过
|
|
62
|
+
- 否则追加:
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
# UAT test artifacts
|
|
66
|
+
docs/uat/reports/
|
|
67
|
+
docs/uat/screenshots/
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 5. 输出结果
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
✅ UAT 插件初始化完成
|
|
74
|
+
|
|
75
|
+
已创建目录:
|
|
76
|
+
docs/uat/flows/ 测试流程文档
|
|
77
|
+
docs/uat/reports/ 测试报告(已加入 .gitignore)
|
|
78
|
+
docs/uat/screenshots/ 截图存储(已加入 .gitignore)
|
|
79
|
+
|
|
80
|
+
已安装 skill:
|
|
81
|
+
.claude/skills/uat-executor/SKILL.md
|
|
82
|
+
|
|
83
|
+
已生成约定文档:
|
|
84
|
+
docs/uat/testid-convention.md data-testid 命名约定(提交 git,供前端参考)
|
|
85
|
+
|
|
86
|
+
Codex / Claude 桌面端现在可以使用 /uat:run 执行测试
|
|
87
|
+
使用 /uat:new 创建第一个测试流程文档
|
|
88
|
+
```
|