analyze_pr
Assess a pull request's risk before submitting to an open-source repo by analyzing repo profile, anti-patterns, and success patterns; returns risk tier, signals, checklist, and recommended action.
Instructions
Detailed PR analysis with signals and checklist. Use analyze_pr for deep analysis, coach_pr for quick pass/fail.
Returns: tier (low_risk/medium_risk/high_risk), signals (positive/negative/neutral), checklist (P0/P1/P2 items), and recommended_action.
Use this before submitting a PR to a large open-source repo to check if your contribution strategy is sound. Combines repo profile data, anti-pattern matching, and success pattern analysis.
Args: title: PR title (e.g. "feat: add new search endpoint") repo: Target repo in org/name format (e.g. "encode/httpx") body: PR body/description text description: Extended description (optional) author: PR author username author_association: Author's association with repo (NONE/CONTRIBUTOR/COLLABORATOR/MEMBER/OWNER) labels: PR labels (e.g. ["bug", "documentation"]) star_count: Repository star count (>= 0; 0 = unknown) repo_merge_rate: Repository's external PR merge rate 0.0-1.0 (0 = unknown) mergeable: Mergeable state (MERGEABLE/CONFLICTING/UNKNOWN) diff_stat: git diff --stat output — populates impact/review and is the authoritative PR-size signal (null when omitted)
Returns: dict with keys: tier, signals, checklist, recommended_action, repo, title, impact, review (impact/review null without diff_stat)
Example: analyze_pr("fix: timeout in connection pool", "encode/httpx", "Fixes #123") → {"tier": "medium_risk", "signals": {...}, "checklist": [...], "recommended_action": "..."}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | ||
| repo | Yes | ||
| title | Yes | ||
| author | No | ||
| labels | No | ||
| diff_stat | No | ||
| mergeable | No | MERGEABLE | |
| star_count | No | ||
| description | No | ||
| repo_merge_rate | No | ||
| author_association | No | NONE |