modules/programs/agents/shared/skills/pr-activity-report/SKILL.md
Quarterly PR Activity Report
npx skillsauth add MichaelVessia/nixos-config pr-activity-reportInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Arguments: $ARGUMENTS (required). Format: owner/repo optionally followed by
a quarter like Q1 2026. If no quarter given, use the current quarter.
gh CLIYou need three datasets. Exclude bot authors (login containing [bot] or
dependabot or renovate or github-actions). Only count merged PRs.
For every human contributor with repo access, compute per-ISO-week:
prs_authored: number of PRs they authored that were merged that weekprs_reviewed: number of unique PRs they submitted a review on that weekUse gh api with GraphQL or REST pagination. Group by ISO week (Monday start).
Include weeks with zero activity so the heatmap has no gaps.
Collect all users who either authored or reviewed at least one PR in the period, plus anyone with push access who had zero activity (to show gaps).
The output shape is:
[
{ "week_start": "2026-01-05", "user": "alice", "prs_authored": 3, "prs_reviewed": 5 },
...
]
For every (reviewer, author) pair where the reviewer submitted at least one review on the author's merged PRs during the quarter:
[
{ "reviewer": "alice", "author": "bob", "count": 12 },
...
]
For every merged PR in the quarter, collect size and classification data:
[
{
"number": 42,
"user": "alice",
"title": "feat(auth): add SSO login",
"merged_at": "2026-01-15T10:00:00Z",
"additions": 340,
"deletions": 12,
"changed_files": 8,
"size_tier": "L",
"pr_type": "feat",
"top_dirs": ["src/auth", "tests/auth"]
},
...
]
Size tiers (based on additions + deletions):
| Tier | Lines changed | |------|--------------| | XS | 0-9 | | S | 10-49 | | M | 50-249 | | L | 250-999 | | XL | 1000+ |
PR type parsed from the PR title using this regex:
^(feat|fix|refactor|chore|docs|test|ci|build|perf)(\(.+?\))?[!]?:. Falls back
to "other" when the title does not match.
Top directories derived from the file paths (first two path segments, deduped, max 5).
Use gh api with pagination. Suggested approach:
# Get all merged PRs in date range, including size fields
gh api --paginate "repos/{owner}/{repo}/pulls?state=closed&sort=updated&direction=desc&per_page=100" \
--jq '.[] | select(.merged_at != null) | select(.merged_at >= "START" and .merged_at < "END") | {number, user: .user.login, title: .title, merged_at: .merged_at, additions, deletions, changed_files}'
# For each PR, get reviews
gh api "repos/{owner}/{repo}/pulls/{number}/reviews" \
--jq '[.[] | .user.login] | unique'
# For each PR, get file paths (batch alongside reviews)
gh api "repos/{owner}/{repo}/pulls/{number}/files" \
--jq '[.[] | .filename]'
From the file paths, derive top_dirs by extracting the first two path segments
of each file (e.g. src/auth/login.ts -> src/auth), deduping, and keeping the
top 5 by frequency.
Compute size_tier from additions + deletions using the tier table above.
Parse pr_type from title using the regex above.
This will be slow for large repos. To speed up, batch requests and cache results. If there are more than ~500 PRs, process in chunks and show progress.
If the API calls are going to be very numerous (>200 PRs), write a small bash script that collects everything into a JSON file first, then process it.
From the collected data, compute:
+N / -N (use k suffix for thousands, e.g. +2.1k / -0.4k)Display all six stats as cards in a 3x2 grid.
Analyze the data and write opinionated, specific insights. Reference actual numbers and usernames. Cover:
3-5 bullet points covering the most important patterns:
Write a short insight box before each of the three heatmaps, the chord diagram, the size distribution chart, and the contributor profiles section:
Be direct. Use color-coded markers: .good (green), .flag (yellow),
.concern (red).
Add a context disclaimer noting this data covers only this repo and contributors may be active elsewhere.
Generate a single self-contained index.html file in a temp directory
(mktemp -d). Use Plotly 2.35.2 and D3 v7. Dark GitHub theme.
The HTML must include, in this order:
{Quarter} {Year} -- PR Activity (Humans Only) with subtitleEmbed the three JSON datasets directly in <script> tags.
username (A:NNN R:NNN +Nk -Nk) with monospace font,
padded. The +Nk -Nk shows total additions/deletions for that contributor,
using k suffix for thousands (e.g. +2.1k -0.4k). For values under 1000,
show the raw number (e.g. +340 -12).Horizontal stacked bar chart (Plotly) showing each contributor's PR count broken down by size tier. One bar per contributor (same Y-axis order as heatmaps).
Colors for size tiers:
#7d8590 (gray)#58a6ff (blue)#3fb950 (green)#d29922 (orange)#f85149 (red)Same filter buttons apply. Place after the three heatmaps, before the chord diagram.
Only shown when >= 50% of PRs in the quarter have a parseable conventional commit prefix in the title (matching the regex from Dataset 3).
When shown: horizontal stacked bar per contributor with colors per type. Use a distinct color palette (not the size tier colors). Same filter buttons apply.
When omitted: add a brief note in the takeaways explaining that PR type breakdown was skipped because fewer than 50% of PR titles follow conventional commit format, and include the actual parse rate percentage.
Clicking any username in any Y-axis label, chart label, or stacked bar opens a modal with:
https://github.com/{username}.png?size=64), total authored and reviewed
counts+N -N, and merge datetop_dirs from Dataset 3Implementation: pure CSS modal toggled by JS. Fixed overlay with --panel
background card, max-width 600px, scrollable content. Close on overlay click or
Escape key. No new libraries.
--bg: #0d1117; --fg: #e6edf3; --muted: #7d8590;
--panel: #161b22; --border: #30363d; --accent: #58a6ff;
Size tier color variables (for reuse in charts and badges):
--tier-xs: #7d8590; --tier-s: #58a6ff; --tier-m: #3fb950;
--tier-l: #d29922; --tier-xl: #f85149;
Print the path to the generated index.html file. The user can then deploy it
however they choose (e.g. surge, gh-pages, local preview).
tools
User guide for the local squash-safe `stack` CLI for stacked PR/MR repair on GitHub and GitLab. Use when someone asks how to inspect, track, sync, merge, document, or undo stacked pull requests / merge requests in squash-merge repositories. Prefer this tool over GitHub's `gh stack` command for this workflow.
tools
Control herdr from inside it. Manage workspaces and tabs, split panes, spawn agents, read output, and wait for state changes — all via CLI commands that talk to the running herdr instance over a local unix socket. Use when running inside herdr (HERDR_ENV=1).
development
Inspect my self-hosted AutoCaliWeb library. Use when the user asks about AutoCaliWeb, books in Calibre, OPDS status, recent imports, shelves, catalog stats, or wants to search the ebook library.
data-ai
Subscribe a YouTube channel in TubeArchivist, queue its top videos by views from recent uploads, wait for the first file, scan Jellyfin, and rename + lock the channel folder to a friendly display name. Use when the user says "add a youtube channel", "subscribe to <channel>", or wants a curated TubeArchivist + Jellyfin import for a creator.