write-mr-description
Skill0 starsChanged 19 days agoMITView on GitHub
Open a draft Merge Request with a generated description, self-review it, or both. Scans commits on the current branch since divergence from the target. Use when the user says "write MR description", "open MR", "raise MR", "draft MR", "review my MR", "self-review", "MR template", "PR description", "summarize my branch", or "describe these commits". Works with GitLab (glab) and GitHub (gh). Works well with self-hosted GitLab repos, Jira tickets and conventional-commit prefixes.
- Commits and pushes
In this repository57 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .cursor/rules/comments.mdcCursor rule
- .cursor/rules/commit-messages.mdcCursor rule
- .cursor/rules/git-workflow.mdcCursor rule
- .cursor/rules/manage-stack.mdcCursor rule
- .cursor/rules/no-worktrees.mdcCursor rule
- manage-stackSkill
- convert-as-skillSkill
- create-agentSkill
- create-agents-mdSkill
- create-commandSkill
- create-hookSkill
- create-ruleSkill
- create-skillSkill
- retrospectiveSkill
- super-architectureSkill
- super-cachingSkill
- super-elixirSkill
- super-nodejsSkill
- super-protobufSkill
- super-tech-blueprintSkill
- atomic-semantic-commitSkill
- code-reviewSkill
- create-bruno-collectionSkill
- create-documentationSkill
- create-ticketsSkill
- ready-specSkill
- write-adrSkill
- write-changelogSkill
- write-planSkill
- write-postmortemSkill
- write-runbookSkill
- noslopSkill
- output-saversSkill
- safe-refactorSkill
- tddSkill
- verifySkill
- get-movingSkill
- later-listSkill
- standupSkill
- challenge-meSkill
- codebase-learnerSkill
- researchSkill
- second-opinionSkill
- traceSkill
- color-kitSkill
- design-system-kitSkill
- diagramSkill
- infographicSkill
- product-polish-workflowSkill
- prototype-wireframeSkill
- ui-ux-kitSkill
- evidenceSkill
- find-skillsSkill
- handoffSkill
- rumblingSkill
- use-levistackSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 46
If ambiguous, use AskQuestion:
- Distinctive: line 76
If HEAD is already on the target, stop — ask the user to switch to a feature branch.
- Distinctive: line 195
If the target isn't known (standalone invocation), detect it:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Write MR Description
Peer skills: polyglot-copywriter (STE simple vocabulary), noslop (slop-free description), code-review (GitLab draft review after open).
References: references/prose-and-visuals.md, TEMPLATE.md, EXAMPLES.md, samples/description-with-diagram.md.
Routing
Determine the user's intent and pick one route:
| User says | Route |
| "write MR description", "fill MR template", "describe my branch", "summarize my branch" | A — Description only |
| "open MR", "raise MR", "push and open MR", "draft MR", "create MR" | B — Open draft MR (runs A first, then pushes + opens) |
| "review my MR", "self-review", "review the MR" | C — Self-review only |
| "open MR and review", "raise MR then review", "create MR description and do self review" | B + C (open draft, then self-review) |
If ambiguous, use AskQuestion:
"What would you like me to do?"
Options:
- "Generate the MR description only (I'll paste it myself)"
- "Push + open a draft MR with the description"
- "Self-review an already-open MR"
- "Push + open a draft MR, then self-review it"Route A — Generate MR description
A.1 Ask target branch
Detect default:
git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's|refs/remotes/origin/||'Fallback: try origin/main, then origin/master. Then ask:
"Which branch should this MR target?"
Options: [<detected>, "main", "master", "develop", "Let me type it"]If HEAD is already on the target, stop — ask the user to switch to a feature branch.
A.2 Discover commits
git rev-parse --abbrev-ref HEAD
git merge-base HEAD origin/<target>
git log --no-merges --reverse --format='%H%x09%s%x09%an' <merge-base>..HEADIf empty, stop.
A.3 Extract diff signals
For each commit, run git show --stat <hash> and git show <hash> -- <focused paths>:
**/errors/*.go— error codes / status changes**/task/*.go,**/handler/*.go,**/workflow.go— HTTP behaviour**/model/*.go— request/response fieldsclients/<service>/*.go(notmock/) — client methodsCHANGELOG.md
Build a signal table:
| Signal | Pattern | Surfaces as |
| JIRA ticket | [A-Z]+-\d+ in subject/branch | Closes [TICKET] |
| New error code | +.*Err\w+.*serviceError\.New | Table row NEW |
| Status code flip | same Err block, -http.Status* → +http.Status* | 400 → 422 |
| New required header | new headers.Get("...") + error return | Breaking + curl |
| New constant | exported const in model/config | Bullet |
| New route | r.Methods(...).Path(...) | curl |
| CHANGELOG | diff under ## Unreleased | tick box |
A.4 Authors + tickets
- Authors from
git log --format='%an <%ae>', dedupe. Emaillocal.part→@handle. - Tickets from subjects + branch. Most-mentioned =
Closes; rest =Related.
A.5 Render
Fill the template from TEMPLATE.md. Checkbox rules:
static_checks→ always uncheckedCHANGELOG→ checked only if diff proves ittests→ checked if_test.gochanges exist for every new task
Required: include a mermaid diagram or scope table in ### Description so readers see change boundaries (prose-and-visuals.md).
A.6 Prose gate
- polyglot-copywriter — English,
register: santai, itsreferences/simple-prose.mdon summary bullets and narrative (not on code literals or ticket URLs). - noslop — after pass on the full description markdown (noslop § write-mr-description).
Output as a single fenced markdown block, then list up to 3 follow-up bullets (missing CHANGELOG line, stale docs, 💥 justification, missing diagram/table).
Route B — Open draft MR
Prerequisite: run Route A first to produce the description.
B.1 Push
git push -u origin HEADB.2 Detect platform
| Remote contains | CLI |
gitlab, or a self-hosted GitLab host (glab auth status lists it) | glab |
github.com | gh |
B.3 Create draft
GitLab:
glab mr create \
--draft \
--target-branch <target> \
--title "<prefix>(<scope>): [<TICKET>] <summary>" \
--description "$(cat <<'EOF'
<description from Route A>
EOF
)"GitHub:
gh pr create \
--draft \
--base <target> \
--title "<title>" \
--body "$(cat <<'EOF'
<description from Route A>
EOF
)"B.4 Confirm
Print the MR/PR URL. If the user chose B + C, proceed to Route C.
Route C — Self-review
Can run standalone (on an already-open MR) or after Route B. For GitLab draft inline review with suggestions, prefer loading code-review instead of only this checklist.
C.1 Get the diff
git diff origin/<target>...HEADIf the target isn't known (standalone invocation), detect it:
glab mr view --json targetBranch -q .targetBranch # GitLab
gh pr view --json baseRefName -q .baseRefName # GitHubC.2 Review dimensions
Scan the diff for:
- Correctness — logic bugs, nil derefs, unreachable code
- Error handling — bare
errors.New(should be typed), swallowed errors, wrong status - Tests — new task without
_test.go, missing table rows for new branches - Style — gci import order, missing package doc, wrong export visibility
- Docs/contracts — stale README, test/data fixtures listing old codes, curl with wrong headers
- Breaking impact — is 💥 warranted and documented?
- Dead code — unused imports, commented blocks, duplicate conditions
C.3 Present findings
Output:
## Self-review findings
| # | Sev | File:Line | Finding |
|---|---|---|---|
| 1 | 🔴 | task/verification_check.go:145 | ... |
| 2 | 🟡 | model/model.go:52 | ... |
| 3 | 🟢 | api_test.go:304 | ... |Severity:
- 🔴 Critical — must fix before review
- 🟡 Suggestion — reviewer would likely comment
- 🟢 Nitpick — optional
Then ask:
Which findings should I fix? (numbers, "all", or "none")C.4 Implement fixes
For each selected finding:
- Make the change
- Run
go test -race -count=1 ./<package>/... - Commit:
fix(<scope>): address self-review finding #N — <one-liner>
After all fixes:
Fixes applied. Push to update the draft MR? (yes/no)If yes: git push
Heuristics
- Status code changes → table row, not paragraph.
- Quote error messages verbatim from the diff.
- Curl headers from
headers.Get(...)calls in the diff, not memory. - Multi-commit branches → group by intent.
- Single-commit → still re-extract signals from diff.
Anti-patterns
- ❌ Raw
git login description. - ❌ Authors from chat context instead of
git log. - ❌ CHANGELOG box checked without proof.
- ❌ Extra sections the template doesn't have.
- ❌ 💥 for internal-only refactors.
- ❌ Non-draft MR. Always draft first.
- ❌ Self-review that just says "LGTM".
- ❌ Committing fixes without running tests.
Resources
- TEMPLATE.md — MR template skeleton
- EXAMPLES.md — worked example
- references/prose-and-visuals.md — STE, noslop, mermaid/table
- samples/description-with-diagram.md
Related skills
atomic-semantic-commit: the branch has mixed changes, split commits first.code-review: self-review the diff before you open the MR.verify: prove the test plan before you write it down.create-tickets: the MR needs a linked ticket.polyglot-copywriter: polish the final wording.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

