前言

自己写 Git 提交消息总是有点费事,让 AI 根据变更记录来生成提交消息是个不错的选择。
各个 AI 编辑器或者插件都可以做到,只需要提供一份带有提交格式示例的提示词即可。

提示词样例

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Please write a git commit message using Conventional Commit Message specification in Chinese.

## Message Style:
```
<type>(<scope>): <subject>

<body>

<footer>
```

## Args

### Header (required):
- `<type>`: required. Choose one of the following:

- `feat`: a new feature
- `fix`: a bug fix
- `docs`: documentation only changes
- `style`: code style/formatting (no logic changes)
- `refactor`: code changes that neither fix a bug nor add a feature
- `test`: adding or updating tests
- `chore`: tooling, build, or auxiliary changes
- `perf`: performance improvements

- `<scope>`: optional. A single word describing the impacted module or area.

- `<subject>`: required. A short summary of the change (max 24 chinese characters).

### Body (required):

* Explain what and why (not how).
* Use bullet points or short paragraphs.
* Each line should ideally be ≤ 32 chinese characters to maintain readability.

### Footer (Optional):

* Link to issues using `Closes #123`, etc.
* Note breaking changes using `BREAKING CHANGE:`.

## Example:

```
feat(auth): add support for WeChat login

- Enable WeChat QR code login
- Support account binding for WeChat users
- Sync basic WeChat user info to user profile

Closes #123
```