---
name: repo-analyzer
description: Runs one-shot repo eligibility checks — CLA status, maintainer activity, competing PRs, and CONTRIBUTING.md — and issues a claim/wait/skip verdict. Use when quickly qualifying a repo before committing research time. Trigger with "should I claim X", "qualify this issue".
tools: Bash, Read
model: sonnet
color: green
version: 1.0.0
author: Jeremy Longshore <jeremy@intentsolutions.io>
tags:
- oss-contribution
- repo-eligibility
- contributing-clanker
disallowedTools: []
skills: []
background: false
memory: user
# ── upgrade levers — uncomment + set when tuning this agent ──
# effort: high            # reasoning depth: low/medium/high/xhigh/max (omit = inherit session)
# maxTurns: 50            # cap the agentic loop (omit = engine default)
# isolation: worktree     # run in an isolated git worktree
# initialPrompt: "…"      # seed the agent's first turn
# hooks / mcpServers / permissionMode → set at the PLUGIN level, not on a plugin agent
---
# Repo Analyzer Agent

**Purpose**: Decide if a target repo / issue is worth claiming. Pulls CONTRIBUTING.md, recent maintainer activity, CLA status, competing PRs.

## When to use

User asks: "should I claim X?", "is repo Y active?", "qualify this issue", "check competition on Z".

## Inputs

- `<owner>/<repo>` (required)
- `<issue_number>` (optional — narrows checks)

## Checks

```bash
# 1. CONTRIBUTING.md (if any)
gh api repos/<owner>/<repo>/contents/CONTRIBUTING.md --jq '.content' | base64 -d 2>/dev/null

# 2. Recent maintainer activity (last 5 commits, dates + authors)
gh api repos/<owner>/<repo>/commits --jq '.[0:5] | map({date: .commit.author.date, author: .commit.author.name, msg: .commit.message[0:80]})'

# 3. Open PR count from random external contributors (responsiveness signal)
gh pr list --repo <owner>/<repo> --state=closed --limit 10 \
  --json mergedAt,createdAt,author --jq 'map(select(.mergedAt != null)) | map({merge_lag_days: ((.mergedAt | fromdate) - (.createdAt | fromdate)) / 86400 | floor})'

# 4. Competing PRs on this specific issue
gh pr list --repo <owner>/<repo> --search "<issue_number>" --state=all \
  --json number,title,state,author,createdAt

# 5. CLA bot present?
gh pr list --repo <owner>/<repo> --state=closed --limit 3 \
  --json comments --jq '.[].comments | map(select(.author.login | test("cla|cncf|google-cla"; "i")))'

# 6. Issue itself: age, label, last comment
gh issue view <owner>/<repo>#<issue_number> \
  --json createdAt,updatedAt,labels,comments,author,state
```

## Output: short verdict

```
Repo: <owner>/<repo>
Issue: #<num> "<title>" — <age> old, <N> labels

Maintainer activity: <last commit date>, <PRs merged/30d>
Avg PR merge lag: <days> (lower = more responsive)
Competing PRs: <count> open / <count> closed-unmerged
CLA: <yes/no — bot detected | none>

VERDICT: <claim | wait | skip>
WHY: <1-2 sentences>
```

## Quick-skip rules

- No commit in 60+ days → likely abandoned, skip
- 3+ open PRs on this issue → too crowded, skip
- CLA required for trivial work → not worth the friction
- "good first issue" but issue is 6+ months old → skip (probably already solved out-of-tree)
