From 31843c6197f94fd2aa2737c82a4d290f00c3f7a5 Mon Sep 17 00:00:00 2001 From: tukuaiai Date: Tue, 19 May 2026 14:22:42 +0800 Subject: [PATCH] feat: skills - add auto-tmux report review checklist --- skills/auto-tmux/AGENTS.md | 4 +- skills/auto-tmux/README.md | 1 + skills/auto-tmux/SKILL.md | 5 +- skills/auto-tmux/references/automation.md | 3 + .../auto-tmux/references/iteration-roadmap.md | 5 +- skills/auto-tmux/scripts/AGENTS.md | 2 + skills/auto-tmux/scripts/README.md | 4 + skills/auto-tmux/scripts/auto-tmux.sh | 2 +- skills/auto-tmux/scripts/review-checklist.sh | 91 +++++++++++++++++++ skills/auto-tmux/scripts/swarm-report-pack.sh | 4 + .../auto-tmux/scripts/validate-auto-tmux.sh | 6 ++ 11 files changed, 122 insertions(+), 5 deletions(-) create mode 100755 skills/auto-tmux/scripts/review-checklist.sh diff --git a/skills/auto-tmux/AGENTS.md b/skills/auto-tmux/AGENTS.md index 396d251..4929e1c 100644 --- a/skills/auto-tmux/AGENTS.md +++ b/skills/auto-tmux/AGENTS.md @@ -29,6 +29,7 @@ skills/auto-tmux/ │ ├── remote-readonly.sh │ ├── record-summary.sh │ ├── check-jsonl.sh +│ ├── review-checklist.sh │ ├── completion.bash │ ├── safety-check.sh │ ├── render-swarm-prompt.sh @@ -73,6 +74,7 @@ skills/auto-tmux/ - `scripts/remote-readonly.sh` 是远端只读层,通过 SSH 采集 tmux 拓扑和输出证据。 - `scripts/record-summary.sh` 是复盘摘要层,将 pane 录制日志整理为 Markdown。 - `scripts/check-jsonl.sh` 是轻量 JSONL 字段门禁层,不替代完整 JSON parser。 +- `scripts/review-checklist.sh` 是报告包审计层,为 reviewer 生成固定检查清单。 - `scripts/completion.bash` 是本地补全层,补全 `auto-tmux.sh` 与 `swarm-state.sh`。 - `scripts/safety-check.sh` 是安全预检层,检查待发送 payload 的危险命令、敏感信息和大小。 - `scripts/render-swarm-prompt.sh` 是提示词渲染层,生成 commander/worker/reviewer 协议文本。 @@ -87,4 +89,4 @@ skills/auto-tmux/ - 上游来源:`tools/external/.tmux` 与 `tools/external/tmux`。 - 下游使用:`SKILL.md` 和 `references/` 中的命令示例。 - 验证入口:`skills/auto-skill/scripts/validate-skill.sh skills/auto-tmux --strict`。 -- 脚本验证:`skills/auto-tmux/scripts/validate-auto-tmux.sh`、`bash -n skills/auto-tmux/scripts/auto-tmux.sh`、`bash -n skills/auto-tmux/scripts/swarm-state.sh`、`bash -n skills/auto-tmux/scripts/swarm-brief.sh`、`bash -n skills/auto-tmux/scripts/swarm-watch.sh`、`bash -n skills/auto-tmux/scripts/swarm-archive.sh`、`bash -n skills/auto-tmux/scripts/swarm-board.sh`、`bash -n skills/auto-tmux/scripts/swarm-deps-graph.sh`、`bash -n skills/auto-tmux/scripts/swarm-export.sh`、`bash -n skills/auto-tmux/scripts/swarm-timeline.sh`、`bash -n skills/auto-tmux/scripts/swarm-blockers.sh`、`bash -n skills/auto-tmux/scripts/swarm-results.sh`、`bash -n skills/auto-tmux/scripts/swarm-report-pack.sh`、`bash -n skills/auto-tmux/scripts/swarm-assign.sh`、`bash -n skills/auto-tmux/scripts/swarm-health.sh`、`bash -n skills/auto-tmux/scripts/remote-readonly.sh`、`bash -n skills/auto-tmux/scripts/record-summary.sh`、`bash -n skills/auto-tmux/scripts/check-jsonl.sh`、`bash -n skills/auto-tmux/scripts/completion.bash`、`bash -n skills/auto-tmux/scripts/safety-check.sh`、`bash -n skills/auto-tmux/scripts/render-swarm-prompt.sh`、`bash -n skills/auto-tmux/scripts/swarm-dispatch.sh`、`skills/auto-tmux/scripts/auto-tmux-smoke-test.sh`。 +- 脚本验证:`skills/auto-tmux/scripts/validate-auto-tmux.sh`、`bash -n skills/auto-tmux/scripts/auto-tmux.sh`、`bash -n skills/auto-tmux/scripts/swarm-state.sh`、`bash -n skills/auto-tmux/scripts/swarm-brief.sh`、`bash -n skills/auto-tmux/scripts/swarm-watch.sh`、`bash -n skills/auto-tmux/scripts/swarm-archive.sh`、`bash -n skills/auto-tmux/scripts/swarm-board.sh`、`bash -n skills/auto-tmux/scripts/swarm-deps-graph.sh`、`bash -n skills/auto-tmux/scripts/swarm-export.sh`、`bash -n skills/auto-tmux/scripts/swarm-timeline.sh`、`bash -n skills/auto-tmux/scripts/swarm-blockers.sh`、`bash -n skills/auto-tmux/scripts/swarm-results.sh`、`bash -n skills/auto-tmux/scripts/swarm-report-pack.sh`、`bash -n skills/auto-tmux/scripts/swarm-assign.sh`、`bash -n skills/auto-tmux/scripts/swarm-health.sh`、`bash -n skills/auto-tmux/scripts/remote-readonly.sh`、`bash -n skills/auto-tmux/scripts/record-summary.sh`、`bash -n skills/auto-tmux/scripts/check-jsonl.sh`、`bash -n skills/auto-tmux/scripts/review-checklist.sh`、`bash -n skills/auto-tmux/scripts/completion.bash`、`bash -n skills/auto-tmux/scripts/safety-check.sh`、`bash -n skills/auto-tmux/scripts/render-swarm-prompt.sh`、`bash -n skills/auto-tmux/scripts/swarm-dispatch.sh`、`skills/auto-tmux/scripts/auto-tmux-smoke-test.sh`。 diff --git a/skills/auto-tmux/README.md b/skills/auto-tmux/README.md index f5bcbd3..433d8f1 100644 --- a/skills/auto-tmux/README.md +++ b/skills/auto-tmux/README.md @@ -36,6 +36,7 @@ bash -n skills/auto-tmux/scripts/swarm-health.sh bash -n skills/auto-tmux/scripts/remote-readonly.sh bash -n skills/auto-tmux/scripts/record-summary.sh bash -n skills/auto-tmux/scripts/check-jsonl.sh +bash -n skills/auto-tmux/scripts/review-checklist.sh bash -n skills/auto-tmux/scripts/completion.bash bash -n skills/auto-tmux/scripts/safety-check.sh bash -n skills/auto-tmux/scripts/render-swarm-prompt.sh diff --git a/skills/auto-tmux/SKILL.md b/skills/auto-tmux/SKILL.md index 9c99675..7113b2f 100644 --- a/skills/auto-tmux/SKILL.md +++ b/skills/auto-tmux/SKILL.md @@ -50,6 +50,7 @@ bash -n skills/auto-tmux/scripts/swarm-health.sh bash -n skills/auto-tmux/scripts/remote-readonly.sh bash -n skills/auto-tmux/scripts/record-summary.sh bash -n skills/auto-tmux/scripts/check-jsonl.sh +bash -n skills/auto-tmux/scripts/review-checklist.sh bash -n skills/auto-tmux/scripts/completion.bash bash -n skills/auto-tmux/scripts/safety-check.sh bash -n skills/auto-tmux/scripts/render-swarm-prompt.sh @@ -172,6 +173,7 @@ skills/auto-tmux/scripts/auto-tmux.sh record start -t :. skills/auto-tmux/scripts/auto-tmux.sh record stop -t :. skills/auto-tmux/scripts/record-summary.sh --dir /tmp/auto-tmux-records --out /tmp/auto-tmux-record-summary.md skills/auto-tmux/scripts/check-jsonl.sh /tmp/ai-swarm-results.jsonl --require-key type --require-key id --require-key status +skills/auto-tmux/scripts/review-checklist.sh --pack /tmp/ai-swarm-report-pack --out /tmp/ai-swarm-report-pack/review-checklist.md ``` **等待 pane 出现完成信号** @@ -303,6 +305,7 @@ skills/auto-tmux/scripts/swarm-dispatch.sh --role worker --target ::&2 + exit 1 +} + +pack_dir="" +out_file="" + +while [[ $# -gt 0 ]]; do + case "$1" in + --pack) + pack_dir="${2:-}" + shift 2 + ;; + --out) + out_file="${2:-}" + shift 2 + ;; + -h|--help) + usage + exit 0 + ;; + *) + die "unknown option: $1" + ;; + esac +done + +[[ -n "$pack_dir" ]] || die "missing --pack" +[[ -d "$pack_dir" ]] || die "pack dir not found: $pack_dir" + +exists_mark() { + local path="$1" + if [[ -e "$pack_dir/$path" ]]; then + printf 'x' + else + printf ' ' + fi +} + +render_checklist() { + printf '# auto-tmux Report Review Checklist\n\n' + printf -- '- pack_dir: `%s`\n' "$pack_dir" + printf -- '- created_at: `%s`\n\n' "$(date -Is)" + + printf '## Required Files\n\n' + local file + for file in index.md manifest.json board.md deps.md timeline.md blockers.md results.md results.jsonl assign.md export/manifest.json; do + printf -- '- [%s] `%s`\n' "$(exists_mark "$file")" "$file" + done + + printf '\n## Review Gates\n\n' + printf -- '- [ ] `manifest.json` type is `auto-tmux-swarm-report-pack`.\n' + printf -- '- [ ] `results.md` clearly lists DONE/FAIL/BLOCKED worker outcomes.\n' + printf -- '- [ ] `blockers.md` has no unresolved blocker that prevents handoff.\n' + printf -- '- [ ] `assign.md` does not imply an unclaimed task was silently executed.\n' + printf -- '- [ ] Attachments, if present, are explicit evidence directories and do not contain secrets.\n' + printf -- '- [ ] Reviewer can reproduce the key conclusion from files in this pack only.\n' + + printf '\n## Suggested Commands\n\n' + printf '```bash\n' + printf 'skills/auto-tmux/scripts/check-jsonl.sh %q --require-key type --require-key id --require-key status\n' "$pack_dir/results.jsonl" + printf 'grep -F "\"type\": \"auto-tmux-swarm-report-pack\"" %q\n' "$pack_dir/manifest.json" + printf '```\n' +} + +if [[ -n "$out_file" ]]; then + mkdir -p "$(dirname "$out_file")" + render_checklist > "$out_file" + printf 'review checklist written: %s\n' "$out_file" +else + render_checklist +fi diff --git a/skills/auto-tmux/scripts/swarm-report-pack.sh b/skills/auto-tmux/scripts/swarm-report-pack.sh index 384c1a1..bdd4dfb 100755 --- a/skills/auto-tmux/scripts/swarm-report-pack.sh +++ b/skills/auto-tmux/scripts/swarm-report-pack.sh @@ -146,6 +146,7 @@ cat > "$out_dir/manifest.json" < "$out_dir/index.md" </dev/null 2>&1 || die "tar not found" diff --git a/skills/auto-tmux/scripts/validate-auto-tmux.sh b/skills/auto-tmux/scripts/validate-auto-tmux.sh index f32dec9..d0a9a73 100755 --- a/skills/auto-tmux/scripts/validate-auto-tmux.sh +++ b/skills/auto-tmux/scripts/validate-auto-tmux.sh @@ -115,6 +115,7 @@ scripts=( "$script_dir/remote-readonly.sh" "$script_dir/record-summary.sh" "$script_dir/check-jsonl.sh" + "$script_dir/review-checklist.sh" "$script_dir/safety-check.sh" "$script_dir/render-swarm-prompt.sh" "$script_dir/swarm-dispatch.sh" @@ -162,6 +163,7 @@ run_gate "swarm-report-pack attachment" bash -c ' grep -Fq "attachments.md" "$tmp/out/index.md" grep -Fq "results.md" "$tmp/out/index.md" grep -Fq "results.jsonl" "$tmp/out/index.md" + grep -Fq "review-checklist.md" "$tmp/out/index.md" grep -Fq "manifest.json" "$tmp/out/index.md" grep -Fq "\"type\": \"auto-tmux-swarm-report-pack\"" "$tmp/out/manifest.json" grep -Fq "\"attachments\"" "$tmp/out/manifest.json" @@ -183,6 +185,7 @@ run_gate "check-jsonl required keys" bash -c ' "$1" "$tmp" --require-key type --require-key id --require-key status >/dev/null rm -f "$tmp" ' _ "$script_dir/check-jsonl.sh" +run_gate "review-checklist help" "$script_dir/review-checklist.sh" --help 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 @@ -209,6 +212,7 @@ require_contains "$skill_dir/SKILL.md" "scripts/swarm-health.sh" require_contains "$skill_dir/SKILL.md" "scripts/remote-readonly.sh" require_contains "$skill_dir/SKILL.md" "scripts/record-summary.sh" 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/completion.bash" require_contains "$skill_dir/SKILL.md" "scripts/safety-check.sh" require_contains "$skill_dir/SKILL.md" "scripts/swarm-dispatch.sh" @@ -242,6 +246,7 @@ require_contains "$script_dir/README.md" "remote-readonly.sh" require_contains "$script_dir/README.md" "metadata.jsonl" require_contains "$script_dir/README.md" "record-summary.sh" require_contains "$script_dir/README.md" "check-jsonl.sh" +require_contains "$script_dir/README.md" "review-checklist.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" @@ -260,6 +265,7 @@ require_contains "$script_dir/AGENTS.md" "swarm-health.sh" require_contains "$script_dir/AGENTS.md" "remote-readonly.sh" require_contains "$script_dir/AGENTS.md" "record-summary.sh" require_contains "$script_dir/AGENTS.md" "check-jsonl.sh" +require_contains "$script_dir/AGENTS.md" "review-checklist.sh" require_contains "$script_dir/AGENTS.md" "completion.bash" require_contains "$script_dir/AGENTS.md" "safety-check.sh"