SuperAPIAI Directory

pr-genius

github.com · AI developer platforms

Pull request contribution advisor based on case studies from real repos: merge probability analysis, pattern matching and contribution strategy.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsLinux

About this tool

PR Genius is a pull request contribution advisor based on real repository case studies, positioned as an "external PR CRM" for professional open source contributors and AI agents—that is, managing the PRs you submit to other repositories, rather than being a PR dashboard. Its core proposition is: it does not write PRs for you, but knows which PRs will be closed, thereby helping to avoid rejection.

[Purpose and Positioning] The project is used to assess the probability of a PR being merged and its potential risks before submission, and to track its status after submission: including whether to fix CI, whether to rebase, whether to keep waiting, whether to ping the maintainer, or whether to give up. The repository contains 943 patterns loaded from 67 repositories. The repository description explicitly states that trigger coverage (how often rules trigger on real PRs) is measured separately by scripts/measure_pattern_coverage.py (see issue #66), and does not claim the existence of a "quality pass rate" metric, because the current set is not measurable, so no assertion is made.

[Main Capabilities]

  1. Merge probability analysis and pattern matching: provides analysis based on a real case library to help determine the direction of a PR.
  2. Status heartbeat: runs daily via cron to automatically detect statuses such as NEEDS_REBASE / CI_FAILING (needs immediate fixing), STALE_REVIEW (ping after exceeding the threshold), STALE_NO_REVIEW (consider giving up), CLEAN / WAITING (keep waiting).
  3. contributor_view (contributor view): answers "should I submit this PR now, and what are the blockers?" It is a pre-submission gate that can be run before opening a PR and run again after modifications.
  4. maintainer_view (maintainer view): answers "how should the maintainer handle this PR?" It uses 5 action decisions: READY_FOR_REVIEW, WAIT_FOR_AUTHOR, CLOSE_DUPLICATE, CLOSE_STALE_OR_RISKY, HOLD_MAINTAINER_DECISION.
  5. Knowledge base and repository profiles: repository profiles can be obtained by repository (python3 -m prgenius profile get owner/name), and rules vary by project.

[Usage] Command line: after installation, the console script is prgenius-core, and python3 -m prgenius is equivalent. Every command accepts the global parameter --repo-root pointing to the knowledge base checkout directory. Running doctor for the first time is important; it will tell you whether the knowledge base package was found and which optional parts are missing; after a bare pip install, showing overall: NOT OK is expected, because that wheel contains only code and is not a broken installation, and the warning will indicate what to do. issue and issue-batch are new in v1.6.3. MCP configuration: supports building a stdio MCP server via Docker (docker build -t pr-genius . && docker run --rm -i pr-genius); this image is a stdio server, not an HTTP service; the ghcr.io/zsxh1990/pr-genius image is built by Dockerfile.github_action, is used for GitHub Action, and is not used for MCP stdio. Among MCP tool parameters, title is required for analyze_pr, coach_pr, and triage_pr; repo is required for most tools, in the format owner/name; pr_description is optional; query is required for search_patterns; diff_stat is optional and is the output of git diff --stat, an authoritative signal of PR size; when missing, the impact / review fields are null. star_count ≥ 0, repo_merge_rate is in [0.0, 1.0], author_association takes values NONE/CONTRIBUTOR/COLLABORATOR/MEMBER/OWNER, mergeable takes values MERGEABLE/CONFLICTING/UNKNOWN; invalid values are rejected rather than silently producing meaningless results. GitHub Action: can be used in any repository. comment_mode controls whether to publish the full analysis as a visible PR comment (similar to pr-agent's /review): never (defrecognized), high_risk (only publish on high risk), always (publish on every run; existing comments are updated in place, so it won't spam). The legacy comment_on_high_risk: true is still supported and behaves the same as comment_mode: high_risk. For tags, it is recommended to use @v2.1.4 to pin the release tag for reproducibility; @main is the latest development version and is not recommended for production use. There is no floating major-version tag tracking 2.x; the only floating major-version tag, v1, is frozen at v1.8.0, and there is no v2 tag, so the full vX.Y.Z tag should be pinned. Docker image tags are generated by publish-ghcr.yml from each vX.Y.Z git tag as {version} / {major}.{minor} / {major}, for example latest, 2.1.4, 2.1, 2. Dependabot can be used for automatic updates. DSH (Cordis) plugin: available in v2.0.0+, and can be embedded in DeepSeek Harness's chat sidebar, advisor panel, session tab, preferences section, and the /prgenius slash command. The TypeScript layer is only a thin shell; analysis is delegated to the existing Python MCP engine; the plugin adds five UI surfaces on top of it. Maintainer mode is the same five surfaces running under a different projection. All tunables are validated by Schemastery and can be set in cordis.yml without changing code; invalid values fail at load time and indicate the field; the full schema is in src/config.ts (14 leaf fields, covering kbRoot, MCP transport/command/args/URL/timeout/protocol version, sidebar default view, maintainer toggle/action/confidence floor/stall days, language, risk filtering). Relationship between the plugin and v1.x: it wraps the same Python analysis engine (prgenius/src/prgenius/mcp.py); the v1.x CLI and MCP server continue to work unchanged; the plugin only adds UI and configuration management and does not fork the analysis logic. [Contributor key points] Practical points from FIX_BEFORE_SUBMIT to READY_TO_SUBMIT: link the issue (write Fixes #N / Closes #N in the body; this is the most common reason a first PR is rejected); keep it small (size comes from --diff-stat; if not passed, impact/review are null, so it should be passed); tests should fail without your changes (tests that pass on both sides are just decoration); match the target repository's own conventions rather than global conventions; read that repository's profile first, because rules vary by project, which is exactly the point of the knowledge base. Repository numbers can be verified under the current commit with 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('.')))". [Applicable scenarios and limitations] Suitable for professional open-source contributors, AI agents, and scenarios that need to review PRs from a maintainer's perspective; can be integrated into CI (GitHub Action), containerized deployment (GHCR Docker image), or chat environments (DSH plugin). Limitations and honest disclosure: the repository clearly states that the DSH plugin has passed TypeScript compilation, unit tests, and static contract consistency verification (scripts/check_dsh_plugin_contract.py, 27/27 checks), and has been run in a real DSH runtime (issues #100, #101, #103 were discovered this way); however, the current code is still unverified — fixes released in 2.1.5 and later have not yet been re-verified in the host environment, and the rendering and runtime behavior of this version require that recheck. See docs/compatibility.md for the version matrix (every cell is marked as not run), and docs/maturity-self-assessment.md for the completeness scorecard. Related documentation also includes docs/index.md (file map), AGENT_GUIDELINES_SCHEMA.md, ROUNDS_SCHEMA.md, BLACKLIST.md (repositories not to be tracked), CONTRIBUTING.md (AI-assisted PRs welcome), code of conduct and security policy, and provides a Chinese version of the README (README.zh-CN.md). [Not yet provided] The repository materials do not provide specific charging methods, prices, platform support details, or quantified performance data.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools