github-repo-stats
- Repo stars 0
- Author updated Live
- Author repo skills-registry
- Domain
- Engineering
- 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
- Guided setup
- External API key
- Required · GitHub
- Operating systems
- Unspecified (assume cross-platform)
- Runtime requirements
- Python
- Permissions
-
- Read-only
- Write / modify
- Network behavior
- External requests
- 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-repo-stats
description: > Use when this capability is needed. Use the GitHub REST API (no SDK needed) with curl + python…
category: engineering
runtime: Python
---
# github-repo-stats output preview
## PART A: Task fit
- Use case: > Use when this capability is needed. Use the GitHub REST API (no SDK needed) with curl + python3 to pull PR and issue data for a given repo and date range. The unauthenticated rate limit is 60 requires GitHub API key; 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 / Base URL pattern / Authenticated header (use when token available)” and do not present inference as author intent.
## PART B: Execution result
- **01** The card summarizes the use case; runtime output centers on “> Use when this capability is needed. Use the GitHub REST API (no SDK needed) with curl + python3 to pull PR and issue data for a given repo and date range. The unauthenticated rate limit is 60 requires GitHub API key; runs on Python. Works with Claude Code, Cursor, Cline and 23 more.”.
- **02** When the source has headings, the agent prioritizes “Overview / Base URL pattern / Authenticated header (use when token available)” 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; may access external network resources; requires GitHub API keys.
## Running Rules
- read files, write/modify files; may access external network resources; requires GitHub API keys.
- Validate with a small sample before expanding scope.
- Return the result, validation criteria, and next iteration options. The source mentions slash commands such as `/pulls`, `/issues`; use them first when your agent supports command triggers.
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 / Base URL pattern / Authenticated header (use when token available)”. 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-repo-stats
description: > Use when this capability is needed. Use the GitHub REST API (no SDK needed) with curl + python…
category: engineering
source: tomevault-io/skills-registry
---
# github-repo-stats
## When to use
- > Use when this capability is needed. Use the GitHub REST API (no SDK needed) with curl + python3 to pull PR and issue…
- 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 / Base URL pattern / Authenticated header (use when token available)” and keep inference separate from source facts.
- read files, write/modify files; may access external network resources; requires GitHub API keys.
- 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-repo-stats" {
input -> user goal + target files + boundaries + acceptance criteria
context -> Overview / Base URL pattern / Authenticated header (use when token available)
rules -> SKILL.md triggers / order / output contract
runtime -> Python | read files, write/modify files | may access external network resources
guardrails -> requires GitHub API keys + small-sample validation + diff/log review
output -> copyable result + checklist + next iteration
} GitHub Repository Stats via REST API
Overview
Use the GitHub REST API (no SDK needed) with curl + python3 to pull PR and
issue data for a given repo and date range. The unauthenticated rate limit is 60
requests/hour; set GITHUB_TOKEN in the environment for 5000/hour.
Base URL pattern
https://api.github.com/repos/{owner}/{repo}/pulls # PRs
https://api.github.com/repos/{owner}/{repo}/issues # Issues (includes PRs!)
https://api.github.com/search/issues # Search endpoint
Issues endpoint returns both issues AND pull requests. Filter with
"pull_request" in itemto separate them.
Authenticated header (use when token available)
AUTH_HEADER="-H \"Authorization: token $GITHUB_TOKEN\""
Pagination pattern
GitHub paginates at 100 items max per page. Always loop until an empty page:
import requests, time
def fetch_all(url, params, token=None):
headers = {"Authorization": f"token {token}"} if token else {}
headers["Accept"] = "application/vnd.github+json"
results = []
page = 1
while True:
params["page"] = page
params["per_page"] = 100
r = requests.get(url, headers=headers, params=params)
if r.status_code == 403:
time.sleep(60) # rate-limited, back off
continue
data = r.json()
if not data:
break
results.extend(data)
if len(data) < 100:
break
page += 1
return results
Date filtering
GitHub REST API supports since parameter (ISO 8601) for issues/PRs but NOT
until. Filter the until boundary in Python after fetching:
from datetime import datetime, timezone
def parse_dt(s):
return datetime.fromisoformat(s.replace("Z", "+00:00"))
start = datetime(2024, 12, 1, tzinfo=timezone.utc)
end = datetime(2024, 12, 31, 23, 59, 59, tzinfo=timezone.utc)
created_in_range = [i for i in items
if start <= parse_dt(i["created_at"]) <= end]
Key fields
| Field | Description |
|---|---|
number |
PR/issue number |
state |
"open" or "closed" |
created_at |
ISO 8601 creation timestamp |
closed_at |
ISO 8601 close timestamp (null if open) |
merged_at |
ISO 8601 merge timestamp (PRs only, null if unmerged) |
pull_request.merged_at |
In issue-endpoint results; same as above |
user.login |
Author login |
labels |
List of {"name": "..."} objects |
Detecting merged PRs
Via /pulls endpoint, merged_at is present and non-null.
Via /issues endpoint, check item.get("pull_request", {}).get("merged_at").
Computing average time-to-merge
from datetime import datetime, timezone
def days_between(a, b):
da = datetime.fromisoformat(a.replace("Z", "+00:00"))
db = datetime.fromisoformat(b.replace("Z", "+00:00"))
return (db - da).total_seconds() / 86400
merged = [p for p in prs if p.get("merged_at")]
avg = sum(days_between(p["created_at"], p["merged_at"]) for p in merged) / len(merged)
avg_rounded = round(avg, 1)
Finding top contributor
from collections import Counter
logins = [p["user"]["login"] for p in prs]
top = Counter(logins).most_common(1)[0][0]
Output: write report.json
import json, pathlib
report = {
"pr": {
"total": total_prs,
"merged": merged_count,
"closed": closed_count,
"avg_merge_days": avg_merge_days,
"top_contributor": top_contributor,
},
"issue": {
"total": total_issues,
"bug": bug_count,
"resolved_bugs": resolved_bugs,
}
}
pathlib.Path("/app/report.json").write_text(json.dumps(report, indent=2))
Source: cxcscmu/SkillLearnBench — distributed by TomeVault.
Decide Fit First
Design Intent
How To Use It
Boundaries And Review