# Stale PR digest

Once a week, posts the pull requests in one repository that have waited too long, and on whom.

Requires GitHub, through Composio. Requires Slack, through Composio. Runs on a schedule.

## Install

No one has run this against real GitHub and Slack accounts through Composio yet. Its eval cases use stand-ins.

```sh
npx @parcha/agentrun template install github:Parcha-ai/agentrun-templates/templates/stale-pr-digest@242f29da8317fbe51d0cce4628bdb5ab61d7ccc9 --trust
```

Or open `<your AgentRun address>/#/templates/install?src=github%3AParcha-ai%2Fagentrun-templates%2Ftemplates%2Fstale-pr-digest%40242f29da8317fbe51d0cce4628bdb5ab61d7ccc9`. Pinned to commit 242f29da8317fbe51d0cce4628bdb5ab61d7ccc9.

## What it does

Once a week, a Slack post listing the open pull requests in one GitHub repository that have sat with no review or no activity for longer than you allow, oldest wait first. Each line says who is waiting on whom (a requested reviewer who hasn't looked, an author who hasn't answered a change request, an approved PR nobody merged), how long, and a link. Drafts stay out. A PR still stuck from last week is marked as such instead of reported fresh. It only reads GitHub, through Composio's GitHub toolkit, and posts to one channel. It posts on its own only if you pick Never for approvals at install; it stays held to your repository and channel either way.

- Skill `stale-prs`: Find the open pull requests in one GitHub repository that have waited past a set number of days, work out who each one is waiting on, and post one Slack digest, oldest wait first. Reads GitHub through Composio's GitHub tools; the one write is the pinned Slack post. Use for the weekly schedule and for "which PRs are stuck".

## What starts it

- On a schedule: Mondays at 09:00 (UTC), unless you pick another time when you install it.
- By hand, any time: from the console, the API or the CLI.

## Inputs

| Name | Type | Required | What it is |
| --- | --- | --- | --- |
| `stale_days` | integer, 1 to 90 | no | The schedule passes your saved setting. Blank: 3. Example: `3`. |

### Setup, filled in once at install

| Name | Type | Required | What it is |
| --- | --- | --- | --- |
| `owner` | string | yes | The GitHub account or organization that owns the repository, like Parcha-ai. |
| `repo` | string | yes | The repository's name without the owner, like agentrun. |
| `channel` | string | yes | The Slack channel ID the digest goes to, like C0123ABCD (in Slack: the channel's details, at the bottom). Not a #name. |
| `stale_days` | integer | no | How many days a PR may wait on someone before it is listed; 3 unless you set it. Weekends count. Default: `3`. |
| `cron` | string, cron | no | When the digest runs, as a cron line (minute hour day-of-month month day-of-week): Monday 09:00 unless you set it. Default: `0 9 * * 1`. |
| `timezone` | string, timezone | no | The IANA time zone the cron line is read in (Europe/Madrid, America/New\_York): UTC unless you set it. Default: `UTC`. |

## What it needs

- Harness: pi, claude-agent, codex
- Model: balanced tier, low effort
- Tools: read
- Composio GitHub tools: GITHUB_LIST_PULL_REQUESTS, GITHUB_LIST_REVIEWS_FOR_A_PULL_REQUEST, GITHUB_LIST_ISSUE_COMMENTS, GITHUB_LIST_COMMITS_ON_A_PULL_REQUEST. Reads the open pull requests in the repository you set, with their reviews, comments and commits. Every call is held to that one repository. It writes nothing on GitHub.
- Composio Slack tools: SLACK_SEND_MESSAGE. Posts the weekly digest to the one Slack channel you set, and nowhere else.
- Computer: Wherever your AgentRun puts a new agent
- Keys: A model key
- Learning: on

## Sample output

Input:

```json
{
  "content": "Scheduled run. Write this week's stale pull request digest with your stale-prs skill and post it.",
  "stale_days": 3
}
```

Output:

Illustrative output, written by hand from the `who-waits-on-whom` eval case's test repository. A measured eval run
replaces it.

The Monday digest for acme/tidewater found four PRs waiting more than 3 days and posted one message to the team's
channel. Each line says who has the next move: priya owes a reply to carol's change request, bob owes a first review,
carol owes a second look after lina's fix, and sam has an approved PR to merge. The draft, the day-old PR and the
Dependabot bump stayed out.

## Tested

Passes 4 of 4 eval cases on pi, 4 of 4 on Claude Code and 4 of 4 on Codex.

4 eval cases: injection-in-pr, no-repeats, nothing-stale, who-waits-on-whom.

## Source

- Package: https://github.com/Parcha-ai/agentrun-templates/tree/242f29da8317fbe51d0cce4628bdb5ab61d7ccc9/templates/stale-pr-digest
- Publisher: Parcha-ai
- Author: Parcha Labs
- Version: 0.1.0
- License: Apache-2.0
- Category: Engineering
- Page: https://marketplace.agentrun.ai/templates/stale-pr-digest/
