yunxiao-code 1.2.1 → 1.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 +124 -216
- package/bin/yx-code +0 -0
- package/claude-plugin/skills/yx-commands/SKILL.md +12 -2
- package/claude-plugin/skills/yx-commands-summary/SKILL.md +303 -0
- package/claude-plugin/skills/yx-commands-workitems/SKILL.md +68 -0
- package/package.json +13 -6
- package/scripts/postinstall.js +4 -2
package/README.md
CHANGED
|
@@ -1,311 +1,219 @@
|
|
|
1
|
-
# yx-
|
|
1
|
+
# yx-commands
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
阿里云云效代码仓库 yx-commands Skills,基于 [Agent Skills](https://agentskills.io/) 开放标准,让 Claude Code、Cursor 等 AI 编程工具可以自动完成代码提交、推送、创建合并请求、工作项查询和工作总结等开发工作流。
|
|
4
4
|
|
|
5
5
|
## 功能特性
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
7
|
+
- 🤖 **智能提交** - AI 分析代码变更,自动生成 commit message
|
|
8
|
+
- 📤 **自动推送** - 推送当前分支到远程仓库
|
|
9
|
+
- 🔀 **创建 MR** - 自动创建合并请求,默认目标分支 develop
|
|
10
|
+
- 📊 **代码审查** - 查看分支间的代码差异统计
|
|
11
|
+
- ⚡ **一键工作流** - 提交 → 推送 → 创建 MR 一条龙完成
|
|
12
|
+
- 📋 **工作项查询** - 列出我负责或参与的工作项,支持状态/角色/项目过滤
|
|
13
|
+
- 📈 **工作总结** - 生成周报/月报/季报/年报,支持 JSON 输出供 AI 分析
|
|
13
14
|
|
|
14
15
|
## 安装
|
|
15
16
|
|
|
16
|
-
### npm 安装(推荐)
|
|
17
|
-
|
|
18
17
|
```bash
|
|
19
18
|
npm install -g yunxiao-code
|
|
20
19
|
```
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
- macOS (Intel/Apple Silicon)
|
|
24
|
-
- Linux (x64)
|
|
25
|
-
|
|
26
|
-
### 从源码编译
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
git clone https://github.com/ZLStream/yunxiao-code.git
|
|
30
|
-
cd yunxiao-code
|
|
31
|
-
make build-local
|
|
32
|
-
sudo make install
|
|
33
|
-
```
|
|
21
|
+
安装后自动部署 skill 到 `~/.claude/skills/`,Claude Code 和 Cursor 会自动加载。
|
|
34
22
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
go build -o yx-code ./cmd/yx-code
|
|
39
|
-
sudo mv yx-code /usr/local/bin/
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
#### 安装 AI Agent 插件(可选)
|
|
43
|
-
|
|
44
|
-
如需使用斜杠命令,手动为每个 skill 创建软链接:
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
for dir in claude-plugin/skills/*/; do
|
|
48
|
-
ln -s "$(pwd)/$dir" ~/.claude/skills/"$(basename $dir)"
|
|
49
|
-
done
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
安装后可在 Claude Code 或 Cursor Agent 中使用:
|
|
53
|
-
- `/yx-commands-commit` - 分析代码变更并提交
|
|
54
|
-
- `/yx-commands-push` - 推送代码
|
|
55
|
-
- `/yx-commands-mr` - 创建合并请求
|
|
56
|
-
- `/yx-commands-review` - 查看代码差异
|
|
57
|
-
- `/yx-commands-commit-push-mr` - 一键完成完整工作流
|
|
58
|
-
|
|
59
|
-
## 系统要求
|
|
60
|
-
|
|
61
|
-
- Go 1.26.1+(从源码编译时)
|
|
62
|
-
- Git CLI(运行时依赖)
|
|
63
|
-
- Node.js 14+(npm 安装时)
|
|
23
|
+
支持平台:macOS (Intel/Apple Silicon)、Linux (x64)
|
|
64
24
|
|
|
65
25
|
## 快速开始
|
|
66
26
|
|
|
67
|
-
###
|
|
27
|
+
### 初始化配置
|
|
68
28
|
|
|
69
29
|
```bash
|
|
70
30
|
yx-code init
|
|
71
31
|
```
|
|
72
32
|
|
|
73
|
-
|
|
33
|
+
在 `~/.yunxiao/config.yaml` 生成全局配置文件,填写 `organization_id` 和 `token`:
|
|
74
34
|
|
|
75
35
|
```yaml
|
|
76
|
-
# 云效合并请求 CLI 配置
|
|
77
36
|
domain: openapi-rdc.aliyuncs.com
|
|
78
|
-
organization_id: ""
|
|
79
|
-
token: ""
|
|
37
|
+
organization_id: "你的组织ID"
|
|
38
|
+
token: "你的个人访问令牌"
|
|
80
39
|
```
|
|
81
40
|
|
|
82
|
-
填写 `organization_id` 和 `token`(个人访问令牌)。
|
|
83
|
-
|
|
84
41
|
> **获取 Token**: 云效控制台 → 个人设置 → 个人访问令牌 → 创建令牌
|
|
85
42
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
| 字段 | 说明 | 默认值 |
|
|
89
|
-
|------|------|--------|
|
|
90
|
-
| `domain` | 云效 API 域名 | `openapi-rdc.aliyuncs.com` |
|
|
91
|
-
| `organization_id` | 组织 ID(必填) | 无 |
|
|
92
|
-
| `token` | 个人访问令牌(必填) | 无 |
|
|
43
|
+
> **user_id 无需手动配置**,首次使用工作项功能时会通过 token 自动获取并缓存。
|
|
93
44
|
|
|
94
|
-
###
|
|
45
|
+
### 一键提交(推荐)
|
|
95
46
|
|
|
96
|
-
|
|
47
|
+
开发完成后,直接输入:
|
|
97
48
|
|
|
98
|
-
```bash
|
|
99
|
-
export YUNXIAO_DOMAIN="openapi-rdc.aliyuncs.com"
|
|
100
|
-
export YUNXIAO_ORGANIZATION_ID="your-org-id"
|
|
101
|
-
export YUNXIAO_TOKEN="your-token"
|
|
102
49
|
```
|
|
103
|
-
|
|
104
|
-
### 4. 配置优先级(从低到高)
|
|
105
|
-
|
|
106
|
-
1. 默认值
|
|
107
|
-
2. `.yunxiao.yaml` 配置文件(从当前目录向上逐级查找)
|
|
108
|
-
3. 环境变量:`YUNXIAO_DOMAIN`、`YUNXIAO_ORGANIZATION_ID`、`YUNXIAO_TOKEN`
|
|
109
|
-
4. CLI 参数:`--domain`、`--org`、`--token`
|
|
110
|
-
|
|
111
|
-
## 命令参考
|
|
112
|
-
|
|
113
|
-
### yx-code init
|
|
114
|
-
|
|
115
|
-
初始化云效配置文件。
|
|
116
|
-
|
|
117
|
-
```bash
|
|
118
|
-
yx-code init
|
|
50
|
+
/yx-commands-commit-push-mr
|
|
119
51
|
```
|
|
120
52
|
|
|
121
|
-
|
|
53
|
+
AI 自动完成:分析变更 → 提交 → 推送 → 创建 MR
|
|
122
54
|
|
|
123
|
-
|
|
55
|
+
### 生成周报
|
|
124
56
|
|
|
125
|
-
```
|
|
126
|
-
yx-
|
|
57
|
+
```
|
|
58
|
+
/yx-commands-summary
|
|
127
59
|
```
|
|
128
60
|
|
|
129
|
-
|
|
130
|
-
|------|------|------|------|
|
|
131
|
-
| `<git-url>` | | 是 | Git 仓库地址 |
|
|
132
|
-
| `--branch` | `-b` | 否 | 新分支名称,指定后会从主分支创建新分支 |
|
|
133
|
-
| `--path` | `-p` | 否 | 克隆目标路径,默认从 URL 提取仓库名 |
|
|
61
|
+
AI 获取工作项数据,自动生成工作总结。
|
|
134
62
|
|
|
135
|
-
|
|
136
|
-
# 基本克隆
|
|
137
|
-
yx-code clone https://codeup.aliyun.com/your-org/your-repo.git
|
|
63
|
+
## Skill 命令
|
|
138
64
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
65
|
+
| 命令 | 功能 | 使用场景 |
|
|
66
|
+
|------|------|----------|
|
|
67
|
+
| `/yx-commands-commit` | 智能提交 | AI 分析变更生成 commit message |
|
|
68
|
+
| `/yx-commands-push` | 推送代码 | 推送当前分支到远程 |
|
|
69
|
+
| `/yx-commands-mr` | 创建 MR | 创建合并请求(默认目标 develop) |
|
|
70
|
+
| `/yx-commands-review` | 代码审查 | 查看分支差异统计 |
|
|
71
|
+
| `/yx-commands-commit-push-mr` | 完整工作流 | 一键完成提交、推送、创建 MR |
|
|
72
|
+
| `/yx-commands-workitems` | 查询工作项 | 列出我负责/参与的工作项 |
|
|
73
|
+
| `/yx-commands-summary` | 工作总结 | 生成周报/月报/季报/年报 |
|
|
142
74
|
|
|
143
|
-
|
|
75
|
+
## 典型工作流
|
|
144
76
|
|
|
145
|
-
|
|
77
|
+
### 一键完成
|
|
146
78
|
|
|
147
|
-
```bash
|
|
148
|
-
yx-code commit -m "<message>"
|
|
149
79
|
```
|
|
150
|
-
|
|
151
|
-
| 参数 | 简写 | 必填 | 说明 |
|
|
152
|
-
|------|------|------|------|
|
|
153
|
-
| `--message` | `-m` | 是 | 提交信息 |
|
|
154
|
-
|
|
155
|
-
```bash
|
|
156
|
-
yx-code commit -m "feat: 添加用户登录功能"
|
|
80
|
+
/yx-commands-commit-push-mr
|
|
157
81
|
```
|
|
158
82
|
|
|
159
|
-
|
|
83
|
+
AI 会自动:
|
|
84
|
+
1. 分析代码变更,生成 commit message
|
|
85
|
+
2. 执行 `git add .` 和 `git commit`
|
|
86
|
+
3. 推送到远程仓库
|
|
87
|
+
4. 创建合并请求
|
|
160
88
|
|
|
161
|
-
|
|
89
|
+
### 分步执行
|
|
162
90
|
|
|
163
|
-
```
|
|
164
|
-
yx-
|
|
91
|
+
```
|
|
92
|
+
/yx-commands-commit → AI 分析变更并提交
|
|
93
|
+
/yx-commands-push → 推送到远程
|
|
94
|
+
/yx-commands-mr → 创建合并请求
|
|
165
95
|
```
|
|
166
96
|
|
|
167
|
-
###
|
|
97
|
+
### 代码审查
|
|
168
98
|
|
|
169
|
-
|
|
99
|
+
查看当前分支与目标分支的差异:
|
|
170
100
|
|
|
171
|
-
```
|
|
172
|
-
yx-
|
|
101
|
+
```
|
|
102
|
+
/yx-commands-review
|
|
173
103
|
```
|
|
174
104
|
|
|
175
|
-
|
|
176
|
-
|------|------|------|------|
|
|
177
|
-
| `--message` | `-m` | 是 | MR 标题 |
|
|
178
|
-
| `--description` | `-d` | 否 | MR 描述 |
|
|
179
|
-
| `--target` | `-t` | 否 | 目标分支,默认: develop |
|
|
105
|
+
### 工作总结
|
|
180
106
|
|
|
181
107
|
```bash
|
|
182
|
-
#
|
|
183
|
-
yx-
|
|
108
|
+
# 交互式选择时间范围
|
|
109
|
+
/yx-commands-summary
|
|
184
110
|
|
|
185
|
-
#
|
|
186
|
-
yx-code
|
|
111
|
+
# 指定时间周期
|
|
112
|
+
yx-code summary --period week # 本周
|
|
113
|
+
yx-code summary --period month # 本月
|
|
114
|
+
yx-code summary --period quarter # 本季度
|
|
115
|
+
yx-code summary --period year # 本年
|
|
187
116
|
|
|
188
|
-
#
|
|
189
|
-
yx-code
|
|
190
|
-
```
|
|
117
|
+
# 自定义时间范围
|
|
118
|
+
yx-code summary --start 2024-01-01 --end 2024-03-31
|
|
191
119
|
|
|
192
|
-
|
|
120
|
+
# JSON 格式输出(AI 友好)
|
|
121
|
+
yx-code summary --period month --json
|
|
122
|
+
```
|
|
193
123
|
|
|
194
|
-
|
|
124
|
+
### 工作项查询
|
|
195
125
|
|
|
196
126
|
```bash
|
|
197
|
-
|
|
198
|
-
|
|
127
|
+
# 列出我负责的进行中工作项(默认)
|
|
128
|
+
yx-code workitems
|
|
199
129
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
| `--source` | `-s` | 否 | 源分支,默认: 当前分支 |
|
|
130
|
+
# 按角色和状态过滤
|
|
131
|
+
yx-code workitems --role participated --status all
|
|
132
|
+
yx-code workitems --role assigned --status done
|
|
204
133
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
yx-code diff
|
|
134
|
+
# 指定项目
|
|
135
|
+
yx-code workitems --project <项目标识符>
|
|
208
136
|
|
|
209
|
-
#
|
|
210
|
-
yx-code
|
|
137
|
+
# JSON 格式输出
|
|
138
|
+
yx-code workitems --json
|
|
211
139
|
```
|
|
212
140
|
|
|
213
|
-
|
|
141
|
+
## 配置
|
|
214
142
|
|
|
215
|
-
|
|
143
|
+
### 配置文件
|
|
216
144
|
|
|
217
|
-
|
|
218
|
-
|
|
145
|
+
配置统一存放在 `~/.yunxiao/config.yaml`:
|
|
146
|
+
|
|
147
|
+
```yaml
|
|
148
|
+
domain: openapi-rdc.aliyuncs.com
|
|
149
|
+
organization_id: "你的组织ID"
|
|
150
|
+
token: "你的个人访问令牌"
|
|
151
|
+
user_id: "" # 自动获取,无需手动填写
|
|
219
152
|
```
|
|
220
153
|
|
|
221
|
-
|
|
|
222
|
-
|
|
223
|
-
|
|
|
224
|
-
|
|
|
225
|
-
|
|
|
154
|
+
| 字段 | 说明 | 默认值 |
|
|
155
|
+
|------|------|--------|
|
|
156
|
+
| `domain` | 云效 API 域名 | `openapi-rdc.aliyuncs.com` |
|
|
157
|
+
| `organization_id` | 组织 ID(必填) | 无 |
|
|
158
|
+
| `token` | 个人访问令牌(必填) | 无 |
|
|
159
|
+
| `user_id` | 用户 ID | 自动获取 |
|
|
226
160
|
|
|
227
|
-
|
|
161
|
+
### 环境变量
|
|
228
162
|
|
|
229
163
|
```bash
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
# 2. 克隆仓库并创建特性分支
|
|
235
|
-
yx-code clone https://codeup.aliyun.com/org/repo.git -b feature/login
|
|
164
|
+
export YUNXIAO_ORGANIZATION_ID="your-org-id"
|
|
165
|
+
export YUNXIAO_TOKEN="your-token"
|
|
166
|
+
```
|
|
236
167
|
|
|
237
|
-
|
|
238
|
-
cd repo
|
|
168
|
+
### 配置优先级(从低到高)
|
|
239
169
|
|
|
240
|
-
|
|
241
|
-
|
|
170
|
+
1. 默认值
|
|
171
|
+
2. `~/.yunxiao/config.yaml` 全局配置文件
|
|
172
|
+
3. 环境变量:`YUNXIAO_DOMAIN`、`YUNXIAO_ORGANIZATION_ID`、`YUNXIAO_TOKEN`、`YUNXIAO_USER_ID`
|
|
173
|
+
4. CLI 参数:`--domain`、`--org`、`--token`
|
|
242
174
|
|
|
243
|
-
|
|
244
|
-
yx-code push
|
|
175
|
+
## CLI 命令
|
|
245
176
|
|
|
246
|
-
|
|
247
|
-
yx-code mr -m "添加用户登录功能"
|
|
177
|
+
Skill 底层通过 `yx-code` CLI 与云效 API 交互:
|
|
248
178
|
|
|
249
|
-
|
|
250
|
-
yx-code
|
|
179
|
+
```bash
|
|
180
|
+
yx-code init # 初始化配置 (~/.yunxiao/config.yaml)
|
|
181
|
+
yx-code clone <url> -b <branch> # 克隆仓库并创建分支
|
|
182
|
+
yx-code commit -m "msg" # 提交代码
|
|
183
|
+
yx-code push # 推送代码
|
|
184
|
+
yx-code mr -m "title" # 创建合并请求
|
|
185
|
+
yx-code diff # 查看代码差异
|
|
186
|
+
yx-code workitems # 列出工作项
|
|
187
|
+
yx-code summary --period week # 生成工作总结
|
|
251
188
|
```
|
|
252
189
|
|
|
253
|
-
##
|
|
254
|
-
|
|
255
|
-
本工具基于 [Agent Skills](https://agentskills.io/) 开放标准,兼容 Claude Code、Cursor 等支持该标准的 AI 编程工具,可通过斜杠命令自动化云效工作流。
|
|
256
|
-
|
|
257
|
-
### 兼容性
|
|
190
|
+
## 兼容性
|
|
258
191
|
|
|
259
192
|
| 工具 | 支持 | 说明 |
|
|
260
193
|
|------|------|------|
|
|
261
|
-
| [Claude Code](https://claude.ai/code) | ✅ |
|
|
262
|
-
| [Cursor](https://cursor.com) | ✅ |
|
|
263
|
-
|
|
264
|
-
### 可用命令
|
|
265
|
-
|
|
266
|
-
| 命令 | 功能 |
|
|
267
|
-
|------|------|
|
|
268
|
-
| `/yx-commands-commit` | 分析代码变更并提交 |
|
|
269
|
-
| `/yx-commands-push` | 推送代码到远程 |
|
|
270
|
-
| `/yx-commands-mr` | 创建合并请求 |
|
|
271
|
-
| `/yx-commands-review` | 查看分支代码差异 |
|
|
272
|
-
| `/yx-commands-commit-push-mr` | 一键完成提交、推送、创建MR |
|
|
273
|
-
|
|
274
|
-
### 使用示例
|
|
275
|
-
|
|
276
|
-
在 Claude Code 或 Cursor Agent 中直接输入命令:
|
|
277
|
-
|
|
278
|
-
```
|
|
279
|
-
/yx-commands-commit-push-mr
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
AI 会自动:
|
|
283
|
-
1. 分析代码变更
|
|
284
|
-
2. 生成 commit message
|
|
285
|
-
3. 执行 commit、push
|
|
286
|
-
4. 创建合并请求
|
|
194
|
+
| [Claude Code](https://claude.ai/code) | ✅ | 原生支持 Agent Skills |
|
|
195
|
+
| [Cursor](https://cursor.com) | ✅ | 兼容 `~/.claude/skills/` 目录 |
|
|
287
196
|
|
|
288
|
-
|
|
197
|
+
## 从源码安装
|
|
289
198
|
|
|
290
|
-
|
|
199
|
+
```bash
|
|
200
|
+
git clone https://github.com/ZLStream/yunxiao-commands.git
|
|
201
|
+
cd yunxiao-commands
|
|
202
|
+
make build-local
|
|
203
|
+
sudo make install
|
|
291
204
|
|
|
205
|
+
# 手动链接 skills
|
|
206
|
+
for dir in claude-plugin/skills/*/; do
|
|
207
|
+
ln -s "$(pwd)/$dir" ~/.claude/skills/"$(basename $dir)"
|
|
208
|
+
done
|
|
292
209
|
```
|
|
293
|
-
~/.claude/skills/
|
|
294
|
-
├── yx-commands/ ← 主 skill(工作流路由)
|
|
295
|
-
├── yx-commands-commit/ ← 提交命令
|
|
296
|
-
├── yx-commands-push/ ← 推送命令
|
|
297
|
-
├── yx-commands-mr/ ← 创建 MR
|
|
298
|
-
├── yx-commands-review/ ← 代码审查
|
|
299
|
-
└── yx-commands-commit-push-mr/ ← 一键完整工作流
|
|
300
|
-
```
|
|
301
|
-
|
|
302
|
-
Cursor 会自动从 `~/.claude/skills/` 加载,无需额外配置。
|
|
303
210
|
|
|
304
211
|
## 相关链接
|
|
305
212
|
|
|
213
|
+
- [Agent Skills 标准](https://agentskills.io/)
|
|
306
214
|
- [阿里云云效官方文档](https://help.aliyun.com/zh/yunxiao/)
|
|
307
215
|
- [云效 OpenAPI 文档](https://help.aliyun.com/zh/yunxiao/developer-reference/)
|
|
308
216
|
|
|
309
217
|
## License
|
|
310
218
|
|
|
311
|
-
MIT
|
|
219
|
+
MIT
|
package/bin/yx-code
CHANGED
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: yx-commands
|
|
3
|
-
description: 阿里云云效(codeup)代码仓库工作流自动化。功能包括:智能提交代码、推送、创建MR(合并请求)
|
|
3
|
+
description: 阿里云云效(codeup)代码仓库工作流自动化。功能包括:智能提交代码、推送、创建MR(合并请求)、代码审查、分支差异对比、工作项查询、工作总结生成。触发场景:用户提到云效、codeup、阿里云代码仓库、yx-code工具;git地址以git@codeup.aliyun.com开头;需要提交代码并创建MR;说"提交合并"触发完整工作流;说"工作总结""周报""月报"触发总结功能。注意:github相关操作或纯git命令不要使用此技能。
|
|
4
4
|
tools: Bash, Read
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -31,6 +31,8 @@ tools: Bash, Read
|
|
|
31
31
|
| `/yx-commands-mr` | 创建 MR | 提交合并请求(默认 develop) |
|
|
32
32
|
| `/yx-commands-review` | 代码审查 | 查看分支差异 |
|
|
33
33
|
| `/yx-commands-commit-push-mr` | 完整工作流 | 一键完成提交、推送、创建MR |
|
|
34
|
+
| `/yx-commands-workitems` | 查询工作项 | 列出我负责/参与的工作项 |
|
|
35
|
+
| `/yx-commands-summary` | 工作总结 | 生成周报/月报/季报/年报 |
|
|
34
36
|
|
|
35
37
|
## 典型工作流
|
|
36
38
|
|
|
@@ -53,7 +55,15 @@ tools: Bash, Read
|
|
|
53
55
|
/yx-commands-review -t develop -s feature-branch
|
|
54
56
|
```
|
|
55
57
|
|
|
58
|
+
### 工作总结
|
|
59
|
+
```
|
|
60
|
+
/yx-commands-summary → 交互式选择时间范围
|
|
61
|
+
/yx-commands-summary --period month → 本月总结
|
|
62
|
+
/yx-commands-workitems → 查看当前进行中工作项
|
|
63
|
+
```
|
|
64
|
+
|
|
56
65
|
## 前置条件
|
|
57
66
|
|
|
58
67
|
- 已安装 `yx-code` CLI 工具
|
|
59
|
-
- `yx-code` 在系统 PATH 中可用
|
|
68
|
+
- `yx-code` 在系统 PATH 中可用
|
|
69
|
+
- 已运行 `yx-code init` 完成配置(`~/.yunxiao/config.yaml`)
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: yx-commands-summary
|
|
3
|
+
description: 生成云效工作项总结,支持按周/月/季度/年或自定义时间范围,同时汇总本地云效仓库的 git 提交记录
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
生成指定时间范围内的工作总结(含需求、任务、缺陷 + git 提交记录),适合写周报、月报或绩效总结。
|
|
7
|
+
|
|
8
|
+
**AI 生成工作总结的完整流程:**
|
|
9
|
+
|
|
10
|
+
## 第一步:确定时间范围
|
|
11
|
+
|
|
12
|
+
根据用户请求确定 `START_DATE` 和 `END_DATE`(格式 `YYYY-MM-DD`),例如本月:
|
|
13
|
+
- START_DATE = 本月第一天
|
|
14
|
+
- END_DATE = 今天
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 第二步:获取云效工作项
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
yx-code summary --start <START_DATE> --end <END_DATE> --json
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
也可使用预设周期:
|
|
25
|
+
```bash
|
|
26
|
+
yx-code summary --period week --json # 本周
|
|
27
|
+
yx-code summary --period month --json # 本月
|
|
28
|
+
yx-code summary --period quarter --json # 本季度
|
|
29
|
+
yx-code summary --period year --json # 本年
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**参数说明:**
|
|
33
|
+
|
|
34
|
+
| 参数 | 说明 | 可选值 | 默认值 |
|
|
35
|
+
|------|------|--------|--------|
|
|
36
|
+
| `--period` / `-p` | 时间周期 | week/month/quarter/year | 交互提示 |
|
|
37
|
+
| `--start` | 开始日期 | YYYY-MM-DD 格式 | - |
|
|
38
|
+
| `--end` | 结束日期 | YYYY-MM-DD 格式 | 今天 |
|
|
39
|
+
| `--status` / `-s` | 状态过滤 | all(默认)/ undone(排除已完成)/ 中文状态名 | all |
|
|
40
|
+
| `--json` | JSON 格式输出 | - | false |
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## 第三步:扫描本地云效 git 仓库并收集提交记录
|
|
45
|
+
|
|
46
|
+
**3.1 获取 git 用户名**
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
git config --global user.name
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**3.2 扫描所有 remote 指向 codeup.aliyun.com 的本地仓库**
|
|
53
|
+
|
|
54
|
+
在常见代码目录中查找,深度限制 5 层,并通过项目根目录 mtime 预过滤,跳过时间范围内未活动的仓库:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
for gitdir in $(find ~/IdeaProjects ~/Projects ~/code ~/workspace ~/repos ~/src ~/dev ~/work ~/Documents/code 2>/dev/null -maxdepth 5 -name ".git" -type d); do
|
|
58
|
+
repo=$(dirname "$gitdir")
|
|
59
|
+
# 1. mtime 预过滤:项目根目录在时间范围内未被修改则跳过(纯文件系统操作,无需启动 git)
|
|
60
|
+
if ! find "$repo" -maxdepth 0 -newermt "<START_DATE>" 2>/dev/null | grep -q .; then
|
|
61
|
+
continue
|
|
62
|
+
fi
|
|
63
|
+
# 2. 检查 remote 是否为云效仓库
|
|
64
|
+
if git -C "$repo" remote -v 2>/dev/null | grep -q "codeup.aliyun.com"; then
|
|
65
|
+
echo "$repo"
|
|
66
|
+
fi
|
|
67
|
+
done
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
> - 项目根目录 mtime 在任何文件编辑、IDE 打开等操作时均会更新,比 `.git/` 内部文件更灵敏
|
|
71
|
+
> - mtime 检查为纯文件系统操作,优先于需要启动 git 进程的 remote URL 检查
|
|
72
|
+
> - 某个目录不存在时 `2>/dev/null` 静默跳过,不影响其他目录扫描
|
|
73
|
+
|
|
74
|
+
**3.3 对每个仓库查询时间范围内的 commit**
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
git -C <repo_path> log \
|
|
78
|
+
--after="<START_DATE> 00:00:00" \
|
|
79
|
+
--before="<END_DATE> 23:59:59" \
|
|
80
|
+
--author="<用户名>" \
|
|
81
|
+
--format="%h|%s|%ai" \
|
|
82
|
+
--no-merges
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
从 remote URL 提取仓库名作为展示标识:
|
|
86
|
+
```bash
|
|
87
|
+
git -C <repo_path> remote get-url origin
|
|
88
|
+
# git@codeup.aliyun.com:org/repo-name.git → 取最后一段去掉 .git → repo-name
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## 第四步:整合展示
|
|
94
|
+
|
|
95
|
+
将云效工作项和 git 提交记录合并为以下结构:
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
## 工作总结(2024-03-01 ~ 2024-03-31)
|
|
99
|
+
|
|
100
|
+
### 云效工作项(N 项)
|
|
101
|
+
|
|
102
|
+
**总计:N 项**(需求 X 项 / 任务 Y 项 / 缺陷 Z 项)
|
|
103
|
+
|
|
104
|
+
#### 需求(X 项)
|
|
105
|
+
| 编号 | 标题 | 状态 | 优先级 | 所在项目 | 创建日期 |
|
|
106
|
+
|------|------|------|--------|----------|----------|
|
|
107
|
+
| XJHS-1898 | 太保:兼容团险网点人员 | 已上线 | 中 | 芯计划书 | 2024-03-10 |
|
|
108
|
+
|
|
109
|
+
#### 任务(Y 项)
|
|
110
|
+
...
|
|
111
|
+
|
|
112
|
+
#### 缺陷(Z 项)
|
|
113
|
+
...
|
|
114
|
+
|
|
115
|
+
#### 按项目汇总
|
|
116
|
+
| 项目 | 工作项数 |
|
|
117
|
+
|------|----------|
|
|
118
|
+
| 展业赋能 | 7 |
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
### Git 提交记录(共 N 次提交,涉及 R 个仓库)
|
|
123
|
+
|
|
124
|
+
#### 仓库:repo-a(M 次提交)
|
|
125
|
+
| 提交哈希 | 提交信息 | 日期 |
|
|
126
|
+
|----------|----------|------|
|
|
127
|
+
| a1b2c3d | feat: 新增XX功能 | 2024-03-15 |
|
|
128
|
+
|
|
129
|
+
#### 仓库:repo-b(K 次提交)
|
|
130
|
+
| 提交哈希 | 提交信息 | 日期 |
|
|
131
|
+
|----------|----------|------|
|
|
132
|
+
| e4f5g6h | fix: 修复登录问题 | 2024-03-20 |
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
### 综合统计
|
|
137
|
+
| 维度 | 数量 |
|
|
138
|
+
|------|------|
|
|
139
|
+
| 云效工作项 | X 项 |
|
|
140
|
+
| Git 提交 | Y 次 |
|
|
141
|
+
| 涉及云效项目 | Z 个 |
|
|
142
|
+
| 涉及代码仓库 | R 个 |
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**展示规则:**
|
|
146
|
+
- 云效工作项按 `category` 字段分组:`Req`=需求、`Task`=任务、`Bug`=缺陷,无数据的类别跳过
|
|
147
|
+
- 标题超过 30 字时截断并加"..."
|
|
148
|
+
- 若 `parent_id` 非空,在标题后附注"(子项)"
|
|
149
|
+
- 优先级为空时显示"-"
|
|
150
|
+
- Git 提交按仓库分组,同一仓库内按日期倒序
|
|
151
|
+
- 未找到任何 codeup 仓库时,跳过 Git 部分
|
|
152
|
+
- yx-code 未安装时,跳过云效工作项部分
|
|
153
|
+
- 如需进一步分析,可请求:"根据以上数据,帮我写一份适合汇报给领导的月度总结"
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## 第五步:选择总结模板
|
|
158
|
+
|
|
159
|
+
根据汇报场景选择合适的模板,将第四步的数据重新组织:
|
|
160
|
+
|
|
161
|
+
### 模板一:周报(简洁高效型)
|
|
162
|
+
|
|
163
|
+
**适用场景**:每周团队例会、直属领导汇报
|
|
164
|
+
|
|
165
|
+
```markdown
|
|
166
|
+
## 周报(YYYY-MM-DD ~ YYYY-MM-DD)
|
|
167
|
+
|
|
168
|
+
### 本周完成
|
|
169
|
+
1. **[项目/需求名称]** - 简要描述完成内容及成果
|
|
170
|
+
- 具体工作点1
|
|
171
|
+
- 具体工作点2
|
|
172
|
+
|
|
173
|
+
2. **[问题修复]** - 描述修复的问题和影响范围
|
|
174
|
+
|
|
175
|
+
### 进行中
|
|
176
|
+
- **[任务名称]** - 当前进度(XX%),预计完成时间
|
|
177
|
+
|
|
178
|
+
### 下周计划
|
|
179
|
+
1. [计划事项1]
|
|
180
|
+
2. [计划事项2]
|
|
181
|
+
|
|
182
|
+
### 风险与阻塞
|
|
183
|
+
- [如有风险或需要协调的事项]
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**生成要点**:
|
|
187
|
+
- 从已完成的云效工作项中提取"本周完成"
|
|
188
|
+
- 从待处理/进行中的工作项提取"进行中"
|
|
189
|
+
- Git 提交作为具体工作点的佐证
|
|
190
|
+
- 保持简洁,每项 1-2 行
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
### 模板二:季度总结(成果导向型)
|
|
195
|
+
|
|
196
|
+
**适用场景**:季度绩效评估、部门汇报
|
|
197
|
+
|
|
198
|
+
```markdown
|
|
199
|
+
## 202X年QX季度工作总结
|
|
200
|
+
|
|
201
|
+
### 一、核心成果
|
|
202
|
+
|
|
203
|
+
**1. [项目/业务线A]**
|
|
204
|
+
- 完成需求 X 项,修复缺陷 Y 个
|
|
205
|
+
- 关键成果1:描述业务价值
|
|
206
|
+
- 关键成果2:描述技术贡献
|
|
207
|
+
|
|
208
|
+
**2. [项目/业务线B]**
|
|
209
|
+
- ...
|
|
210
|
+
|
|
211
|
+
### 二、工作量统计
|
|
212
|
+
| 维度 | 数量 |
|
|
213
|
+
|------|------|
|
|
214
|
+
| 完成需求 | X 项 |
|
|
215
|
+
| 完成任务 | Y 项 |
|
|
216
|
+
| 修复缺陷 | Z 项 |
|
|
217
|
+
| 代码提交 | N 次 |
|
|
218
|
+
| 涉及项目 | M 个 |
|
|
219
|
+
|
|
220
|
+
### 三、技术亮点
|
|
221
|
+
- 亮点1:技术创新/性能优化/架构改进
|
|
222
|
+
- 亮点2:工具建设/效率提升
|
|
223
|
+
|
|
224
|
+
### 四、问题与改进
|
|
225
|
+
- 遇到的问题及解决方案
|
|
226
|
+
- 下季度改进方向
|
|
227
|
+
|
|
228
|
+
### 五、下季度规划
|
|
229
|
+
1. [重点事项1]
|
|
230
|
+
2. [重点事项2]
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
**生成要点**:
|
|
234
|
+
- 按项目/业务线分组,突出业务价值
|
|
235
|
+
- 统计数据要准确,用表格展示
|
|
236
|
+
- 技术亮点从 Git 提交中提取(feat/refactor/optimize)
|
|
237
|
+
- 问题与改进从缺陷工作项中提炼
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
### 模板三:年终总结(全面回顾型)
|
|
242
|
+
|
|
243
|
+
**适用场景**:年度绩效考核、晋升答辩、年终汇报
|
|
244
|
+
|
|
245
|
+
```markdown
|
|
246
|
+
## 202X年度工作总结
|
|
247
|
+
|
|
248
|
+
### 一、年度概览
|
|
249
|
+
|
|
250
|
+
> 一句话总结全年核心贡献
|
|
251
|
+
|
|
252
|
+
**年度数据看板**
|
|
253
|
+
| 维度 | 数量 |
|
|
254
|
+
|------|------|
|
|
255
|
+
| 完成需求 | X 项 |
|
|
256
|
+
| 完成任务 | Y 项 |
|
|
257
|
+
| 修复缺陷 | Z 项 |
|
|
258
|
+
| 代码提交 | N 次 |
|
|
259
|
+
| 参与项目 | M 个 |
|
|
260
|
+
|
|
261
|
+
### 二、重点项目回顾
|
|
262
|
+
|
|
263
|
+
**1. [项目名称](Q1-Q2)**
|
|
264
|
+
- 项目背景:简述业务背景和目标
|
|
265
|
+
- 我的贡献:具体负责的内容
|
|
266
|
+
- 成果与价值:上线效果、性能提升、用户反馈
|
|
267
|
+
|
|
268
|
+
**2. [项目名称](Q3-Q4)**
|
|
269
|
+
- ...
|
|
270
|
+
|
|
271
|
+
### 三、技术成长
|
|
272
|
+
- **技术栈扩展**:今年学习/应用的新技术
|
|
273
|
+
- **架构能力**:参与的系统设计、架构优化
|
|
274
|
+
- **工程效率**:工具建设、流程改进、文档沉淀
|
|
275
|
+
|
|
276
|
+
### 四、团队协作
|
|
277
|
+
- 跨团队协作项目
|
|
278
|
+
- 知识分享/技术分享
|
|
279
|
+
- 新人指导/Code Review
|
|
280
|
+
|
|
281
|
+
### 五、不足与反思
|
|
282
|
+
- 今年做得不够好的地方
|
|
283
|
+
- 改进措施和行动计划
|
|
284
|
+
|
|
285
|
+
### 六、明年规划
|
|
286
|
+
- **业务目标**:期望参与的重点项目
|
|
287
|
+
- **技术目标**:希望深入的技术方向
|
|
288
|
+
- **个人成长**:能力提升计划
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
**生成要点**:
|
|
292
|
+
- 按季度梳理重点项目,突出业务价值和个人贡献
|
|
293
|
+
- 技术成长需要结合 Git 提交中的技术关键词
|
|
294
|
+
- 不足与反思要真诚且有改进方案
|
|
295
|
+
- 明年规划要具体可执行
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
**使用方式**:
|
|
300
|
+
- 用户说"帮我写周报"→ 使用模板一
|
|
301
|
+
- 用户说"帮我写季度总结"→ 使用模板二
|
|
302
|
+
- 用户说"帮我写年终总结"→ 使用模板三
|
|
303
|
+
- 用户说"帮我写月报"→ 参考模板二,简化为月度维度
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: yx-commands-workitems
|
|
3
|
+
description: 列出云效工作项(我负责的,含需求、任务、缺陷)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
列出当前用户在云效中负责的工作项(需求、任务、缺陷)。用户 ID 会在首次运行时通过 token 自动获取并缓存。
|
|
7
|
+
|
|
8
|
+
**步骤:**
|
|
9
|
+
|
|
10
|
+
1. 列出我负责的未完成工作项(默认,按类别分组展示):
|
|
11
|
+
```bash
|
|
12
|
+
yx-code workitems
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
2. 按状态过滤:
|
|
16
|
+
```bash
|
|
17
|
+
# 列出所有状态的工作项
|
|
18
|
+
yx-code workitems --status all
|
|
19
|
+
|
|
20
|
+
# 列出指定中文状态的工作项
|
|
21
|
+
yx-code workitems --status 开发中
|
|
22
|
+
|
|
23
|
+
# 列出指定项目的工作项
|
|
24
|
+
yx-code workitems --project <项目标识符>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
3. 获取完整 JSON 数据(供 AI 整理展示):
|
|
28
|
+
```bash
|
|
29
|
+
yx-code workitems --json
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**参数说明:**
|
|
33
|
+
|
|
34
|
+
| 参数 | 说明 | 可选值 | 默认值 |
|
|
35
|
+
|------|------|--------|--------|
|
|
36
|
+
| `--status` / `-s` | 状态过滤 | undone(排除已完成)/ all / 中文状态名 | undone |
|
|
37
|
+
| `--project` / `-p` | 指定项目 | 项目标识符或名称 | 全部项目 |
|
|
38
|
+
| `--json` | JSON 格式输出 | - | false |
|
|
39
|
+
|
|
40
|
+
**AI 整理展示格式:**
|
|
41
|
+
|
|
42
|
+
当用户请求查看工作项时,执行 `yx-code workitems --json`,然后将 JSON 数据整理成以下格式展示:
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
## 我负责的工作项(未完成)
|
|
46
|
+
|
|
47
|
+
### 需求(N 项)
|
|
48
|
+
| 编号 | 标题 | 状态 | 优先级 | 创建人 | 所在项目 | 创建日期 |
|
|
49
|
+
|------|------|------|--------|--------|----------|----------|
|
|
50
|
+
| XJHS-1898 | 太保:兼容团险网点人员 | 处理中 | 中 | 谢思超 | 芯计划书 | 2024-11-26 |
|
|
51
|
+
|
|
52
|
+
### 任务(N 项)
|
|
53
|
+
| 编号 | 标题 | 状态 | 优先级 | 创建人 | 所在项目 | 创建日期 |
|
|
54
|
+
|------|------|------|--------|--------|----------|----------|
|
|
55
|
+
...
|
|
56
|
+
|
|
57
|
+
### 缺陷(N 项)
|
|
58
|
+
| 编号 | 标题 | 状态 | 优先级 | 创建人 | 所在项目 | 创建日期 |
|
|
59
|
+
|------|------|------|--------|--------|----------|----------|
|
|
60
|
+
...
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
规则:
|
|
64
|
+
- 按 category 字段分组:`Req`=需求、`Task`=任务、`Bug`=缺陷
|
|
65
|
+
- 若某类别无数据则跳过
|
|
66
|
+
- 标题过长时截断显示(保留前 30 个字符)
|
|
67
|
+
- 若 `parent_id` 非空,在标题后附注"(子项)"
|
|
68
|
+
- 优先级为空时显示"-"
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yunxiao-code",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "阿里云云效
|
|
3
|
+
"version": "1.3.1",
|
|
4
|
+
"description": "阿里云云效 Agent Skills,支持智能提交、工作项查询、工作总结等开发工作流",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"aliyun",
|
|
7
7
|
"阿里云",
|
|
@@ -9,15 +9,22 @@
|
|
|
9
9
|
"云效",
|
|
10
10
|
"CLI",
|
|
11
11
|
"git",
|
|
12
|
-
"代码"
|
|
12
|
+
"代码",
|
|
13
|
+
"agent-skills",
|
|
14
|
+
"claude",
|
|
15
|
+
"cursor",
|
|
16
|
+
"AI",
|
|
17
|
+
"workitems",
|
|
18
|
+
"summary",
|
|
19
|
+
"merge-request"
|
|
13
20
|
],
|
|
14
21
|
"repository": {
|
|
15
22
|
"type": "git",
|
|
16
|
-
"url": "git+https://github.com/ZLStream/yunxiao-
|
|
23
|
+
"url": "git+https://github.com/ZLStream/yunxiao-commands.git"
|
|
17
24
|
},
|
|
18
|
-
"homepage": "https://github.com/ZLStream/yunxiao-
|
|
25
|
+
"homepage": "https://github.com/ZLStream/yunxiao-commands#readme",
|
|
19
26
|
"bugs": {
|
|
20
|
-
"url": "https://github.com/ZLStream/yunxiao-
|
|
27
|
+
"url": "https://github.com/ZLStream/yunxiao-commands/issues"
|
|
21
28
|
},
|
|
22
29
|
"bin": {
|
|
23
30
|
"yx-code": "bin/yx-code.js"
|
package/scripts/postinstall.js
CHANGED
|
@@ -71,7 +71,7 @@ function deployPlugin() {
|
|
|
71
71
|
linked.forEach(name => console.log(' - ' + name));
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
console.log('\n可用命令: /yx-commands-commit, /yx-commands-push, /yx-commands-mr, /yx-commands-review, /yx-commands-commit-push-mr\n');
|
|
74
|
+
console.log('\n可用命令: /yx-commands-commit, /yx-commands-push, /yx-commands-mr, /yx-commands-review, /yx-commands-commit-push-mr, /yx-commands-workitems, /yx-commands-summary\n');
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
console.log('\n✅ yx-code CLI installed successfully!\n');
|
|
@@ -81,7 +81,9 @@ console.log(' yx-code clone - 克隆仓库');
|
|
|
81
81
|
console.log(' yx-code commit - 提交代码');
|
|
82
82
|
console.log(' yx-code push - 推送代码');
|
|
83
83
|
console.log(' yx-code mr - 创建合并请求');
|
|
84
|
-
console.log(' yx-code diff -
|
|
84
|
+
console.log(' yx-code diff - 查看代码差异');
|
|
85
|
+
console.log(' yx-code workitems - 列出工作项');
|
|
86
|
+
console.log(' yx-code summary - 生成工作总结\n');
|
|
85
87
|
|
|
86
88
|
try {
|
|
87
89
|
deployPlugin();
|