msdevflow 0.6.0 → 0.6.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 +200 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# msdevflow
|
|
2
|
+
|
|
3
|
+
`msdevflow` 是一个用于 GitCode 的 Claude Code Agent Skill,可以把已授权的 Issue 安全推进到代码实现、普通 PR、CI、检视意见闭环和最终合入,也可以通过显式 `action` 只执行其中一个能力。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
环境要求:
|
|
8
|
+
|
|
9
|
+
- Claude Code,且支持 Agent Skills;
|
|
10
|
+
- Node.js `>=18` 和 npm;
|
|
11
|
+
- Git;
|
|
12
|
+
- Python `>=3.10` 和 pip;
|
|
13
|
+
- GitCode 账号;
|
|
14
|
+
- Chrome 或 Edge(推荐,用于 openLiBing OAuth)。
|
|
15
|
+
|
|
16
|
+
运行一步安装:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npx msdevflow setup
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
`setup` 会先展示完整计划,确认后在同一次运行中:
|
|
23
|
+
|
|
24
|
+
1. 安装或更新 `msdevflow` skill;
|
|
25
|
+
2. 安装或升级官方 `@gitcode-cli/cli@latest`;
|
|
26
|
+
3. 安装受审的 Python Playwright 依赖;
|
|
27
|
+
4. 验收 Issue、PR、结构化评论、行内评论、JSON、显式仓库和正文文件等 CLI 能力;
|
|
28
|
+
5. GitCode CLI 未认证时打开官方浏览器登录。
|
|
29
|
+
|
|
30
|
+
可选的只读预检:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npx msdevflow setup --dry-run
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
自定义 Claude Code skills 目录:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npx msdevflow setup --skills-dir "<skills-directory>"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
安装完成后重新启动 Claude Code 会话。如果机器已有 Python 版本的 `gitcode`,setup 会保留它,并为 npm CLI 创建 `gitcode-npm` 命令;否则使用 `gitcode`。
|
|
43
|
+
|
|
44
|
+
## 完整端到端流程
|
|
45
|
+
|
|
46
|
+
从目标仓库目录启动 Claude Code:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
claude
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
然后输入:
|
|
53
|
+
|
|
54
|
+
```text
|
|
55
|
+
/msdevflow
|
|
56
|
+
处理 https://gitcode.com/<canonical-owner>/<repo>/issues/<number>。
|
|
57
|
+
本地仓库:<local-repository-absolute-path>
|
|
58
|
+
canonical:<canonical-owner>/<repo>
|
|
59
|
+
source:<your-account>/<repo>
|
|
60
|
+
使用 guided 模式,按权威远端和本地证据推进完整作者 E2E。
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
未指定 `action` 时,流程为:
|
|
64
|
+
|
|
65
|
+
```text
|
|
66
|
+
Issue 发现/核验
|
|
67
|
+
-> 需求分析与方案确认
|
|
68
|
+
-> 建分支、开发、本地验证
|
|
69
|
+
-> commit、push、创建普通 PR
|
|
70
|
+
-> 当前 head 的 CI 通过
|
|
71
|
+
-> 等待外部 reviewer
|
|
72
|
+
-> 处理 feedback 并重新通过 CI(可重复)
|
|
73
|
+
-> 独立审批门禁满足
|
|
74
|
+
-> 用户确认当前 PR 的最终合入
|
|
75
|
+
-> 远端回读 PR 已 merged
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
这是可暂停、可恢复的流程。外部检视或审批有新进展后,可再次运行:
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
/msdevflow
|
|
82
|
+
恢复 https://gitcode.com/<canonical-owner>/<repo>/pulls/<number> 的完整作者 E2E。
|
|
83
|
+
本地仓库:<local-repository-absolute-path>
|
|
84
|
+
canonical:<canonical-owner>/<repo>
|
|
85
|
+
source:<your-account>/<repo>
|
|
86
|
+
使用 guided 模式,从权威远端和本地事实定位当前位置并继续。
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## 独立 action
|
|
90
|
+
|
|
91
|
+
显式提供 `action=<name>` 时,只运行该 action,完成后立即停止;前置条件不足时不会隐式补跑上游流程。
|
|
92
|
+
|
|
93
|
+
| action | 用途 | 完成状态或结果 |
|
|
94
|
+
|---|---|---|
|
|
95
|
+
| `discover` | 只读发现当前账号负责的候选 Issue | 列出候选和排除证据 |
|
|
96
|
+
| `create-issue` | 按仓库或 community 模板创建 Issue | `issue-created` |
|
|
97
|
+
| `issue` | 接取并核验指定 Issue | `verified` |
|
|
98
|
+
| `develop` | 分析、设计、实现和本地验证 | `locally-verified` |
|
|
99
|
+
| `pr` | commit、push 并创建普通 PR | `pr-open` |
|
|
100
|
+
| `ci` | 监控、诊断并修复当前 PR 的 CI | `ci-passed` |
|
|
101
|
+
| `openlibing-auth` | 验证 GitCode → openLiBing OAuth | `openlibing-authenticated` |
|
|
102
|
+
| `feedback` | 处理自己 PR 收到的检视意见 | `feedback-resolved` 或 `waiting-for-review` |
|
|
103
|
+
| `code-review` | 独立检视他人的 PR | `review-findings`、`review-passed` 或 `review-incomplete` |
|
|
104
|
+
| `merge` | 核验门禁并在最终确认后合入 | `merged`、`waiting` 或 `blocked` |
|
|
105
|
+
|
|
106
|
+
示例:
|
|
107
|
+
|
|
108
|
+
```text
|
|
109
|
+
/msdevflow action=create-issue
|
|
110
|
+
在 Ascend/example 提一个 bug:升级后首次启动失败……
|
|
111
|
+
使用 guided 模式,确认完整预览后再创建。
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
```text
|
|
115
|
+
/msdevflow action=ci
|
|
116
|
+
PR:https://gitcode.com/Ascend/example/pulls/456
|
|
117
|
+
本地仓库:D:\work\example
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
```text
|
|
121
|
+
/msdevflow action=code-review
|
|
122
|
+
PR:https://gitcode.com/Ascend/example/pulls/789
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
`code-review` 只能检视其他作者的 PR。发现问题时发布高置信度、可操作的 finding;完整检视未发现问题且没有有效未解决意见时,经用户针对当前 PR/head 明确确认后,先发布带签名摘要,再独立评论精确的 `/lgtm`。它不发送 `/approve` 或 `/merge`,也不修改作者代码。
|
|
126
|
+
|
|
127
|
+
## PR 与检视规则
|
|
128
|
+
|
|
129
|
+
- 创建普通 PR,不创建 Draft PR,也不执行 Ready;
|
|
130
|
+
- 不主动请求检视,不触发检视机器人;
|
|
131
|
+
- 作者流程不会调用 `code-review`,也不会自行制造 LGTM/approve;
|
|
132
|
+
- CI、review 和 merge 结论始终绑定当前 PR head SHA;
|
|
133
|
+
- 最终 merge 无论运行模式如何,都需要用户针对当前 PR 明确确认。
|
|
134
|
+
|
|
135
|
+
## 中文和远端写入
|
|
136
|
+
|
|
137
|
+
Agent 写入的 PR/Issue 正文、评论和 discussion 回复末尾会附加:
|
|
138
|
+
|
|
139
|
+
```text
|
|
140
|
+
——msdevflow
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
所有人类可读远端文本通过 UTF-8 安全通道写入,并从 GitCode 逐字回读。中文变成 `?`、出现乱码、截断或尾签损坏时,流程会停止并优先原地修复。
|
|
144
|
+
|
|
145
|
+
`compile`、`/lgtm`、`/merge` 等严格机器协议保持原样,不附加尾签。
|
|
146
|
+
|
|
147
|
+
## 安全边界
|
|
148
|
+
|
|
149
|
+
`msdevflow`:
|
|
150
|
+
|
|
151
|
+
- 不读取、打印或转存 GitCode Token;
|
|
152
|
+
- 不要求用户把 Token 粘贴到终端、对话或项目文件;
|
|
153
|
+
- openLiBing Token 只在当前 Python 认证进程内短暂使用,不输出、不落盘;
|
|
154
|
+
- 永远不会自动下载 Playwright Chromium;
|
|
155
|
+
- 优先使用系统 Chrome/Edge,其次使用已经安装的 Playwright Chromium;
|
|
156
|
+
- 浏览器不可用时只返回可复制的 OAuth URL,并标记验证未完成;
|
|
157
|
+
- 不跳过 hooks、测试、CI、review 或 approval;
|
|
158
|
+
- 不默认 force push、重写共享历史、关闭 Issue或删除分支;
|
|
159
|
+
- 所有远端写都显式指定目标仓库,并在结果不确定时先回读而不是盲目重试。
|
|
160
|
+
|
|
161
|
+
## 常见阻塞
|
|
162
|
+
|
|
163
|
+
### `/msdevflow` 不存在
|
|
164
|
+
|
|
165
|
+
确认以下文件存在,然后重启 Claude Code:
|
|
166
|
+
|
|
167
|
+
```text
|
|
168
|
+
~/.claude/skills/msdevflow/SKILL.md
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### `blocked: bootstrap-required`
|
|
172
|
+
|
|
173
|
+
重新运行:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
npx msdevflow setup
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### GitCode 尚未登录
|
|
180
|
+
|
|
181
|
+
使用 setup 选定的命令:
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
<gitcode-command> auth login --web
|
|
185
|
+
<gitcode-command> auth status --json
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
用户只在官方浏览器页面输入凭证。
|
|
189
|
+
|
|
190
|
+
### `blocked: browser-required`
|
|
191
|
+
|
|
192
|
+
安装或修复系统 Chrome/Edge 后恢复原流程。不要运行 `playwright install chromium` 作为默认解决方案。
|
|
193
|
+
|
|
194
|
+
### `waiting-for-review`
|
|
195
|
+
|
|
196
|
+
这是作者流程等待独立 reviewer 的正常状态。检视意见或审批状态变化后,使用 PR URL 恢复完整 E2E。
|
|
197
|
+
|
|
198
|
+
## 详细文档
|
|
199
|
+
|
|
200
|
+
完整 action、恢复、模板、CI、review、UTF-8 和安全契约见 [`skill/msdevflow/README.md`](skill/msdevflow/README.md)。
|