用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tomevault-io/skills-registry --skill github-repo-stats命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
| Use when this capability is needed.
> Use when this capability is needed.
Review architecture and API design for the vfs-s3 project. Use when the user mentions @architect, asks to review an issue's design, discuss module boundaries, API shape, or architectural decisions for vfs-s3. Also trigger when the user wants to create an ADR (Architecture Decision Record) or evaluate a technical approach for the project. Intended for dispatch from Codex automation or Claude routines; GitHub trigger phrase: @vfs-s3-bot please prepare design doc Use when this capability is needed.
基于 SOC 职业分类
正在显示 SKILL.md
| name | github-repo-stats |
| description | > 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
requests/hour; set GITHUB_TOKEN in the environment for 5000/hour.
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.
AUTH_HEADER="-H \"Authorization: token $GITHUB_TOKEN\""
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
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]
| 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 |
Via /pulls endpoint, merged_at is present and non-null.
Via /issues endpoint, check item.get("pull_request", {}).get("merged_at").
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)
from collections import Counter
logins = [p["user"]["login"] for p in prs]
top = Counter(logins).most_common(1)[0][0]
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.