How hhari1234/ai-code-reviewer works
PR-Agent accepts pull-request commands, gathers repository and diff context, invokes an AI provider, and publishes review output through a Git hosting provider. The README highlights review, describe, improve, and ask; the tree also contains handlers and tools for labels, questions, documentation, changelogs, and compliance. The graph focuses on runtime components and major documented capabilities. Several tool and server links are based on the SOURCE INDEX or README rather than complete source excerpts, so uncertain wiring is omitted.
Main entry points: pr_agent.py Command router · pr_code_suggestions.py Code suggestions · pr_reviewer.py PR review · github_provider.py GitHub provider
Components 24
Request handling
- Command router
pr_agent/agent/pr_agent.py - CLI entry
pr_agent/cli.py - Configuration
pr_agent/config_loader.py
PR capabilities
- PR review
pr_agent/tools/pr_reviewer.py - PR description
pr_agent/tools/pr_description.py - Code suggestions
pr_agent/tools/pr_code_suggestions.py - PR questions
pr_agent/tools/pr_questions.py - Other PR tools
pr_agent/tools
Review analysis
- PR processing
pr_agent/algo/pr_processing.py - Repository context
pr_agent/algo/repo_context.py - Diff processing
pr_agent/algo/git_patch_processing.py - Comment deduplication
pr_agent/algo/inline_comment_dedup.py - Skills loading
pr_agent/algo/skills_loader.py - Token handling
pr_agent/algo/token_handler.py
Providers and servers
- AI handler interface
pr_agent/algo/ai_handlers/base_ai_handler.py - LiteLLM handler
pr_agent/algo/ai_handlers/litellm_ai_handler.py - GitHub provider
pr_agent/git_providers/github_provider.py - Provider interface
pr_agent/git_providers/git_provider.py - Other providers
pr_agent/git_providers - Webhook servers
pr_agent/servers - MOSAICO A2A
pr_agent/mosaico/server.py
Other components
- Developer
- LLM service
- Git hosting
Connections 30
- Developer → CLI entry: submits command
README.md - CLI entry → Command router: routes request
- Command router → PR review: dispatches
pr_agent/agent/pr_agent.py - Command router → PR description: dispatches
pr_agent/agent/pr_agent.py - Command router → Code suggestions: dispatches
pr_agent/agent/pr_agent.py - Command router → PR questions: dispatches
pr_agent/agent/pr_agent.py - Command router → Other PR tools: dispatches
pr_agent/agent/pr_agent.py - PR review → PR processing: uses
pr_agent/tools/pr_reviewer.py - PR review → Repository context: uses
pr_agent/tools/pr_reviewer.py - PR review → Skills loading: uses
pr_agent/tools/pr_reviewer.py - PR review → Token handling: uses
pr_agent/tools/pr_reviewer.py - PR review → LiteLLM handler: requests inference
pr_agent/tools/pr_reviewer.py - PR review → GitHub provider: publishes review
- Code suggestions → Diff processing: uses
pr_agent/tools/pr_code_suggestions.py - Code suggestions → PR processing: uses
pr_agent/tools/pr_code_suggestions.py - Code suggestions → Repository context: uses
pr_agent/tools/pr_code_suggestions.py - Code suggestions → Skills loading: uses
pr_agent/tools/pr_code_suggestions.py - Code suggestions → Token handling: uses
pr_agent/tools/pr_code_suggestions.py - Code suggestions → LiteLLM handler: requests inference
pr_agent/tools/pr_code_suggestions.py - Code suggestions → GitHub provider: publishes suggestions
- LiteLLM handler → AI handler interface: implements
pr_agent/algo/ai_handlers/litellm_ai_handler.py - LiteLLM handler → LLM service: requests completion
README.md - GitHub provider → Git hosting: reads and publishes
README.md - GitHub provider → Diff processing: uses
pr_agent/git_providers/github_provider.py - GitHub provider → Comment deduplication: uses
pr_agent/git_providers/github_provider.py - GitHub provider → Provider interface: implements
pr_agent/git_providers/github_provider.py - Other providers → Git hosting: integrates
- Webhook servers → Command router: forwards requests
pr_agent/servers/gitlab_webhook.py - MOSAICO A2A → Command router: dispatches requests
- Command router → Configuration: loads settings
pr_agent/agent/pr_agent.py