Analyze all changes in the current branch compared to the main/master branch and produce a ready-to-use GitLab Merge Request title and description.
Workflow
Step 1: Identify the Base Branch
Determine the base branch:
code
git branch -a | grep -E '(main|master)' | head -1
Use whichever of main or master exists. If both exist, prefer main.
Step 2: Gather Context
- •
Get the current branch name:
codegit branch --show-current
- •
Get the merge base:
codegit merge-base HEAD <base-branch>
- •
Get commit messages for context:
codegit log --oneline <merge-base>..HEAD
- •
Get the list of changed files:
codegit diff --name-status <merge-base>..HEAD
- •
Get the full diff:
codegit diff <merge-base>..HEAD
If the diff is very large, review file by file.
- •
For each changed file, read the full current version to understand context beyond the diff.
Step 3: Produce the MR Title and Description
Output a single message containing the MR title and description in GitLab markdown format. Use this exact structure:
code
## Title <short, descriptive title under 72 characters> ## Description ### Summary <1-3 sentence overview of what this MR does and why> ### Changes <bulleted list of the key changes, grouped logically> ### Impact <brief instructions for reviewers to understand the impact of the changes>
Rules
- •Title must be concise (under 72 characters), written in imperative mood (e.g. "Add user authentication" not "Added user authentication").
- •Summary should explain the "why" — motivation and context — not just restate the diff.
- •Changes should be a bulleted list of meaningful changes, not a file-by-file dump. Group related changes together. Focus on what matters to a reviewer. Do not just list the changed files.
- •Impact should give reviewers concrete steps or commands to get simple expression how to use it if applicable.
- •Agent should interview the user if there are any questions about the changes or the MR.
- •If commits reference GitLab issues, include a
### Related issuessection with links (e.g.Closes #123orRelates to #45). - •Do NOT pad the description with boilerplate, caveats, or filler. Keep it tight and useful.
- •Do NOT include issue references that don't actually exist — only include them if the commits or branch name clearly reference real issues.
- •Output the title and description as a single, copy-pasteable message. Do not add commentary before or after.