babysit
它能做什么
这个代理会一直盯着一个拉取请求(Pull Request),直到它可以合并为止。它会监控评论、审查意见和自动化检查,确保所有问题都得到解决。
适用场景
- ✓当你希望有人替你跟进某个拉取请求时。
- ✓当你需要确保拉取请求上的所有评论和审查意见都已处理时。
- ✓当你希望在合并之前,确保拉取请求的自动化检查全部通过时。
技能链接
https://github.com/thedotmack/claude-mem/blob/main/plugin/skills/babysit/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“盯着这个拉取请求,直到它可以合并为止。”
每周 5 个新技能,1 分钟读完。
工作原理
代理会定期检查拉取请求的状态、评论和审查意见。在所有问题都解决、检查全部通过之前,它会一直持续监控。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Babysit PR
Stay with the PR until it is actually clean. Do not stop after one check pass if comments or review threads are still unresolved.
Workflow
- Identify the PR number, branch, and base branch.
- Confirm the PR is not draft and inspect mergeability, checks, review decision, comments, and review threads.
- Watch pending checks until they finish. Poll at a practical interval, usually 30-60 seconds unless the user asks for a different cadence.
- Read new comments and unresolved review threads. Treat bot summaries as useful, but verify actionable findings against the code.
- Fix real issues in focused commits, run relevant tests/builds, push, and return to step 2.
- Resolve stale review threads only after verifying the code or generated artifact now addresses the comment.
- Stop only when checks are passing or intentionally skipped, review decision is acceptable, no actionable comments remain, and no unresolved review threads remain.
GitHub CLI Checks
Use gh pr view for the coarse status:
gh pr view <number> --json \
number,state,isDraft,mergeable,mergeStateStatus,reviewDecision,headRefOid,statusCheckRollup,url
Resolve the repository owner/name before using GraphQL:
repo_json=$(gh repo view --json owner,name)
owner=$(jq -r '.owner.login // .owner.name' <<<"$repo_json")
repo=$(jq -r '.name' <<<"$repo_json")
Use GraphQL for unresolved review threads. Include pageInfo; omit cursor on the first page, then pass the previous endCursor with -f cursor="$cursor" while hasNextPage is true.
gh api graphql \
-f query='query($owner:String!,$repo:String!,$number:Int!,$cursor:String){repository(owner:$owner,name:$repo){pullRequest(number:$number){reviewThreads(first:100,after:$cursor){pageInfo{hasNextPage endCursor}nodes{id,isResolved,isOutdated,path,line,comments(last:1){nodes{author{login},body,createdAt,url}}}}}}}' \
-f owner="$owner" -f repo="$repo" -F number=<number>
Use this loop when a PR may have many review threads:
thread_query='query($owner:String!,$repo:String!,$number:Int!,$cursor:String){repository(owner:$owner,name:$repo){pullRequest(number:$number){reviewThreads(first:100,after:$cursor){pageInfo{hasNextPage endCursor}nodes{id,isResolved,isOutdated,path,line,comments(last:1){nodes{author{login},body,createdAt,url}}}}}}}'
cursor_args=()
while :; do
page=$(gh api graphql -f query="$thread_query" -f owner="$owner" -f repo="$repo" -F number=<number> "${cursor_args[@]}")
printf '%s\n' "$page" | jq -r '.data.repository.pullRequest.reviewThreads.nodes[]
| select(.isResolved==false)
| [.id,.path,(.line//""),(.isOutdated|tostring),(.comments.nodes[-1].author.login//""),(.comments.nodes[-1].body|gsub("\n";" ")|.[0:240])]
| @tsv'
jq -e '.data.repository.pullRequest.reviewThreads.pageInfo.hasNextPage' >/dev/null <<<"$page" || break
cursor=$(jq -r '.data.repository.pullRequest.reviewThreads.pageInfo.endCursor' <<<"$page")
cursor_args=(-f cursor="$cursor")
done
Filter unresolved threads with jq:
jq -r '.data.repository.pullRequest.reviewThreads.nodes[]
| select(.isResolved==false)
| [.id,.path,(.line//""),(.isOutdated|tostring),(.comments.nodes[-1].author.login//""),(.comments.nodes[-1].body|gsub("\n";" ")|.[0:240])]
| @tsv'
Resolve a stale thread only when the fix is verified:
gh api graphql \
-f query='mutation($threadId:ID!){resolveReviewThread(input:{threadId:$threadId}){thread{id,isResolved}}}' \
-f threadId=<thread-id>
Operating Rules
- Keep the watcher running while long checks are pending.
- If a generated file is part of the distribution, verify the source and generated artifact agree before resolving comments.
- If a bot reports an issue against stale code, confirm whether the thread is outdated or addressed in the latest head.
- Before final reporting, do one fresh sweep of PR status, unresolved threads, recent comments, and local
git status. - Report concrete evidence: latest commit SHA, check names and results, unresolved thread count, tests run, and any dirty local files left untouched.
常见问题
什么是拉取请求?
它是一种对代码项目提出修改的方式。这些修改在被加入主项目之前,需要经过其他人的审查。
什么是「自动化检查」(CI)?
这些是由计算机自动运行的检查,用来确保新代码没有破坏项目中的任何内容。
代理会自己修复问题吗?
代理负责监控并汇报问题,但实际的修复通常还需要由人来完成。
详情
作者的原始描述
Watch a pull request or review cycle until it is ready to merge. Use when asked to babysit, monitor, or keep checking PR comments, reviews, and CI until all actionable issues are resolved.
repo: thedotmack/claude-mem
热度
- GitHub 星标
- 101k
- 排名
- #1267
- 许可证
- Apache-2.0
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
Agent Cost Report
101k让你的智能体生成其活动的详细成本报告。显示在 token 和服务上花费了多少。
claude-mem-install
101k帮助你的智能体在不同环境中设置 Claude-Mem。你可以选择使用本地或远程工作进程,并配置观察功能。
mem-search
101k让你的智能体搜索过去的记忆。适合回忆之前的解决方案,或旧会话中的工作内容。
host-observer
101k帮助你的智能体响应 Claude-Mem 观察者任务。它只能回复“skip_summary”或完整的 XML 观察记录。