用途:编排多仓库的 GitHub PR、Gerrit CL、本地 Git worktree 与分支清理,并对活跃开放 PR 做下一步处理提示。
主要能力:先以只读方式并行运行三个收集器,构建 ~/github 的统一视图——kscripts gh-clean -l 50 --markdown(已合并/关闭 PR、陈旧 worktree、悬空远程分支)、kscripts gh-view -d 14 --markdown(开放 PR 与评审/CI 下一步)、kscripts gerrit-view -p ~/github/dart-sdk(Dart SDK Gerrit worktree 与 CL 状态,需该目录存在);可选 kscripts gh-issues --linked-prs --markdown。随后交叉核对活跃会话归属,将结果分为三桶:A 活跃/勿动、B 可立即清理、C 需显式确认,并通过 ask_question 审批后执行。
使用方式:确保 kscripts 在 PATH 上,缺失时用 dart install 'kevmoo_scripts@{git: https://github.com/kevmoo/scripts.dart}' 安装,之后用 upkeep update dart_install 保持更新。首次扫描切勿加 --apply。清理前对脏/未推送 worktree 运行 git -C <worktree_path> status -s 与 git -C <worktree_path> log -n 2 --oneline;对已合并分支做 squash-merge 祖先检查:git -C <repo_path> fetch origin main --quiet 与 git -C <repo_path> rev-list --count origin/main..<branch>,计数为 0 时可用 git -C <repo_path> branch -D <branch> 删除。执行 B 桶时,若某已合并 PR 的 worktree 被归入 A 桶,需按仓库逐个运行 kscripts gh-clean -R <owner/repo> --apply;仅当没有已合并 PR worktree 被重分类到 A 桶时,才运行无范围的 kscripts gh-clean -l 50 --apply。C 桶经批准后运行 git -C <parent_repo> worktree remove --force <worktree_path> 与 git -C <parent_repo> branch -D <branch>。
限制:该技能针对个人仓库布局与 kscripts CLI;不要运行 dart install ~/github/kevmoo/scripts.dart,本地路径安装会永久把 upkeep update dart_install 指向该检出而非远程,仅用于测试未提交工作,之后需从 Git 重装。其他平台、收费与效果信息暂未提供。