Sign inSign up

junit/pr-agent-pua

By junit

โ€ขUpdated 7 months ago

Behavioral protocol-enhanced PR-Agent images

Image
Developer tools
0

347

junit/pr-agent-pua repository overview

GitHub โ 

โ ๐Ÿš€ PR-Agent - Behavioral Protocol Enhanced Code Review

๐Ÿด PR-Agent fork with PUA behavioral enhancements, published from junit/pr-agent-puaโ 


โ โš ๏ธ Fork Notice

This repository keeps the PR-Agent product identity while publishing the fork from junit/pr-agent-pua, with behavior protocol enhancements that are not fully compatible with upstream pr-agent.

โ ๐Ÿ’ก Origins & Design Philosophy

โ Inspiration

This project's behavioral enhancement system is inspired by tanweai/puaโ , an innovative approach to AI agent behavioral protocols. Thank you to the original author for pioneering this direction.

This fork is built upon the excellent foundation of qodo-ai/pr-agentโ . We extend our gratitude to the QodoAI team (formerly CodiumAI) for creating such a powerful open-source code review platform.

โ Design Decision: From Interactive to Protocol-Based

Initial Vision: We originally considered a full port of the interactive PUA system, where agents would engage in iterative dialogue during code review.

Pivot: After deep analysis, we realized interactive PR review is not a good fit for automated workflows:

  • โŒ Multi-turn interactions break CI/CD pipelines
  • โŒ Unpredictable review timing frustrates developers
  • โŒ Difficult to integrate with existing GitOps practices
  • โŒ Hard to maintain consistency across reviews

Final Approach: We extracted the core behavioral protocols and adapted them for non-interactive, single-pass code review:

  • โœ… Culture-specific review methodologies (13 corporate flavors)
  • โœ… Behavioral compliance protocols (ไธ‰ๆก็บข็บฟ: ้—ญ็Žฏ, ไบ‹ๅฎž้ฉฑๅŠจ, ็ฉทๅฐฝๅˆ†ๆž)
  • โœ… Quality gates with automatic retry mechanisms
  • โœ… Auto flavor routing by command type
  • โœ… Multi-language support (Chinese/English with locale detection)

This protocol-based approach delivers the behavioral enhancement benefits while maintaining compatibility with standard PR workflowsโ€”because trust should be simple, but verification should be rigorous.

โ What's New

PUA (Protocol-based Unified Agent) adds:

  • ๐Ÿข 13 corporate culture flavors (Alibaba, Huawei, Musk, Amazon, Jobs, ByteDance, etc.)
  • ๐Ÿ”„ Auto flavor routing โ€” intelligently selects the best methodology for each command
  • ๐Ÿ”’ Behavioral compliance protocols (ไธ‰ๆก็บข็บฟ: ้—ญ็Žฏๆ„่ฏ†, ไบ‹ๅฎž้ฉฑๅŠจ, ็ฉทๅฐฝๅˆ†ๆž)
  • โœ… Quality gates with automatic retry โ€” ensures reviews meet behavioral standards
  • ๐ŸŒ Multi-language support โ€” Chinese/English with automatic locale detection

PUA configuration highlights:

  • pua.locale and pua.command_locales.* support global and per-command locale routing

  • pua.command_extra_instructions.* appends command-specific behavioral constraints

  • pua.flavor_overrides.<flavor>.* overrides rhetoric keywords without changing routing

  • Dynaconf environment variables must use double underscores, such as PUA__ENABLED=true

  • Original Project: qodo-ai/pr-agentโ 

  • Fork Repository: junit/pr-agent-puaโ 

  • License: AGPL-3.0 (same as upstream)

  • Compatibility: Core PR-Agent workflow is preserved, but fork-specific behavior is not a drop-in replacement

See FORK_CHANGES.mdโ  for detailed modifications.


โ What is PR-Agent?

PR-Agent is a behavioral protocol-enhanced code review system in this repository. It is built on top of qodo-ai/pr-agentโ , published from junit/pr-agent-puaโ , and adds culture-specific methodologies and quality gates that enforce rigorous review standardsโ€”because trust should be simple, but verification should be rigorous.

โ ๐ŸŽฏ Core Differentiators

Culture-Specific Intelligence โ€” Choose from 13 corporate culture flavors (Alibaba, Huawei, Musk, Jobs, Amazon, ByteDance, Tencent, Baidu, Pinduoduo, Meituan, JD, Xiaomi, Netflix) or enable auto-routing to let the system intelligently select the best methodology for each command.

Three Red Lines Quality Gates โ€” Every review is automatically checked against three non-negotiable standards:

  • ้—ญ็Žฏๆ„่ฏ† (Closure): Issues include actionable solutions, not just problem statements
  • ไบ‹ๅฎž้ฉฑๅŠจ (Fact-Driven): All judgments reference specific files, line numbers, and code
  • ็ฉทๅฐฝๅˆ†ๆž (Exhaustive): When finding a pattern, the system checks if it exists elsewhere

Automatic Retry Mechanism โ€” When quality gates fail, the system automatically regenerates the review with focused prompts, ensuring consistent behavioral standards without manual intervention.

Multi-Language Support โ€” Full Chinese/English support with automatic locale detection and per-command language overrides.

