clawsweeper
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseClawSweeper
ClawSweeper
ClawSweeper lives at . It is the one OpenClaw
maintenance bot for sweeping, commit review, repair jobs, and guarded fix PRs.
Use this skill whenever Peter asks about reports, findings, dispatch health,
repair/cloud PR creation, comment commands, automerge, permissions, or gates.
~/Projects/clawsweeperClawSweeper 位于 ,是 OpenClaw 的专属维护机器人,负责扫描、提交审查、修复任务以及受保护的修复PR。当Peter询问报告、检测结果、调度健康状态、修复/云端PR创建、评论命令、自动合并、权限或闸门相关问题时,使用此工具。
~/Projects/clawsweeperStart
启动
bash
cd ~/Projects/clawsweeper
git status --short --branch
git pull --ff-only
pnpm run build:allDo not overwrite unrelated edits. If the tree is dirty, inspect first and keep
read-only report work read-only unless Peter asked to commit.
bash
cd ~/Projects/clawsweeper
git status --short --branch
git pull --ff-only
pnpm run build:all请勿覆盖无关的编辑内容。如果工作树处于未提交状态,需先检查内容;除非Peter要求提交,否则只读报告类工作需保持只读状态。
One Bot, One App
单机器人单应用
Use the ClawSweeper repo and the GitHub App. Use only
configuration for this automation. Do not use legacy apps,
variables, labels, or skills.
clawsweeperCLAWSWEEPER_*Required app setup:
- : public app client ID for
CLAWSWEEPER_APP_CLIENT_ID.clawsweeper - : private key used only inside
CLAWSWEEPER_APP_PRIVATE_KEYsteps.actions/create-github-app-token - Target app permissions: read target scan context; write issues and pull
requests; contents write for report commits, repair branches, and workflow
inputs; Actions write on for comment-router re-review dispatch, workflow dispatch, run cancellation, and self-heal; optional Checks write for commit Check Runs.
openclaw/clawsweeper
Token boundary:
- Codex workers do not get mutation credentials.
- Review workers run with stripped secret/token env.
- Deterministic scripts own comments, labels, branch pushes, PR creation, closes, and merges through short-lived GitHub App tokens.
- Merge and write gates default closed.
使用 ClawSweeper 仓库和 GitHub App。仅使用 配置进行此自动化操作,请勿使用旧版应用、变量、标签或工具。
clawsweeperCLAWSWEEPER_*必要的应用设置:
- :
CLAWSWEEPER_APP_CLIENT_ID的公开应用客户端ID。clawsweeper - :仅在
CLAWSWEEPER_APP_PRIVATE_KEY步骤中使用的私钥。actions/create-github-app-token - 目标应用权限:读取目标扫描上下文;写入议题和拉取请求;写入内容以提交报告、修复分支和工作流输入;在 上写入Actions以实现评论路由重审查调度、工作流调度、运行取消和自我修复;可选写入检查项以生成提交检查运行记录。
openclaw/clawsweeper
令牌边界:
- Codex 工作者不具备变更凭据。
- 审查工作者使用移除了密钥/令牌的环境变量运行。
- 确定性脚本通过短期GitHub App令牌处理评论、标签、分支推送、PR创建、关闭和合并操作。
- 合并和写入闸门默认处于关闭状态。
Commit Reports
提交报告
Canonical commit reports:
text
records/<repo-slug>/commits/<40-char-sha>.mdUse the lister:
bash
pnpm commit-reports -- --since 6h
pnpm commit-reports -- --since "24 hours ago" --findings
pnpm commit-reports -- --since 7d --non-clean
pnpm commit-reports -- --repo openclaw/openclaw --author steipete --since 7d
pnpm commit-reports -- --since 24h --jsonResults: , , , ,
. One report per SHA; reruns overwrite the SHA-named report.
nothing_foundfindingsinconclusivefailedskipped_non_codeManual rerun/backfill:
bash
gh workflow run commit-review.yml --repo openclaw/clawsweeper \
-f target_repo=openclaw/openclaw \
-f commit_sha=<end-sha> \
-f before_sha=<start-or-parent-sha> \
-f create_checks=false \
-f enabled=trueUse only when Peter explicitly wants target commit Check
Runs. Add for focused one-off review instructions.
create_checks=true-f additional_prompt="..."标准提交报告路径:
text
records/<repo-slug>/commits/<40-char-sha>.md使用列表工具:
bash
pnpm commit-reports -- --since 6h
pnpm commit-reports -- --since "24 hours ago" --findings
pnpm commit-reports -- --since 7d --non-clean
pnpm commit-reports -- --repo openclaw/openclaw --author steipete --since 7d
pnpm commit-reports -- --since 24h --json结果类型:、、、、。每个SHA对应一份报告;重新运行会覆盖同名SHA的报告。
nothing_foundfindingsinconclusivefailedskipped_non_code手动重新运行/回填:
bash
gh workflow run commit-review.yml --repo openclaw/clawsweeper \
-f target_repo=openclaw/openclaw \
-f commit_sha=<end-sha> \
-f before_sha=<start-or-parent-sha> \
-f create_checks=false \
-f enabled=true仅当Peter明确要求生成目标提交检查运行记录时,才设置 。添加 以提供针对性的一次性审查指令。
create_checks=true-f additional_prompt="..."Sweep Reports
扫描报告
Issue/PR reports live at:
text
records/<repo-slug>/items/<number>.md
records/<repo-slug>/closed/<number>.mdLead with counts, concrete findings, and report links. Do not post unsolicited
GitHub comments from report-reading work. Public surfaces are markdown reports,
durable ClawSweeper review comments, and optional checks.
PR reports include Codex -style with priority,
confidence, repository-relative file, and line range. Public PR comments show a
short list when findings exist; full review comments,
evidence links, likely owners, and runtime details stay inside the collapsed
block.
/reviewreviewFindingsReview findings:Review detailsUseful commands:
bash
pnpm run status
pnpm run audit
pnpm run reconcile
pnpm run apply-decisions -- --dry-run议题/PR报告存储路径:
text
records/<repo-slug>/items/<number>.md
records/<repo-slug>/closed/<number>.md报告开头需包含统计数据、具体检测结果和报告链接。请勿从报告阅读工作中发布未经请求的GitHub评论。公开展示形式为Markdown报告、持久化的ClawSweeper审查评论以及可选的检查项。
PR报告包含Codex 风格的 ,包含优先级、可信度、仓库相对文件和行范围。当存在检测结果时,公开PR评论会显示简短的「Review findings:」列表;完整的审查评论、证据链接、可能的负责人和运行时详情会放在折叠的「Review details」区块内。
/reviewreviewFindings实用命令:
bash
pnpm run status
pnpm run audit
pnpm run reconcile
pnpm run apply-decisions -- --dry-runCreate One Repair Job
创建单个修复任务
Create a job from issue/PR refs and a maintainer prompt:
bash
pnpm run repair:create-job -- \
--repo openclaw/openclaw \
--refs 123,456 \
--prompt-file /tmp/clawsweeper-prompt.mdCreate from an existing ClawSweeper report:
bash
pnpm run repair:create-job -- \
--from-report ../clawsweeper/records/openclaw-openclaw/items/123.mdThe job creator checks for an existing open PR, body match, or remote
branch before writing another job. Use
to inspect. Use only after deciding the duplicate guard is stale.
clawsweeper/<cluster-id>--dry-run--forceValidate, commit, then dispatch:
bash
pnpm run repair:validate-job -- jobs/openclaw/inbox/clawsweeper-openclaw-openclaw-123.md
pnpm run repair:dispatch -- jobs/openclaw/inbox/clawsweeper-openclaw-openclaw-123.md \
--mode autonomous \
--runner blacksmith-4vcpu-ubuntu-2404 \
--execution-runner blacksmith-16vcpu-ubuntu-2404 \
--model gpt-5.5Do not dispatch a just-created job before the job file is committed and pushed;
the workflow reads the job path from GitHub.
从议题/PR引用和维护者提示创建任务:
bash
pnpm run repair:create-job -- \
--repo openclaw/openclaw \
--refs 123,456 \
--prompt-file /tmp/clawsweeper-prompt.md从现有ClawSweeper报告创建任务:
bash
pnpm run repair:create-job -- \
--from-report ../clawsweeper/records/openclaw-openclaw/items/123.md任务创建器会在创建新任务前检查是否存在已打开的PR、内容匹配或远程 分支。使用 进行检查;仅在确认重复检查机制过时后,才使用 。
clawsweeper/<cluster-id>--dry-run--force验证、提交然后调度:
bash
pnpm run repair:validate-job -- jobs/openclaw/inbox/clawsweeper-openclaw-openclaw-123.md
pnpm run repair:dispatch -- jobs/openclaw/inbox/clawsweeper-openclaw-openclaw-123.md \
--mode autonomous \
--runner blacksmith-4vcpu-ubuntu-2404 \
--execution-runner blacksmith-16vcpu-ubuntu-2404 \
--model gpt-5.5在任务文件提交并推送前,请勿调度刚创建的任务;工作流需从GitHub读取任务路径。
Replacement PRs
替代PR
For a useful but uneditable/stale/unsafe source PR, make the maintainer prompt
explicit:
md
Treat #123 as useful source work. If the source branch cannot be safely updated
because it is uneditable, stale, draft-only, unmergeable, or unsafe, create a
narrow ClawSweeper replacement PR instead of waiting. Preserve the source PR
author as co-author, credit the source PR in the replacement PR body, and close
only that source PR after the replacement PR is opened.The worker should emit and list the
source PR URL in . The deterministic executor opens or updates
, adds non-bot source authors as
trailers, and closes superseded source PRs only after replacement exists.
repair_strategy=replace_uneditable_branchsource_prsclawsweeper/<cluster-id>Co-authored-by对于有用但无法编辑/已过时/不安全的源PR,需明确维护者提示:
md
将#123视为有用的源工作。如果源分支因无法编辑、已过时、仅为草稿、无法合并或不安全而无法安全更新,请创建一个精简的ClawSweeper替代PR,而非等待。保留源PR作者为共同作者,在替代PR正文中注明源PR,并在替代PR打开后仅关闭该源PR。工作者应输出 并在 中列出源PR URL。确定性执行器会打开或更新 ,添加非机器人源作者为 尾部信息,并仅在替代PR存在后关闭被取代的源PR。
repair_strategy=replace_uneditable_branchsource_prsclawsweeper/<cluster-id>Co-authored-byGates
闸门控制
Open execution windows intentionally and close them after the run:
bash
gh variable set CLAWSWEEPER_ALLOW_EXECUTE --repo openclaw/clawsweeper --body 1
gh variable set CLAWSWEEPER_ALLOW_FIX_PR --repo openclaw/clawsweeper --body 1
gh variable set CLAWSWEEPER_ALLOW_MERGE --repo openclaw/clawsweeper --body 1
gh variable set CLAWSWEEPER_ALLOW_AUTOMERGE --repo openclaw/clawsweeper --body 1Reset gates only when Peter asks; the active maintainer window may intentionally
leave them at .
1Important gates:
- : allows deterministic write lanes.
CLAWSWEEPER_ALLOW_EXECUTE - : allows branch repair/replacement PRs.
CLAWSWEEPER_ALLOW_FIX_PR - : allows merge-capable applicators.
CLAWSWEEPER_ALLOW_MERGE - : allows comment-router automerge.
CLAWSWEEPER_ALLOW_AUTOMERGE - : lets scheduled comment routing post replies and dispatch repair.
CLAWSWEEPER_COMMENT_ROUTER_EXECUTE
有意开启执行窗口,并在运行后关闭:
bash
gh variable set CLAWSWEEPER_ALLOW_EXECUTE --repo openclaw/clawsweeper --body 1
gh variable set CLAWSWEEPER_ALLOW_FIX_PR --repo openclaw/clawsweeper --body 1
gh variable set CLAWSWEEPER_ALLOW_MERGE --repo openclaw/clawsweeper --body 1
gh variable set CLAWSWEEPER_ALLOW_AUTOMERGE --repo openclaw/clawsweeper --body 1仅当Peter要求时重置闸门;活跃的维护者窗口可能会有意将其保持为 。
1重要闸门:
- :允许确定性写入通道。
CLAWSWEEPER_ALLOW_EXECUTE - :允许分支修复/替代PR。
CLAWSWEEPER_ALLOW_FIX_PR - :允许具备合并能力的应用器。
CLAWSWEEPER_ALLOW_MERGE - :允许评论路由自动合并。
CLAWSWEEPER_ALLOW_AUTOMERGE - :允许定时评论路由发布回复并调度修复。
CLAWSWEEPER_COMMENT_ROUTER_EXECUTE
Maintainer Mentions
维护者提及
Prefer comments for all maintainer-facing control. Slash
commands still parse as compatibility aliases, but examples and live guidance
should use mentions.
@clawsweepertext
@clawsweeper status
@clawsweeper re-review
@clawsweeper review
@clawsweeper fix ci
@clawsweeper address review
@clawsweeper rebase
@clawsweeper autofix
@clawsweeper automerge
@clawsweeper approve
@clawsweeper explain
@clawsweeper stop
@clawsweeper <question or safe action request>
@clawsweeper[bot] re-review
@openclaw-clawsweeper fix ci
@openclaw-clawsweeper[bot] fix ciAccepted aliases: , , , ,
, and . and dispatch a fresh
ClawSweeper issue/PR review without starting repair. ,
, and dispatch the
repair worker only for ClawSweeper PRs or PRs opted into
or . runs the bounded
review/fix loop without merging. runs the bounded review/fix/merge
loop, but draft PRs stay fix-only until GitHub marks them ready for review.
reviewre-reviewrereviewreview againrerun reviewrun reviewreviewre-reviewfix ciaddress reviewrebaseclawsweeper:autofixclawsweeper:automergeautofixautomergeFreeform maintainer mentions such as
or dispatch a read-only assist
review with the mention text as one-off instructions. The answer lands in the
next public ClawSweeper review comment. Action-looking prose does not directly
mutate GitHub; it must map to existing structured recommendations and pass the
normal deterministic gates.
@clawsweeper why did automerge stop?@clawsweeper: can you explain this failure?Default accepted maintainers: , , ; fallback
repository permission accepts , , or . Contributor
comments are ignored without a reply.
OWNERMEMBERCOLLABORATORadminmaintainwriteRun router manually:
bash
pnpm run repair:comment-router -- --repo openclaw/openclaw --lookback-minutes 180
pnpm run repair:comment-router -- --repo openclaw/openclaw --execute --wait-for-capacityScheduled routing stays dry unless
.
CLAWSWEEPER_COMMENT_ROUTER_EXECUTE=1所有面向维护者的控制操作优先使用 评论。斜杠命令仍会被解析为兼容别名,但示例和实时指导应使用提及方式。
@clawsweepertext
@clawsweeper status
@clawsweeper re-review
@clawsweeper review
@clawsweeper fix ci
@clawsweeper address review
@clawsweeper rebase
@clawsweeper autofix
@clawsweeper automerge
@clawsweeper approve
@clawsweeper explain
@clawsweeper stop
@clawsweeper <question or safe action request>
@clawsweeper[bot] re-review
@openclaw-clawsweeper fix ci
@openclaw-clawsweeper[bot] fix ci接受的别名:、、、、 和 。 和 会调度全新的ClawSweeper议题/PR审查,但不会启动修复。、 和 仅会为ClawSweeper PR或已选择 或 的PR调度修复工作者。 会运行受限的审查/修复循环,但不会合并。 会运行受限的审查/修复/合并循环,但草稿PR在GitHub标记为可审查前仅会进行修复操作。
reviewre-reviewrereviewreview againrerun reviewrun reviewreviewre-reviewfix ciaddress reviewrebaseclawsweeper:autofixclawsweeper:automergeautofixautomerge自由格式的维护者提及,如 或 ,会调度只读辅助审查,并将提及文本作为一次性指令。答案会出现在下一条公开的ClawSweeper审查评论中。类似操作的表述不会直接修改GitHub;它必须映射到现有的结构化建议,并通过常规的确定性闸门检查。
@clawsweeper why did automerge stop?@clawsweeper: can you explain this failure?默认接受的维护者:、、; fallback仓库权限接受 、 或 。贡献者的评论会被忽略,不会回复。
OWNERMEMBERCOLLABORATORadminmaintainwrite手动运行路由:
bash
pnpm run repair:comment-router -- --repo openclaw/openclaw --lookback-minutes 180
pnpm run repair:comment-router -- --repo openclaw/openclaw --execute --wait-for-capacity定时路由默认仅检查不执行,除非设置 。
CLAWSWEEPER_COMMENT_ROUTER_EXECUTE=1Trusted Autofix And Automerge
可信自动修复与自动合并
@clawsweeper autofix@clawsweeper automerge- verifies maintainer authorization;
- labels the PR or
clawsweeper:autofix;clawsweeper:automerge - dispatches ClawSweeper review for the current head SHA;
- creates or reuses a durable adopted job;
- repairs at most the configured caps;
- never merges autofix PRs or draft PRs;
- merges automerge PRs only when ClawSweeper passed the exact current head, checks are green, GitHub says mergeable, no human-review label is present, the PR is not draft, required user-facing OpenClaw changelog entries are present, and both merge gates are open.
If ClawSweeper passes while merge gates are closed, it labels
and comments instead of merging.
adds .
clawsweeper:merge-ready@clawsweeper stopclawsweeper:human-reviewWhen Peter asks Codex to create a PR and enable ClawSweeper automerge, do not
leave his local OpenClaw checkout on the PR branch. After the PR is created,
pushed, and the request is posted or otherwise
confirmed, return the local checkout to and fast-forward it when the
working tree is clean:
@clawsweeper automergemainbash
git switch main
git pull --ff-onlyIf unrelated local edits or an in-progress rebase prevent switching, report the
blocker instead of stashing, deleting, or overwriting work.
Repair caps:
bash
CLAWSWEEPER_MAX_REPAIRS_PER_PR=10
CLAWSWEEPER_MAX_REPAIRS_PER_HEAD=1@clawsweeper autofix@clawsweeper automerge- 验证维护者授权;
- 为PR添加 或
clawsweeper:autofix标签;clawsweeper:automerge - 为当前头部SHA调度ClawSweeper审查;
- 创建或复用持久化的已接管任务;
- 修复次数不超过配置上限;
- 绝不会合并自动修复PR或草稿PR;
- 仅当ClawSweeper通过当前头部SHA的审查、检查项全部通过、GitHub标记为可合并、无人工审查标签、PR非草稿状态、存在所需的面向用户的OpenClaw变更日志条目,且两个合并闸门均处于打开状态时,才会合并自动合并PR。
如果ClawSweeper审查通过但合并闸门关闭,会添加 标签并发表评论,而非合并。 会添加 标签。
clawsweeper:merge-ready@clawsweeper stopclawsweeper:human-review当Peter要求Codex创建PR并启用ClawSweeper自动合并时,请勿让他的本地OpenClaw检出停留在PR分支。PR创建、推送并确认 请求已发布后,将本地检出切换回 分支,并在工作树干净时进行快进拉取:
@clawsweeper automergemainbash
git switch main
git pull --ff-only如果无关的本地编辑或正在进行的变基操作阻止切换,请报告阻塞问题,而非暂存、删除或覆盖工作内容。
修复上限:
bash
CLAWSWEEPER_MAX_REPAIRS_PER_PR=10
CLAWSWEEPER_MAX_REPAIRS_PER_HEAD=1Security Boundary
安全边界
Do not stage unapproved security-sensitive work for ClawSweeper Repair. Route
vulnerability reports, CVE/GHSA/advisory work, leaked secrets/tokens/keys,
plaintext secret storage, SSRF, XSS, CSRF, RCE, auth bypass, privilege
escalation, and sensitive data exposure to central OpenClaw security handling.
For PRs explicitly opted into or
, security-sensitive review findings may dispatch
bounded repair, but merge remains blocked until a later exact-head review is
clean and the normal merge gates pass. Trust deterministic ClawSweeper security
markers, labels, and job frontmatter; do not infer security handling from vague
prose.
clawsweeper:autofixclawsweeper:automerge请勿为ClawSweeper Repair暂存未经批准的安全敏感工作。将漏洞报告、CVE/GHSA/公告工作、泄露的密钥/令牌/密钥、明文密钥存储、SSRF、XSS、CSRF、RCE、认证绕过、权限提升和敏感数据泄露等问题路由至OpenClaw中央安全处理流程。
对于明确选择 或 的PR,安全敏感的审查结果可能会调度受限修复,但合并仍会被阻止,直到后续的头部SHA审查无问题且常规合并闸门通过。信任确定性的ClawSweeper安全标记、标签和任务前置信息;请勿从模糊的表述中推断安全处理方式。
clawsweeper:autofixclawsweeper:automergeMonitoring
监控
Receiver workflows:
bash
gh run list --repo openclaw/clawsweeper --workflow "ClawSweeper Commit Review" \
--limit 12 --json databaseId,displayTitle,event,status,conclusion,createdAt,updatedAt,url
gh run list --repo openclaw/clawsweeper --workflow "repair cluster worker" \
--limit 12 --json databaseId,displayTitle,event,status,conclusion,createdAt,updatedAt,url
gh run list --repo openclaw/clawsweeper --workflow "repair comment router" \
--limit 12 --json databaseId,displayTitle,event,status,conclusion,createdAt,updatedAt,urlTarget dispatcher:
bash
gh run list --repo openclaw/openclaw --workflow "ClawSweeper Dispatch" \
--event push --limit 8 --json databaseId,displayTitle,event,status,conclusion,headSha,urlTarget commit check:
bash
gh api "repos/openclaw/openclaw/commits/<sha>/check-runs?per_page=100" \
--jq '.check_runs[] | select(.name=="ClawSweeper Commit Review") | [.status,.conclusion,.details_url] | @tsv'接收方工作流:
bash
gh run list --repo openclaw/clawsweeper --workflow "ClawSweeper Commit Review" \
--limit 12 --json databaseId,displayTitle,event,status,conclusion,createdAt,updatedAt,url
gh run list --repo openclaw/clawsweeper --workflow "repair cluster worker" \
--limit 12 --json databaseId,displayTitle,event,status,conclusion,createdAt,updatedAt,url
gh run list --repo openclaw/clawsweeper --workflow "repair comment router" \
--limit 12 --json databaseId,displayTitle,event,status,conclusion,createdAt,updatedAt,url目标调度器:
bash
gh run list --repo openclaw/openclaw --workflow "ClawSweeper Dispatch" \
--event push --limit 8 --json databaseId,displayTitle,event,status,conclusion,headSha,url目标提交检查:
bash
gh api "repos/openclaw/openclaw/commits/<sha>/check-runs?per_page=100" \
--jq '.check_runs[] | select(.name=="ClawSweeper Commit Review") | [.status,.conclusion,.details_url] | @tsv'Reading Output
输出解读
For findings or failures, summarize:
- target repo, item/PR/commit, run, report path
- result, confidence, severity, and exact blocker
- affected files or cluster refs
- validation commands and whether they passed
- whether mutation gates were open or closed
- next deterministic action
Keep the broom small: one cluster, one branch, one PR, narrow proof, clear
owner-visible evidence.
对于检测结果或失败情况,需总结:
- 目标仓库、项目/PR/提交、运行记录、报告路径
- 结果、可信度、严重性和确切阻塞点
- 受影响的文件或集群引用
- 验证命令及其是否通过
- 变更闸门处于打开还是关闭状态
- 下一步确定性操作
聚焦重点:单个集群、单个分支、单个PR、明确的证据、清晰的所有者可见信息。