job51-gitlab-cr-node-jt-1 2.6.6 → 2.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,7 @@ description: 代码审查技能,审查变更代码并输出 REPORT 和 LINE_IN
7
7
 
8
8
  1. **读取 diff 文件**:使用 Read 工具读取文件:$ARGUMENTS
9
9
 
10
- 2. **解析文件信息**:从 `=== File Information ===` 部分提取
10
+ 2. **解析文件信息**:从 `# File Information` 部分提取
11
11
  - `Block Index`: 当前块索引号
12
12
  - `New Start`: 当前 diff 块在变更后文件中的起始行号(仅供参考)
13
13
  - `New Count`: 当前 diff 块的行数
@@ -94,6 +94,20 @@ description: 代码审查技能,审查变更代码并输出 REPORT 和 LINE_IN
94
94
 
95
95
  7. **必须输出 `<LINE_INFO>` 标签**:即使无问题也要输出空数组 `<LINE_INFO>[]</LINE_INFO>`
96
96
 
97
+ 8. **修改建议中的代码格式**:
98
+ - **必须使用 markdown 代码块**(```language ... ```)展示建议代码
99
+ - **禁止**使用行内代码(\`xxx\`)展示多行代码示例
100
+ - 代码块的语言根据文件类型自动选择(如 \`java\`、\`js\`、\`ts\`、\`py\`、\`go\` 等)
101
+ - 示例:
102
+ \`\`\`
103
+ **修改建议**:添加空值检查
104
+ \`\`\`java
105
+ if (forum != null) {
106
+ String forumName = forum.toString();
107
+ }
108
+ \`\`\`
109
+ \`\`\`
110
+
97
111
  <REPORT>
98
112
  ## 🤖 AI 代码审查结果
99
113
 
@@ -1,7 +1,7 @@
1
1
  # GitLab Code Review AI Tool 技术文档
2
2
 
3
3
  **项目名称**: job51-gitlab-cr-node
4
- **当前版本**: 2.6.6
4
+ **当前版本**: 2.6.7
5
5
  **作者**: tao.jing
6
6
  **最后更新**: 2026-04-16
7
7
  **项目地址**: https://gitdev.51job.com/51jobweb/ai-agent
@@ -27,6 +27,22 @@
27
27
 
28
28
  ## 版本历史
29
29
 
30
+ ### v2.6.7 (2026-04-16)
31
+
32
+ **Bug 修复**:
33
+ - **修复行号计算偏移问题**:修改临时文件格式,元数据行改为以 `# ` 开头,方便 AI 识别并忽略
34
+ - 问题现象:AI 计算的绝对行号总是比正确值多 8(如正确行号 30 返回 38)
35
+ - 根本原因:AI 没有正确忽略临时文件的元数据行(`=== File Information ===` 等 7 行)
36
+ - 修复方案:
37
+ - 修改临时文件格式:元数据行改为 `# File Information`、`# New Path:` 等注释格式
38
+ - 更新 SKILL.md:明确指示 AI 忽略所有以 `# ` 开头的行,从 `@@` 之后开始编号
39
+ - 更新 code-review-rules.md:同步更新示例格式
40
+ - 修复文件:`index.js:87-96`、`.claude/skills/simple-code-review/SKILL.md`、`.claude/rules/code-review-rules.md`
41
+ - **优化修改建议代码格式**:支持多语言代码块格式
42
+ - 修改建议中的代码示例必须使用 markdown 代码块(```language ... ```)
43
+ - 语言类型根据实际文件类型自动选择(java、js、py 等)
44
+ - 禁止使用行内代码(`xxx`)展示多行代码
45
+
30
46
  ### v2.6.6 (2026-04-16)
31
47
 
32
48
  **Bug 修复**:
package/index.js CHANGED
@@ -86,7 +86,7 @@ class GitLabCodeReviewer {
86
86
 
87
87
  // 构造包含元数据的 diff 内容
88
88
  // 注意:元数据行以 '# ' 开头,AI 会忽略这些行,从 '@@' 之后开始计数
89
- const diffContentWithMetadata = `# File Information (AI 请忽略这些元数据行,从 @@ 之后开始计数)
89
+ const diffContentWithMetadata = `# File Information
90
90
  # New Path: ${diffObject.new_path || 'N/A'}
91
91
  # Old Path: ${diffObject.old_path || 'N/A'}
92
92
  # Block Index: ${blockIndex}