@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.
Files changed (83) hide show
  1. package/README.md +57 -235
  2. package/install.js +406 -116
  3. package/package.json +2 -1
  4. package/plugins/api/skills/api/SKILL.md +102 -0
  5. package/plugins/api/skills/api-field-mapper/SKILL.md +95 -0
  6. package/plugins/api/skills/config/SKILL.md +140 -0
  7. package/plugins/api/skills/gen/SKILL.md +345 -0
  8. package/plugins/api/skills/help/SKILL.md +121 -0
  9. package/plugins/api/skills/import/SKILL.md +95 -0
  10. package/plugins/api/skills/map/SKILL.md +152 -0
  11. package/plugins/api/skills/search/SKILL.md +95 -0
  12. package/plugins/diag/skills/audit/SKILL.md +103 -0
  13. package/plugins/diag/skills/diag/SKILL.md +41 -0
  14. package/plugins/diag/skills/diagnose/SKILL.md +167 -0
  15. package/plugins/diag/skills/init/SKILL.md +142 -0
  16. package/plugins/diag/skills/stack-analyzer/SKILL.md +150 -0
  17. package/plugins/pm/skills/ask/SKILL.md +89 -0
  18. package/plugins/pm/skills/brief/SKILL.md +95 -0
  19. package/plugins/pm/skills/export/SKILL.md +93 -0
  20. package/plugins/pm/skills/help/SKILL.md +257 -0
  21. package/plugins/pm/skills/milestone/SKILL.md +102 -0
  22. package/plugins/pm/skills/monthly/SKILL.md +111 -0
  23. package/plugins/pm/skills/plan/SKILL.md +96 -0
  24. package/plugins/pm/skills/pm/SKILL.md +174 -0
  25. package/plugins/pm/skills/progress/SKILL.md +113 -0
  26. package/plugins/pm/skills/report-generator/SKILL.md +104 -0
  27. package/plugins/pm/skills/risk/SKILL.md +223 -0
  28. package/plugins/pm/skills/standup/SKILL.md +96 -0
  29. package/plugins/pm/skills/stats/SKILL.md +158 -0
  30. package/plugins/pm/skills/weekly/SKILL.md +157 -0
  31. package/plugins/req/skills/branch/SKILL.md +447 -0
  32. package/plugins/req/skills/cache/SKILL.md +232 -0
  33. package/plugins/req/skills/changelog/SKILL.md +187 -0
  34. package/plugins/req/skills/changelog-generator/SKILL.md +106 -0
  35. package/plugins/req/skills/code-impact-analyzer/SKILL.md +48 -0
  36. package/plugins/req/skills/commit/SKILL.md +308 -0
  37. package/plugins/req/skills/dev/SKILL.md +229 -0
  38. package/plugins/req/skills/dev-guide/SKILL.md +530 -0
  39. package/plugins/req/skills/do/SKILL.md +191 -0
  40. package/plugins/req/skills/done/SKILL.md +95 -0
  41. package/plugins/req/skills/edit/SKILL.md +187 -0
  42. package/plugins/req/skills/fix/SKILL.md +300 -0
  43. package/plugins/req/skills/help/SKILL.md +136 -0
  44. package/plugins/req/skills/init/SKILL.md +505 -0
  45. package/plugins/req/skills/issue/SKILL.md +237 -0
  46. package/plugins/req/skills/issue-guide/SKILL.md +125 -0
  47. package/plugins/req/skills/migrate/SKILL.md +128 -0
  48. package/plugins/req/skills/modules/SKILL.md +195 -0
  49. package/plugins/req/skills/natural-language-dispatcher/SKILL.md +545 -0
  50. package/plugins/req/skills/new/SKILL.md +172 -0
  51. package/plugins/req/skills/new-quick/SKILL.md +246 -0
  52. package/plugins/req/skills/pr/SKILL.md +157 -0
  53. package/plugins/req/skills/prd/SKILL.md +187 -0
  54. package/plugins/req/skills/prd-analyzer/SKILL.md +131 -0
  55. package/plugins/req/skills/prd-edit/SKILL.md +201 -0
  56. package/plugins/req/skills/projects/SKILL.md +115 -0
  57. package/plugins/req/skills/quick-fix-guide/SKILL.md +51 -0
  58. package/plugins/req/skills/release/SKILL.md +300 -0
  59. package/plugins/req/skills/release-rationale/SKILL.md +213 -0
  60. package/plugins/req/skills/req/SKILL.md +173 -0
  61. package/plugins/req/skills/requirement-analyzer/SKILL.md +274 -0
  62. package/plugins/req/skills/review/SKILL.md +201 -0
  63. package/plugins/req/skills/review-pr/SKILL.md +699 -0
  64. package/plugins/req/skills/show/SKILL.md +302 -0
  65. package/plugins/req/skills/specs/SKILL.md +99 -0
  66. package/plugins/req/skills/split/SKILL.md +164 -0
  67. package/plugins/req/skills/status/SKILL.md +184 -0
  68. package/plugins/req/skills/test/SKILL.md +431 -0
  69. package/plugins/req/skills/test-guide/SKILL.md +304 -0
  70. package/plugins/req/skills/test_new/SKILL.md +417 -0
  71. package/plugins/req/skills/test_regression/SKILL.md +298 -0
  72. package/plugins/req/skills/update/SKILL.md +131 -0
  73. package/plugins/req/skills/update-template/SKILL.md +203 -0
  74. package/plugins/req/skills/upgrade/SKILL.md +178 -0
  75. package/plugins/req/skills/use/SKILL.md +158 -0
  76. package/plugins/req/skills/version-bumper/SKILL.md +113 -0
  77. package/plugins/uat/skills/bug/SKILL.md +153 -0
  78. package/plugins/uat/skills/init/SKILL.md +88 -0
  79. package/plugins/uat/skills/new/SKILL.md +131 -0
  80. package/plugins/uat/skills/report/SKILL.md +48 -0
  81. package/plugins/uat/skills/run/SKILL.md +78 -0
  82. package/plugins/uat/skills/uat/SKILL.md +64 -0
  83. package/plugins/uat/skills/uat-executor/SKILL.md +299 -0
