LLM-Based Agent for Standard Compliance in GitLab Merge Requests
Abstract
Code reviews are a central component of collaborative software development, yet they often require considerable manual effort in practice. Ensuring consistent compliance with project-specific standards can be challenging, particularly when these standards require contextual interpretation of code, naming conventions, or documentation. This paper presents an LLM-based prototype designed to support the application of a documented rule catalog within GitLab merge requests. The agent is integrated into the existing workflow and is triggered automatically by merge request events. It analyzes the source code contained in a merge request and evaluates it against explicitly defined project rules. To ensure structured and consistent output, a predefined JSON schema guides the model’s response and enables validation before publication. Invalid or non-parseable outputs are detected and not posted to the merge request. The approach is not intended to replace human reviewers, but to support them in the systematic application of documented project standards. The implementation demonstrates the technical feasibility of integrating rule-based governance with LLM-supported contextual interpretation in a practical GitLab workflow.