github-pr-stats
- Repo stars 0
- Author updated Live
- Author repo skills-registry
- Domain
- Data
- Compatible agents
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- Trust score
- 88 / 100 · community maintained
- Author / version / license
- @tomevault-io · no license declared
- Token usage
- Lean
- Setup complexity
- Plug-and-play
- External API key
- Not required
- Operating systems
- Unspecified (assume cross-platform)
- Runtime requirements
- Python
- Permissions
-
- Read-only
- Write / modify
- Network behavior
- Local-only
- Install commands
- 26 variants
Profile is derived at build time from SKILL.md and install vectors. Subject to drift from author intent.
Heads up: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: github-pr-stats
description: Compute PR statistics (total, merged, closed, avg merge time, top contributor) from GitHub API d…
category: data
runtime: Python
---
# github-pr-stats output preview
## PART A: Task fit
- Use case: Compute PR statistics (total, merged, closed, avg merge time, top contributor) from GitHub API data using Python or jq. Use when this capability is needed. After fetching PR data from the GitHub API, use Python or jq to compute: runs entirely locally; runs on Python. Works with Claude Code, Cursor, Cline and 23 more..
- Inputs: target material, constraints, expected output, and acceptance criteria.
- Evidence boundary: follow “Overview / Fetching PRs for a Date Range / Python: Compute Stats from JSON” and do not present inference as author intent.
## PART B: Execution result
- **01** The card summarizes the use case; runtime output centers on “Compute PR statistics (total, merged, closed, avg merge time, top contributor) from GitHub API data using Python or jq. Use when this capability is needed. After fetching PR data from the GitHub API, use Python or jq to compute: runs entirely locally; runs on Python. Works with Claude Code, Cursor, Cline and 23 more.”.
- **02** When the source has headings, the agent prioritizes “Overview / Fetching PRs for a Date Range / Python: Compute Stats from JSON” so the result follows the author’s structure.
- **03** Typical output includes task judgment, concrete steps, required commands or file edits, validation, and follow-up options.
- **04** Risk context follows the fingerprint: read files, write/modify files; mostly runs locally; usually needs no extra API key.
## Running Rules
- read files, write/modify files; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding scope.
- Return the result, validation criteria, and next iteration options. The source does not require a stable slash command. After installation, invoke the skill by name and describe the task.
Name target files or source material, expected output, forbidden changes, and whether network or shell access is allowed. Permission fingerprint: read files, write/modify files.
Start with a small task and check whether the result follows “Overview / Fetching PRs for a Date Range / Python: Compute Stats from JSON”. Inspect diffs, logs, previews, or tests before expanding scope.
Confirm the final output includes a concrete result, evidence, and next action. If it stays generic, tighten inputs, boundaries, and acceptance criteria.
---
name: github-pr-stats
description: Compute PR statistics (total, merged, closed, avg merge time, top contributor) from GitHub API d…
category: data
source: tomevault-io/skills-registry
---
# github-pr-stats
## When to use
- Compute PR statistics (total, merged, closed, avg merge time, top contributor) from GitHub API data using Python or jq…
- Use it when the task has clear inputs, repeatable steps, and validation criteria.
## What to provide
- Target material, scope, expected result, and forbidden changes.
- Whether network, commands, file writes, or external services are allowed.
## Execution rules
- Organize steps around “Overview / Fetching PRs for a Date Range / Python: Compute Stats from JSON” and keep inference separate from source facts.
- read files, write/modify files; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding the task.
## Output requirements
- Return the deliverable, key evidence, validation method, and next action.
- Mark missing information as unknown; do not invent commands, platforms, or dependencies. The author source anchors workflow facts; repository files anchor sources and commands; Fluxly only adds fit, limitations, and quality judgment.
skill "github-pr-stats" {
input -> user goal + target files + boundaries + acceptance criteria
context -> Overview / Fetching PRs for a Date Range / Python: Compute Stats from JSON
rules -> SKILL.md triggers / order / output contract
runtime -> Python | read files, write/modify files | mostly runs locally
guardrails -> usually needs no extra API key + small-sample validation + diff/log review
output -> copyable result + checklist + next iteration
} GitHub PR Statistics
Overview
After fetching PR data from the GitHub API, use Python or jq to compute:
- Total PR count
- Merged vs closed counts
- Average time-to-merge (days)
- Top contributor by PR count
Fetching PRs for a Date Range
# Using gh search (handles pagination, date filtering)
gh pr list -R cli/cli \
--search "created:2024-12-01..2024-12-31" \
--state all \
--limit 500 \
--json number,author,createdAt,mergedAt,closedAt,state
Python: Compute Stats from JSON
import json
from datetime import datetime, timezone
from collections import Counter
# Load PR data (from gh pr list --json output)
with open('prs.json') as f:
prs = json.load(f)
total = len(prs)
# Count merged vs closed-but-not-merged
merged = [pr for pr in prs if pr['mergedAt']]
closed = [pr for pr in prs if not pr['mergedAt'] and pr['state'] == 'CLOSED']
# Average time to merge (creation -> mergedAt), in days
def parse_dt(s):
return datetime.fromisoformat(s.replace('Z', '+00:00'))
merge_days = []
for pr in merged:
created = parse_dt(pr['createdAt'])
merged_at = parse_dt(pr['mergedAt'])
delta = (merged_at - created).total_seconds() / 86400
merge_days.append(delta)
avg_merge_days = round(sum(merge_days) / len(merge_days), 1) if merge_days else 0.0
# Top contributor
authors = Counter(pr['author']['login'] for pr in prs)
top_contributor = authors.most_common(1)[0][0]
print(json.dumps({
"total": total,
"merged": len(merged),
"closed": len(closed),
"avg_merge_days": avg_merge_days,
"top_contributor": top_contributor
}, indent=2))
Notes on State Values
gh pr list --jsonreturnsstateas"OPEN","CLOSED", or"MERGED"mergedAtis non-null only for merged PRs- A PR with
state == "CLOSED"andmergedAt == nullis truly closed (not merged)
Notes on the Search API
created:2024-12-01..2024-12-31is inclusive on both ends- Dec 31 means up to
2024-12-31T23:59:59Z - Use
--limit 500to avoid truncation for active repos
Source: cxcscmu/SkillLearnBench — distributed by TomeVault.
Decide Fit First
Design Intent
How To Use It
Boundaries And Review