โ ๐Ÿข Who Uses This?
  • Teams practicing specific engineering cultures โ€” Embed your companyโ€™s review philosophy into CI/CD
  • Open-source maintainers โ€” Ensure contributions meet rigorous standards across language barriers
  • Engineering organizations โ€” Standardize review quality while respecting cultural diversity
  • DevOps teams โ€” Automate behavioral compliance without breaking pipelines

โ Table of Contents

โ Getting Started

โ ๐Ÿš€ Quick Start for PR-Agent
โ 1. Try it Instantly (No Setup)

You can quickly experience the public PR-Agent bot on any public GitHub repository by commenting @CodiumAI-Agent /improve. For this fork's behavior and deployment options, use the workflows and images published from junit/pr-agent-pua.

Add automated PR reviews to your repository with a simple workflow file:

# .github/workflows/pr-agent.yml
name: PR Agent
on:
  pull_request:
    types: [opened, synchronize]
jobs:
  pr_agent_job:
    runs-on: ubuntu-latest
    steps:
    - name: PR Agent action step
      uses: junit/pr-agent-pua@main
      env:
        OPENAI_KEY: ${{ secrets.OPENAI_KEY }}
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Full GitHub Action setup guideโ 

โ 3. CLI Usage (Local Development)

Run PR-Agent locally on your repository:

pip install pr-agent
export OPENAI_KEY=your_key_here
pr-agent --pr_url https://github.com/owner/repo/pull/123 review

Complete CLI setup guideโ 

โ 4. Other Platforms

โ Why Use PR-Agent?

โ ๐ŸŽฏ Built for Real Development Teams

Fast & Affordable: Each tool (/review, /improve, /ask) uses a single LLM call (~30 seconds, low cost)

Handles Any PR Size: Our PR Compression strategyโ  effectively processes both small and large PRs

Highly Customizable: JSON-based prompting allows easy customization of review categories and behavior via configuration filesโ 

Platform Agnostic:

  • Git Providers: GitHub, GitLab, BitBucket, Azure DevOps, Gitea
  • Deployment: CLI, GitHub Actions, Docker, self-hosted, webhooks
  • AI Models: OpenAI GPT, Claude, Deepseek, and more

Open Source Benefits:

  • Full control over your data and infrastructure
  • Customize prompts and behavior for your team's needs
  • No vendor lock-in
  • Community-driven development

โ Features

PR-Agent offers comprehensive pull request functionalities integrated with various git providers:

GitHubGitLabBitbucketAzure DevOpsGitea
TOOLSโ Describeโ โœ…โœ…โœ…โœ…โœ…
Reviewโ โœ…โœ…โœ…โœ…โœ…
Improveโ โœ…โœ…โœ…โœ…โœ…
Askโ โœ…โœ…โœ…โœ…
โฎ‘ Ask on code linesโ โœ…โœ…
Help Docsโ โœ…โœ…โœ…
Update CHANGELOGโ โœ…โœ…โœ…โœ…
USAGEโ CLIโ โœ…โœ…โœ…โœ…โœ…
App / webhookโ โœ…โœ…โœ…โœ…โœ…
Tagging botโ โœ…
Actionsโ โœ…โœ…โœ…โœ…
COREโ Adaptive and token-aware file patch fittingโ โœ…โœ…โœ…โœ…
Chat on code suggestionsโ โœ…โœ…
Dynamic contextโ โœ…โœ…โœ…โœ…
Fetching ticket contextโ โœ…โœ…โœ…
Incremental Updateโ โœ…
Interactivityโ โœ…โœ…
Local and global metadataโ โœ…โœ…โœ…โœ…
Multiple models supportโ โœ…โœ…โœ…โœ…
PR compressionโ โœ…โœ…โœ…โœ…
RAG context enrichmentโ โœ…โœ…
Self reflectionโ โœ…โœ…โœ…โœ…

โ See It in Action

โ /describeโ 


โ /reviewโ 


โ /improveโ 


โ Try It Now

For a quick public demo, you can mention @CodiumAI-Agent on your public GitHub repository and add the desired command in a PR comment. For this repository's forked deployment, use the Action, Docker image, or self-hosted setup published from junit/pr-agent-pua. For example, add a comment to any pull request with the following text:

@CodiumAI-Agent /review

and the agent will respond with a review of your PR.

Note that this public bot is suitable only for initial experimentation. It does not have 'edit' access to your repo, for example, so it cannot update the PR description or add labels (@CodiumAI-Agent /describe will publish PR description as a comment). In addition, the bot cannot be used on private repositories, as it does not have access to the files there.

โ How It Works

The following diagram illustrates PR-Agent tools and their flow:

PR-Agent Tools

โ Data Privacy

โ Self-hosted PR-Agent

โ Contributing

To contribute to the project, get started by reading our Contributing Guideโ .

โ โค๏ธ Community

This open-source release remains here as a community contribution from Qodo โ€” the origin of modern AI-powered code collaboration. Weโ€™re proud to share it and inspire developers worldwide.

The project now has its first external maintainer, Naor (@naorpeledโ ), and is currently in the process of being donated to an open-source foundation.

Tag summary

Content type

Image

Digest

sha256:6ca1267edโ€ฆ

Size

216.6 MB

Last updated

7 months ago

docker pull junit/pr-agent-pua:sha-361df50d80db