Why Reviewing PRs is Still A Cumbersome Task
Artificial Intelligence has quickly become an integral part of a software engineer's toolkit.
We ask ChatGPT to explain unfamiliar code, use GitHub Copilot to autocomplete functions, and occasionally paste a pull request into an LLM for feedback. These tools undoubtedly improve productivity, but they still depend heavily on one thing: us.
- We gather the pull request.
- We search for the Jira story.
- We copy the acceptance criteria.
- We summarize the business requirements.
- We explain the repository structure.
- Only then do we ask the AI to help.
That isn't automation. It's simply moving manual work into a chat window.
Over the past few months, I've become increasingly interested in a different approach—building AI agents that can understand engineering workflows, gather their own context, interact with developer tools, and complete meaningful tasks with minimal human intervention.
This article marks the beginning of a new series called Agentic Engineering, where I'll share practical implementations of AI-powered workflows that automate repetitive engineering tasks across the software development lifecycle.
The Problem
Let's look at a typical pull request review. A reviewer usually needs to:
- Open the Pull Request
- Read the code changes
- Find the corresponding Jira story
- Understand the business requirements
- Read the acceptance criteria
- Compare implementation against requirements
- Check coding standards
- Leave review comments
Depending on the complexity of the change, simply gathering context can consume 15–30 minutes before any real technical review even begins. As repositories grow larger and development teams become more distributed, this overhead becomes increasingly expensive.
What If the Agent Did the Context Gathering?
Instead of asking an AI:
Review this pull request.
I wanted to build an agent that already knows:
- Which repository to inspect
- Which Pull Request to analyze
- Which Jira story is associated with the PR
- What are the acceptance criteria
- What files changed
- How to generate a structured review
The objective isn't to replace software engineers. It's to eliminate repetitive work so reviewers can focus on architecture, business logic, security, and edge cases.
Building My First AI Productivity Agent
To explore this idea, I built a simple command-line agent that orchestrates multiple developer tools into a single workflow.
The implementation currently uses:
- GitHub CLI (
gh) - GitHub Copilot CLI
- Jira REST API
Rather than treating these as independent tools, the agent combines them into a single engineering workflow.
Getting Started
Prerequisites
The agent is intentionally lightweight and relies on existing developer tooling rather than custom integrations.
Python
Python 3.11+ is recommended.
python --version
Python 3.13.3
Python Packages
Install the required dependencies:
python-dotenv jira urllib3
GitHub Copilot CLI
Run:
gh copilot -p "what is 2+2"
4
GitHub CLI
Install GitHub CLI from:
gh --version
gh version 2.95.0 (2026-06-17)
https://github.com/cli/cli/releases/tag/v2.95.0
Authenticate with GitHub
Log in using gh. This step will be one-time only.
gh auth login
gh auth status
github.com
✓ Logged in to github.com account johndoe
✓ Git operations for github.com configured to use https
✓ Token: ****************
✓ Token scopes:
- repo
- read:org
- gist
Architecture And Design
Leveraging GitHub CLI
One design decision I made was to avoid writing custom GitHub API wrappers wherever possible. Instead, the agent delegates repository operations to GitHub CLI.
Search Pull Requests
gh search prs
Used by:
get_prs()
Retrieve Pull Request Diff
gh pr diff
Used by:
get_diff()
GitHub CLI handles authentication, repository context, pagination, and formatting, allowing the Python code to remain focused on orchestration rather than API plumbing.
High-Level Architecture
Developer
|
v
Agent Orchestrator
+------------+-------------+
| | |
v v v
GitHub CLI Jira API Copilot CLI
|
v
Context Builder
|
v
Review Decision Engine
|
v
Structured Report
The agent collects information from GitHub and Jira, builds the necessary context, and asks Copilot CLI to perform a structured review. Instead of manually assembling prompts, the engineer simply invokes the workflow.
Code Design Overview
run()
│
├── Wrapper around subprocess.run()
get_prs()
│
└── Executes:
gh search prs
get_diff()
│
└── Retrieves PR diff
write_temp_diff()
│
└── Creates a temporary .diff file
review_with_copilot()
│
└── Invokes GitHub Copilot CLI
get_jira_client()
│
└── Creates an authenticated Jira client
post_jira_comment()
│
└── Posts review back to Jira
write_report()
│
└── Generates Markdown report
review_pr()
│
└── Main orchestration method
Agent Workflows And Expected Output
The current version exposes three workflows.
List Pull Requests
agent --list
Displays pull requests that are available for review.
Review All Pull Requests
agent --review-all
Reviews every eligible pull request automatically.
This is useful before a release or during periods when multiple PRs are waiting for review.
Review a Single Pull Request
agent review-pr \
--repo engineering-service \
--pr 248 \
--jira ENG-542
The agent:
- Retrieves PR details from GitHub
- Retrieves the Jira story
- Reads acceptance criteria
- Collects changed files
- Sends the complete context to Copilot CLI
- Produces a structured review
The engineer no longer needs to gather all of this information manually.
PR Review Report
The generated review follows a consistent structure.
Summary
High Severity Findings
Medium Severity Findings
Low Severity Findings
Testing Gaps
Suggestions
This predictable format makes reviews easier to consume and simplifies future automation.
Why These Technologies
Why GitHub CLI?
GitHub CLI already solves authentication and repository access elegantly. Instead of writing custom integrations for every GitHub API endpoint, I can retrieve:
- Pull Request metadata
- Changed files
- Commit history
- Repository information
with simple CLI commands.
This keeps the implementation lightweight while still providing everything the agent needs. Moreover, no more token handling.
Why Jira?
Git tells us what changed.
Jira tells us why it changed.
Without the Jira story, an AI review can evaluate syntax, formatting, and code quality—but it cannot determine whether the implementation actually satisfies the original business requirements.
Retrieving the Jira story and its acceptance criteria makes the review much more meaningful.
Why Copilot CLI?
Copilot CLI acts as the reasoning engine.
Instead of manually crafting prompts, the agent prepares all of the required context and delegates the analysis to Copilot.
The result is a review that's aware of:
- Code changes
- Business requirements
- Acceptance criteria
- Repository context
rather than just isolated code snippets.
Why I Consider This an Agent
Today, many applications wrap an LLM and call it an "AI Agent." I think the definition should be a little stricter.
A useful engineering agent should be able to:
- Gather information independently
- Invoke external tools
- Combine information from multiple systems
- Make workflow decisions
- Produce meaningful outputs without requiring constant human guidance
This project isn't just sending prompts to an LLM. It's orchestrating GitHub, Jira, and Copilot into a workflow that removes repetitive engineering work.
That, to me, is where agents become genuinely useful.
Security Considerations
Since the agent interacts with production engineering systems, a few guardrails were built into the design.
Read-only GitHub Operations
The current implementation never performs GitHub write operations. It only retrieves repository information and pull request data.
Temporary File Cleanup
Pull request diffs are written to temporary files before analysis. These files are automatically deleted after the review completes.
Explicit Jira Updates
Review results are only posted back to Jira when explicitly requested. The agent never modifies tickets automatically.
Looking Ahead
Pull request reviews are only the beginning.
Over the next several articles in this series, we'll continue building practical engineering agents to automate other parts of the software development lifecycle, including:
The goal isn't to replace engineers. It's to eliminate repetitive work so engineers can spend more time solving meaningful problems.
If you're building similar workflows—or have ideas for engineering tasks that could be automated—I'd love to hear about them in the comments.
About the Author
|
Hi, I'm Nachiket Joshi. I'm a software engineer focused on AI systems, distributed platforms, and developer productivity workflows. I share practical implementations of AI-powered engineering systems. |
Top comments (0)