enrich-prs
Skill1 starsChanged 6 months agoMITView on GitHub
Fetch detailed review data for team-reviewed PRs: review rounds, dismissals, approvals, change requests, and per-reviewer actions. Produces enrichment JSON files used by metrics skills for quality and cycle analysis. Use when asked to 'enrich PRs', 'fetch review details', or as part of a data sync.
In this repository30 other files it gives its agents.
- setupSkill
- epic-cleanupSkill
- epic-overviewSkill
- oncall-reviewSkill
- sprint-managementSkill
- sprint-statusSkill
- team-activitySkill
- team-data-syncSkill
- direct-report-prepSkill
- interview-analysisSkill
- interview-prepSkill
- peer-prepSkill
- project-statusSkill
- team-analysisSkill
- today-prioritiesSkill
- weekly-snippetSkill
- bus-factorSkill
- contribution-velocitySkill
- nine-boxSkill
- project-people-mapSkill
- review-cardsSkill
- review-cyclesSkill
- review-networkSkill
- team-health-reportSkill
- task-rolloverSkill
- context-checkSkill
- prep-my-daySkill
- initiative-breakdownSkill
- product-briefSkill
- technical-deep-diveSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 39
Check which of these already have enrichment files in data/enrichment/
- Distinctive: line 106
If a PR returns 404 (deleted/private), write a minimal stub noting it's inaccessible
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
PR Enrichment
Fetch detailed review timeline data for PRs that received team reviews. This data powers the review-cycles, review-cards, and nine-box metrics skills.
When to Trigger
- "enrich PRs", "fetch review details", "get PR review data"
- "enrich [month]", "enrich last quarter"
- Called by
team-data-syncas part of a full data refresh
Data Sources (Input)
data/YYYY-MM/{login}-prs.json— list of PRs to potentially enrich (need repo and number)data/YYYY-MM/{login}-reviews.json— identifies which PRs had team reviewersteam.json— team roster (to identify team-internal reviews)
Data Produced (Output)
data/enrichment/{pr_number}.json— one file per PR with review detail
Process
Step 1: Build the enrichment manifest
For each month in the requested range:
- Load all
{login}-prs.jsonfiles to get authored PRs - Load all
{login}-reviews.jsonfiles to identify team reviewers - Cross-reference: find PRs where BOTH author AND at least one reviewer are team members
- Check which of these already have enrichment files in
data/enrichment/ - The delta = PRs needing enrichment that don't have a file yet
Report:
Enrichment plan for 2026-01 through 2026-03:
Total team-reviewed PRs: 184
Already enriched: 142
Needing enrichment: 42Step 2: Fetch review timeline for each PR
For each unenriched PR, query the GitHub API for the review timeline:
gh api repos/{owner}/{repo}/pulls/{number}/reviews \
--jq '[.[] | {author: .user.login, state: .state, submitted_at: .submitted_at}]'Step 3: Calculate metrics per PR
From the review timeline, compute:
| Field | Description |
team_reviews_count | Total review events from team members |
changes_requested | Count of CHANGES_REQUESTED events |
approvals | Count of APPROVED events |
dismissals | Count of DISMISSED events |
review_rounds | Number of review cycles (review → commit → review) |
final_state | Last review state (APPROVED, PENDING, CHANGES_REQUESTED) |
reviewer_actions | Per-reviewer breakdown of actions |
repo | Repository (owner/name) |
number | PR number |
author | PR author login |
Review rounds calculation:
A "round" = one cycle of: reviewer submits feedback → author pushes commits → reviewer reviews again. Count the number of times this cycle repeats. A PR with no iterations (approved on first review) has review_rounds: 1.
Step 4: Write enrichment file
Save to data/enrichment/{number}.json:
{
"team_reviews_count": 4,
"changes_requested": 1,
"approvals": 1,
"dismissals": 2,
"review_rounds": 3,
"final_state": "APPROVED",
"reviewer_actions": {
"alice": { "approved": 1, "changes_requested": 0, "commented": 0, "dismissed": 1 },
"bob": { "approved": 0, "changes_requested": 1, "commented": 0, "dismissed": 1 }
},
"repo": "org/repo-name",
"number": 12345,
"author": "carol"
}Step 5: Batch and rate limit
- Process PRs in batches of 10-20 to avoid rate limits
- Pause between batches if rate limit headers indicate throttling
- Report progress: "Enriched 20/42 PRs..."
- If a PR returns 404 (deleted/private), write a minimal stub noting it's inaccessible
Step 6: Summary report
Enrichment complete:
Processed: 42 PRs
Successful: 40
Skipped (404): 2
Total enrichment files: 184
Coverage by month:
2026-01: 52/55 PRs enriched (95%)
2026-02: 61/64 PRs enriched (95%)
2026-03: 71/65 PRs enriched (100%)Rules
- Never overwrite existing enrichment files unless explicitly asked to "re-enrich" or "refresh"
- Only enrich team-reviewed PRs — skip PRs where all reviewers are external
- Idempotent — running twice produces the same result (skips already-enriched PRs)
- Enrichment files are keyed by PR number — assumes PR numbers are globally unique within the org (they are within a repo; if cross-repo collisions occur, include repo in filename)
- Rate limit awareness — check
X-RateLimit-Remainingheader and back off when low
Notes
- Enrichment data is the most expensive to fetch (1 API call per PR)
- For large teams with high PR volume, a full quarter might be 200-500 API calls
- The
batch-plan.jsonfile can be used to track progress across interrupted sessions - PRs older than ~90 days may have review data that's harder to reconstruct from the API
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

