Inspiration
Code review is not only about reading diffs. The harder problem is understanding context.
In many teams, merge requests show what changed, but not why it changed, what surrounding areas are affected, or what hidden assumptions a reviewer should know before approving. That missing context slows reviews, increases risk, and turns tribal knowledge into a bottleneck.
This project was inspired by a simple question: what if every merge request came with an instant, reviewer-ready context brief inside GitLab?
That idea fit the GitLab AI Hackathon especially well, because the challenge focused on building agents that respond to events and take action inside developer workflows, not just chatbots.
What it does
Context MR Agent turns a merge request into a structured context brief for reviewers.
When triggered inside GitLab, the flow analyzes the merge request and posts a note directly into the discussion with:
- what changed
- why it matters
- affected areas
- hidden assumptions
- risk level
- files to inspect first
- reviewer checklist
- documentation follow-up suggestions
Instead of forcing reviewers to reconstruct intent from raw diffs alone, the agent gives them immediate context in the place where review already happens: the merge request. GitLab’s custom flows support merge-request-oriented triggers such as mention, assign, and assign reviewer, and platform tools can gather review context and create merge request notes directly.
How we built it
We built the project as a native GitLab Duo Agent Platform custom flow.
The core of the project is a single custom flow that uses GitLab-native tools to:
- read merge request metadata,
- inspect diffs and commits,
- build review context,
- infer risk and hidden assumptions,
- post a structured note back into the merge request.
The implementation relies on platform tools such as build_review_merge_request_context, get_merge_request, list_merge_request_diffs, list_commits, list_repository_tree, get_repository_file, and create_merge_request_note. These tools are officially available in the GitLab Duo Agent Platform toolset.
We also created a polished demo page to explain the product visually, but the real submission is the custom flow itself. That decision was intentional: the hackathon is about building agents and flows that work inside GitLab workflows.
Challenges we ran into
The biggest challenge was designing something that felt genuinely useful instead of just AI-generated.
We did not want another generic summarizer. The hard part was making the output:
- concise,
- actionable,
- easy to scan in seconds,
- and valuable for real reviewers.
Another challenge was working within the GitLab trigger model. Custom flows do not use a dedicated “merge request opened” trigger, so we designed the experience around supported triggers like Assign reviewer and Mention, which are documented for custom flows in projects.
We also spent a lot of time on prompt design. The goal was to avoid fluffy language and produce something closer to a practical reviewer brief than a generic AI explanation.
What we learned
We learned that the most compelling AI workflow tools are not the ones that “do everything.” They are the ones that remove one specific point of friction extremely well.
We also learned how much leverage comes from building directly on the platform instead of around it. GitLab’s flow system, triggers, and built-in tools make it possible to create something that feels native to the software development lifecycle rather than bolted on as a separate assistant.
Most importantly, we learned that in code review, clarity is often more valuable than more code. Reviewers usually do not need more output. They need better context.
What's next
The next step is to make the agent even more helpful in real team workflows by:
- improving file-priority detection,
- highlighting missing evidence such as absent tests or missing docs,
- and tailoring output for risky areas like auth, migrations, and CI configuration.
The long-term vision is simple: turn merge requests from raw code changes into clear, reviewer-ready decisions.
Built With
- gitlab-built-in-agent-tools
- gitlab-custom-flows
- gitlab-duo-agent-platform
- gitlab-merge-requests
- gitlab-pages
- next.js
- react
- tailwind-css
- typescript
- yaml



Log in or sign up for Devpost to join the conversation.