agentsclimarketplace

Run2 robust community metrics

Skill cxcscmu/SkillLearnBench/skills/b2-self-feedback-gemini-3-flash-preview/github-repo-analytics/run2_robust_community_metrics

Robust Python logic for community pulse metrics with substring label matching and precise PR status handling.From its SKILL.md

Install
npx -y skills add cxcscmu/SkillLearnBench --skill run2_robust_community_metrics

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

SKILL.md

1.3 KB, 297 tokens by cl100k_base, as published. Nobody here has run it

Robust Community Metrics

This skill focuses on precision and robustness when calculating metrics from GitHub JSON data.

Substring Label Matching (The "Bug" Filter)

To follow the requirement of matching any label containing a substring:

def is_bug_report(issue, substring='bug'):
    return any(substring in label['name'].lower() for label in issue.get('labels', []))

Precise PR Status (Merged vs. Closed)

In GitHub, a PR can be open or closed. A closed PR might be merged.

  • Merged: pull_request.merged_at is not null.
  • Closed (Unmerged): state == "closed" AND pull_request.merged_at is null.

Time-to-Merge Calculation

Always use datetime.fromisoformat and handle UTC offsets (replacing 'Z' with '+00:00').

def get_merge_days(created_at_str, merged_at_str):
    created = datetime.fromisoformat(created_at_str.replace('Z', '+00:00'))
    merged = datetime.fromisoformat(merged_at_str.replace('Z', '+00:00'))
    return (merged - created).total_seconds() / (24 * 3600)

Handling Large Data Sets

When dealing with more than 100 items, ensure the processing script can merge multiple JSON files or handle an array of items.

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.