agentsclimarketplace

Run2 gh pr analysis

Skill cxcscmu/SkillLearnBench/skills/b2-self-feedback-claude-sonnet-4-6/github-repo-analytics/run2_gh-pr-analysis

[COLM'26] SkillLearnBench is the first benchmark for evaluating continual learning methods that automatically generate agent skills.

Install
npx -y skills add cxcscmu/SkillLearnBench --skill run2_gh-pr-analysis

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

What its author says it does

Copied from the file, not written here

How to compute PR statistics (merged, closed, avg_merge_days, top_contributor) from GitHub Search API items using Python.

SKILL.md

2.0 KB, 515 tokens by cl100k_base, as published. Nobody here has run it

GitHub PR Analysis from Search API Results

Input Format

Each PR item from /search/issues has:

  • state: "open" or "closed" (merged PRs are also "closed")
  • created_at: ISO 8601 string e.g. "2024-12-05T10:00:00Z"
  • pull_request.merged_at: timestamp string or null
  • user.login: author username

Classifying PRs

def classify_prs(prs):
    merged, closed, open_prs = [], [], []
    for pr in prs:
        pr_field = pr.get("pull_request") or {}
        merged_at = pr_field.get("merged_at")
        if merged_at:
            merged.append({**pr, "_merged_at": merged_at})
        elif pr["state"] == "closed":
            closed.append(pr)
        else:
            open_prs.append(pr)
    return merged, closed, open_prs

Average Merge Time (days, rounded to 1 decimal)

from datetime import datetime, timezone

def parse_dt(s):
    return datetime.strptime(s, "%Y-%m-%dT%H:%M:%SZ").replace(tzinfo=timezone.utc)

def avg_merge_days(merged_prs):
    if not merged_prs:
        return 0.0
    diffs = []
    for pr in merged_prs:
        pr_field = pr.get("pull_request") or {}
        merged_at = pr_field.get("merged_at")
        created_at = pr.get("created_at")
        if merged_at and created_at:
            delta = (parse_dt(merged_at) - parse_dt(created_at)).total_seconds() / 86400
            diffs.append(delta)
    return round(sum(diffs) / len(diffs), 1) if diffs else 0.0

Top Contributor

from collections import Counter

def top_contributor(prs):
    authors = Counter(pr["user"]["login"] for pr in prs if pr.get("user"))
    return authors.most_common(1)[0][0] if authors else "unknown"

Key Distinction: "closed" means unmerged+closed

  • merged: pull_request.merged_at is not null
  • closed: state == "closed" AND pull_request.merged_at is null
  • These two are mutually exclusive and exhaustive for closed PRs.

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 327,132. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.