Write Merge Request Description logo

Write Merge Request Description

Community
ShenQingchuan
write-merge-request-description

根据真实代码变更撰写并更新图文并茂、高可解释性的 Merge Request 描述,使用原生 Mermaid 图表讲清数据流、时序与分支逻辑。当用户要求写 MR 描述、补充架构图或流程图、提升代码变更可读性与评审效率时使用。

Overview

PublisherShenQingchuan
Repositoryskills
Skill namewrite-merge-request-description
Stars
28
Forks
3
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by ShenQingchuan on GitHub. Read the source before you install it.

Installation

Install the Write Merge Request Description AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/ShenQingchuan/skills/tree/main/registry/writing/write-merge-request-description
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ShenQingchuan/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/registry/writing/write-merge-request-description .claude/skills/write-merge-request-description
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Write Merge Request Description in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Write Merge Request Description on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Write Merge Request Description is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Write Merge Request Description

在 Agent 加速开发、单次代码变更体量变大的当下,MR 描述的核心价值不是把 git diff 翻译成中文流水账,而是帮人类评审者与后续阅读的 Agent 快速建立心智模型:一眼看懂为什么改、核心机制怎么转、边界条件怎么兜底、上线先后顺序是什么。

核心原则

  1. 讲清“机制与意图”,拒绝文件级流水账 不要按文件名逐个罗列“改了 a.go、加了 b.go”。要按业务切面组织内容:先说改完后系统具备什么能力,再拆解写路径、读路径、数据迁移等具体场景。
  2. 原生 Mermaid 优先,人机双友好 架构、数据流、时序交互、条件分支、状态流转一律优先直接写 ```mermaid 代码块。GitLab 可直接渲染给人类看,Agent 也能直接读取结构化源码理解拓扑关系,不依赖外部渲染器,也不会因跨项目图片权限裂图。
  3. 小图拆解,一节一图,图文咬合 不要画塞满几十个节点的巨型全景图。每个业务小节只回答一个核心问题,配一张 4~8 个节点的紧凑小图:
    • 图前:一两句话讲清楚“为什么要这样设计”。
    • 图中:节点写业务动作 + 关键表/字段名(如 ["审核单表:写入 source_id 和 source_type"]),不堆砌代码函数名。
    • 图后:补充图里画不出来的边界规则(如幂等去重、参数校验拒绝条件、职责分工、失败兜底)。
  4. 诚实披露真实状态与上线红线 跑过的测试、还没在测试环境执行的 SQL、尚未发布的上下游协议制品、必须严守的发布先后顺序(如“先加列再发服务”),全部明确摆在台面上,绝不把未执行的步骤写成“已完成”。

工作流程

  1. 锁定目标与上下文:确认 MR IID 与仓库,读取当前 MR 描述、源/目标分支、提交记录和实际 diff,保留旧描述里仍然有效的背景、关联链接与注意事项。
  2. 提炼主干与变更坐标:从代码事实出发,拎出本次变更解决的业务问题、核心数据/协议变化、上下游依赖和部署约束。
  3. 按场景规划 Mermaid 小图:识别最需要降低理解成本的 1~4 个切面,选择合适的图型:
    • 数据流向 / 字段映射 / 条件分支 / 补数逻辑 → flowchart LR 或 flowchart TD
    • 多方调用 / 读写先后顺序 / 事务与外部交互 → sequenceDiagram
    • 单据或任务生命周期变化 → stateDiagram-v2
    • 核心表结构与关联变化 → erDiagram
  4. 处理真实截图(按需):只有 UI 界面前后对比、监控面板、终端实测结果等无法用 Mermaid 表达的本地位图,才调用 /persist-img-by-gitlab 上传并嵌入链接;逻辑图不转静态图片。
  5. 撰写并更新 MR:按下方结构组织成干净、好读的 Markdown,确认无误后通过 glab mr update 写回目标 MR。

推荐结构

按变更实际内容裁剪,不硬凑空小节:

1. 这次改了什么(开篇速览)

  • 一句话主干:直接用大白话说明改完之后支持了什么业务能力、解决了什么卡点。
  • 核心动作与关联上下文:说明读写链路怎么变、迁移脚本在哪、测试环境是否已执行、关联的前后端或协议 MR 是哪个。
  • 关键坐标速览表(涉及协议、表结构、脚本、配置等多维改动时使用):
markdown
| 项 | 说明 |
|---|---|
| 协议 | 涉及的字段名、字段号、请求/响应位置 |
| 表结构 | 新增或修改的表、列、索引 |
| 补数/迁移 | SQL 路径或命令行工具位置 |
| 配置 | 是否有新增配置项及默认值 |

2. 分场景机制拆解(主体,2~4 个业务小节)

直接用具体业务场景做小标题(例如 ## 审核单上的源内容编号、## 新提审、## 列表和详情、## 老数据),不写空泛的“关键实现”。每个小节遵循三段式:

  1. 设计原因:为什么这样存、为什么这样查。
  2. Mermaid 图:直观展示数据流、调用时序或判断分支。
  3. 边界与不变量:什么情况下拒绝请求、去重命中时改不改旧值、哪部分逻辑由上游或下游负责。

3. 上线前要做的事(可勾选清单)

当存在数据库变更、数据回填、制品发布或配置下发时,按严格执行顺序列出:

markdown
- [ ] 在目标库执行 `xxx.sql` 完成加列。
- [ ] 执行补数语句或运行迁移工具。
- [ ] 抽查新写入数据与列表过滤结果。
- [ ] 发布协议制品并升级上下游调用方。

4. 评审时注意(重点与风险提示)

用编号列表把 Reviewer 最需要盯紧的硬约束列出来:

  1. 发布顺序红线(如先加列再发版,否则读写报错)。
  2. 数据兼容与幂等(如补数只填空值、不覆盖已有值,异常数据保持默认值)。
  3. 契约占用与边界(如已占用的协议字段号、未纳入本次 MR 的范围)。

更新命令

将最终描述保存为本地 Markdown 文件后更新 MR:

bash
glab mr update MR_IID \
  --repo group/project \
  --description-file description.md \
  --yes

非当前默认实例时,传入完整仓库 URL 或设置 GITLAB_HOST。用户只要求生成草稿时不执行更新命令。

完成前检查

  • 开篇 10 秒内能看懂“这次改了什么、为什么改”。
  • 每个 Mermaid 图都紧扣一个具体场景,节点用业务大白话加关键字段,没有画成大而空的模块框图。
  • 边界条件、幂等规则、未执行的脚本、上线顺序都已如实写明,与实际 diff 完全一致。
  • 不包含敏感凭据或未脱敏的内部密钥。

Frequently asked questions

What does the Write Merge Request Description AI skill do?

根据真实代码变更撰写并更新图文并茂、高可解释性的 Merge Request 描述,使用原生 Mermaid 图表讲清数据流、时序与分支逻辑。当用户要求写 MR 描述、补充架构图或流程图、提升代码变更可读性与评审效率时使用。

Why use Write Merge Request Description on TypingMind?

Because you install it once and use it with any model. Write Merge Request Description is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Write Merge Request Description in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ShenQingchuan/skills/tree/main/registry/writing/write-merge-request-description. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Write Merge Request Description?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Write Merge Request Description?

As many as you like. As long as a model supports skills, you can use Write Merge Request Description with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Write Merge Request Description AI skill free?

Yes. It is published on GitHub by ShenQingchuan under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