News

OpenClaw Launches GitHub PR Watchdog: Smart Automation Prevents Stale Pull Requests

OpenClaw Launches GitHub PR Watchdog: Smart Automation Prevents Stale Pull Requests

For developers juggling multiple open GitHub Pull Requests (PRs), the challenge of keeping track of their status can be significant. It's a common scenario: you open GitHub at the end of the day only to find a reviewer commented hours ago, CI silently failed, or a PR marked "ready for review" has sat untouched for days.

Context-switching to babysit PRs is an expensive overhead, yet missing a crucial review window is worse, often stalling the entire team's progress. Developers need a solution that eliminates tab-switching, avoids cluttered dashboards, and bypasses email notifications buried under newsletters, delivering actionable alerts directly where they are already communicating.

OpenClaw GitHub PR Watchdog: An Intelligent Monitoring Solution

The GitHub PR Watchdog is an OpenClaw skill designed to address these pain points. It proactively monitors your open pull requests and delivers smart, actionable alerts directly to your messaging app of choice—be it Telegram, Slack, Discord, or WhatsApp. Running silently in the background on a heartbeat schedule you control (e.g., every 20 minutes), it only reaches out when something genuinely requires your attention.

How It Works

This skill connects to GitHub's REST API using a personal access token securely stored in your local OpenClaw configuration. Every N minutes (configurable; a common setting is 20 minutes), it performs the following steps:

  • Fetches All Open PRs: Gathers all active PRs across your designated watched repositories.
  • Checks for New Activity: For each PR, it identifies any new activity since the last check, including:
    • New review comments or change requests;
    • CI status changes (pass/fail/pending);
    • PRs that have been open longer than your defined staleness threshold;
    • Approvals indicating the PR is ready to merge.
  • Sends Concise Digest: It dispatches a concise digest of notifications exclusively for PRs where a change has occurred, ensuring relevance and minimal noise.
  • Drafts Suggested Responses: A unique feature allows the skill to draft suggested responses for review comments, enabling users to approve and post them with a single reply.

The system is designed for pure signal, eliminating noise and duplicates.

Example Alert (via Telegram)

An illustrative alert via Telegram might look like this:

🔴 CI Failed — my-app / feat/auth-refresh
  ↳ 3 checks failed | View run →

💬 New Review — my-api / fix/rate-limiter
  @sarah_dev: "Can we extract this into a helper?"
  Suggested reply ready — send "reply 1" to post it

✅ Approved & Ready — my-app / chore/upgrade-deps
  2 approvals | No conflicts | Safe to merge

Technical Implementation Details

The core logic of the PR Watchdog resides in a single `SKILL.md` file, complemented by a small Node.js runner. OpenClaw handles the crucial aspects of scheduling, secret management, and message routing, allowing the developer to focus primarily on writing the GitHub API calls and the output formatting logic.

An excerpt from the `skill.yaml` configuration highlights key parameters:

# skill.yaml (excerpt)
name: pr-watchdog
description: Monitor GitHub PRs and alert on review activity, CI status, and stale PRs
schedule: every 20 minutes
inputs:
  - GITHUB_TOKEN
  - WATCHED_REPOS       # comma-separated list
  - STALE_THRESHOLD_HRS # default: 24
  - ALERT_CHANNEL       # telegram | slack | discord

The total JavaScript code for this skill is approximately 180 lines, with much of it dedicated to formatting the output for immediate readability. OpenClaw's framework significantly simplified the development process, enabling the efficient creation and deployment of such automation agents.

↗ Read original source