New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

pr-genius

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pr-genius

PR 评估和建议工具 — 基于历史反模式和成功模式。DSH (Cordis) 插件壳 + Python FastMCP 分析引擎。

Source
npmnpm
Version
2.1.0
Version published
Weekly downloads
155
-69.67%
Maintainers
1
Weekly downloads
 
Created
Source

type: Knowledge Bundle title: PR Genius — Pre-submission PR Advisor description: Evidence-backed PR contribution advisor for large open-source projects version: 1.9.1 created: 2026-07-01 updated: 2026-09-05 author: zsxh1990 conforms_to: OKF v0.1 (Sudhakaran88/okf-conformance) + agent_guidelines extension

mcp-name: io.github.zsxh1990/pr-genius

PR Genius — The advisor that knows which PRs get closed

943 loaded patterns across 67 repos. (Trigger coverage — how often rules fire on real PRs — is measured separately by scripts/measure_pattern_coverage.py, issue #66. There is no "quality pass rate" claim here: it is not measurable for the current set, so it is not asserted.) Clone → paste MCP config → ask "Should I open this PR to encode/httpx?"

CI PyPI Python License Glama score GitHub Marketplace DSH Plugin

🎯 What is PR Genius?

PR Genius is not a PR dashboard. It's an Outbound PR CRM for professional OSS contributors and AI agents:

Manage PRs you've submitted to other repos — when to fix CI, rebase, wait, ping, or abandon.

PR Genius is also a DSH (Cordis) plugin that slots into the DeepSeek Harness chat sidebar, advisor panel, session tab, and /prgenius slash-command. See 🧩 DSH Plugin below.

Capabilitygh CLIPR Genius
Cross-repo PR list✅✅
Status classification❌✅ (9 states)
Stale detection❌✅
Action suggestions❌✅
Common OSS PR policy❌✅
Snapshot & transitions❌✅

Status heartbeat runs daily via cron, auto-detecting:

  • 🔴 NEEDS_REBASE / CI_FAILING — fix immediately
  • 🟡 STALE_REVIEW — ping after threshold
  • 🟡 STALE_NO_REVIEW — consider abandoning
  • 🟢 CLEAN / WAITING — continue waiting

🛡️ Why PR Genius?

PR Genius doesn't write PRs for you. It knows which PRs get closed.

CapabilityLLM directlyScraper AgentPR Genius
Knowledge sourceTraining dataReal-time scrape943 structured patterns
Repo understandingGenericSurface data (stars)17-field agent_guidelines
Failure patternsUnknownUnknown251 anti-patterns
Success patternsUnknownUnknown692 patterns — retrieval/reference only, not wired into scoring (issue #69)
Maintainer preferenceGuessRecent PRsStructured policy files
Merge probabilityCan't estimateCan't estimateBased on repo merge rate + signals

Real cases (PR Genius helped avoid these rejections):

PRRepoWhat happenedPR Genius would have flagged
#491MisakaNet"Destructive README rewrite" — closedbreaking_change_no_compat anti-pattern
#47434huggingface/transformers"We'll handle internally" — closedmaintainer_internal_handling anti-pattern
#10393awesome-mcp-serversMissing Glama badge — auto-flaggedawesome-mcp-servers-glama-badge-required anti-pattern
#282punkpeye/fastmcp+271 lines, first PR — closed without reviewpunkpeye-fastmcp-282-too-large anti-pattern
—contribaiIssue claim without due diligence — auto-closedcontribai-issue-claim-no-due-diligence anti-pattern
#2902soxoj/maigretCI failure (tag dev not recognized) — fixed, mergedmaigret-tag-validation pattern
—Ikalus1988/MisakaNetClaimed issue without due diligence — auto-closedcontribai-issue-claim-no-due-diligence anti-pattern
#928Ikalus1988/MisakaNetVoice hooks PR — scope creep, closedikalus1998-misakanet-928 lesson
#936Ikalus1988/MisakaNetGlobal disable switch — incomplete implikalus1998-misakanet-936 lesson
#938Ikalus1988/MisakaNetAnti-patterns reference doc — premature PRikalus1998-misakanet-938 lesson
#965Ikalus1988/MisakaNetREADME numbers sync — stale dataikalus1998-misakanet-965 lesson
#248punkpeye/awesome-mcp-devtoolsListing PR — still pending, no maintainer responsepunkpeye-awesome-mcp-devtools-248-pending case study

🚀 Quick Start

pip install prgenius-core

# Analyze PR
python3 -m prgenius analyze "feat: add feature" --repo org/repo --body "Fixes #123"

# Coach (pass/fail)
python3 -m prgenius coach "feat: add feature" --repo org/repo

# Triage (policy check)
python3 -m prgenius triage "docs: typo" --repo org/repo --diff-stat "docs/faq.md | 3 ++-"

# Status heartbeat (outbound PR monitoring)
python3 -m prgenius status --author zsxh1990
python3 -m prgenius status --author zsxh1990 --format json --save-snapshot

# Profile writeback suggestions (dry-run)
python3 -m prgenius profile writeback --author zsxh1990

🤖 GitHub Action

Use PR Genius as a GitHub Action in any repo:

# .github/workflows/pr-genius.yml
name: PR Genius Check
on:
  pull_request:
    types: [opened, synchronize]

permissions:
  contents: read
  issues: write   # required when comment_mode != never (post/update PR comment)

jobs:
  pr-genius:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: zsxh1990/pr-genius@v1
        id: pr-genius
        with:
          title: ${{ github.event.pull_request.title }}
          repo: ${{ github.repository }}
          body: ${{ github.event.pull_request.body }}
          pr_number: ${{ github.event.pull_request.number }}
          comment_mode: always   # never | high_risk | always — post full analysis as a PR comment

comment_mode controls whether the full analysis is posted as a visible PR comment (mirrors pr-agent's /review):

  • never — do not post (default when unset and comment_on_high_risk is false)
  • high_risk — post only when the risk tier is high_risk
  • always — post on every run; existing comments are updated in place (no spam)

Legacy: comment_on_high_risk: true is still supported and behaves like comment_mode: high_risk.

Version Auto-Update

  • @v1 — Always points to the latest v1.x.x release (recommended)
  • @v1.9.1 — Pinned to specific version (for reproducibility)
  • @main — Latest development version (not recommended for production)

The v1 tag is automatically updated when a new version is published to PyPI.

Docker Image (Alternative)

Use PR Genius as a Docker container via GitHub Container Registry:

# .github/workflows/pr-genius-docker.yml
name: PR Genius Check (Docker)
on:
  pull_request:
    types: [opened, synchronize]

permissions:
  contents: read
  pull-requests: write

jobs:
  pr-genius:
    runs-on: ubuntu-latest
    steps:
      - name: Run PR Genius
        uses: docker://ghcr.io/zsxh1990/pr-genius:latest
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          args: coach "${{ github.event.pull_request.title }}" --repo ${{ github.repository }} --format json

Docker Image Tags:

  • ghcr.io/zsxh1990/pr-genius:latest — Latest release
  • ghcr.io/zsxh1990/pr-genius:1.9.1 — Specific version
  • ghcr.io/zsxh1990/pr-genius:1.9 — Minor version
  • ghcr.io/zsxh1990/pr-genius:1 — Major version (auto-updated)

Auto-update with Dependabot:

# .github/dependabot.yml
version: 2
updates:
  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      interval: "weekly"
  - package-ecosystem: "docker"
    directory: "/"
    schedule:
      interval: "weekly"

🤖 MCP Configuration

{
  "mcpServers": {
    "pr-genius": {
      "command": "python",
      "args": ["-m", "prgenius", "mcp", "serve"]
    }
  }
}

Docker: docker run --rm -i ghcr.io/zsxh1990/pr-genius:1.9.1

14 MCP Tools

ToolPurposeRequired Args
analyze_prMerge probability + optimization path + 3-tier risktitle, repo
coach_prGo/no-go decision (pass/fail)title, repo
triage_prMaintainer policy check (9 rules)title, repo
get_repo_profileRepo profile (17 fields)repo
list_open_prsLocal open case-study records (not live GitHub PRs; live ones → status_prs); optional repo/author filters(none)
get_case_studyPR case study detailscase_id
search_patternsAnti-pattern/success-pattern searchquery
schema_infoOKF schema versions(none)
status_prsOutbound PR status heartbeatauthor
profile_writeback_suggestionsProfile update suggestions (dry-run)author
maintainer_viewMaintainer-side PR view (5 actions: READY_FOR_REVIEW, WAIT_FOR_AUTHOR, CLOSE_DUPLICATE, CLOSE_STALE_OR_RISKY, HOLD_MAINTAINER_DECISION)repo
contributor_viewContributor readiness decision (5 actions: READY_TO_SUBMIT, FIX_BEFORE_SUBMIT, NEEDS_DISCUSSION, IMPROVE_CHANCE, ASK_MAINTAINER)repo
review_queuePrioritized review queuerepo
prgenius_doctorInstall/data/MCP self-test — run this when analyze returns nothing(none)

Tool Parameter Notes

  • title (required for analyze_pr, coach_pr, triage_pr): The PR title, e.g. "fix: timeout in connection pool"
  • repo (required for most tools): Repository in owner/name format, e.g. "encode/httpx"
  • pr_description (optional): Additional PR body text for deeper analysis
  • query (required for search_patterns): Search keywords, e.g. "connection timeout"
  • diff_stat (optional for analyze_pr, coach_pr): git diff --stat output — populates the impact/review fields (both are null without it) and is the authoritative PR-size signal
  • star_count ≥ 0, repo_merge_rate in [0.0, 1.0], author_association in NONE/CONTRIBUTOR/COLLABORATOR/MEMBER/OWNER, mergeable in MERGEABLE/CONFLICTING/UNKNOWN — invalid values are rejected instead of silently producing meaningless output

🧩 DSH Plugin

PR Genius ships as a DSH (Cordis) plugin (v2.0.0+). The TypeScript layer is a thin shell — analysis is delegated to the existing Python MCP engine; the plugin adds four UI surfaces on top.

Install

dsh plugin add pr-genius

Or apply the one-line patch in cordis.patch.yml. Full guide: docs/dsh-integration.md.

Four surfaces

SurfaceSlotWhat it does
Dashboard (sidebar)ui-sidebarPR Intelligence Dashboard — cross-repo status at a glance
Advisor tabconversation.viewSession-level advisor for the current conversation
Advisor panelui-sidebar (panel mode)Same advisor as a right-hand panel
/prgeniusctx.commandSlash-command for inline PR checks

Maintainer mode is the same four surfaces on a different projection (5-action decision: READY_FOR_REVIEW, WAIT_FOR_AUTHOR, CLOSE_DUPLICATE, CLOSE_STALE_OR_RISKY, HOLD_MAINTAINER_DECISION).

Configuration

All tunables are Schemastery-validated and settable from cordis.yml — no code changes needed. Invalid values fail at load time naming the field. See src/config.ts for the full schema (12 fields: MCP transport/endpoint/timeout, sidebar default view, maintainer confidence threshold, stale-days, locale, risk filter, etc.).

Relationship to v1.x

The DSH plugin wraps the same Python analysis engine (prgenius/src/prgenius/mcp.py). v1.x CLI and MCP server continue to work unchanged. The plugin adds UI surfaces and config management; it does not fork the analysis logic.

Honesty note: The DSH plugin has been verified for TypeScript compilation, unit tests, and static contract conformance (scripts/check_dsh_plugin_contract.py, 27/27 checks). It has not been run against a live DSH runtime — rendering and runtime behavior require DSH verification. See docs/compatibility.md for the version matrix (every cell marked unrun) and docs/maturity-self-assessment.md for the completeness scorecard.

📊 Data Scale

Numbers below are measured from the repo at the current commit. Run python3 -c "from prgenius.parser import iter_profiles, iter_case_studies; from prgenius.evaluator import load_anti_patterns, load_success_patterns; print(len(list(iter_profiles('.'))), len(list(iter_case_studies('.'))), len(load_anti_patterns('.')), len(load_success_patterns('.')))" to verify.

DimensionCount
Repo profiles67
Case studies53
Success patterns692 (436 .md + 256 .json)
Anti-patterns251 (61 .md + 190 .json)
Total patterns943 (all loaded)
Covered repos67 (uv, react, kubernetes, transformers, httpx, etc.)

🤖 Robots / Agents

📖 Contributing

See CONTRIBUTING.md. AI-assisted PRs welcome.

🤝 Community

中文文档

中文版 README:README.zh-CN.md

Citation

@misc{pr-genius-2026,
  title  = {PR Genius — Evidence-backed PR Contribution Advisor},
  author = {zsxh1990},
  year   = {2026},
  url    = {https://github.com/zsxh1990/pr-genius}
}

Keywords

dsh-plugin

FAQs

Package last updated on 03 Oct 2026

Related posts