From 6fbe39eed117cc14a0ab464f162b85c614f2dd59 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 31 Jul 2026 02:44:06 -0700 Subject: [PATCH] chore(skills): add autonomous issue sweep workflow --- .../openclaw-autonomous-issue-sweep/SKILL.md | 253 ++++++++++++++++++ .../agents/openai.yaml | 4 + 2 files changed, 257 insertions(+) create mode 100644 .agents/skills/openclaw-autonomous-issue-sweep/SKILL.md create mode 100644 .agents/skills/openclaw-autonomous-issue-sweep/agents/openai.yaml diff --git a/.agents/skills/openclaw-autonomous-issue-sweep/SKILL.md b/.agents/skills/openclaw-autonomous-issue-sweep/SKILL.md new file mode 100644 index 000000000000..9ce683ef9957 --- /dev/null +++ b/.agents/skills/openclaw-autonomous-issue-sweep/SKILL.md @@ -0,0 +1,253 @@ +--- +name: openclaw-autonomous-issue-sweep +description: "Orchestrate 64 autonomous OpenClaw issue workers newest-to-oldest; find existing PRs, deeply investigate bugs, simplify or refactor, live-test, independently review, land verified fixes, close already-fixed issues, and add only meaningful new evidence." +--- + +# OpenClaw Autonomous Issue Sweep + +Run an end-to-end maintainer campaign, not a candidate shortlist. The parent +conversation is the orchestrator: delegate discovery, investigation, coding, +testing, review, GitHub mutations, PR preparation, landing, and cleanup to +subagents. Keep parent-thread updates to concise progress and clickable URLs. + +## Authority and campaign shape + +- Spawn exactly **64 first-class subagents** unless the user requests another + count or available capacity makes that impossible; disclose the actual count. +- Use full-history forks so every subagent inherits the orchestrator's model + and **xhigh reasoning effort**. Never print, record, or disclose model + identifiers; redact subprocess banners and diagnostics before reporting. +- Treat a request to run this workflow as authority to review, fix, refactor, + commit, push, create/update PRs, land eligible changes, comment, and close + issues individually. Do not ask for routine confirmation again. +- Never treat sweep authority as permission to publish releases, bump protocol + or SQLite schema versions, weaken security, break shipped compatibility, + change another owner's protected product surface, or execute untrusted code + with local credentials. +- Have subagents read the complete root `AGENTS.md`, relevant scoped guides, + `VISION.md`, and companion skills before acting. Use `$gitcrawl`, Octopool, + `$openclaw-pr-maintainer`, `$openclaw-testing`, `$crabbox`, and `$autoreview` + where each owns the workflow. +- Keep the parent out of operational work. It may spawn, assign, receive + results, serialize shared resources, monitor host/pool health, prewarm and + allocate needed remote leases, issue follow-up tasks, and report; it must + not inspect issues, edit code, run tests, mutate GitHub, or land PRs. + +## Coordinate 64 workers safely + +1. Assign one subagent to maintain the live open-issue queue in descending + `createdAt` order, one to coordinate landing/proof capacity, and the rest to + issue investigations. Coordinator agents also investigate when idle. +2. Claim issues from the newest unclaimed end only; replenish workers as they + finish. Parallel completions may arrive out of order, but never knowingly + start an older unclaimed issue ahead of a newer available issue. +3. Deduplicate by canonical root cause, not merely by issue number. Let one + owner fix a shared defect and link related issues/PRs to that outcome. +4. Freeze the reviewed source SHA for each wave. Designate a single fetch owner; + pause shared-ref refreshes while repo-native PR prepare/merge runs. +5. Never switch a shared checkout branch or edit it while sibling agents use it. + Use an existing agent-owned checkout, a repo-native isolated PR worktree, or + an explicitly user-authorized new worktree. Otherwise serialize write + access; parallel read-only investigations may continue. +6. Sample checkout/temp-volume free disk, CPU/load, memory pressure, process + count, operator-gateway health, actual worker count, and Octopool capacity + before each wave and periodically thereafter. Throttle expensive work for + sustained pressure or low disk; never kill unrelated operator processes. +7. Serialize merge operations and each Testbox lease. A lease has one owner and + one active command; never reclaim, sync, or change its head during a run. +8. Respect GitHub rate limits, active assignees, repository ownership, and + existing contributor work. Do not auto-assign broad-discovery candidates. +9. Replace finished workers while the queue remains. Record actual active, + completed, failed, fixed, landed, closed, commented, and skipped counts; + never report launched or finished workers as still running. + +## Conserve GitHub capacity and host resources + +- Prefer local `$gitcrawl` archives and source history for queue discovery, + issue/PR search, duplicate clusters, comments, and previously merged work. + Check archive freshness; do not broadly sync, enrich, or re-embed merely to + start a sweep. +- Prefer `octopool gh ...` or narrowly bounded `octopool request` for + necessary live GitHub reads and mutations. Check `octopool health` and + `octopool stats` periodically; let repo-native PR wrappers retain their + required GitHub transport and authenticated identity. +- Use plain `gh` only when Octopool cannot support the operation or the + canonical maintainer wrapper requires it. Request minimal fields, reuse + results across workers, batch compatible reads, avoid unbounded pagination, + and never use `gh run watch` or frequent unchanged CI polls. +- Require a fresh live state check only before consequential mutations, final + merge decisions, or a stale/contradictory cached result. Rate-limit and + deduplicate worker requests instead of having 64 agents independently fetch + the same issue, PR, author profile, or CI rollup. +- Keep disk, load, memory pressure, active lease IDs, provider trust class, + checkout ownership, and pool capacity in the orchestration ledger. Slow new + assignments, serialize builds/tests, clean only campaign-owned artifacts, + and offload heavy proof before resource pressure threatens the host. +- The parent may prewarm a trusted Crabbox/Testbox lease when a concrete heavy + proof is imminent, then hand its verified lease ID and checkout ownership to + one subagent at a time. Avoid speculative fleets, respect path-scoped lease + ownership, and stop campaign-owned leases before handoff or closeout. +- Keep untrusted contributor proof on a separate sanitized direct-AWS lease; + never transfer a credential-hydrated trusted lease to untrusted work. + +## Search for existing work on every credible issue + +Always investigate existing PRs before implementing a fix: + +1. Read the live issue body, all material comments, labels, assignments, + timeline/cross-references, repro details, affected versions, and ClawSweeper + findings. +2. Search `$gitcrawl` for the issue number, title, error text, affected + subsystem, relevant symbols, duplicate symptoms, open PRs, merged PRs, and + recently closed work. +3. Verify candidates against Octopool-backed live GitHub search, directly + linked PRs, current PR heads, `origin/main`, and commit history. Search + exact issue references and symptom/root-cause terms; do not stop at the + first plausible PR. +4. Read competing implementations deeply enough to decide whether an existing + PR already fixes the real defect, merely masks one symptom, has gone stale, + or reveals a cleaner owner-boundary refactor. +5. Preserve contributor commits, attribution, issue reporter credit, and useful + ideas whenever repairing or replacing existing work. + +Choose outcomes in this order: + +1. **Fixed on main:** prove the original failure is resolved; close with the + exact merged PR, commit, current source/test, or release proof. +2. **Existing PR is the best fix:** improve it as needed, verify the exact + final head, and land it through the repo-native maintainer workflow. +3. **Existing PR is useful but incomplete:** finish it or create a cleaner + replacement that preserves human attribution and links the original. +4. **No suitable PR:** implement the best high-confidence root-cause repair or + a justified simplifying refactor; create, verify, and land a focused PR. +5. **Bug cannot be fixed, but simplification is real:** independently land a + proven behavior-neutral refactor when it meaningfully removes complexity + without pretending the original issue was fixed. +6. **Cannot fix or close:** comment only if investigation uncovered concrete, + material evidence missing from the issue and ClawSweeper's existing review. + +## Prove the bug and choose the best design + +- Trace the actual user path from entry point through caller, canonical owner, + callee, sibling implementations, transport/lifecycle boundaries, tests, + current `main`, shipped contracts, and direct dependency source or docs. +- Personally inspect sibling `../codex` source before any Codex integration + verdict or change, as required by the root guide; another agent's report is + not sufficient for the agent making that decision. +- Require a failing regression, reproducible command, real logs, live product + behavior, dependency contract, or exact source-level proof. Never repair an + issue on title, speculation, ClawSweeper output, or a plausible diff alone. +- Prefer the correct owner-boundary refactor over a narrow guard, workaround, + new fallback, duplicate policy, extra configuration, or compatibility shim. + A larger refactor is appropriate when it fixes the whole bug class more + clearly and its behavior/ownership risk remains understood and bounded. +- While reading, look for dead branches, unused helpers, duplicate paths, + stale abstractions, obsolete tests, and complexity that can be deleted as + part of the same coherent change. +- Measure `git diff --numstat`; aim to reduce **production LOC**, excluding + tests. Production growth is acceptable only when clearly justified by fewer + concepts, better ownership, essential product behavior, or stronger safety. +- Allow small missing product affordances, such as an obviously expected CLI + command, when adjacent behavior and docs establish the contract. Reject + substantial new features, speculative redesign, new paid services, + unsupported integrations, or unrelated drive-by changes. +- Do not edit `CHANGELOG.md`; capture user impact, issue/PR references, and + human credit in the PR body or commit message. + +## Verify behavior and obtain two independent reviews + +For every non-trivial production change: + +1. Add focused regression coverage for the original bug and affected sibling + paths. Delete tests protecting removed obsolete implementation details. +2. Choose proof with `$openclaw-testing`. Live-test the real user/provider/ + channel/CLI/package/UI path whenever feasible. Route heavy, packaging, + Docker, E2E, or broad checks through `$crabbox`; report an unavailable live + prerequisite accurately instead of calling a mock live proof. +3. Classify source trust before executing anything. Never run contributor/fork + scripts, hooks, config, tests, installs, or wrappers locally or on a + credential-hydrated host; follow the sanitized untrusted-source workflow. +4. Run `$autoreview` on the complete final change until no accepted actionable + findings remain. Re-run it after any production, test, or reviewed-head + change. Treat review findings as hypotheses and verify each against source. + Prose-only skill files and other non-production internal notes do not need + autoreview; validate their structure and formatting instead. +5. Separately self-invoke an independent Codex reviewer. First verify the + installed interface with `codex exec --help`, then run a bounded read-only, + ephemeral review from a trusted checkout, for example: + + ```bash + codex exec --json --sandbox read-only --ephemeral \ + -C "$trusted_checkout" --output-last-message "$review_result" \ + "Independently inspect the frozen candidate diff and its owner, callers, + siblings, tests, current main, user behavior, and dependency contracts. + Report only concrete correctness, architecture, simplification, or + verification gaps. Do not modify files or expose secrets." \ + >/dev/null 2>/dev/null + ``` + + Point the reviewer at the exact immutable diff/head. Do not substitute the + `$autoreview` Codex engine for this separate pass. Never run that reviewer + from an untrusted project-controlled checkout. Read only the final review + result; do not emit raw model banners. Verify actionable findings, make + justified fixes, rerun proof, and refresh both independent reviews. + +6. Read the latest ClawSweeper comment and address each applicable `Rank-up +moves:` item with real evidence or an explicit reason for skipping it. + +## Publish, land, and clean up + +- Prefer an existing writable contributor PR. If its head is unsuitable or + cannot be updated safely, open a focused replacement, explain the + relationship, and preserve attribution. +- Before opening replacement PRs, verify author association, active-PR counts, + repository permission, branch policy, current auto-response exemptions, and + override labels; never assume a privileged-role exemption. Reuse or land + existing reviewed work before creating a burst of competing PRs. +- Use the actual PR template and state the user impact, canonical root cause, + rejected alternatives, production LOC delta, exact head SHA, focused/live + proof, autoreview result, independent Codex result, CI state, and credit. +- Read `$agent-transcript` for agent-created PRs, but do not include logs + without the user's explicit transcript approval. During a fully autonomous + sweep, omit transcripts rather than interrupting the user for consent. +- Open new PRs as drafts, wait for a non-null mergeability result, mark them + ready, and verify CI attached to the exact pushed head before landing. +- Autonomously land only a reproduced, high-confidence, bounded-risk repair + or behavior-neutral simplification with clean independent reviews and green + exact-head required proof. Change size alone is not the risk criterion. +- For main-targeted PRs use only the repo-native `scripts/pr` flow: initialize + review, create/validate review artifacts, run + `OPENCLAW_TESTBOX=1 scripts/pr prepare-run `, then + `scripts/pr merge-run `. Verify the canonical merge SHA afterward. +- Keep owner/security/auth/config/public-SDK/protocol/persistent-state/product + decisions outside autonomous landing when the relevant guide requires owner + judgment. Continue with the next issue instead of blocking the whole sweep. +- Close a fixed issue only after live rechecking its open state and matching + the original symptoms to current-main proof. Cite the merged PR/commit and + ask the reporter to reopen if it still reproduces on the current version. +- Never close merely because a repro is difficult, the report is inconvenient, + the behavior might be intentional, or the PR is stale. Product-decision and + won't-implement closures require maintainer judgment. +- If no fix is possible, comment only when supplying new reproducible steps, + an exact failing owner/line, verified dependency behavior, previously + unidentified duplicate/fixing PR, a concrete workaround, or another + meaningful fact absent from prior discussion and ClawSweeper. +- Recheck live state immediately before every mutation; avoid redundant, + speculative, noisy, or duplicate comments. Handle closures individually and + follow repository limits on bulk operations. + +## Parent-thread reporting + +Send concise progress plus URLs only. Prefer updates such as: + +```text +64 agents active · 41 investigated · 3 landed · 5 already-fixed issues closed +Landed: https://github.com/openclaw/openclaw/pull/123 +Closed: https://github.com/openclaw/openclaw/issues/456 +``` + +Do not narrate routine reads, pending hypotheses, unchanged CI, or candidate +URLs that are not actually ready. Count only verified merged PRs, confirmed +closures, and comments that were really posted. Continue until the user stops +the sweep, the requested boundary is reached, or the live issue queue is +genuinely exhausted. diff --git a/.agents/skills/openclaw-autonomous-issue-sweep/agents/openai.yaml b/.agents/skills/openclaw-autonomous-issue-sweep/agents/openai.yaml new file mode 100644 index 000000000000..ac7c3f2276c8 --- /dev/null +++ b/.agents/skills/openclaw-autonomous-issue-sweep/agents/openai.yaml @@ -0,0 +1,4 @@ +interface: + display_name: "OpenClaw Autonomous Issue Sweep" + short_description: "Autonomously fix, refactor, land, and close issues" + default_prompt: "Use $openclaw-autonomous-issue-sweep to orchestrate 64 subagents through OpenClaw issues newest to oldest; reuse existing PRs, prove and land high-confidence fixes or refactors, close resolved issues, and report concise progress plus URLs."