@aipper/aiws-spec 0.0.4 → 0.0.6
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/package.json
CHANGED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ws-deliver
|
|
3
|
+
description: 交付(submodules + superproject 分步提交,并安全合并回目标分支)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
7
|
+
|
|
8
|
+
目标:
|
|
9
|
+
- 适配 superproject + submodule(数量不固定)的交付收尾:
|
|
10
|
+
1) 先逐个提交 submodule(每个 repo 单独确认 commit message)
|
|
11
|
+
2) 再提交 superproject(包含 submodule gitlink 指针更新 + 变更工件/代码)
|
|
12
|
+
3) 最后 fast-forward 合并回目标分支(复用 `aiws change finish`,减少手动 merge 出错)
|
|
13
|
+
|
|
14
|
+
非目标(强制):
|
|
15
|
+
- 不自动 `git add -A`(避免误提交)
|
|
16
|
+
- 不自动 push
|
|
17
|
+
- 不自动删除分支
|
|
18
|
+
|
|
19
|
+
前置(强制):
|
|
20
|
+
1) 先运行 `$ws-preflight`。
|
|
21
|
+
2) 确认当前处于 change 分支(推荐):`change/<change-id>`(也支持 `changes/`、`ws/`、`ws-change/`)。
|
|
22
|
+
- 若不在 change 分支:要求用户先切换到 `change/<change-id>`(或在命令里显式提供 `<change-id>`)。
|
|
23
|
+
3) 任何自动提交都必须在提交前输出:
|
|
24
|
+
- 该 repo 的 `git status --porcelain`
|
|
25
|
+
- 该 repo 的 `git diff --staged`
|
|
26
|
+
并让用户确认 commit message(每个 repo 单独确认)。
|
|
27
|
+
|
|
28
|
+
建议流程(按顺序):
|
|
29
|
+
|
|
30
|
+
## A) 发现 submodules 清单(数量不固定)
|
|
31
|
+
在 superproject 根目录执行:
|
|
32
|
+
```bash
|
|
33
|
+
git submodule status --recursive
|
|
34
|
+
```
|
|
35
|
+
如果没有 submodule:跳到 C)。
|
|
36
|
+
|
|
37
|
+
## B) 逐个提交 submodules(先 submodule,后 superproject)
|
|
38
|
+
对每个 submodule path(可递归)重复以下步骤(建议按 `git submodule status --recursive` 顺序):
|
|
39
|
+
1) 定位并检查状态:
|
|
40
|
+
```bash
|
|
41
|
+
sub_path="<path>"
|
|
42
|
+
git -C "$sub_path" branch --show-current
|
|
43
|
+
git -C "$sub_path" status --porcelain
|
|
44
|
+
```
|
|
45
|
+
2) 若 submodule 处于 detached HEAD(`branch --show-current` 为空):
|
|
46
|
+
- 默认建议:在该 submodule 内创建并切到同名 change 分支(与 superproject 对齐),例如 `change/<change-id>`:
|
|
47
|
+
```bash
|
|
48
|
+
git -C "$sub_path" switch -c "change/<change-id>"
|
|
49
|
+
```
|
|
50
|
+
- 若用户明确不想建分支:停止,解释风险(提交可能不可追溯/难以推送)。
|
|
51
|
+
3) 选择性 staging(默认用 `-p` 更安全):
|
|
52
|
+
```bash
|
|
53
|
+
git -C "$sub_path" add -p
|
|
54
|
+
git -C "$sub_path" diff --staged --stat
|
|
55
|
+
git -C "$sub_path" diff --staged
|
|
56
|
+
```
|
|
57
|
+
4) AI 生成该 submodule 的 commit message(标题+可选 body),并让用户确认(每个 repo 单独确认)。
|
|
58
|
+
5) 执行提交(不带 `--no-verify`):
|
|
59
|
+
```bash
|
|
60
|
+
git -C "$sub_path" commit -m "<message>"
|
|
61
|
+
```
|
|
62
|
+
6) 若该 submodule 没有 staged changes:跳过(不要硬提交空 commit)。
|
|
63
|
+
|
|
64
|
+
## C) 提交 superproject(更新 gitlinks + 自身改动 + changes 工件)
|
|
65
|
+
1) 先检查 submodule 指针差异(gitlinks):
|
|
66
|
+
```bash
|
|
67
|
+
git diff --submodule
|
|
68
|
+
```
|
|
69
|
+
2) 选择性 staging:
|
|
70
|
+
- 先 stage 发生指针变化的 submodule 路径(明确列出):
|
|
71
|
+
```bash
|
|
72
|
+
git add <submodule-path-1> <submodule-path-2>
|
|
73
|
+
```
|
|
74
|
+
- 再 stage superproject 自身改动(默认 `-p`):
|
|
75
|
+
```bash
|
|
76
|
+
git add -p
|
|
77
|
+
git diff --staged --stat
|
|
78
|
+
git diff --staged
|
|
79
|
+
```
|
|
80
|
+
3) AI 生成 superproject 的 commit message(应包含 “bump submodule <name> -> <sha>” 等关键信息),并让用户确认。
|
|
81
|
+
4) 提交:
|
|
82
|
+
```bash
|
|
83
|
+
git commit -m "<message>"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## D) 门禁与证据(推荐)
|
|
87
|
+
```bash
|
|
88
|
+
if [[ -x "./node_modules/.bin/aiws" ]]; then
|
|
89
|
+
./node_modules/.bin/aiws validate . --stamp
|
|
90
|
+
elif command -v aiws >/dev/null 2>&1; then
|
|
91
|
+
aiws validate . --stamp
|
|
92
|
+
else
|
|
93
|
+
npx @aipper/aiws validate . --stamp
|
|
94
|
+
fi
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## E) 安全合并回目标分支(fast-forward)
|
|
98
|
+
优先使用 `$ws-finish`(底层调用 `aiws change finish`)。
|
|
99
|
+
|
|
100
|
+
若需要显式指定目标分支:
|
|
101
|
+
```bash
|
|
102
|
+
aiws change finish <change-id> --into <base-branch>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## F) (可选)归档变更工件
|
|
106
|
+
```bash
|
|
107
|
+
aiws change archive <change-id>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
输出要求:
|
|
111
|
+
- `Submodules:` 每个 submodule 的分支/提交摘要(repo → commit sha → message)
|
|
112
|
+
- `Superproject:` 提交摘要
|
|
113
|
+
- `Merge:` `aiws change finish` 的输出(into/from)
|
|
114
|
+
- `Evidence:` `.agentdocs/tmp/aiws-validate/*.json`(若使用 --stamp)
|
|
@@ -126,6 +126,7 @@
|
|
|
126
126
|
".agents/skills/ws-analyze/SKILL.md",
|
|
127
127
|
".agents/skills/ws-commit/SKILL.md",
|
|
128
128
|
".agents/skills/ws-dev/SKILL.md",
|
|
129
|
+
".agents/skills/ws-deliver/SKILL.md",
|
|
129
130
|
".agents/skills/ws-finish/SKILL.md",
|
|
130
131
|
".agents/skills/ws-migrate/SKILL.md",
|
|
131
132
|
".agents/skills/ws-plan/SKILL.md",
|