用途:在用户推送代码后监控 GitHub Actions 的 CI 运行,自动检测仓库和分支,去重并发监控并汇报结果。
主要能力:自动检测分支(优先 jj bookmark,其次 git);通过 /tmp/{repo}-ci-monitor 哨兵文件去重,防止重复监控;轮询等待分支上出现 CI 运行,最多 60 秒;用 gh run watch --exit-status 持续观察直至结束;失败时用 gh run view --log-failed 抓取失败日志(最后 3000 字符);无论成功或出错都会清理哨兵文件。
使用方式:推送后在后台运行脚本: uv run ~/.claude/skills/monitoring-ci/ci-monitor.py 指定分支: uv run ~/.claude/skills/monitoring-ci/ci-monitor.py --branch my-feature 在 Claude 中可将其作为后台 Bash 命令运行,使用 run_in_background: true 以免阻塞对话,并告知用户监控已在后台运行、完成时会收到通知。
退出码:0 表示 CI 通过(或未发现运行);1 表示 CI 失败并打印日志。
限制:需已认证的 gh CLI,且仓库需配置 GitHub Actions 工作流。其他平台或非 GitHub Actions 场景暂未提供支持。