Track how long your GitHub pull requests take to merge

Every Monday: median hours from pull request opened to merged last week, how many merged, time to first review, and the slowest ones.

Runs
Mondays at 9:00
Uses
GitHub
Posts
Stat tile

From your apps to your board

How the skill works: your agent reads last week's merged prs from GitHub; repositories from What you tell it, mondays at 9:00, and gives you median hours to merge and the report in the chat.

Reads

  • GitHubLast week's merged PRs
  • What you tell itRepositories
reads
Your agentClaude Code, Codex, Cursor or GeminiMondays at 9:00
posts

You get

  • Median hours to mergeA stat tile on your board, with its trend
  • The report in the chatEvery run, with or without Briefkin

What you get

  • Median cycle time last week, with the change and an 8-week trend.
  • PRs merged, median time to first review and the 90th percentile.
  • Slowest PRs: number, author, hours and size.
  • One line on where PRs waited, for example "47 of 52 hours before the first review".

The card on the right is a sample. Yours shows your own numbers and updates in place every run.

What lands on your board

acme-webMedian hours to merge19h-17% vs previous period, bettervs last report
PRs merged47+12% vs previous period
First review (median)4.5h-18% vs previous period, better
90th percentile71h
An example with made-up numbers. Your agent posts your real ones.

What it does

When shipping feels slow, the first question is where pull requests wait: in review, in rework, or in a queue of approvals. GitHub records every timestamp needed to answer it but shows none of it as a trend.

Every Monday the agent takes last week's merged pull requests, works out the median time from opening (or from ready for review, for drafts) to merge, and the median wait for a first review. Engineering leads see whether review is the bottleneck, and which small PRs waited longest.

How it works

  1. 1List last week's merged PRs

    Run gh pr list --repo <owner>/<repo> --state merged --search "merged:2026-10-05..2026-10-11" --limit 500 --json number,title,author,createdAt,mergedAt,additions,deletions,reviews with last week's dates. Leave out PRs from bots such as Dependabot.

  2. 2Start the clock at ready for review

    For PRs that were opened as drafts, query timelineItems(itemTypes: READY_FOR_REVIEW_EVENT, last: 1) { nodes { ... on ReadyForReviewEvent { createdAt } } } through gh api graphql, and use that time instead of createdAt.

  3. 3

    3Work out the times

    Cycle time is mergedAt minus the start, in hours. Time to first review is the earliest reviews[].submittedAt by someone other than the author. Take the median and 90th percentile of each, and save them weekly for the trend.

  4. 4

    4Post the tile

    Median cycle time is the headline with 8 weeks of history; PRs merged and median time to first review go in the glance; the five slowest PRs with their size in the opened card.

  5. Post it to the board

    With BRIEFKIN_TOKEN set, the agent sends the result as one card that updates in place every run. Without it, you get the report in the chat.

Install and run it

Pick your agent, where the data comes from and how to schedule it; the commands below follow.

Agent
Data
Schedule
  1. Install the skill

    One command. It puts the SKILL.md in ~/.claude/skills and in ~/.agents/skills, which Codex, Cursor, Gemini CLI, Copilot CLI and OpenCode read too.

    shellcurl -fsSL https://briefkin.dev/skills/github-pr-cycle-time/install | sh
  2. Run it

    Ask Claude Code:

    promptRun the github-pr-cycle-time skill

    Or paste the prompt instead of installing:

    promptUsing the GitHub CLI or API for <owner>/<repo>, take the pull requests merged last week (Monday to Sunday), leaving out bots. For each, compute hours from opened (or from ready for review, if it started as a draft) to merged, and hours to the first review by someone other than the author. Give me the median and 90th percentile of both, the number merged, and the five slowest PRs with author and lines changed. Compare with the week before and end with one line on where PRs waited.
  3. Put it on a schedule

    Mondays at 9:00, from cron on any machine where Claude Code is signed in:

    crontab0 9 * * 1 claude -p "Run the github-pr-cycle-time skill"

    Add it with crontab -e. A laptop asleep at that time runs it when it wakes if you use launchd or Task Scheduler instead; GitHub Actions works for the API route.

  4. Send it to your board

    Connect Briefkin once with curl -fsSL https://briefkin.dev/install | sh and every run lands on your board as a stat tile. How setup works

View the SKILL.mdRaw file
SKILL.md---
name: github-pr-cycle-time
description: "Every Monday: median hours from pull request opened to merged last week, how many merged, time to first review, and the slowest ones. Use when the user asks for this, or when it runs on a schedule."
---

# GitHub pull request cycle time

Every Monday: median hours from pull request opened to merged last week, how many merged, time to first review, and the slowest ones.

When shipping feels slow, the first question is where pull requests wait: in review, in rework, or in a queue of approvals. GitHub records every timestamp needed to answer it but shows none of it as a trend.

