aodw-skill 0.10.0 → 0.13.0
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/.aodw-next/01-core/ai-knowledge-rules.md +35 -2
- package/.aodw-next/01-core/aodw-constitution.md +22 -3
- package/.aodw-next/01-core/git-discipline.md +110 -52
- package/.aodw-next/01-core/test-discipline.md +2 -0
- package/.aodw-next/02-workflow/autopilot-protocol.md +4 -1
- package/.aodw-next/02-workflow/environment-roles.md +106 -0
- package/.aodw-next/02-workflow/orca-multi-session.md +80 -0
- package/.aodw-next/02-workflow/rt-manager.md +83 -12
- package/.aodw-next/02-workflow/shared-verification-host.md +103 -0
- package/.aodw-next/02-workflow/sub-agent-driven-profile.md +2 -1
- package/.aodw-next/04-auditors/aodw-development-auditor-rules.md +2 -6
- package/.aodw-next/04-auditors/aodw-full-auditor-rules.md +2 -6
- package/.aodw-next/README.md +168 -7
- package/.aodw-next/SKILL.md +4 -1
- package/.aodw-next/manifest.yaml +26 -2
- package/.aodw-next/project.yaml +4 -0
- package/.aodw-next/skills/handover-pack/scripts/next-number.sh +1 -1
- package/.aodw-next/skills/handover-pack/templates/handover-template.md +3 -1
- package/.aodw-next/templates/dev-session-guide-template.md +20 -0
- package/.aodw-next/templates/environments.template.md +54 -0
- package/.aodw-next/templates/lessons.template.md +7 -0
- package/.aodw-next/templates/main-session-handover-template.md +19 -0
- package/.aodw-next/templates/orca-handoff-template.md +31 -0
- package/.aodw-next/templates/release/checklist.template.md +29 -0
- package/.aodw-next/templates/release/notes.template.md +22 -0
- package/.aodw-next/templates/release/plan.template.md +15 -0
- package/.aodw-next/templates/release/retro-index.template.md +8 -0
- package/.aodw-next/templates/release/retro-topic.template.md +33 -0
- package/.aodw-next/templates/rt-lite.template.md +1 -0
- package/.aodw-next/templates/rt-meta-template.yaml +2 -2
- package/.aodw-next/templates/shared-verification-host-profile.template.md +50 -0
- package/.aodw-next/tools/next-rt-id.sh +39 -0
- package/.aodw-next/tools/rel-plan.mjs +203 -0
- package/.aodw-next/tools/worktree-gc.sh +260 -0
- package/AODW_Adapters/README.md +22 -126
- package/AODW_Adapters/agents/AGENTS.md +11 -0
- package/AODW_Adapters/antigravity/.agent/rules/aodw-next.md +2 -72
- package/AODW_Adapters/claude/CLAUDE.md +2 -72
- package/AODW_Adapters/copilot/.github/copilot-instructions.md +3 -0
- package/AODW_Adapters/cursor/.cursor/rules/aodw-next.mdc +3 -75
- package/AODW_Adapters/openclaw/SKILL.md +3 -106
- package/README.md +60 -22
- package/bin/aodw.js +374 -279
- package/bin/commands/new.js +21 -25
- package/bin/commands/update.js +387 -0
- package/bin/commands/verify.js +420 -0
- package/bin/utils/lock.js +343 -0
- package/bin/utils/path-guard.js +449 -0
- package/bin/utils/release.js +36 -0
- package/bin/utils/tool-entries.js +506 -0
- package/package.json +8 -2
- package/.aodw-next/templates/aodw-kernel-loader-template.md +0 -71
- package/AODW_Adapters/cursor/.cursor/commands/README.md +0 -37
- package/AODW_Adapters/cursor/.cursor/rules/aodw-autopilot-continue.mdc +0 -42
- package/AODW_Adapters/openclaw/AGENTS.md +0 -142
- package/bin/processors/index.js +0 -98
- package/bin/update-adapters-from-template.js +0 -76
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# 默认只报告。--apply 清理默认工作树目录内通过全部核对的工作树。
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
# 按字节解析路径,避免 macOS awk 在本地化排序下将不同中文路径判为相等。
|
|
5
|
+
export LC_ALL=C
|
|
6
|
+
apply=0
|
|
7
|
+
while [ "$#" -gt 0 ]; do
|
|
8
|
+
case "$1" in
|
|
9
|
+
--apply) apply=1; shift ;;
|
|
10
|
+
*) echo '用法:bash .aodw-next/tools/worktree-gc.sh [--apply]' >&2; exit 2 ;;
|
|
11
|
+
esac
|
|
12
|
+
done
|
|
13
|
+
base_ref="$(git symbolic-ref --quiet refs/remotes/origin/HEAD || printf '%s\n' refs/remotes/origin/main)"
|
|
14
|
+
trunk="${base_ref#refs/remotes/origin/}"
|
|
15
|
+
if ! base="$(git rev-parse --verify --quiet "${base_ref}^{commit}")"; then
|
|
16
|
+
printf '错误:无法解析 %s。请先运行 git fetch origin,再运行 git remote set-head origin -a。\n' "$base_ref" >&2
|
|
17
|
+
exit 1
|
|
18
|
+
fi
|
|
19
|
+
printf '本地 origin/%s:%s %s(未自动 fetch;需要更新时请先自行 fetch)\n' \
|
|
20
|
+
"$trunk" "$(git rev-parse --short "$base")" "$(git show -s --format=%cI "$base")"
|
|
21
|
+
tmp="$(mktemp -d "${TMPDIR:-/tmp}/aodw-worktree-gc-XXXXXX")"
|
|
22
|
+
trap 'rm -rf "$tmp"' EXIT
|
|
23
|
+
read_worktrees() {
|
|
24
|
+
local field worktree
|
|
25
|
+
paths=()
|
|
26
|
+
git worktree list --porcelain -z > "$tmp/worktrees"
|
|
27
|
+
while IFS= read -r -d '' field; do
|
|
28
|
+
case "$field" in
|
|
29
|
+
worktree\ *)
|
|
30
|
+
worktree=${field#worktree }
|
|
31
|
+
if [ -d "$worktree" ]; then worktree="$(cd -P "$worktree" && pwd -P)"; fi
|
|
32
|
+
paths[${#paths[@]}]=$worktree ;;
|
|
33
|
+
esac
|
|
34
|
+
done < "$tmp/worktrees"
|
|
35
|
+
}
|
|
36
|
+
read_worktrees
|
|
37
|
+
main=${paths[0]}
|
|
38
|
+
|
|
39
|
+
# 只读取 PID、命令名、cwd;命令失败或没有结果都不能推断为无人使用。
|
|
40
|
+
read_processes() {
|
|
41
|
+
# lsof 在 C locale 会转义中文路径,采集时保持 UTF-8,比较时仍按字节。
|
|
42
|
+
if ! LC_ALL=en_US.UTF-8 lsof -a -d cwd -Fpcn > "$tmp/cwd" || [ ! -s "$tmp/cwd" ]; then
|
|
43
|
+
echo '错误:无法取得进程 cwd,停止清理。' >&2
|
|
44
|
+
return 1
|
|
45
|
+
fi
|
|
46
|
+
}
|
|
47
|
+
read_processes
|
|
48
|
+
|
|
49
|
+
# 仅扫描顶层软链;用物理目录解析相对目标和多级软链,兼容 macOS bash 3.2。
|
|
50
|
+
IFS=: read -r -a skill_dirs <<< "${WORKTREE_GC_SKILL_DIRS-$HOME/.claude/skills:$HOME/.codex/skills:$HOME/.agents/skills:$HOME/.cursor/skills}"
|
|
51
|
+
read_skill_links() {
|
|
52
|
+
local directory link target value owner worktree
|
|
53
|
+
skill_links=(); skill_owners=()
|
|
54
|
+
if [ "${#skill_dirs[@]}" -eq 0 ]; then return 0; fi
|
|
55
|
+
for directory in "${skill_dirs[@]}"; do
|
|
56
|
+
[ -d "$directory" ] || continue
|
|
57
|
+
for link in "$directory"/* "$directory"/.[!.]* "$directory"/..?*; do
|
|
58
|
+
[ -L "$link" ] && [ -e "$link" ] || continue
|
|
59
|
+
target=$link
|
|
60
|
+
while [ -L "$target" ]; do
|
|
61
|
+
value="$(readlink "$target")"
|
|
62
|
+
case "$value" in /*) target=$value ;; *) target=${target%/*}/$value ;; esac
|
|
63
|
+
done
|
|
64
|
+
if [ -d "$target" ]; then
|
|
65
|
+
target="$(cd -P "$target" && pwd -P)"
|
|
66
|
+
else
|
|
67
|
+
target="$(cd -P "${target%/*}" && pwd -P)/${target##*/}"
|
|
68
|
+
fi
|
|
69
|
+
owner=''
|
|
70
|
+
for worktree in "${paths[@]}"; do
|
|
71
|
+
case "$target" in
|
|
72
|
+
"$worktree"|"$worktree"/*)
|
|
73
|
+
if [ "${#worktree}" -gt "${#owner}" ]; then owner=$worktree; fi ;;
|
|
74
|
+
esac
|
|
75
|
+
done
|
|
76
|
+
skill_links[${#skill_links[@]}]=$link
|
|
77
|
+
skill_owners[${#skill_owners[@]}]=$owner
|
|
78
|
+
done
|
|
79
|
+
done
|
|
80
|
+
}
|
|
81
|
+
read_skill_links
|
|
82
|
+
|
|
83
|
+
# 列表和每次删除共用同一核对,外部工作树也完整计算四条结论。
|
|
84
|
+
check_worktree() {
|
|
85
|
+
local worktree nested=''
|
|
86
|
+
if [ ! -d "$path" ]; then
|
|
87
|
+
branch='不可用'; class=5; reason='工作树目录不存在,可运行 git worktree prune'
|
|
88
|
+
return 0
|
|
89
|
+
fi
|
|
90
|
+
branch="$(git -C "$path" symbolic-ref --quiet --short HEAD || true)"
|
|
91
|
+
head="$(git -C "$path" rev-parse HEAD)"
|
|
92
|
+
merged=0; dirty=0; force=0; changes=0
|
|
93
|
+
reason='未合入'
|
|
94
|
+
if git merge-base --is-ancestor "$head" "$base"; then merged=1; reason='已合入'; fi
|
|
95
|
+
git --no-optional-locks -C "$path" status --porcelain -z --untracked-files=all > "$tmp/status"
|
|
96
|
+
while IFS= read -r -d '' entry; do
|
|
97
|
+
changes=$((changes + 1))
|
|
98
|
+
untracked=${entry#???}; untracked=${untracked%/}
|
|
99
|
+
case "$entry" in
|
|
100
|
+
'?? '*)
|
|
101
|
+
case "$untracked" in
|
|
102
|
+
node_modules/*) untracked=node_modules ;;
|
|
103
|
+
*/node_modules/*) untracked=${untracked%%/node_modules/*}/node_modules ;;
|
|
104
|
+
esac
|
|
105
|
+
case "$untracked" in node_modules|*/node_modules)
|
|
106
|
+
if [ -d "$path/$untracked" ] || [ -L "$path/$untracked" ]; then
|
|
107
|
+
force=1; continue
|
|
108
|
+
fi ;;
|
|
109
|
+
esac ;;
|
|
110
|
+
R*|?R*|C*|?C*) IFS= read -r -d '' source ;;
|
|
111
|
+
esac
|
|
112
|
+
dirty=1
|
|
113
|
+
done < "$tmp/status"
|
|
114
|
+
if [ "$dirty" -eq 1 ]; then reason="${reason}、有未提交改动";
|
|
115
|
+
elif [ "$force" -eq 1 ]; then reason="${reason}、无改动(仅有未跟踪 node_modules)";
|
|
116
|
+
else reason="${reason}、无改动"; fi
|
|
117
|
+
busy="$(awk -v root="$path" '
|
|
118
|
+
BEGIN {for (i=2; i<ARGC; i++) {roots[i]=ARGV[i]; delete ARGV[i]}}
|
|
119
|
+
/^p/ {pid=substr($0,2)} /^c/ {command=substr($0,2)}
|
|
120
|
+
/^n/ {
|
|
121
|
+
cwd=substr($0,2); owner=""
|
|
122
|
+
for (i in roots)
|
|
123
|
+
if ((cwd == roots[i] || index(cwd,roots[i] "/") == 1) &&
|
|
124
|
+
length(roots[i]) > length(owner)) owner=roots[i]
|
|
125
|
+
if (owner == root) {
|
|
126
|
+
count++
|
|
127
|
+
if (count <= 3) summary=summary (count > 1 ? "; " : "") "PID " pid " " command
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
END {if (count) printf "%d 个:%s%s", count, summary, (count > 3 ? " 等" : "")}
|
|
131
|
+
' "$tmp/cwd" "${paths[@]}")"
|
|
132
|
+
if [ -n "$busy" ]; then reason="${reason}、有进程在用(${busy})";
|
|
133
|
+
else reason="${reason}、无进程"; fi
|
|
134
|
+
keep=''
|
|
135
|
+
for ((k=0; k<${#skill_links[@]}; k++)); do
|
|
136
|
+
if [ "${skill_owners[$k]}" = "$path" ]; then
|
|
137
|
+
keep="${keep}被 Skill 软链引用:${skill_links[$k]};"
|
|
138
|
+
fi
|
|
139
|
+
done
|
|
140
|
+
class=0
|
|
141
|
+
if [ "$path" = "$main" ]; then
|
|
142
|
+
class=1; reason="${reason}、主目录"
|
|
143
|
+
else
|
|
144
|
+
reason="${reason}、不是主目录"
|
|
145
|
+
for worktree in "${paths[@]}"; do
|
|
146
|
+
case "$worktree" in
|
|
147
|
+
"$path"/*) nested="${nested}内含工作树:${worktree};" ;;
|
|
148
|
+
esac
|
|
149
|
+
done
|
|
150
|
+
case "$path" in
|
|
151
|
+
"$main"/.claude/worktrees/*)
|
|
152
|
+
if [ -n "$keep" ]; then class=1;
|
|
153
|
+
elif [ "$merged" -eq 0 ]; then class=2;
|
|
154
|
+
elif [ "$dirty" -eq 1 ]; then class=3;
|
|
155
|
+
elif [ -n "$busy" ]; then class=4; fi ;;
|
|
156
|
+
*) class=5; reason="${reason}(可由所属会话收尾)" ;;
|
|
157
|
+
esac
|
|
158
|
+
if [ -n "$nested" ]; then class=1; keep="${keep}${nested}"; fi
|
|
159
|
+
fi
|
|
160
|
+
if [ -n "$keep" ]; then reason="${reason};$keep"; fi
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
labels=('可删' '保留' '未合入' '有未提交改动' '有进程在用' '仓库外/失效')
|
|
164
|
+
lines=('' '' '' '' '' '')
|
|
165
|
+
candidates=()
|
|
166
|
+
for path in "${paths[@]}"; do
|
|
167
|
+
check_worktree
|
|
168
|
+
if [ "$path" = "$main" ]; then main_branch=${branch:-分离 HEAD}; main_changes=$changes; fi
|
|
169
|
+
if [ "$class" -eq 0 ]; then candidates[${#candidates[@]}]=$path; fi
|
|
170
|
+
lines[$class]="${lines[$class]}${path} | ${branch:-分离 HEAD} | ${reason}"$'\n'
|
|
171
|
+
done
|
|
172
|
+
for ((i=0; i<${#labels[@]}; i++)); do
|
|
173
|
+
printf '【%s】\n%s' "${labels[$i]}" "${lines[$i]}"
|
|
174
|
+
done
|
|
175
|
+
echo '【主目录】'
|
|
176
|
+
behind="$(git -C "$main" rev-list --count "HEAD..$base")"
|
|
177
|
+
ahead="$(git -C "$main" rev-list --count "$base..HEAD")"
|
|
178
|
+
printf '%s | %s | 落后 origin/%s %s 个提交、领先 origin/%s %s 个提交、未提交改动 %s 项\n' \
|
|
179
|
+
"$main" "$main_branch" "$trunk" "$behind" "$trunk" "$ahead" "$main_changes"
|
|
180
|
+
|
|
181
|
+
now="$(date +%s)"
|
|
182
|
+
unmerged=''; suspicious=''
|
|
183
|
+
git for-each-ref --format='%(refname:short)%09%(committerdate:unix)%09%(committerdate:iso8601)' refs/heads/ > "$tmp/branches"
|
|
184
|
+
while IFS=$'\t' read -r branch timestamp date; do
|
|
185
|
+
[ "$branch" != "$trunk" ] || continue
|
|
186
|
+
if ! git merge-base --is-ancestor "refs/heads/$branch" "$base"; then
|
|
187
|
+
unmerged="${unmerged}${branch} | 最后提交 ${date}"$'\n'
|
|
188
|
+
fi
|
|
189
|
+
behind="$(git rev-list --count "refs/heads/$branch..$base")"
|
|
190
|
+
if [ "$((now - timestamp))" -gt 604800 ] || [ "$behind" -gt 50 ]; then
|
|
191
|
+
suspicious="${suspicious}${branch} | 最后提交 ${date} | 落后 origin/${trunk} ${behind} 个提交"$'\n'
|
|
192
|
+
fi
|
|
193
|
+
done < "$tmp/branches"
|
|
194
|
+
printf '【未合入的本地分支】\n%s【可疑分支】\n%s' "$unmerged" "$suspicious"
|
|
195
|
+
|
|
196
|
+
echo '【已打完成标签但未关单】'
|
|
197
|
+
index="$main/RT/index.yaml"
|
|
198
|
+
[ -f "$index" ] || index=/dev/null
|
|
199
|
+
awk '
|
|
200
|
+
/^[[:space:]]*-[[:space:]]+id:[[:space:]]*/ {
|
|
201
|
+
id=$0; sub(/^.*id:[[:space:]]*/,"",id); sub(/[[:space:]]*(#.*)?$/, "", id)
|
|
202
|
+
gsub(/^["\047]|["\047]$/, "", id)
|
|
203
|
+
}
|
|
204
|
+
/^[[:space:]]*status:[[:space:]]*/ {
|
|
205
|
+
s=$0; sub(/^.*status:[[:space:]]*/,"",s); sub(/[[:space:]]*(#.*)?$/, "", s)
|
|
206
|
+
if (id != "") print id "\t" s
|
|
207
|
+
}
|
|
208
|
+
' "$index" > "$tmp/statuses"
|
|
209
|
+
git tag --list 'done-RT-*' > "$tmp/tags"
|
|
210
|
+
while IFS= read -r tag; do
|
|
211
|
+
[[ "$tag" =~ ^done-RT-[0-9]+$ ]] || continue
|
|
212
|
+
id=${tag#done-}
|
|
213
|
+
index_status="$(awk -F '\t' -v id="$id" '$1 == id {print $2}' "$tmp/statuses")"
|
|
214
|
+
meta_status='无 meta'; meta="$main/RT/$id/meta.yaml"
|
|
215
|
+
if [ -f "$meta" ]; then
|
|
216
|
+
meta_status="$(awk '/^[[:space:]]*status:[[:space:]]*/ {
|
|
217
|
+
sub(/^.*status:[[:space:]]*/, ""); sub(/[[:space:]]*(#.*)?$/, ""); print; exit
|
|
218
|
+
}' "$meta")"
|
|
219
|
+
fi
|
|
220
|
+
if [ "$index_status" != done ] || { [ -f "$meta" ] && [ "$meta_status" != done ]; }; then
|
|
221
|
+
printf '%s | index: %s | meta: %s\n' "$id" "${index_status:-未登记}" "${meta_status:-未登记}"
|
|
222
|
+
fi
|
|
223
|
+
done < "$tmp/tags"
|
|
224
|
+
|
|
225
|
+
failed=0
|
|
226
|
+
if [ "$apply" -eq 1 ]; then
|
|
227
|
+
echo '【执行清理】'
|
|
228
|
+
# bash 3.2 的 nounset 不接受空数组展开。
|
|
229
|
+
if [ "${#candidates[@]}" -gt 0 ]; then
|
|
230
|
+
for path in "${candidates[@]}"; do
|
|
231
|
+
read_processes
|
|
232
|
+
read_worktrees
|
|
233
|
+
read_skill_links
|
|
234
|
+
check_worktree
|
|
235
|
+
if [ "$class" -ne 0 ]; then echo "跳过:${path} | ${reason}"; continue; fi
|
|
236
|
+
options=(remove)
|
|
237
|
+
if [ "$force" -eq 1 ]; then options=(remove --force); fi
|
|
238
|
+
if git worktree "${options[@]}" "$path" > "$tmp/delete" 2>&1; then
|
|
239
|
+
echo "已删除工作树:${path}"
|
|
240
|
+
if [ -n "$branch" ]; then
|
|
241
|
+
if git branch -d "$branch" > "$tmp/delete" 2>&1; then
|
|
242
|
+
echo "已删除本地分支:${branch}"
|
|
243
|
+
else
|
|
244
|
+
echo "本地分支删除失败(保留,不强删):${branch}"
|
|
245
|
+
cat "$tmp/delete"; failed=1
|
|
246
|
+
fi
|
|
247
|
+
fi
|
|
248
|
+
else
|
|
249
|
+
echo "工作树删除失败(保留分支):${path}"
|
|
250
|
+
cat "$tmp/delete"; failed=1
|
|
251
|
+
fi
|
|
252
|
+
done
|
|
253
|
+
fi
|
|
254
|
+
merged_branches="$(git for-each-ref --merged="$base" \
|
|
255
|
+
--format='%(if)%(worktreepath)%(then)%(else)%(refname:lstrip=2)%(end)' refs/heads/feature/ | sed '/^$/d')"
|
|
256
|
+
if [ -n "$merged_branches" ]; then
|
|
257
|
+
printf '已合入、未被任何工作树检出的本地分支:\n%s\n先确认本 RT 的 detached 工作树已删除,再用 git branch -d 删除对应分支。\n' "$merged_branches"
|
|
258
|
+
fi
|
|
259
|
+
fi
|
|
260
|
+
exit "$failed"
|
package/AODW_Adapters/README.md
CHANGED
|
@@ -1,136 +1,32 @@
|
|
|
1
|
-
# AODW
|
|
1
|
+
# AODW Entry Templates
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
此目录是各 AI 工具入口文件的**唯一模板源**:`publish.sh` 把它原样同步进 npm 包的 `AODW_Adapters/`,`aodw-skill init` 直接读取并渲染,不再有第二份按平台生成的 loader 或生成器。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 入口文件
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
**Cursor IDE 适配器**
|
|
9
|
-
- `.cursor/rules/aodw-next.mdc` - Cursor 规则文件
|
|
10
|
-
- 使用 Cursor 的 `.mdc` (Markdown Component) 格式
|
|
11
|
-
- 支持命令索引和上下文加载指令
|
|
7
|
+
仓库根 `AGENTS.md` 是唯一规范入口,其余文件都只指向它,每份只有一两行:
|
|
12
8
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
| 模板 | 安装到项目根的路径 | 谁在读 |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| `agents/AGENTS.md` | `AGENTS.md`(缺失时才生成) | 所有支持 `AGENTS.md` 的工具 |
|
|
12
|
+
| `claude/CLAUDE.md` | `CLAUDE.md`(`@AGENTS.md`) | Claude Code |
|
|
13
|
+
| `cursor/.cursor/rules/aodw-next.mdc` | `.cursor/rules/aodw-next.mdc`(`alwaysApply: true`) | Cursor |
|
|
14
|
+
| `antigravity/.agent/rules/aodw-next.md` | `.agent/rules/aodw-next.md`(`trigger: always_on`) | Antigravity |
|
|
15
|
+
| `copilot/.github/copilot-instructions.md` | `.github/copilot-instructions.md`(相对链接 `../AGENTS.md`) | GitHub Copilot |
|
|
16
|
+
| `openclaw/SKILL.md` | `SKILL.md`(`init` 提问选“是”才安装) | OpenClaw |
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
**Google Gemini Antigravity 适配器**
|
|
20
|
-
- `.agent/rules/aodw-next.md` - Gemini Agent 规则文件
|
|
21
|
-
- 适用于 Antigravity AI 平台
|
|
18
|
+
## 模板约定
|
|
22
19
|
|
|
23
|
-
|
|
20
|
+
- 目录结构就是安装到项目根后的路径;五个标准入口始终整套安装,只有 `openclaw/` 是可选项。
|
|
21
|
+
- 唯一的占位符是 `{{AODW_DIR}}`,`init` 换成实际通道目录名(默认 `.aodw-next`,`AODW_CORE_DIR` 指定其他仓内目录时跟随)。四个薄壳不写通道目录,只指向 `AGENTS.md`。
|
|
22
|
+
- `agents/AGENTS.md` 里 `<!-- AODW_ORCA_START -->` 与 `<!-- AODW_ORCA_END -->` 之间的内容只在 `--dev-env orca` 时保留。
|
|
23
|
+
- 模板里不写任何项目或公司的业务规则:`AGENTS.md` 只负责把人带到内核与 `06-project/`,项目约定由项目自己写进生成后的 `AGENTS.md`。
|
|
24
|
+
- 每个工具的入口语法以该工具的加载规则为准(Cursor 的 `.mdc` frontmatter、Antigravity 的 `trigger`、Copilot 的 Markdown 链接、Claude Code 的 `@` 导入);`npx aodw-skill verify` 只校验文件层面的指针有效,不代替在工具里实测。
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
## 所有权
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
`init` 创建并写下的入口登记在项目的 `<通道目录>/aodw.entries.json`(路径 + 写入时的 SHA-256)。未登记的既有文件(即使字节恰好与模板相同)或生成后被改过的文件都归项目所有,不会被覆盖也不会被 `uninstall` 删除;详见源码仓库 `cli/bin/utils/tool-entries.js`。
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
npx aodw-skill init
|
|
31
|
-
```
|
|
30
|
+
## 作为开发者
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
### 作为开发者
|
|
36
|
-
|
|
37
|
-
#### 添加新工具适配器
|
|
38
|
-
|
|
39
|
-
1. **创建新目录**:
|
|
40
|
-
```bash
|
|
41
|
-
mkdir AODW_Adapters/vscode
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
2. **添加配置文件**:
|
|
45
|
-
- 工具特定的配置
|
|
46
|
-
- 提示词文件
|
|
47
|
-
- 规则定义
|
|
48
|
-
|
|
49
|
-
3. **更新 CLI**:
|
|
50
|
-
编辑 `cli/bin/aodw.js`,在选项列表中添加新工具:
|
|
51
|
-
```javascript
|
|
52
|
-
choices: [
|
|
53
|
-
{ name: 'All (Install all adapters)', value: 'all' },
|
|
54
|
-
{ name: 'Cursor', value: 'cursor', checked: true },
|
|
55
|
-
{ name: 'Anthropic Claude', value: 'claude' },
|
|
56
|
-
{ name: 'Google Gemini (Antigravity)', value: 'antigravity' },
|
|
57
|
-
{ name: 'VS Code', value: 'vscode' } // 新增
|
|
58
|
-
]
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
4. **更新逻辑**:
|
|
62
|
-
确保 `toolsToInstall` 逻辑包含新工具:
|
|
63
|
-
```javascript
|
|
64
|
-
const toolsToInstall = tools.includes('all')
|
|
65
|
-
? ['cursor', 'claude', 'antigravity', 'vscode'] // 新增
|
|
66
|
-
: tools;
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
5. **发布新版本**:
|
|
70
|
-
```bash
|
|
71
|
-
cd cli
|
|
72
|
-
./publish.sh minor # 新功能使用 minor
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
#### 更新现有适配器
|
|
76
|
-
|
|
77
|
-
1. 修改对应目录下的文件
|
|
78
|
-
2. 运行 `cli/publish.sh patch` 发布补丁版本
|
|
79
|
-
3. 用户运行 `npx aodw-skill update` 即可获得更新
|
|
80
|
-
|
|
81
|
-
## 🏗️ 设计原则
|
|
82
|
-
|
|
83
|
-
### "薄适配器"原则
|
|
84
|
-
|
|
85
|
-
适配器应该**尽量轻量**:
|
|
86
|
-
|
|
87
|
-
❌ **错误做法** - 在适配器中重复规范内容:
|
|
88
|
-
```markdown
|
|
89
|
-
<!-- CLAUDE.md -->
|
|
90
|
-
# AODW 规范
|
|
91
|
-
## RT 管理
|
|
92
|
-
RT-ID 格式为 RT-XXX...(大量重复 .aodw 中的内容)
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
✅ **正确做法** - 引导 AI 阅读核心规范:
|
|
96
|
-
```markdown
|
|
97
|
-
<!-- CLAUDE.md -->
|
|
98
|
-
你正在一个 AODW 项目中工作。
|
|
99
|
-
请优先阅读 `.aodw-next/01-core/aodw-constitution.md` 了解核心规范。
|
|
100
|
-
当处理 RT 时,参考 `.aodw-next/02-workflow/rt-manager.md`。
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
### 职责边界
|
|
104
|
-
|
|
105
|
-
- **适配器的职责**:将工具特定的接口映射到 AODW 规范
|
|
106
|
-
- **核心规范的职责**:定义"什么是 AODW"
|
|
107
|
-
|
|
108
|
-
## 📝 目录结构
|
|
109
|
-
|
|
110
|
-
```
|
|
111
|
-
AODW_Adapters/
|
|
112
|
-
├── README.md # 本文件
|
|
113
|
-
├── cursor/
|
|
114
|
-
│ └── .cursor/
|
|
115
|
-
│ └── rules/
|
|
116
|
-
│ └── aodw-next.mdc
|
|
117
|
-
├── claude/
|
|
118
|
-
│ └── CLAUDE.md
|
|
119
|
-
└── antigravity/
|
|
120
|
-
└── .agent/
|
|
121
|
-
└── rules/
|
|
122
|
-
└── aodw-next.md
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
## 🔄 版本同步
|
|
126
|
-
|
|
127
|
-
适配器版本与 AODW 核心规范保持同步:
|
|
128
|
-
- 当 `.aodw-next/` 更新时,适配器也应相应调整
|
|
129
|
-
- CLI 的 `update` 命令会同时更新核心和适配器
|
|
130
|
-
|
|
131
|
-
## 🤝 贡献
|
|
132
|
-
|
|
133
|
-
欢迎为新工具贡献适配器!请确保:
|
|
134
|
-
1. 遵循"薄适配器"原则
|
|
135
|
-
2. 测试适配器在目标工具中的效果
|
|
136
|
-
3. 提供清晰的使用说明
|
|
32
|
+
改入口文案直接改这里的文件,然后跑 `cd cli && npm test` 与 `/bin/bash cli/test/e2e-tool-entries.sh`(用真实发行包验证生成、校验与卸载)。
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# AGENTS.md
|
|
2
|
+
|
|
3
|
+
本文件是本仓库对开发者与 AI Agent 的唯一规范入口:各 AI 工具的入口文件(`CLAUDE.md` 以及 Cursor、Antigravity、Copilot 的规则文件)都只指向这里。项目自己的约定写在本文件;本文件由 `aodw-skill init` 首次生成,之后归项目所有,可直接编辑。
|
|
4
|
+
|
|
5
|
+
## 开始任务前
|
|
6
|
+
|
|
7
|
+
1. 先读通用流程内核 `{{AODW_DIR}}/01-core/aodw-constitution.md`,再按其中的上下文加载指令按需读取其他规则(索引见 `{{AODW_DIR}}/manifest.yaml`)。
|
|
8
|
+
2. 再读项目补充说明 `{{AODW_DIR}}/06-project/ai-overview.md` 与 `{{AODW_DIR}}/06-project/modules-index.yaml`。
|
|
9
|
+
<!-- AODW_ORCA_START -->
|
|
10
|
+
3. 本项目用 Orca 多会话协作,开工前先读 `{{AODW_DIR}}/02-workflow/orca-multi-session.md` 与 `{{AODW_DIR}}/06-project/dev-session-guide.md`。
|
|
11
|
+
<!-- AODW_ORCA_END -->
|
|
@@ -1,76 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
trigger: always_on
|
|
3
|
+
description: AODW-Next 规范入口:开始任何任务前先读仓库根目录的 AGENTS.md
|
|
3
4
|
---
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
# 版本: 4.0.0 (Unified)
|
|
7
|
-
|
|
8
|
-
## 0. 语言要求 (Language Requirement)
|
|
9
|
-
|
|
10
|
-
**中文交流 (Chinese Communication)**:所有回复、思考过程、任务清单、文档内容均须使用中文。
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
你是一个 **AODW-Next (AI 编排开发工作流) 协作 Agent**。
|
|
15
|
-
|
|
16
|
-
## 1. 核心指令 (The Prime Directive)
|
|
17
|
-
你 **必须** 在开始任何任务前,优先读取并遵循以下 **Kernel (宪章)** 文件:
|
|
18
|
-
|
|
19
|
-
- .aodw-next/01-core/aodw-constitution.md
|
|
20
|
-
|
|
21
|
-
**注意**:
|
|
22
|
-
- 该文件是你行为的最高准则。
|
|
23
|
-
- 该文件包含了所有阶段的 **Context Loading Directives (上下文加载指令)**。
|
|
24
|
-
- 你必须根据宪章的指示,在不同阶段**按需加载**其他规则文件。
|
|
25
|
-
- ⚠️ **Token 优化原则**:只在需要时加载相关文件,避免一次性加载所有文件。详见 `.aodw-next/01-core/aodw-constitution.md` 第 6 节"文件加载策略"。
|
|
26
|
-
|
|
27
|
-
## 2. 命令索引 (Command Index)
|
|
28
|
-
|
|
29
|
-
当用户表达以下意图时,参考对应的核心规则:
|
|
30
|
-
|
|
31
|
-
| 用户意图 | 核心规则 | 说明 |
|
|
32
|
-
|---------|---------|------|
|
|
33
|
-
| **创建新 RT** | .aodw-next/02-workflow/rt-manager.md (Sec 1-4, 8-9)<br/>.aodw-next/01-core/ai-knowledge-rules.md (Sec 3.1)<br/>.aodw-next/01-core/ai-interaction-rules.md (Sec 1-4) | 生成 RT-ID,创建目录,Intake 流程 |
|
|
34
|
-
| **选择模式** | .aodw-next/02-workflow/rt-manager.md (Sec 5)<br/>.aodw-next/02-workflow/spec-full-profile.md<br/>.aodw-next/02-workflow/spec-lite-profile.md | 决策 Spec-Full/Spec-Lite,创建分支 |
|
|
35
|
-
| **Spec-Lite Autopilot** | .aodw-next/02-workflow/spec-lite-autopilot-profile.md<br/>.aodw-next/02-workflow/autopilot-protocol.md<br/>.aodw-next/02-workflow/rt-autopilot-readiness.md<br/>.aodw-next/01-core/git-discipline.md | 全自动:机械 Gate + Ralph 循环;强制 7 件套(含 autopilot-preflight.md) |
|
|
36
|
-
| **工具初始化** | .aodw-next/05-tooling/ai-tools-init-rules.md | 初始化开发工具(ESLint、Prettier、Ruff、Black 等) |
|
|
37
|
-
| **项目概览初始化** | .aodw-next/01-core/ai-project-overview-rules.md | 初始化或完善项目概览信息(技术栈、架构、模块等) |
|
|
38
|
-
| **分析阶段** | .aodw-next/03-standards/ai-coding-rules.md (Sec 2-3)<br/>.aodw-next/01-core/ai-knowledge-rules.md (Sec 3.4) | 影响分析、不变量检查,更新 impact.md, invariants.md |
|
|
39
|
-
| **实现阶段** | .aodw-next/03-standards/ai-coding-rules.md (Sec 6)<br/>.aodw-next/01-core/ai-knowledge-rules.md (Sec 3.5)<br/>.aodw-next/01-core/module-doc-rules.md | 代码实现、测试编写、模块文档更新 |
|
|
40
|
-
| **验证阶段** | .aodw-next/01-core/ai-knowledge-rules.md (Sec 5) | 验证文档与代码一致,检查 RT 完整性 |
|
|
41
|
-
| **CSF 审查** | .aodw-next/01-core/csf-thinking-framework.md | 执行 CSF 思维框架审查(以终为始、结构化分解、关键要素识别等) |
|
|
42
|
-
| **执行需求审计** | .aodw-next/04-auditors/aodw-requirement-auditor-rules.md | 调用需求阶段审计官,对需求文档进行审计(自动触发或手动触发) |
|
|
43
|
-
| **执行开发审计** | .aodw-next/04-auditors/aodw-development-auditor-rules.md | 调用开发阶段审计官,对代码进行审计(自动触发或手动触发) |
|
|
44
|
-
| **执行综合审计** | .aodw-next/04-auditors/aodw-full-auditor-rules.md | 调用综合审计官,执行全流程审计(需求 + 开发) |
|
|
45
|
-
| **完成 RT** | .aodw-next/01-core/git-discipline.md<br/>.aodw-next/01-core/ai-knowledge-rules.md (Sec 9) | 合并分支,知识蒸馏,更新状态 |
|
|
46
|
-
| **打开 RT** | .aodw-next/02-workflow/rt-manager.md | 打开已有 RT,加载上下文 |
|
|
47
|
-
| **流程控制** | .aodw-next/01-core/ai-interaction-rules.md (Sec 5) | 暂停/恢复流程 |
|
|
48
|
-
|
|
49
|
-
## 3. RT 生命周期
|
|
50
|
-
|
|
51
|
-
```
|
|
52
|
-
创建 → 立项 → 决策 → 分析 → 实现 → 验证 → 完成
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
每个阶段对应的核心规则和操作,详见上述命令索引。
|
|
56
|
-
|
|
57
|
-
## 4. 关键检查点
|
|
58
|
-
|
|
59
|
-
### 4.1 分支管理(必须)
|
|
60
|
-
- 所有代码修改必须在 feature 分支上进行
|
|
61
|
-
- 严禁在 main/master 分支直接修改业务代码
|
|
62
|
-
- 在修改代码前必须验证当前分支
|
|
63
|
-
|
|
64
|
-
### 4.2 Plan 批准节点(必须)
|
|
65
|
-
- Plan 完成后,必须执行 CSF 审查
|
|
66
|
-
- Plan 批准前必须通过 CSF 审查
|
|
67
|
-
- 严禁未获批准前开始修改代码
|
|
68
|
-
|
|
69
|
-
### 4.3 提交前确认(必须)
|
|
70
|
-
- 代码修改完成后,必须展示 git status 和关键 diff
|
|
71
|
-
- 询问用户"修改已完成,是否提交?"
|
|
72
|
-
- 严禁未获用户确认前直接 Commit
|
|
73
|
-
- **Autopilot 例外**:当 RT `meta.yaml` 含 `autopilot: true` 且 GRV 已用户确认、`phase=implementing` 时,由机械 Gate(tests/lint/guard)替代本条「询问是否提交」;轮末用 `CONTINUE`/`DONE`/`blocked` + `rt-grv-continue.sh` 续跑,禁止停问是否继续。详见 `.aodw-next/02-workflow/autopilot-protocol.md`。
|
|
74
|
-
|
|
75
|
-
## 5. 兜底机制
|
|
76
|
-
如果你无法读取 .aodw-next/01-core/aodw-constitution.md,请立即停止并要求用户提供该文件。
|
|
6
|
+
在本仓库执行任何任务前,必须先阅读并严格遵守仓库根目录的 `@AGENTS.md`。本规则只是入口,不在这里重复规范内容。
|
|
@@ -1,72 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
## 0. 语言要求 (Language Requirement)
|
|
5
|
-
|
|
6
|
-
**中文交流 (Chinese Communication)**:所有回复、思考过程、任务清单、文档内容均须使用中文。
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
你是一个 **AODW-Next (AI 编排开发工作流) 协作 Agent**。
|
|
11
|
-
|
|
12
|
-
## 1. 核心指令 (The Prime Directive)
|
|
13
|
-
你 **必须** 在开始任何任务前,优先读取并遵循以下 **Kernel (宪章)** 文件:
|
|
14
|
-
|
|
15
|
-
- .aodw-next/01-core/aodw-constitution.md
|
|
16
|
-
|
|
17
|
-
**注意**:
|
|
18
|
-
- 该文件是你行为的最高准则。
|
|
19
|
-
- 该文件包含了所有阶段的 **Context Loading Directives (上下文加载指令)**。
|
|
20
|
-
- 你必须根据宪章的指示,在不同阶段**按需加载**其他规则文件。
|
|
21
|
-
- ⚠️ **Token 优化原则**:只在需要时加载相关文件,避免一次性加载所有文件。详见 `.aodw-next/01-core/aodw-constitution.md` 第 6 节"文件加载策略"。
|
|
22
|
-
|
|
23
|
-
## 2. 命令索引 (Command Index)
|
|
24
|
-
|
|
25
|
-
当用户表达以下意图时,参考对应的核心规则:
|
|
26
|
-
|
|
27
|
-
| 用户意图 | 核心规则 | 说明 |
|
|
28
|
-
|---------|---------|------|
|
|
29
|
-
| **创建新 RT** | .aodw-next/02-workflow/rt-manager.md (Sec 1-4, 8-9)<br/>.aodw-next/01-core/ai-knowledge-rules.md (Sec 3.1)<br/>.aodw-next/01-core/ai-interaction-rules.md (Sec 1-4) | 生成 RT-ID,创建目录,Intake 流程 |
|
|
30
|
-
| **选择模式** | .aodw-next/02-workflow/rt-manager.md (Sec 5)<br/>.aodw-next/02-workflow/spec-full-profile.md<br/>.aodw-next/02-workflow/spec-lite-profile.md | 决策 Spec-Full/Spec-Lite,创建分支 |
|
|
31
|
-
| **Spec-Lite Autopilot** | .aodw-next/02-workflow/spec-lite-autopilot-profile.md<br/>.aodw-next/02-workflow/autopilot-protocol.md<br/>.aodw-next/02-workflow/rt-autopilot-readiness.md<br/>.aodw-next/01-core/git-discipline.md | 全自动:机械 Gate + Ralph 循环;强制 7 件套(含 autopilot-preflight.md) |
|
|
32
|
-
| **工具初始化** | .aodw-next/05-tooling/ai-tools-init-rules.md | 初始化开发工具(ESLint、Prettier、Ruff、Black 等) |
|
|
33
|
-
| **项目概览初始化** | .aodw-next/01-core/ai-project-overview-rules.md | 初始化或完善项目概览信息(技术栈、架构、模块等) |
|
|
34
|
-
| **分析阶段** | .aodw-next/03-standards/ai-coding-rules.md (Sec 2-3)<br/>.aodw-next/01-core/ai-knowledge-rules.md (Sec 3.4) | 影响分析、不变量检查,更新 impact.md, invariants.md |
|
|
35
|
-
| **实现阶段** | .aodw-next/03-standards/ai-coding-rules.md (Sec 6)<br/>.aodw-next/01-core/ai-knowledge-rules.md (Sec 3.5)<br/>.aodw-next/01-core/module-doc-rules.md | 代码实现、测试编写、模块文档更新 |
|
|
36
|
-
| **验证阶段** | .aodw-next/01-core/ai-knowledge-rules.md (Sec 5) | 验证文档与代码一致,检查 RT 完整性 |
|
|
37
|
-
| **CSF 审查** | .aodw-next/01-core/csf-thinking-framework.md | 执行 CSF 思维框架审查(以终为始、结构化分解、关键要素识别等) |
|
|
38
|
-
| **执行需求审计** | .aodw-next/04-auditors/aodw-requirement-auditor-rules.md | 调用需求阶段审计官,对需求文档进行审计(自动触发或手动触发) |
|
|
39
|
-
| **执行开发审计** | .aodw-next/04-auditors/aodw-development-auditor-rules.md | 调用开发阶段审计官,对代码进行审计(自动触发或手动触发) |
|
|
40
|
-
| **执行综合审计** | .aodw-next/04-auditors/aodw-full-auditor-rules.md | 调用综合审计官,执行全流程审计(需求 + 开发) |
|
|
41
|
-
| **完成 RT** | .aodw-next/01-core/git-discipline.md<br/>.aodw-next/01-core/ai-knowledge-rules.md (Sec 9) | 合并分支,知识蒸馏,更新状态 |
|
|
42
|
-
| **打开 RT** | .aodw-next/02-workflow/rt-manager.md | 打开已有 RT,加载上下文 |
|
|
43
|
-
| **流程控制** | .aodw-next/01-core/ai-interaction-rules.md (Sec 5) | 暂停/恢复流程 |
|
|
44
|
-
|
|
45
|
-
## 3. RT 生命周期
|
|
46
|
-
|
|
47
|
-
```
|
|
48
|
-
创建 → 立项 → 决策 → 分析 → 实现 → 验证 → 完成
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
每个阶段对应的核心规则和操作,详见上述命令索引。
|
|
52
|
-
|
|
53
|
-
## 4. 关键检查点
|
|
54
|
-
|
|
55
|
-
### 4.1 分支管理(必须)
|
|
56
|
-
- 所有代码修改必须在 feature 分支上进行
|
|
57
|
-
- 严禁在 main/master 分支直接修改业务代码
|
|
58
|
-
- 在修改代码前必须验证当前分支
|
|
59
|
-
|
|
60
|
-
### 4.2 Plan 批准节点(必须)
|
|
61
|
-
- Plan 完成后,必须执行 CSF 审查
|
|
62
|
-
- Plan 批准前必须通过 CSF 审查
|
|
63
|
-
- 严禁未获批准前开始修改代码
|
|
64
|
-
|
|
65
|
-
### 4.3 提交前确认(必须)
|
|
66
|
-
- 代码修改完成后,必须展示 git status 和关键 diff
|
|
67
|
-
- 询问用户"修改已完成,是否提交?"
|
|
68
|
-
- 严禁未获用户确认前直接 Commit
|
|
69
|
-
- **Autopilot 例外**:当 RT `meta.yaml` 含 `autopilot: true` 且 GRV 已用户确认、`phase=implementing` 时,由机械 Gate(tests/lint/guard)替代本条「询问是否提交」;轮末用 `CONTINUE`/`DONE`/`blocked` + `rt-grv-continue.sh` 续跑,禁止停问是否继续。详见 `.aodw-next/02-workflow/autopilot-protocol.md`。
|
|
70
|
-
|
|
71
|
-
## 5. 兜底机制
|
|
72
|
-
如果你无法读取 .aodw-next/01-core/aodw-constitution.md,请立即停止并要求用户提供该文件。
|
|
1
|
+
<!-- AODW-Next 入口薄壳:规范在仓库根 AGENTS.md,本文件只负责让 Claude Code 加载它;规则请写进 AGENTS.md,不要写在这里。 -->
|
|
2
|
+
@AGENTS.md
|