🔧

GitHub Issues → Auto-Code → PR

DevOpsAdvanced1 hour

Automatically pick up assigned GitHub issues, write the code, and open pull requests

Prerequisites

  • OpenClaw installed and running
  • GitHub account with repo write access
  • CI/CD pipeline for running tests

Required Skills

github-auto-pr
openclaw install github-auto-pr
openclaw install pr-reviewer
ci-status-tracker
openclaw install ci-status-tracker

Installation Steps

1

Install required skills

Install the GitHub PR, PR reviewer, and CI status tracker skills.

openclaw install github-auto-pr pr-reviewer ci-status-tracker
2

Create a GitHub account for OpenClaw

Create a dedicated GitHub account for your OpenClaw agent and grant it write access to your repos. Generate a personal access token with repo scope.

3

Configure issue polling

Set the polling interval, target repos, and the label or assignee that triggers the agent to pick up an issue.

4

Add the config snippet

Copy the configuration below and customize the repos, polling interval, and review settings.

Configuration

{
  "schedules": [
    {
      "name": "issue-worker",
      "cron": "*/15 * * * *",
      "actions": [
        "poll-assigned-issues",
        "analyze-issue",
        "write-code",
        "run-tests",
        "open-pr",
        "request-review"
      ]
    }
  ],
  "integrations": {
    "github": {
      "repos": ["your-org/your-repo"],
      "assignee": "openclaw-bot",
      "triggerLabels": ["good-first-issue", "openclaw"],
      "pr": {
        "reviewers": ["your-username"],
        "draft": false,
        "branchPrefix": "openclaw/"
      }
    },
    "coding": {
      "tool": "opencode",
      "maxIterations": 3,
      "requireTests": true
    }
  }
}

Add this to your openclaw.json and customize the values for your setup.

SOUL.md

## Issue Worker Rules
- Only pick up issues that are clearly scoped with acceptance criteria. If an issue is vague, add a comment asking for clarification instead of guessing.
- Before writing code, read the existing codebase patterns. Match the style, conventions, and test patterns already in use.
- Always create a new branch from the latest main. Never push directly to main.
- If tests fail after your changes, iterate up to maxIterations times. If still failing, open the PR as a draft with a comment explaining what's blocking.
- PR descriptions should reference the issue number, explain the approach taken, and note any tradeoffs.
- If an issue requires changes to more than 5 files, flag it as potentially too complex for automation and leave a comment.
- After opening the PR, wait for review feedback. If changes are requested, address them and push updates to the same branch.

Add this to your SOUL.md to define the agent's behavior for this workflow.

Expected Behavior

Every 15 minutes, OpenClaw checks for GitHub issues assigned to its account. When it finds one, it analyzes the issue, writes the code using OpenCode, runs tests, opens a PR, and requests review. It iterates on review feedback until the PR is approved or it hits the max iteration limit.

Usage Guide

Assign issues to your OpenClaw bot's GitHub account or add the configured trigger label. The agent polls every 15 minutes, picks up new issues, and works through them. PRs are opened with full context and linked to the original issue. Adjust maxIterations and triggerLabels to control scope.

Community Use Cases

All Use Cases →

More DevOps Recipes

All Recipes →