Every Monday the agent takes last week's merged pull requests, works out the median time from opening (or from ready for review, for drafts) to merge, and the median wait for a first review. Engineering leads see whether review is the bottleneck, and which small PRs waited longest.

## Two ways to get the data

Use the API or MCP route when you have an MCP server, a CLI or an API token for the app. Otherwise, if you can drive a browser the user is signed in to (Claude in Chrome, a Playwright or Chrome DevTools MCP server), use the browser route. Say which one you used.

## Route A: API or MCP server

### What you need

- The `gh` CLI signed in with read access to the repositories, or a token in `GITHUB_TOKEN` with read access to pull requests.

If something is missing, say what and stop; do not invent numbers.

### Steps

1. **List last week's merged PRs** (GitHub): Run `gh pr list --repo <owner>/<repo> --state merged --search "merged:2026-10-05..2026-10-11" --limit 500 --json number,title,author,createdAt,mergedAt,additions,deletions,reviews` with last week's dates. Leave out PRs from bots such as Dependabot.
2. **Start the clock at ready for review** (GitHub): For PRs that were opened as drafts, query `timelineItems(itemTypes: READY_FOR_REVIEW_EVENT, last: 1) { nodes { ... on ReadyForReviewEvent { createdAt } } }` through `gh api graphql`, and use that time instead of `createdAt`.
3. **Work out the times**: Cycle time is `mergedAt` minus the start, in hours. Time to first review is the earliest `reviews[].submittedAt` by someone other than the author. Take the median and 90th percentile of each, and save them weekly for the trend.
4. **Post the tile**: Median cycle time is the headline with 8 weeks of history; PRs merged and median time to first review go in the glance; the five slowest PRs with their size in the opened card.

## Route B: the browser

### What you need

- Signed in to GitHub with read access to the repository; private repositories show nothing to accounts without it.

If something is missing, say what and stop; do not invent numbers.

### Steps

Start at https://github.com/pulls. The user is signed in already; never type passwords or codes, and ask if a sign-in page appears.

1. **Search last week's merged PRs**: Replace the search box contents with `is:pr is:merged repo:<owner>/<repo> merged:2026-10-05..2026-10-11 -author:app/dependabot`, using last Monday to Sunday. The count at the top is PRs merged.
2. **Read each PR's timestamps**: Open each PR. Hover the time in the **opened this pull request** line and the **merged commit** line at the bottom of the conversation to read exact times; if the timeline has a **marked this pull request as ready for review** event, start the clock there.
3. **Find the first review**: In the same timeline, the first **approved these changes**, **requested changes** or **reviewed** event by someone other than the author gives time to first review. The **Files changed** tab header shows additions and deletions.
4. **Work out the numbers**: Compute hours to merge and hours to first review per PR, take the median and 90th percentile of each, and list the five slowest PRs with author and size. Compare with last week's saved numbers.

Note: Opening every PR takes a minute or so each, so this route suits repositories merging up to about 30 PRs a week; above that, the API route is the one to use. Insights > Pulse on the repository gives the merged count alone for the last week.

## The report

- **Median cycle time** last week, with the change and an 8-week trend.
- **PRs merged**, **median time to first review** and the 90th percentile.
- **Slowest PRs**: number, author, hours and size.
- One line on where PRs waited, for example "47 of 52 hours before the first review".

## Post it to Briefkin

