Techniques for batch-fixing high-certainty bugs within a limited scope

384593 84945 Updated: 2026-07-12 18:08:10

The "OpenClaw Small Bugfix Sweep" is a specialized workflow designed to batch-process issues and pull requests (PRs) in the OpenClaw repository by addressing minor, high-certainty bugs. Through in-depth code review, it targets only those bugs with clear root causes, unambiguous ownership, and minimal patch requirements. Upon fixing a bug, the system generates a "dirty diff" summary for manual review by Peter (the core maintainer); issues are submitted and closed only after his approval. Crucially, this process never involves pushing code, creating PRs, posting comments, closing issues, or applying tags during the review phase—all such actions are deferred until Peter grants explicit approval.

Install
bunx skills add https://github.com/openclaw/openclaw --skill openclaw-small-bugfix-sweep
Skill Details readonly

I. Skill Overview

This skill processes pasted lists of OpenClaw Issue/PR references (such as #1234 #1235 or full GitHub URLs). It executes a batch workflow: conduct deep reviews for every reference, verify live runtime behavior, trace root causes, and only patch low-risk, high-confidence bugs with narrow impact scopes. After local fixes are completed, the workflow halts and outputs a summary of dirty diffs, modified files, plus test & gate check results for manual review by Peter. Separate commits with corresponding changelog entries are created for each user-facing fix only after Peter’s explicit approval.

II. Core Functional Capabilities

1. Iterative Deep Per-Reference Review Loop

For every pasted reference, the skill runs the full sequential workflow below:
  1. Pull live real-time status of the target Issue/PR via the official gh CLI
  2. Use gitcrawl to inspect related, duplicate, closed, or already resolved linked threads from local archives
  3. Read the full body, comment threads, cross-referenced links, modified files, current source code, adjacent test suites, and dependent data contracts
  4. Trace the exact end-to-end runtime execution path triggering the defect

Handling Logic for Two Target Types

  • For Issues: A local patch is generated only if the entry is confirmed as a functional bug, the root cause is verifiable via current source code, the affected code path is well-defined, and a narrow targeted patch is superior to large-scale refactoring.
  • For PRs: Classify each PR into one of three buckets: ready-to-merge, needs-fixup, or skip. The skill never edits PR branches unless explicitly instructed by the user.
Where feasible, add focused regression test cases to validate the fix. Execute minimal meaningful gate tests to confirm resolution, then proceed to the next reference until all pasted items have been patched or categorized.

2. Skip Eligibility Rules

References matching any of the following criteria are skipped with a concise written rationale; no low-confidence speculative patches are generated:
  • Not a functional software bug
  • Changes limited to configuration, documentation, CI workflows, release pipelines, support text, dependency bumps, or product feature adjustments
  • Unreproducible defects or ambiguous untraceable root causes
  • Large refactors or cross-module overhauls represent the more reasonable resolution
  • The bug has already been resolved on the upstream main branch
  • Dependent runtime behavior is only speculative without source proof
  • No focused regression test validation can be constructed to confirm the fix

3. Patch Implementation Rules

  • Prioritize modifying the source module owning the defective logic; generic abstraction seams are only used when absolutely necessary
  • Match existing code patterns, helper utility functions, and type definitions present in the codebase
  • Strictly prohibit incidental unrelated drive-by refactors within the patch scope
  • Write regression tests adjacent to the failing functional surface
  • Only update documentation for public user-facing behavior modified by the patch
No commits are created during the pre-review stage. After Peter’s approval, each user-facing fix receives its own standalone commit paired with a dedicated changelog entry.
 
No pushes, PR creation, commenting, closing, labeling, landing, or merging operations are executed during the pre-review audit phase.

4. PR Classification Standards

  • ready-to-merge: High-quality code, head branch state fully validated, all required validation checks passed or pending only external CI jobs. Flagged for maintainer manual merge or automated merge via clawsweeper.
  • needs-fixup: Clear minor bug present, yet edits to the PR branch are required. Exact target files and missing test coverage are listed, pending explicit user instructions to apply patches, push updates, or trigger auto-merge.
  • skip: Overly broad scope, stale out-of-date content, speculative logic, configuration/product/security/release adjustments, cross-module boundary changes, or large refactor work.
If the source PR is untrusted or cannot be edited, substitute replacement PRs will not be generated during the sweep workflow.

5. Standard Output Schema

The final structured output ledger contains the following categorized groups:
  • fixed-local: All Issues patched locally on disk
  • ready-to-merge: All PRs eligible for immediate merge
  • needs-fixup: All PRs requiring follow-up code adjustments
  • skipped: All references marked for skip with documented reasoning
  • needs-human: All references requiring manual maintainer intervention
Supplementary outputs include persisted Issue files stored locally on disk, the full list of PRs queued for manual/automated merge, complete test & gate check results, and detailed skip rationales for every excluded reference.

III. Complementary Supporting Skills

This skill operates in tandem with the following auxiliary OpenClaw skills:
  • $gitcrawl: Prioritizes local archived data retrieval to reduce live GitHub API calls
  • $openclaw-pr-maintainer: Executes live GitHub repository hygiene operations
  • $github-deep-review: Provides full source-code root-cause tracing capabilities
  • $openclaw-testing: Generates regression test validation artifacts

IV. Critical Governing Principles

  1. Peter Approval Gate: Fixed workflow sequence = deep review → local patch generation → dirty diff summary output → pause for Peter’s manual audit → commit creation & issue resolution only after approval.
  2. No Batch Combined Commits: Unrelated bug fixes from separate Issues must never be squashed into a single commit.
  3. No Commit Splitting Violations: Every user-facing fix requires its own standalone commit with a dedicated changelog entry.
  4. No Unauthorized Live Repository Operations: No pushes, PR creation, commenting, closing, labeling, landing, or merging actions run during pre-review audit.
  5. No Sub-Agent Invocation: Subordinate child agents are never activated unless explicitly requested by the user.

V. Applicable Use Cases

  1. Maintainers receive batches of Issue/PR bug reports requiring rapid triage and resolution of simple, well-defined minor defects
  2. Batch processing user-submitted bug reports with mandatory pre-merge code review from the core maintainer Peter
  3. Pre-release bulk cleanup of confirmed, reproducible minor defects with clear, narrow resolution paths
  4. PR readiness assessment to categorize pull requests as merge-eligible, requiring modification, or non-actionable skip candidates

VI. Summary

OpenClaw Small Bugfix Sweep is a maintainer-focused batch workflow skill for resolving minor low-risk software defects. It leverages deep code review, root-cause tracing, and narrow targeted patch logic to exclusively address high-certainty bugs. Its core design philosophy follows a strict sequential model: review first, generate local patches second, submit for manual audit third, execute live repository operations last. All production-facing actions (push, PR creation, commenting, closing, labeling, merging) are gated behind Peter’s manual approval to enforce consistent code quality and unified decision-making. This skill is built for OpenClaw core maintainers tasked with efficiently processing bulk lists of GitHub Issues and PRs.