MRGenesis — From Issue to Merge Request
GitLab AI Hackathon Submission
Inspiration
Every developer knows that gap between a feature request and actual implementation. You open a GitLab issue, read something like "Add password reset functionality", and suddenly you're staring at a blank editor wondering where to even begin.
I wanted to close that gap.
The idea for MRGenesis came from watching teammates spend hours in planning meetings just to break down a single issue into actionable tasks — architecture decisions, API design, test strategies, security concerns. All of that knowledge locked inside people's heads, inconsistently applied across the team, repeated from scratch every single time.
What if an AI could simulate that entire planning session the moment an issue was created? What if the first comment on your issue was already a complete, structured development plan? That question became MRGenesis.
What It Does
MRGenesis is an AI-powered GitLab Duo workflow that transforms GitLab issues into structured development plans, instantly.
A developer creates a GitLab issue describing a feature, mentions @ai-mrgenesis-flow-gitlab-ai-hackathon in a comment, and MRGenesis goes to work. Within seconds it produces a complete development blueprint through four specialized AI agents working in sequence.
The Planner Agent breaks the feature down into requirements, architecture decisions, and component dependencies. The Coder Agent follows up with implementation strategies, API endpoint structures, recommended file layouts, and actual code snippets. The Test Agent then designs unit and integration tests and flags the edge cases worth worrying about. Finally the Security Agent closes the loop by identifying vulnerabilities and recommending mitigations, authentication patterns, and validation approaches.
The result is a ready-to-use development roadmap living right inside the GitLab issue where the team already works — no context switching, no separate tools.
How We Built It
MRGenesis is built entirely on GitLab's AI Catalog Agent system using a single YAML-defined flow.
The entire intelligence of the system lives in one file, flows/mrgenesis-flow.yml. It uses GitLab Duo's AgentComponent with a carefully engineered prompt template that instructs the model to simulate four distinct agents in sequence — all within a single inference pass.
name: "mrgenesis-flow"
description: "MRGenesis AI workflow that analyzes GitLab issues and generates a multi-agent development plan."
The prompt system instructs the AI to identify the requested feature, generate structured output for each agent with clear section headers, produce real file path suggestions and working code snippets via the Coder Agent, and always include a security pass as a first-class part of the plan rather than an afterthought.
The supporting files are minimal by design.
flows/mrgenesis-flow.yml <- Core AI workflow definition
.ai-catalog-mapping.json <- Registers the flow in GitLab AI Catalog
.gitlab-ci.yml <- CI pipeline for flow validation and sync
The .ai-catalog-mapping.json registers the flow so GitLab's AI Catalog pipeline can discover, validate, and publish the agent. The .gitlab-ci.yml handles automatic sync on every push.
Built With
| Layer | Technology |
|---|---|
| AI Platform | GitLab Duo AI Agents |
| Agent Framework | GitLab AI Catalog, AgentComponent |
| Flow Definition | YAML |
| Prompt Engineering | GitLab prompt_template system (system + user + history) |
| CI/CD | GitLab CI for catalog sync and validation |
| Trigger Mechanism | GitLab Duo Mention trigger |
| Integration | GitLab Issues, GitLab Duo, AI Catalog |
| Version Control | Git + GitLab |
Challenges We Ran Into
The hardest part was getting the multi-agent simulation right inside a single prompt. GitLab Duo flows currently execute as a single agent component, so simulating four agents, each with a different area of expertise and a distinct output format, required real care in how the system prompt was structured. It had to be directive enough to produce consistent sections every time, while still giving the model enough room to reason intelligently about whatever feature was thrown at it.
Automatic issue triggering was another wall we hit early. The ideal experience would be: create an issue, and MRGenesis responds automatically. But the hackathon environment only supports mention, assign, and assign reviewer as triggers. In production this would be solved cleanly with GitLab webhooks or the API, but here it meant the manual mention step was unavoidable.
There was also a real tension between prompt length and output quality. More detailed prompts produced better, more structured results but pushed against the timeout limit. Tuning the timeout parameter to 180 seconds while keeping the prompt tight enough to reliably complete was more iterative than expected.
Finally, getting the .ai-catalog-mapping.json and .gitlab-ci.yml correctly wired to pass GitLab's catalog sync validation took several rounds of trial and error and a lot of close reading of the AI Catalog documentation.
Accomplishments That We're Proud Of
The thing we're most proud of is that MRGenesis requires zero backend infrastructure. It runs entirely inside GitLab's native AI tooling — no external servers, no separate APIs, no databases. Just a YAML file and a well-crafted prompt.
We're also proud that the output is actually usable. The Coder Agent doesn't just describe what to build in vague terms — it names real file paths like src/controllers/authController.js and writes code snippets a developer can drop straight into their editor.
Making security a required step in every plan, not optional, feels like the right call. Too many tools treat security as a checkbox at the end. MRGenesis bakes it into the workflow from the start, which means every plan that comes out of it has already been reviewed through that lens.
And adoption is genuinely frictionless. Any GitLab team can enable MRGenesis without touching a single line of their existing codebase. Enable the flow, mention it on an issue, and you're running.
What We Learned
The biggest lesson was that prompt engineering is really just software architecture by another name. Designing a prompt that reliably produces four structured, expert-level responses in a single pass requires the same kind of careful thinking as designing a clean API or a well-structured class hierarchy. Small wording changes in the system prompt had surprisingly large effects on output quality, sometimes in ways that were hard to predict until you tested them.
We also came away with a lot of respect for what GitLab's AI Catalog can do. The AgentComponent abstraction combined with the prompt template system and catalog sync pipeline is a surprisingly complete framework for building production-grade AI workflows without ever leaving GitLab.
The last thing that stuck with us is that the best AI tools are invisible. MRGenesis works best when a developer glances at the plan and just starts building, not when they stop to marvel at the fact that AI wrote it. When the output reads like it came from your most experienced teammate, the tool stops being a novelty and starts being part of how the team works.
What's Next for MRGenesis
The name says it all. MRGenesis — the origin of the Merge Request.
Right now MRGenesis generates a plan. The vision is for it to generate the MR itself.
The next step is automatic triggering and responding to new issues the moment they're created, without any manual mention required, using GitLab webhooks in the background. After that, MR generation: taking the Coder Agent's file structure and code snippets and using them to automatically open a draft Merge Request with scaffold files already committed and ready for review.
From there the roadmap extends into letting the Test Agent's output auto-generate test files wired into the project's existing CI pipeline, cross-referencing the Security Agent's findings against GitLab's built-in dependency scanning, and allowing developers to reply to a plan with follow-up comments so MRGenesis can refine it iteratively.
The ultimate goal is simple. A developer writes a one-line issue, and MRGenesis delivers a fully scaffolded, tested, security-reviewed draft Merge Request ready for a human to look at and approve.
That's the version worth building.
Built With
- agentcomponent
- gitlab
- gitlab-ai-catalog
- gitlab-ci/cd
- gitlab-duo
- gitlab-duo-flows
- gitlab-issues-api
- json
- yaml
Log in or sign up for Devpost to join the conversation.