mirror of
https://github.com/tradecatlabs/vibe-coding-cn.git
synced 2026-07-28 11:17:46 +00:00
feat: skills - audit auto-tmux package consistency
This commit is contained in:
@@ -32,6 +32,7 @@ skills/auto-tmux/
|
||||
│ ├── review-checklist.sh
|
||||
│ ├── verify-report-pack.sh
|
||||
│ ├── incident-report.sh
|
||||
│ ├── audit-package.sh
|
||||
│ ├── completion.bash
|
||||
│ ├── safety-check.sh
|
||||
│ ├── render-swarm-prompt.sh
|
||||
|
||||
@@ -317,6 +317,7 @@ skills/auto-tmux/scripts/swarm-dispatch.sh --role worker --target <session>:<win
|
||||
- `scripts/review-checklist.sh`: 为 report pack 生成 reviewer 审计清单
|
||||
- `scripts/verify-report-pack.sh`: 统一验证 report pack 的 manifest、JSONL 和审计清单
|
||||
- `scripts/incident-report.sh`: 生成误发送、误广播、远程采集和敏感信息风险复盘模板
|
||||
- `scripts/audit-package.sh`: 检查脚本、参考资料、SKILL 入口和 validator 的索引一致性
|
||||
- `scripts/completion.bash`: Bash completion,补全 `auto-tmux.sh` 与 `swarm-state.sh`
|
||||
- `scripts/safety-check.sh`: 发送/粘贴/分发前检查危险命令、敏感信息和过大 payload
|
||||
- `scripts/render-swarm-prompt.sh`: commander/worker/reviewer 提示词渲染脚本
|
||||
|
||||
@@ -53,13 +53,14 @@
|
||||
| 45 | `63d7831` | 文档摘要索引 | `reading-paths.md` |
|
||||
| 46 | `07d4850` | 操作事故 runbook | `incident-runbook.md` |
|
||||
| 47 | `d6a309f` | 事故报告脚本 | `incident-report.sh` |
|
||||
| 48 | `本轮` | 脚本清单速查 | `script-cheatsheet.md` |
|
||||
| 48 | `1ac2ee4` | 脚本清单速查 | `script-cheatsheet.md` |
|
||||
| 49 | `本轮` | 包一致性审计 | `audit-package.sh` |
|
||||
|
||||
## 后续候选方向
|
||||
|
||||
| 优先级 | 方向 | 说明 |
|
||||
|:---|:---|:---|
|
||||
| P3 | 最终一致性审计 | 对 roadmap、脚本索引和 references 做一次收尾一致性检查 |
|
||||
| P3 | 迭代收尾说明 | 汇总 50 轮能力层、验证路径和后续维护边界 |
|
||||
|
||||
## 每轮验收清单
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ scripts/
|
||||
├── review-checklist.sh # report pack reviewer 审计清单
|
||||
├── verify-report-pack.sh # report pack 统一验证入口
|
||||
├── incident-report.sh # 事故复盘模板生成
|
||||
├── audit-package.sh # auto-tmux 包索引一致性审计
|
||||
├── completion.bash # Bash completion
|
||||
├── safety-check.sh # 发送/粘贴/分发前的 payload 安全预检
|
||||
├── render-swarm-prompt.sh # commander/worker/reviewer 提示词渲染
|
||||
@@ -63,6 +64,7 @@ scripts/
|
||||
- 审计清单脚本只读报告包目录,不修改报告源文件。
|
||||
- 报告包验证脚本只组合本目录已有只读门禁,不修改报告包内容。
|
||||
- 事故报告脚本只生成模板,不自动判断责任或影响范围。
|
||||
- 包审计脚本只检查索引、入口和 validator 的一致性,不修改任何文件。
|
||||
- completion 文件只能定义 shell completion,不执行 tmux 写操作。
|
||||
- 安全预检脚本只能读取文本或文件,不控制 tmux,不写状态目录。
|
||||
- 状态脚本只能写入显式状态目录,不保存密钥、Token、密码或私密项目内容。
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
- [`review-checklist.sh`](./review-checklist.sh) - 为 report pack 生成 reviewer 审计清单。
|
||||
- [`verify-report-pack.sh`](./verify-report-pack.sh) - 统一验证 report pack 的 manifest、JSONL 和审计清单。
|
||||
- [`incident-report.sh`](./incident-report.sh) - 生成误发送、误广播、远程采集和敏感信息风险复盘模板。
|
||||
- [`audit-package.sh`](./audit-package.sh) - 检查脚本、参考资料、SKILL 入口和 validator 的索引一致性。
|
||||
- [`completion.bash`](./completion.bash) - Bash completion,补全 `auto-tmux.sh` 和 `swarm-state.sh` 子命令。
|
||||
- [`safety-check.sh`](./safety-check.sh) - 发送、粘贴或分发前检查危险命令、敏感信息和过大 payload。
|
||||
- [`render-swarm-prompt.sh`](./render-swarm-prompt.sh) - commander、worker、reviewer 提示词渲染。
|
||||
@@ -123,6 +124,9 @@ skills/auto-tmux/scripts/verify-report-pack.sh --pack /tmp/ai-swarm-report-pack
|
||||
# 生成事故复盘模板
|
||||
skills/auto-tmux/scripts/incident-report.sh --type mis-send --out /tmp/auto-tmux-incident.md
|
||||
|
||||
# 审计 auto-tmux 包索引一致性
|
||||
skills/auto-tmux/scripts/audit-package.sh
|
||||
|
||||
# 启用当前 shell 的补全
|
||||
source skills/auto-tmux/scripts/completion.bash
|
||||
|
||||
|
||||
Executable
+98
@@ -0,0 +1,98 @@
|
||||
#!/usr/bin/env bash
|
||||
# Audit auto-tmux package indexing consistency across scripts, references and gates.
|
||||
set -euo pipefail
|
||||
|
||||
usage() {
|
||||
cat <<'EOF'
|
||||
audit-package: check auto-tmux package indexing consistency
|
||||
|
||||
Usage:
|
||||
audit-package.sh
|
||||
|
||||
Checks:
|
||||
- every scripts/*.sh entry is documented in SKILL.md, scripts/README.md, scripts/AGENTS.md and validate-auto-tmux.sh
|
||||
- completion.bash is documented in the same package indexes
|
||||
- every references/*.md entry is documented in SKILL.md, references/README.md and references/index.md
|
||||
EOF
|
||||
}
|
||||
|
||||
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
skill_dir="$(cd "$script_dir/.." && pwd)"
|
||||
ref_dir="$skill_dir/references"
|
||||
|
||||
case "${1:-}" in
|
||||
-h|--help)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
"")
|
||||
;;
|
||||
*)
|
||||
printf 'error: unknown option: %s\n' "$1" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
failures=0
|
||||
|
||||
fail() {
|
||||
printf '[FAIL] %s\n' "$*" >&2
|
||||
failures=$((failures + 1))
|
||||
}
|
||||
|
||||
pass() {
|
||||
printf '[OK] %s\n' "$*"
|
||||
}
|
||||
|
||||
require_contains() {
|
||||
local file="$1"
|
||||
local pattern="$2"
|
||||
local label="$3"
|
||||
if grep -Fq "$pattern" "$file"; then
|
||||
pass "$label mentions $pattern"
|
||||
else
|
||||
fail "$label missing $pattern"
|
||||
fi
|
||||
}
|
||||
|
||||
for script_path in "$script_dir"/*.sh; do
|
||||
script_name="$(basename "$script_path")"
|
||||
if [[ -x "$script_path" ]]; then
|
||||
pass "executable script: $script_name"
|
||||
else
|
||||
fail "script is not executable: $script_name"
|
||||
fi
|
||||
require_contains "$skill_dir/SKILL.md" "scripts/$script_name" "SKILL.md"
|
||||
require_contains "$script_dir/README.md" "$script_name" "scripts/README.md"
|
||||
require_contains "$script_dir/AGENTS.md" "$script_name" "scripts/AGENTS.md"
|
||||
require_contains "$script_dir/validate-auto-tmux.sh" "$script_name" "validate-auto-tmux.sh"
|
||||
done
|
||||
|
||||
require_contains "$skill_dir/SKILL.md" "scripts/completion.bash" "SKILL.md"
|
||||
require_contains "$script_dir/README.md" "completion.bash" "scripts/README.md"
|
||||
require_contains "$script_dir/AGENTS.md" "completion.bash" "scripts/AGENTS.md"
|
||||
require_contains "$script_dir/validate-auto-tmux.sh" "completion.bash" "validate-auto-tmux.sh"
|
||||
|
||||
for ref_path in "$ref_dir"/*.md; do
|
||||
ref_name="$(basename "$ref_path")"
|
||||
case "$ref_name" in
|
||||
AGENTS.md|README.md)
|
||||
continue
|
||||
;;
|
||||
index.md)
|
||||
require_contains "$skill_dir/SKILL.md" "references/$ref_name" "SKILL.md"
|
||||
require_contains "$ref_dir/README.md" "$ref_name" "references/README.md"
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
require_contains "$skill_dir/SKILL.md" "references/$ref_name" "SKILL.md"
|
||||
require_contains "$ref_dir/README.md" "$ref_name" "references/README.md"
|
||||
require_contains "$ref_dir/index.md" "$ref_name" "references/index.md"
|
||||
done
|
||||
|
||||
if (( failures > 0 )); then
|
||||
printf 'auto-tmux package audit failed: %s issue(s)\n' "$failures" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
printf 'auto-tmux package audit ok\n'
|
||||
@@ -118,6 +118,7 @@ scripts=(
|
||||
"$script_dir/review-checklist.sh"
|
||||
"$script_dir/verify-report-pack.sh"
|
||||
"$script_dir/incident-report.sh"
|
||||
"$script_dir/audit-package.sh"
|
||||
"$script_dir/safety-check.sh"
|
||||
"$script_dir/render-swarm-prompt.sh"
|
||||
"$script_dir/swarm-dispatch.sh"
|
||||
@@ -201,6 +202,8 @@ run_gate "review-checklist strict failure" bash -c '
|
||||
run_gate "verify-report-pack help" "$script_dir/verify-report-pack.sh" --help
|
||||
run_gate "incident-report help" "$script_dir/incident-report.sh" --help
|
||||
run_gate "incident-report render" "$script_dir/incident-report.sh" --type mis-send
|
||||
run_gate "audit-package help" "$script_dir/audit-package.sh" --help
|
||||
run_gate "audit-package consistency" "$script_dir/audit-package.sh"
|
||||
run_gate "safety-check help" "$script_dir/safety-check.sh" --help
|
||||
run_gate "safety-check clean text" "$script_dir/safety-check.sh" --text "make test"
|
||||
if "$script_dir/safety-check.sh" --text "rm -rf /tmp/example" >/tmp/auto-tmux-validate-gate.log 2>&1; then
|
||||
@@ -230,6 +233,7 @@ require_contains "$skill_dir/SKILL.md" "scripts/check-jsonl.sh"
|
||||
require_contains "$skill_dir/SKILL.md" "scripts/review-checklist.sh"
|
||||
require_contains "$skill_dir/SKILL.md" "scripts/verify-report-pack.sh"
|
||||
require_contains "$skill_dir/SKILL.md" "scripts/incident-report.sh"
|
||||
require_contains "$skill_dir/SKILL.md" "scripts/audit-package.sh"
|
||||
require_contains "$skill_dir/SKILL.md" "scripts/completion.bash"
|
||||
require_contains "$skill_dir/SKILL.md" "scripts/safety-check.sh"
|
||||
require_contains "$skill_dir/SKILL.md" "scripts/swarm-dispatch.sh"
|
||||
@@ -281,6 +285,7 @@ require_contains "$script_dir/README.md" "check-jsonl.sh"
|
||||
require_contains "$script_dir/README.md" "review-checklist.sh"
|
||||
require_contains "$script_dir/README.md" "verify-report-pack.sh"
|
||||
require_contains "$script_dir/README.md" "incident-report.sh"
|
||||
require_contains "$script_dir/README.md" "audit-package.sh"
|
||||
require_contains "$script_dir/README.md" "completion.bash"
|
||||
require_contains "$script_dir/README.md" "safety-check.sh"
|
||||
require_contains "$script_dir/AGENTS.md" "validate-auto-tmux.sh"
|
||||
@@ -302,6 +307,7 @@ require_contains "$script_dir/AGENTS.md" "check-jsonl.sh"
|
||||
require_contains "$script_dir/AGENTS.md" "review-checklist.sh"
|
||||
require_contains "$script_dir/AGENTS.md" "verify-report-pack.sh"
|
||||
require_contains "$script_dir/AGENTS.md" "incident-report.sh"
|
||||
require_contains "$script_dir/AGENTS.md" "audit-package.sh"
|
||||
require_contains "$script_dir/AGENTS.md" "completion.bash"
|
||||
require_contains "$script_dir/AGENTS.md" "safety-check.sh"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user