Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .trae/rules/git-commit-message.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
alwaysApply: true
scene: git_message
---

## 提交信息

项目采用 Conventional Commits 规范来格式化提交信息。

### 基本格式

每条提交信息应遵循以下结构(只允许使用英文):

```text
<类型>(<作用域>): <描述>

[正文]

[脚注]
```

- **类型**:必填,表示本次提交的类别(见下文“类型列表”)。
- **作用域**:可选,用括号包裹,指明本次提交影响的代码范围(如模块名、组件名等)。
- **描述**:必填,是对变更的简短说明,使用祈使句、现在时态,首字母小写,末尾不加句号。
- **正文**:可选,对变更动机及与之前行为的对比进行详细说明。
- **脚注**:可选,主要用于关联 Issue 或标记破坏性变更(BREAKING CHANGE)。
Comment on lines +6 to +26

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check language patterns in other .trae rule files

fd -e md . .trae/rules/ --exec head -20

Repository: project-cvsa/cvsa

Length of output: 234


🏁 Script executed:

#!/bin/bash
# List all markdown files in .trae/rules/ and check their language
ls -la .trae/rules/ | grep -E '\.(md|txt)$'

Repository: project-cvsa/cvsa

Length of output: 132


🏁 Script executed:

#!/bin/bash
# Get more context from each markdown file in the directory
for file in .trae/rules/*.md; do
  echo "=== File: $file ==="
  head -30 "$file"
  echo ""
done

Repository: project-cvsa/cvsa

Length of output: 531


🏁 Script executed:

#!/bin/bash
# Check for any AI/LLM configuration or documentation
find . -type f \( -name "*ai*" -o -name "*llm*" -o -name "*config*" -o -name "README*" \) -not -path "*/node_modules/*" -not -path "*/.git/*" | head -20

Repository: project-cvsa/cvsa

Length of output: 885


Align the language of format template placeholders with the required English commit message format.

The file requires commit messages to be English-only ("只允许使用英文"), but the format template on line 15 uses Chinese placeholders: <类型>(<作用域>): <描述>.

Replace these with English equivalents (e.g., <type>(<scope>): <description>) to match the requirement and avoid confusion.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.trae/rules/git-commit-message.md around lines 6 - 26, The commit-message
template uses Chinese placeholders (`<类型>(<作用域>): <描述>`) while the policy
mandates English-only commit messages; update the template placeholders to
English equivalents (e.g., `<type>(<scope>): <description>`) wherever they
appear (notably the header/formatted example block) so the example matches the
"English-only" rule and avoids confusion.


### 示例

1. 新增一个用户登录功能:

```text
feat(auth): add user login endpoint
```

2. 包含破坏性变更的提交(需在脚注中标记):

```text
feat(api): change response format for user details

BREAKING CHANGE: The 'user' field in the response is now nested under 'data'.
```

### 允许的类型列表

- `feat`:新增功能。
- `fix`:修复 bug。
- `update`: 对代码内容做出调整,而原先的代码不视为 bug(如修改前端按钮的文案)
- `docs`:仅修改文档。
- `style`:修改代码格式(不影响代码运行的变动,如空格、分号缺失等)。
- `refactor`:重构代码(既不是新增功能,也不是修改 bug 的代码变动)。
- `perf`:优化性能。
- `test`:增加测试或修改现有测试。
- `ci`:修改 CI 配置文件或脚本(例如:Travis, Circle, BrowserStack, SauceLabs)。
- `chore`:其他不修改源代码或测试文件的更改。
- `revert`:撤销之前的提交。