package/README.md CHANGED
@@ -1,288 +1,110 @@
1
1
  # DevFlow Skills
2
2
 
3
- DevFlow 插件技能集合 —— 独立技能包,包含 [DevFlow](https://github.com/zhouhao4221/devflow-claude) 所有插件的 AI 执行指令(SKILL.md)。支持 OpenCode、Claude Code、Codex 三大 AI 工具。
3
+ DevFlow 技能包 —— 80 AI 技能指令,一键安装到 7 AI 工具。
4
4
 
5
5
  ## 快速开始
6
6
 
7
- 使用 CLI 工具一键安装技能到目标 AI 工具目录:
8
-
9
7
  ```bash
10
- # 安装全部技能到 OpenCode
8
+ # 安装全部技能
11
9
  npx devflow-skills install --tool opencode --all
12
10
 
13
- # 安装指定技能
14
- npx devflow-skills install --tool opencode --skill req-dev --skill req-review
11
+ # 安装指定插件
12
+ npx devflow-skills install --tool cursor --plugin req
15
13
 
16
- # 列出所有可用技能
17
- npx devflow-skills list
14
+ # 安装单个技能
15
+ npx devflow-skills install --tool claude --skill req-dev
18
16
 
19
- # 卸载技能
20
- npx devflow-skills uninstall --tool opencode --all
17
+ # 查看所有技能
18
+ npx devflow-skills list
21
19
  ```
22
20
 
23
- 首次运行 `npx` 时会自动下载对应平台 Go 二进制,也可通过 Go install 安装:
21
+ 首次运行 `npx` 即用,无需安装任何依赖。
24
22
 
25
- ```bash
26
- go install github.com/zhouhao4221/devflow-skills@latest
27
- devflow-skills install --tool claude --all
28
- ```
23
+ ## 支持的工具
29
24
 
30
- ## 概述
25
+ | 工具 | --tool 值 | 安装路径 |
26
+ |------|-----------|----------|
27
+ | Claude Code | `claude` | `plugins/<plugin>/skills/<name>/` |
28
+ | OpenCode | `opencode` | `.agents/skills/<plugin>-<name>/` |
29
+ | Codex | `codex` | `.agents/skills/<plugin>-<name>/` |
30
+ | Cursor | `cursor` | `.agents/skills/<plugin>-<name>/` |
31
+ | GitHub Copilot | `copilot` | `.agents/skills/<plugin>-<name>/` |
32
+ | CodeBuddy | `codebuddy` | `.agents/skills/<plugin>-<name>/` |
33
+ | Windsurf | `windsurf` | `.agents/skills/<plugin>-<name>/` |
31
34
 
32
- 本仓库从 [devflow-claude](https://github.com/zhouhao4221/devflow-claude) 主仓库中提取所有 SKILL.md 文件,作为独立的技能包提供给 CI 校验、版本管理和跨工具分发。每个 SKILL.md 文件定义了 AI 工具在执行对应命令时的行为指引。
35
+ Claude Code 使用分层目录保留插件作用域;其余工具采用 `插件-名称` 扁平命名,保证全局唯一。
33
36
 
34
- ### CLI 命令速览
37
+ ## 命令参考
35
38
 
36
- | 命令 | 说明 |
37
- |------|------|
38
- | `install` | 安装技能到目标 AI 工具目录 |
39
- | `list` | 列出所有可用技能,支持按插件过滤和 JSON 输出 |
40
- | `uninstall` | 从目标 AI 工具目录卸载技能 |
39
+ ### install 安装技能
40
+
41
+ ```bash
42
+ npx devflow-skills install --tool <工具名> [--all | --plugin <插件> | --skill <名>] [--dir <路径>] [-g] [--symlink]
43
+ ```
41
44
 
42
45
  | 参数 | 说明 |
43
46
  |------|------|
44
- | `--tool opencode\|claude\|codex` | 目标 AI 工具(必填) |
45
- | `--skill <NAME>` | 要操作的技能名,支持重复指定多个 |
46
- | `--all` | 操作所有技能(与 `--skill` 互斥) |
47
- | `--dir <PATH>` | 目标项目根目录(默认 `.`) |
48
- | `--plugin <NAME>` | 按插件过滤(`list` 命令) |
49
- | `--format text\|json` | 输出格式(`list` 命令) |
47
+ | `--tool` | 目标 AI 工具(必填) |
48
+ | `--all` | 安装全部 80 个技能 |
49
+ | `--plugin` | 按插件安装(`req` / `api` / `pm` / `diag` / `uat`) |
50
+ | `--skill` | 安装指定技能,可重复使用 |
51
+ | `--dir` | 目标项目目录,默认当前目录 |
52
+ | `-g`, `--global` | 安装到全局目录(`~/` 下) |
53
+ | `--symlink` | 符号链接模式,多工具共享同一份文件 |
50
54
 
51
- ### CLI 安装示例
55
+ ### list — 列出技能
52
56
 
53
57
  ```bash
54
- # OpenCode: 安装到 .agents/skills/(扁平命名,如 req-dev)
55
- npx devflow-skills install --tool opencode --skill req-dev
56
-
57
- # Claude Code: 安装到 plugins/req/skills/dev/(分层目录)
58
- npx devflow-skills install --tool claude --all
59
-
60
- # Codex: 安装到 .agents/skills/(扁平命名,同上)
61
- npx devflow-skills install --tool codex --all
62
-
63
- # 指定目标目录
64
- npx devflow-skills install --tool opencode --all --dir ../my-project
58
+ npx devflow-skills list [--plugin <插件>] [--filter <关键词>] [--format json]
65
59
  ```
66
60
 
67
- ## 仓库结构
61
+ ### uninstall — 卸载技能
68
62
 
69
- ```
70
- plugins/
71
- ├── req/skills/ # 需求管理技能(46 个)
72
- ├── api/skills/ # API 对接技能(8 个)
73
- ├── pm/skills/ # 项目管理技能(14 个)
74
- ├── diag/skills/ # 生产诊断技能(5 个)
75
- └── uat/skills/ # 验收测试技能(7 个)
76
- skill-bindings.json # 命令-技能映射关系
63
+ ```bash
64
+ npx devflow-skills uninstall --tool <工具名> [--all | --skill <名>] [--dir <路径>] [-g]
77
65
  ```
78
66
 
79
- ## 技能分类
67
+ ### add — 从 GitHub 仓库安装
80
68
 
81
- ### req — 需求全流程管理
82
- 覆盖从需求分析、评审、开发、测试到归档的完整生命周期,包括智能开发(`dev`)、规范提交(`commit`)、版本发布(`release`)、代码审查(`review-pr`)、自然语言调度(`natural-language-dispatcher`)等 46 个技能。
83
-
84
- **自动触发技能**:
85
- | 技能 | 触发场景 |
86
- |------|---------|
87
- | `requirement-analyzer` | 创建/编辑需求时自动分析 |
88
- | `dev-guide` | 开发阶段按分层架构引导 |
89
- | `quick-fix-guide` | 快速修复时引导 |
90
- | `test-guide` | 测试阶段引导回归和新建 |
91
- | `prd-analyzer` | PRD 编辑时辅助完善 |
92
- | `code-impact-analyzer` | 需求变更时分析代码影响 |
93
- | `changelog-generator` | 自动生成版本变更说明 |
94
- | `version-bumper` | 发版时自动推导版本号 |
95
-
96
- ### api — API 对接
97
- 支持 Swagger/OpenAPI 解析、字段映射、代码生成、接口搜索等 8 个技能。
98
-
99
- ### pm — 项目管理助手
100
- 从 PRD、需求文档和 Git 记录中提取数据,生成汇报、统计、方案等 14 个技能。
101
-
102
- ### diag — 生产诊断
103
- 只读诊断 + 修复建议,包含审计、堆栈分析等 5 个技能,含安全风控 Hook。
104
-
105
- ### uat — 用户验收测试
106
- UI 验收测试工作流,含测试执行器、报告生成等 7 个技能。
107
-
108
- ## skill-bindings.json
109
-
110
- `skill-bindings.json` 声明了命令与技能之间的映射关系:
111
-
112
- ```json
113
- {
114
- "plugins": {
115
- "req": {
116
- "commands": {
117
- "dev": {
118
- "primarySkill": "dev",
119
- "additionalSkills": ["dev-guide"]
120
- }
121
- }
122
- }
123
- },
124
- "allSkills": {
125
- "req": ["dev", "dev-guide", ...]
126
- }
127
- }
69
+ ```bash
70
+ npx devflow-skills add <owner/repo> --list # 浏览仓库中的技能
71
+ npx devflow-skills add <owner/repo> --tool cursor --all # 安装全部
128
72
  ```
129
73
 
130
- - `commands.<name>.primarySkill`: 命令直接对应的技能
131
- - `commands.<name>.additionalSkills`: 命令执行过程中自动触发的辅助技能
132
- - `allSkills`: 各插件拥有的全部技能清单
133
-
134
- CI 会验证:
135
- 1. `allSkills` 中声明的技能都有对应的 `SKILL.md` 文件
136
- 2. 实际存在的 `SKILL.md` 文件都在 `allSkills` 中有声明
137
- 3. 命令中引用的技能名都在 `allSkills` 中存在
138
-
139
- ## CI 校验
140
-
141
- 每次 push 或 PR 时自动运行 CI(`.github/workflows/ci.yml`),包含:
74
+ ## 技能分类
142
75
 
143
- | 检查项 | 说明 |
144
- |--------|------|
145
- | validate-source | 全量校验 80 SKILL.md 是否符合 agentskills.io 规范(name 正则、description 长度) |
146
- | validate-claude | setup-claude 脚本输出完整性检查 |
147
- | validate-opencode | setup-opencode 输出 frontmatter 格式 + 计数 |
148
- | validate-codex | setup-codex + openai.yaml 输出完整性 |
76
+ | 插件 | 数量 | 用途 |
77
+ |------|------|------|
78
+ | `req` | 46 | 需求全生命周期:创建、评审、开发、测试、发布 |
79
+ | `api` | 8 | Swagger/OpenAPI 解析、字段映射、代码生成 |
80
+ | `pm` | 14 | 项目管理:周报、站会、风险跟踪、里程碑 |
81
+ | `diag` | 5 | 生产诊断:日志审计、堆栈分析 |
82
+ | `uat` | 7 | UI 验收测试:用例执行、Bug 上报、报告生成 |
149
83
 
150
- 本地手动运行:`./scripts/validate-skills.sh --ci`
84
+ ## 与 devflow-claude 的关系
151
85
 
152
- ---
86
+ 本仓库的技能源自 [devflow-claude](https://github.com/zhouhao4221/devflow-claude)(Claude Code 专属插件),独立出来作为跨工具的技能分发中心。devflow-claude 通过 `scripts/setup-claude.sh` 同步本仓库的技能文件,保持两边一致。
153
87
 
154
88
  ## 手动安装(适配器脚本)
155
89
 
156
- CLI 工具(上节)已覆盖所有常见场景。如需在不同环境分配不同路径、或嵌入 CI 流程,可通过适配器脚本手动生成。
157
-
158
- devflow-skills 作为唯一起源,通过适配器脚本生成各工具兼容的技能目录。以下分别说明 Claude Code、OpenCode、Codex 三工具的安装方式。
159
-
160
- ### 前置条件
161
-
162
- - 已 clone 本仓库
163
- - Python 3 可用(用于 `_get-description.py`)
164
-
165
- ### Claude Code
166
-
167
- Claude Code 通过插件 marketplace 加载技能,使用分层目录结构(`plugins/<plugin>/skills/<name>/SKILL.md`)。
90
+ 如果不想用 CLI,也可以通过脚本直接生成:
168
91
 
169
92
  ```bash
170
- # 同步技能到 devflow-claude 仓库
93
+ # Claude Code(分层目录)
171
94
  ./scripts/setup-claude.sh . ../devflow-claude
172
- # 参数: <devflow-skills路径> [devflow-claude路径]
173
- ```
174
-
175
- 产物路径:`../devflow-claude/plugins/<plugin>/skills/<name>/SKILL.md`(80 个文件,与源结构一致)。由 devflow-claude 的 `plugin.json` 加载。
176
-
177
- ### OpenCode
178
95
 
179
- OpenCode `.agents/skills/` 发现技能,使用扁平化命名(`<plugin>-<name>`)。
180
-
181
- ```bash
182
- # 生成 OpenCode 兼容的技能目录
96
+ # OpenCode / Codex / Cursor 等(扁平目录)
183
97
  ./scripts/setup-opencode.sh . ~/.agents/skills
184
- # 参数: <devflow-skills路径> [输出路径,默认 .agents/skills/]
185
- ```
186
-
187
- 产物路径:`~/.agents/skills/<plugin>-<name>/SKILL.md`(80 个目录,name 已自动更新为扁平化前缀)。OpenCode 启动时自动发现所有技能。
188
-
189
- ### Codex
190
-
191
- Codex 同样从 `.agents/skills/` 发现技能,兼容 agentskills.io 规范。
192
-
193
- ```bash
194
- # 基础安装(仅技能目录)
195
- ./scripts/setup-codex.sh . ~/.agents/skills
196
-
197
- # 附加生成 UI 元数据清单(agents/openai.yaml)
198
98
  ./scripts/setup-codex.sh . ~/.agents/skills --gen-openai-yaml
199
99
  ```
200
100
 
201
- 产物路径:`~/.agents/skills/<plugin>-<name>/SKILL.md`(80 个目录)。`--gen-openai-yaml` 额外生成 `agents/openai.yaml`,提供 display_name、description 等 UI 元数据。
202
-
203
- ### 验证安装
204
-
205
- 安装完成后运行校验脚本确认一切正常:
101
+ ## 校验
206
102
 
207
103
  ```bash
208
104
  ./scripts/validate-skills.sh --ci
209
105
  ```
210
106
 
211
- 通过后输出 `SUCCESS: all validations passed`,共 8 项检查全部 PASS。
212
-
213
- ---
214
-
215
- ## 设计理念
216
-
217
- ### 为什么做跨工具 Skill 通用化
218
-
219
- 当前 80 个 SKILL.md 以 Claude Code marketplace 为原生格式(`plugins/<plugin>/skills/<name>/SKILL.md`),在 Codex、OpenCode 等工具中无法直接加载。各工具的 skill 发现机制不同:
220
-
221
- | 工具 | 发现路径 | 命名方式 |
222
- |------|---------|----------|
223
- | Claude Code | `plugins/<plugin>/skills/<name>/SKILL.md` | 插件层作用域 |
224
- | OpenCode | `.agents/skills/<name>/SKILL.md` | 全局扁平 |
225
- | Codex | `.agents/skills/<name>/SKILL.md` | 全局扁平 |
226
-
227
- **核心思路**:devflow-skills 作为唯一起源(single source of truth),不修改 80 个 SKILL.md 正文内容,通过适配层脚本(adapter scripts)为各工具生成各自的兼容产物。
228
-
229
- ### 关键设计决策
230
-
231
- #### D1:统一标准 — 采用 agentskills.io 规范
232
-
233
- [agentskills.io](https://agentskills.io/specification) 是 Open Agent Skills Standard,Codex 原生内置、OpenCode 兼容支持。格式要求为 YAML frontmatter(`name` + `description` 必填)+ Markdown 正文。当前 80 个 SKILL.md 全部使用此格式,零修改即兼容核心要求。
234
-
235
- 选择理由:
236
- - 已被业界采纳(Codex 原生、OpenCode 兼容),非私有标准
237
- - 格式简洁(两个必填字段 + 可选扩展),与现有 SKILL.md 完全兼容
238
- - 有明确的命名正则约束(`^[a-z0-9]+(-[a-z0-9]+)*$`),保证跨工具一致性
239
-
240
- #### D2:命名策略 — `<plugin>-<name>` 扁平化
241
-
242
- Claude Code 按插件分层(`req/dev`、`api/search`),名字无需全局唯一。但 OpenCode/Codex 是全局扁平名字空间。采用 `<plugin>-<name>` 前缀方案(如 `req-dev`、`api-search`):
243
-
244
- - **全局唯一**:多个插件下的重名技能(如 `help`、`init`、`new`)加上前缀后自然去重(`req-help` vs `api-help` vs `pm-help`)
245
- - **可读性强**:一眼可知技能所属插件
246
- - **符合 agentskills.io 正则**:全部由小写字母、数字、连字符组成
247
-
248
- 命名变更在适配层处理(复制时通过 `sed` 更新 frontmatter `name` 字段),源头 SKILL.md 正文不动。
249
-
250
- #### D3:适配路径 — `.agents/skills/` 作为三工具最大公约数
251
-
252
- OpenCode 和 Codex 均原生扫描 `.agents/skills/`,且 OpenCode 也兼容 `.claude/skills/`。选择 `.agents/skills/` 作为适配器统一输出路径,确保:
253
- - OpenCode 和 Codex 零配置可用
254
- - Claude Code 仍通过 `plugins/*/skills/` 加载(setup-claude.sh 直接 copy,不使用 `.agents/skills/`)
255
-
256
- #### D4:不修改源头 SKILL.md
257
-
258
- 80 个 SKILL.md 始终保持原样,所有跨工具适配(name 扁平化、路径重组)都在适配器脚本的复制过程中完成。好处:
259
- - 源头文件干净、可独立维护
260
- - 各工具适配逻辑独立,互不干扰
261
- - CI 校验只需对源头文件生效
262
-
263
- ### 架构总览
264
-
265
- ```
266
- ┌────────────────────┐
267
- │ devflow-skills │ ← 唯一起源
268
- │ plugins/<plugin>/ │ 80 个 SKILL.md
269
- │ skills/<name>/ │ 零修改
270
- │ SKILL.md │
271
- │ skill-bindings.json│
272
- └────────┬───────────┘
273
-
274
- ┌─────────────┼─────────────┐
275
- ▼ ▼ ▼
276
- ┌───────────┐ ┌───────────┐ ┌───────────┐
277
- │ Claude │ │ OpenCode │ │ Codex │
278
- │ Adapter │ │ Adapter │ │ Adapter │
279
- └─────┬─────┘ └─────┬─────┘ └─────┬─────┘
280
- ▼ ▼ ▼
281
- plugins/*/skills/ .agents/skills/ .agents/skills/
282
- (分层插件结构) (扁平前缀命名) (扁平前缀命名)
283
- ```
284
-
285
- ---
107
+ 检查项:SKILL.md frontmatter 完整性、name 字段合规、skill-bindings.json 交叉引用一致性。
286
108
 
287
109
  ## 许可证
288
110