espennilsen/pi / skills/pr-monitor
pr-monitor
VerifiedMonitor open GitHub PRs across all repos in ~/Dev. Checks PR age, flags stale PRs, and optionally alerts via Aivena/Telegram. Uses `gh pr list` for accurate GitHub data. **TRIGGERS - Use this skill when:** - User asks about open PRs, pull requests, or PR status - User says "check PRs", "any stale PRs?", "PR review status" - Cron job `pr-monitor` fires - User asks "what needs review?" or "what's waiting for merge?" - User wants a PR dashboard or PR age report
PR Monitor Skill
Scan all GitHub-hosted repos in ~/Dev for open pull requests. Flag stale PRs and report status.
Procedure
Step 1: Scan all repos for open PRs
Run this exact command to collect all open PRs:
for dir in ~/Dev/*/; do
if [ -d "$dir/.git" ]; then
remote=$(git -C "$dir" remote get-url origin 2>/dev/null)
if echo "$remote" | grep -q github.com; then
repo=$(echo "$remote" | sed 's/.*github.com[:/]\(.*\)\.git/\1/' | sed 's/.*github.com[:/]\(.*\)/\1/')
prs=$(timeout 30s gh pr list --repo "$repo" --state open --json number,title,createdAt,headRefName,author,isDraft,reviewDecision)
pr_count=$(echo "${prs:-[]}" | jq 'length' 2>/dev/null)
if [ "${pr_count:-0}" -gt 0 ]; then
echo "=== $(basename "$dir") ($repo) ==="
echo "$prs" | jq -r '.[] | " #\(.number) [\(.headRefName)] \(.title) (by \(.author.login), created \(.createdAt[:10]), draft: \(.isDraft), review: \(.reviewDecision // "none"))"'
echo ""
fi
fi
fi
done
Step 2: Calculate PR age
For each PR, calculate age from createdAt to today. Classify as:
- π’ Fresh β 0β1 days old
- π‘ Aging β 2β3 days old
- π΄ Stale β 4+ days old
Step 3: Format the report
Output a table with columns:
| Repo | PR | Branch | Title | Author | Age | Status | Review |
|---|
Group by repo. Show age badge (π’/π‘/π΄). Include draft status and review decision.
Step 4: Summary
End with:
- Total open PRs across all repos
- Stale count (4+ days) β these need attention
- Aging count (2β3 days) β these are approaching stale
- Action items β specific PRs that need review or merge
Step 5: Deduplication check (before alerting)
Before sending any Telegram alert, check today's daily memory log for PRs already covered. Optionally, write a lightweight per-PR "alert sent" timestamp (e.g., pr-monitor: [repo] #[number] β <date>) to memory so overlapping executions don't duplicate alerts.
memory_read(target: "daily")
Scan the result for PR references matching [repo] #[number]. Any stale PR already mentioned in today's standup or a prior pr-monitor alert today should be excluded from the new alert.
- If all stale PRs were already reported today β skip the alert entirely (no noise)
- If some are new β send alert only for the new ones
- If none were previously reported β send the full alert
Step 6: Alert (only for net-new stale PRs)
If net-new stale PRs remain after dedup, send an alert to Aivena via a2a_send:
Hey Aivena β PR staleness alert for Espen. Please relay to Telegram.
β οΈ [N] stale PR(s) found (4+ days old, not yet reported today):
- [repo] #[number]: [title] ([age] days)
...
These need review or merge.
β Fury
If no stale PRs exist, or all were already covered today, do nothing (no noise).
Notes
- Requires
ghCLI authenticated (gh auth status) - Requires
jqfor JSON parsing - Only scans repos with GitHub remotes
- Draft PRs are included but noted β they're expected to age longer
- The
reviewDecisionfield shows: APPROVED, CHANGES_REQUESTED, REVIEW_REQUIRED, or none
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why β repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" β or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself β your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |