babysit
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBabysit a PR
照看PR
Claude Code analog of Cursor's built-in . The implementation is a loop over CLI plus the Claude Code skill for pacing.
/babysitghloopPlatform note. On Codex, the Claude tool names and Claude built-in skills named below (, ) are Claude defaults. Resolve them via .
loopAskUserQuestioncodex-tools.mdInside poteto-mode, the Babysit playbook () supersedes this skill: it owns mode declaration, the merge frontier, stack safety, and the watcher. This skill stays the standalone entry point for a single PR outside a poteto-mode run.
../poteto-mode/playbooks/babysit.mdwatch-pr/babysit这是Cursor内置功能在Claude Code中的对应实现。其实现基于 CLI循环调用,搭配Claude Code的技能来控制节奏。
/babysitghloop平台说明:在Codex上,下文提及的Claude工具名称和Claude内置技能(、)均为Claude默认项。可通过解析它们。
loopAskUserQuestioncodex-tools.md在poteto-mode中,Babysit剧本()会替代本技能:它负责模式声明、合并边界、栈安全以及监控器。本技能是poteto-mode运行之外,单个PR的独立入口。
../poteto-mode/playbooks/babysit.mdwatch-pr/babysitWhen to use
使用场景
- There's an open PR and the user explicitly wants it kept green, and you are not already inside a poteto-mode run (the playbook owns that case).
- The user invokes directly.
/babysit - A subagent that opens a PR does NOT babysit — return to the parent and let the parent decide.
- 存在已开启的PR,且用户明确希望保持PR状态正常,同时当前未处于poteto-mode运行中(该场景由剧本接管)。
- 用户直接调用。
/babysit - 创建PR的子Agent不负责照看——需返回至父Agent,由父Agent决定后续操作。
Steps
步骤
-
Fetch PR state.bash
gh pr view <number> --json number,title,state,mergeable,reviewDecision,statusCheckRollup,mergeStateStatus,comments,reviews -
Triage in priority order.
- Merge conflicts (): rebase or merge
mergeStateStatus == DIRTY; resolve; force-push only if the branch is yours and not shared.main - Failing checks (entries with
statusCheckRollup): pull logs withconclusion: FAILURE. Root-cause the failure; fix the underlying code or test; commit; push.gh run view <run-id> --log-failed - Review comments (): act only on feedback you actually agree with. When a comment has a single mechanical answer — a rename, a guard clause, a formatting nit — make the edit and quote the comment in the commit message. When it hinges on a judgement call, or you can't tell what's being asked, don't guess: leave it and reply with what you would have done.
gh pr view --json comments,reviews - Review-bot comments (Bugbot and similar automation): classify fix/dismiss/ask before acting, per . Ask by default on security, data, and high-severity findings.
references/bugbot-triage.md
- Merge conflicts (
-
Loop. Use the Claude Codeskill to pace re-checks. Pick the interval from what you're watching:
loop- Active CI run: poll (it blocks until checks finish, so no separate loop interval needed).
gh pr checks --watch - Awaiting reviewer: 20–30 min heartbeat.
- Idle but want to catch new comments: hourly.
- Active CI run: poll
-
When to stop.
- Build is green, every comment resolved, branch merges cleanly → call it ready.
- You've run three rounds of fix → push → recheck and it still isn't fully green → stop, summarise what's still broken, and hand control back.
- The next fix would force a design choice → pause and put it to the user with .
AskUserQuestion
-
Report. Summarize fixes applied, comments addressed, comments deferred (with reason), current PR status. Cite each commit by SHA.
-
获取PR状态bash
gh pr view <number> --json number,title,state,mergeable,reviewDecision,statusCheckRollup,mergeStateStatus,comments,reviews -
按优先级分类处理
- 合并冲突():变基或合并
mergeStateStatus == DIRTY分支;解决冲突;仅当分支为你所有且未共享时,才进行强制推送。main - 检查失败(中
statusCheckRollup的条目):使用conclusion: FAILURE拉取日志。定位失败根本原因;修复底层代码或测试;提交;推送。gh run view <run-id> --log-failed - 评审评论():仅处理你确实认同的反馈。当评论只需机械性修改——重命名、添加守卫子句、格式调整——直接修改,并在提交信息中引用该评论。当涉及判断决策,或你无法理解要求时,不要猜测:保留现状并回复你的处理思路。
gh pr view --json comments,reviews - 评审机器人评论(Bugbot及类似自动化工具):根据,先分类为修复/驳回/询问再操作。对于安全、数据和高严重性问题,默认选择询问。
references/bugbot-triage.md
- 合并冲突(
-
循环监控:使用Claude Code的技能控制重新检查的节奏。根据监控内容选择间隔:
loop- 活跃CI运行:轮询(该命令会阻塞直到检查完成,因此无需单独设置循环间隔)。
gh pr checks --watch - 等待评审:20–30分钟一次心跳检查。
- 空闲但需捕获新评论:每小时检查一次。
- 活跃CI运行:轮询
-
停止条件
- 构建正常、所有评论已解决、分支可干净合并→标记为就绪。
- 已完成三轮“修复→推送→重新检查”循环但仍未完全正常→停止,总结仍存在的问题,交回控制权。
- 下一次修复需要做出设计选择→暂停,使用询问用户。
AskUserQuestion
-
报告:总结已应用的修复、已处理的评论、已推迟的评论(含原因)、当前PR状态。通过SHA引用每个提交。
Hard rules
硬性规则
- Don't rewrite history on a branch others may have pulled. If a rebase or force-push looks necessary, clear it with the user first.
- Don't tweak a test's expected values just to get a pass. Only change an assertion when the behaviour genuinely changed and the assertion was pinned to the old behaviour.
- Never skip hooks ().
--no-verify - Never bypass a failing check by marking it as not required.
- only when all checks are green and no unresolved review comments remain.
gh pr ready
- 不要重写其他人可能已拉取的分支历史。若需要变基或强制推送,先征得用户同意。
- 不要仅为了通过检查而修改测试的预期值。仅当行为确实改变且断言仍绑定旧行为时,才修改断言。
- 绝不跳过钩子()。
--no-verify - 绝不通过标记为非必需来绕过失败的检查。
- 仅当所有检查正常且无未解决的评审评论时,才使用。
gh pr ready
Cross-refs
交叉引用
- opens here after a PR is opened.
poteto-mode - Use before opening if the diff is contested; once open, babysit takes over.
interrogate - Use on any prose you write here (PR comments, commit messages, status reports).
unslop
- PR创建后,poteto-mode从此处启动。
- 若差异存在争议,在创建PR前使用;创建后,由babysit接管。
interrogate - 在此处编写的任何文案(PR评论、提交信息、状态报告)需使用处理。
unslop
Provenance
来源说明
This is a Claude Code analog of Cursor's , not a port — Cursor's implementation is closed source. The skill is independently authored, with its own prose and structure; the workflow is informed by Cursor's public behavior. The only overlap with other PR tools is the CLI commands it runs, which are functional invocations rather than copied text.
/babysit/babysitgh这是Cursor 功能在Claude Code中的对应实现,而非移植——Cursor的实现为闭源。本技能为独立开发,拥有自己的文案和结构;工作流参考了Cursor公开的行为。与其他PR工具的唯一重叠是所使用的 CLI命令,这些是功能性调用,而非复制的文本。
/babysit/babysitgh