When `BRIEFKIN_TOKEN` is set, or `~/.config/briefkin/env` exists (the installer from https://briefkin.dev/docs writes it), also send the result to the user's Briefkin board as one card. Keep the `item_key` the same on every run so the card updates in place, use a new `event_id` per run, and put today's real numbers in place of the example ones. If the request fails, say so once and carry on.

```bash
[ -n "${BRIEFKIN_TOKEN:-}" ] || . ~/.config/briefkin/env
curl -sS -X POST "${BRIEFKIN_URL:-https://briefkin.dev}/v1/events" \
  -H "authorization: Bearer $BRIEFKIN_TOKEN" \
  -H "content-type: application/json" \
  -d @- <<'JSON'
{
  "v": 1,
  "event_id": "github-pr-cycle-time/<date of this run, e.g. 2026-10-16>",
  "item_key": "github-pr-cycle-time",
  "project": "acme-web",
  "source": "GitHub pull request cycle time skill",
  "kind": "metric",
  "title": "Median PR cycle time down to 19 hours",
  "metric": {
    "label": "Median hours to merge",
    "value": 19,
    "unit": "h",
    "better": "lower",
    "period_start": "<start of the period, ISO 8601>",
    "period_end": "<end of the period, ISO 8601>"
  },
  "glance": [
    {
      "type": "Grid",
      "props": {
        "columns": 3
      },
      "children": [
        {
          "type": "Stat",
          "props": {
            "label": "PRs merged",
            "value": 47,
            "delta": 12
          }
        },
        {
          "type": "Stat",
          "props": {
            "label": "First review (median)",
            "value": 4.5,
            "unit": "h",
            "delta": -18,
            "better": "lower"
          }
        },
        {
          "type": "Stat",
          "props": {
            "label": "90th percentile",
            "value": 71,
            "unit": "h",
            "better": "lower"
          }
        }
      ]
    }
  ],
  "widget": [
    {
      "type": "Table",
      "props": {
        "columns": [
          "Pull request",
          "Author",
          "Hours",
          "Size"
        ],
        "align": [
          "left",
          "left",
          "right",
          "right"
        ],
        "rows": [
          [
            "#1842 Move billing to the new provider",
            "dana",
            168,
            "+1,240 / -380"
          ],
          [
            "#1857 Refactor the search indexer",
            "theo",
            96,
            "+860 / -910"
          ],
          [
            "#1861 Add SSO for teams",
            "sam",
            74,
            "+520 / -40"
          ],
          [
            "#1849 Upgrade to React 19",
            "priya",
            71,
            "+310 / -295"
          ],
          [
            "#1866 Fix time zone bug in reports",
            "marco",
            52,
            "+18 / -6"
          ]
        ]
      }
    },
    {
      "type": "Callout",
      "props": {
        "text": "#1866 changed 24 lines and still took 52 hours, 47 of them waiting for a first review.",
        "tone": "warn"
      }
    }
  ],
  "size": "md"
}
JSON
```

Widgets come from the Briefkin catalog (https://briefkin.dev/v1/catalog). Without a token, just give the user the report.

Set `period_start` and `period_end` to the window the number covers: the tile names it from them ("Last 7 days", "Today", "This month"). For a count right now (open items, a balance), send `"period_label": ""` so no period shows; for another name, send it as `period_label` (at most 24 characters).

## Run it on a schedule

Suggested: Mondays at 9:00 (`0 9 * * 1`). From cron, with the agent signed in on that machine:

```bash
0 9 * * 1 claude -p "Run the github-pr-cycle-time skill"
# Codex: codex exec, Gemini CLI: gemini -p, Copilot CLI: copilot -p, OpenCode: opencode run
```

Or use the agent's own scheduler (Claude Code routines, Codex automations, Claude or ChatGPT scheduled tasks): https://briefkin.dev/skills/github-pr-cycle-time#schedule

Source: https://briefkin.dev/skills/github-pr-cycle-time

What your agent needs

  • The gh CLI signed in with read access to the repositories, or a token in GITHUB_TOKEN with read access to pull requests.

Connecting GitHub

  1. GitHub MCP Server, GitHub's official server, hosted at https://api.githubcopilot.com/mcp/. Sign in with OAuth or a personal access token; add /readonly to the URL, or use a toolset URL such as https://api.githubcopilot.com/mcp/x/pull_requests/readonly, to expose only read tools. It also runs locally (source).
  2. The gh CLI. Run gh auth login once, or set GH_TOKEN for scheduled runs. gh pr list --search "review-requested:@me" --json number,title,url,createdAt and gh api repos/{owner}/{repo}/dependabot/alerts cover most reports.
  3. REST and GraphQL with a fine-grained token. Store it in GITHUB_TOKEN, limit it to the repositories in the report, and grant Read on Metadata, Contents, Pull requests and Issues, plus Dependabot alerts if you report on them.

With every permission on a fine-grained token set to Read, the agent can't push, merge, comment or close anything.

Questions

Why the median and not the average?

One pull request that stays open for three weeks drags the average up for everyone. The median shows the typical PR, and the 90th percentile next to it shows how long the slow ones take, so neither hides the other.

How are drafts handled?

For a PR opened as a draft, the clock starts when it was marked ready for review, since nobody was asked to look before then. Time spent as a draft is work in progress, not waiting.

Do I need Briefkin to use the GitHub pull request cycle time skill?

No. The skill runs with your own agent and gives you the report in the chat. With a Briefkin token set, each run also posts it to your board as a stat tile, so you can glance at it instead of asking again.

Which agents can run it?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot CLI, OpenCode, Windsurf and Amp all read SKILL.md files. The install command puts it in ~/.claude/skills and ~/.agents/skills, where they look. ChatGPT, the Claude app and Grok take the prompt instead. Pick your agent under "Install and run it" and the commands change to match.

Can it work without an API or MCP server, from my browser?

Yes. Switch the data source to "Your browser" and the steps change to the GitHub pages themselves: the agent opens github.com/pulls in a browser you are signed in to and reads the numbers off the page. Claude Code, Codex, Cursor, Claude app and ChatGPT can drive a browser out of the box; Gemini CLI, Copilot CLI and OpenCode need a Playwright or Chrome DevTools MCP server first. It is slower than the API and needs you signed in, so it suits a report you run by hand or from a scheduler on your own computer.

Watch median hours to merge on your board, run after run

Skills are free to use with any agent. Briefkin is where their results land: one board for every report, number and question your agents send, with a ping when something needs you.

Free during the open beta. No card.