Token导航 LogoToken导航

Agent Skill · 研究检索

code-review-for-gitcode(gitcode 的代码审查)

code-review-for-gitcode 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

code-review-for-gitcode 是研究检索类 Agent Skill,可用宿主为 OpenClaw,通过ClawHub获取,权限为需要联网;许可证为 MIT-0,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 12,948。

总安装 9,831周安装 418GitHub Stars 2下载 3,444核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT-0
版本
0.1.3

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:code-review-for-gitcode(gitcode 的代码审查)
来源仓库:https://github.com/guitenbay/code-review-for-gitcode
安装命令:
openclaw skills install code-review-for-gitcode
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install code-review-for-gitcode

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

专为 GitCode PR 设计的完整代码审核流程管理工具。自动执行安全扫描并筛选最重要的问题进行集中展示。支持手动干预审核内容,平衡自动化与人工判断。需配置 GitCode API token 并确保网络连通性。建议定期清理历史审核记录以保持系统整洁。

code-review-for-gitcode 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 OpenClaw;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 openclaw skills install code-review-for-gitcode;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

code-review-for-gitcode 怎么安装?

在终端执行 openclaw skills install code-review-for-gitcode。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

code-review-for-gitcode 支持哪些 AI 工具?

公开资料标注支持 OpenClaw。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

code-review-for-gitcode 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

code-review-for-gitcode 是免费的吗?

来源标注的许可证是 MIT-0。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

code-review-for-gitcode 用的人多吗?

公开数据是累计安装 9,831 次,近一周安装 418 次,下载 3,444 次,GitHub 2 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

code-review-for-gitcode 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 专注 OpenClaw 一种宿主,触发方式和使用习惯不用来回切换。
  • 许可证明确为 MIT-0,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 OpenClaw,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
code-review-for-gitcode

gitcode 的代码审查 · 本页

9,8312需要联网MIT-0通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

name
code-review
description
Complete code review workflow for GitCode PRs. Combines automated security scanning with manual code review, outputs formatted findings, and posts comments to PR. Use when reviewing GitCode pull requests - follows 5-step process: automated scan, manual review, issue selection, formatted output, and optional PR comment posting.

Code Review Skill

Complete 5-step code review workflow for GitCode PRs.

📁 Temp Directory Management

所有审查过程中生成的临时文件必须存放在 temp/ 目录下:

文件说明
temp/review_result.jsonStep 1 自动化扫描结果
temp/top3_issues.jsonStep 3 选择的 Top 问题
temp/formatted_review.jsonStep 4 格式化后的评论
temp/*.py脚本运行时缓存的文件
temp/*获取的 diff 文件,下载的代码文件

⚠️ 重要:审查完成后必须清理 temp/ 目录,删除所有临时文件。

5-Step Review Process

Step 1: Automated Scanning

Run script to detect critical issues:

python scripts/review_pr.py <pr_url> [token]

Detects: SQL injection, command injection, XSS, eval(), hardcoded credentials, resource leaks, infinite loops.

Features:

  • ✅ Automatic line number verification - Downloads the actual file and verifies line numbers match the code snippets
  • ✅ Smart caching - Avoids redundant downloads for the same PR
  • ✅ Line number correction - Automatically fixes incorrect line numbers and logs changes

Output: temp/review_result.json (with verified line numbers)

Step 2: Manual Review (REQUIRED)

Always read all changed code manually. Script misses:

  • Logic errors and edge cases
  • Design flaws
  • Performance issues
  • Missing error handling
  • Business logic errors
  • Code duplication
  • Test coverage gaps

How to get diff:

curl -H "Authorization: Bearer <token>" \
  "https://gitcode.com/api/v5/repos/<owner>/<repo>/pulls/<number>/diff"

Important: For each issue found, record:

  • File path: e.g., src/components/Table.tsx
  • Line range: e.g., L42-L45 (the line numbers of the problematic code)
  • Problem code: The actual code snippet
  • Description: Detailed explanation of the issue
  • Suggestion: Specific fix recommendation

How to find the correct line number in the new file:

Use the provided helper script to find exact line numbers:

# Single line
python scripts/find_line_numbers.py <file_path> "code snippet"

# Multi-line (use \
 to separate lines)
python scripts/find_line_numbers.py <file_path> "line1\
line2\
line3"

Example:

python scripts/find_line_numbers.py file_parser.py "return entries"
# Output: 第 119 行

python scripts/find_line_numbers.py file_parser.py "line.startswith('[ERROR] HCCL') or\
                        line.startswith('[INFO] HCCL')"
# Output: 第 103-104 行

Important: The position in your JSON must be the last line of the problematic code range (e.g., if problem spans L103-L105, use 105).

Manual method (if script unavailable):

When reviewing a diff file, the line numbers shown in the diff (after @@ markers) may not match the actual line numbers in the new file. To find the correct position for PR comments:

Understanding diff hunk headers:

@@ -old_start,old_count +new_start,new_count @@
  • -old_start,old_count: Old file starting line and number of lines
  • +new_start,new_count: New file starting line and number of lines

How to calculate exact line numbers in the new file:

  1. Find the hunk header with +new_start (the number after +)
  2. Count lines from that starting number, including:

- Context lines (no prefix) - Added lines (starting with +) - Modified lines (shown as removed - then added +)

  1. Exclude the hunk header line itself and file metadata lines

Example:

@@ -40,7 +39,7 @@ bool QueryTableDataDetailHandler::HandleRequest(...)
     } else if (request.params.type == "1") {
         ComputeLinkPageDetail(request, response, database);
     }
-    session.OnResponse(std::move(responsePtr));
+    SendResponse(std::move(responsePtr), true);
     return true;
 }
  • New file starts at line 39
  • Line 39: } else if ...
  • Line 40: ComputeLinkPageDetail...
  • Line 41: }
  • Line 42: SendResponse(std::move(responsePtr), true); ← This is line 42
  • Line 43: return true;
  1. For new files (file mode is new file mode):
   # Count only lines starting with '+' (excluding '+++ ' header)
   $lines = Get-Content pr_diff.txt
   $inFile = $false
   $lineNum = 0
   for ($i = 0; $i -lt $lines.Count; $i++) {
       if ($lines[$i] -match "^diff --git.*your-file.py") { $inFile = $true }
       if ($inFile -and $lines[$i] -match "^\+.*your-target-code") {
           Write-Output "New file line: $lineNum"
           break
       }
       if ($inFile -and $lines[$i] -match "^\+" -and $lines[$i] -notmatch "^\+\+\+") {
           $lineNum++
       }
   }
  1. Quick check: The position should point to the last line of the problematic code range in the new file (after PR changes).

Tip: If GitCode API returns 400 Bad Request with "diff failed to be generated due to invalid params under position param", the line number is likely incorrect.

Important: Always verify by manually counting from the +new_start line number in the hunk header. Do not guess or estimate line numbers.

Step 3: Select Top 3 Issues

⚠️ 流程决策:

问题数量后续步骤
0 个直接退出,输出"0 问题,审查通过",跳过 Step 3/4/5
1-3 个继续 Step 3/4,按实际数量处理(不必凑满 3 个)
>3 个选择最严重的 3 个问题,继续后续步骤

Combine automated + manual findings:

  • Filter false positives from script
  • Add issues found in manual review
  • Sort by severity (1-10)
  • Select top issues (up to 3, no need to fill exactly 3)

Note: 当问题数量为 0 时,直接退出整个审查流程,无需生成任何 JSON 文件。

Generate json format file temp/top3_issues.json for these issues to use in next step.

temp/top3_issues.json must be created in the directory of format_review.py for the next step to read.

Important:

  • The description field must contain the complete description from Step 1 and Step 2 findings, not a simplified version. Include all context and details.
  • The position field must be the last line number of the problematic code range (e.g., if problem code is at L42-L45, use 45)

Structure:

{
  "meta": {
    "total_issues": 5,
    "selected_issues": 3,
    "automated_count": 2,
    "manual_count": 3
  },
  "top3_issues": [
    {
      "number": 1,
      "path": "src/file.py",
      "lines": "L42-L45",
      "position": 45,
      "severity": 8,
      "type": "安全问题",
      "description": "Complete description from Step 1/2 findings, not simplified",
      "suggestion": "Detailed suggestion with specific actions",
      "code": "problematic code snippet from L42-L45",
      "code_context": ""
    }
    // 问题数量可以是 1-3 个,不必强制凑满 3 个
  ]
}

Note: position uses the last line of the code range for GitCode API positioning.

Important: The position must be the line number in the new file (after PR changes), not the line number in the diff file. See Step 2 for how to calculate the correct line number.

If total issues = 0: 跳过整个 Step 3/4/5,直接输出审查通过结论。

If total issues 1-3: 按实际数量继续后续步骤,无需凑满 3 个。

After generating temp/top3_issues.json, display the issues in Markdown format:

Top 3 Issues Selected


🔴 问题 #1 | 可维护性问题 | 6/10

文件: server/src/.../CheckProjectValidHandler.cpp\*\*

问题代码行: L119-L124

问题代码:

bool CheckProjectValidHandler::CheckPathSafety(
    const std::string& path,
    ProjectErrorType& error)
{
    ...
}
review内容
描述代码重复,违反DRY原则
建议提取公共函数到 FileUtil 类中

🟠 问题 #2 | 测试覆盖问题 | 6/10

文件: server/src/.../CheckProjectValidHandler.cpp\*\*

问题代码行: L119

问题代码:

bool CheckProjectValidHandler::CheckPathSafety
review内容
描述缺少单元测试
建议补充单元测试覆盖各种场景

🟡 问题 #3 | 代码一致性问题 | 5/10

文件: server/src/.../TimelineProtocolRequest.h\*\*

问题代码行: L68-L72

问题代码:

bool isSafePath = std::any_of(path.begin(), path.end(), ...)
review内容
描述逻辑不一致,缺少 IsRegularFile 检查
建议统一使用 FileUtil::CheckPathSafety

Total: 3 issues selected (or actual count if less than 3)

Note: position in JSON uses the last line number (e.g., L119-L124 → position: 124)

After generating temp/top3_issues.json, immediately proceed to Step 4 to format the output.

If total issues = 0: 直接跳过 Step 3/4/5,输出审查通过结论。

Step 4: Format Output

Format issues to structured JSON:

python scripts/format_review.py temp/top3_issues.json temp/formatted_review.json

Input:

  • temp/top3_issues.json from Step 3

Output: temp/formatted_review.json

temp/formatted_review.json must be created in the directory of post_review.py for the next step to read.

Structure:

{
  "comments": [
    {
      "number": 1,
      "path": "src/file.py",
      "position": 42,
      "severity": 8,
      "type": "安全问题",
      "body": "【review】..."
    }
  ]
}

Comment Format (in body field):

【review】{问题类型}。{问题描述}。{修改建议}。

After generating formatted_review.json, display the formatted content:

Step 4: Formatted Review Comments (Ready to Post)

以下 3 条评论将提交到 PR:

1. `CheckProjectValidHandler.cpp:119`
   类型: 可维护性问题 | 严重程度: 6/10
   内容: 【review】代码重复,违反DRY原则...

2. `CheckProjectValidHandler.cpp:119`
   类型: 测试覆盖问题 | 严重程度: 6/10
   内容: 【review】缺少单元测试...

3. `TimelineProtocolRequest.h:68`
   类型: 代码一致性问题 | 严重程度: 5/10
   内容: 【review】逻辑不一致...

Output: formatted_review.json

Step 5: Post to PR (Optional) - ⚠️ 必须等待用户确认

🚨 重要警告:此步骤涉及向 PR 发布评论,属于外部写入操作。必须先显示预览并等待用户明确确认(yes/no),严禁擅自执行!

Preview and confirm before posting:

python scripts/post_review.py <owner> <repo> <pr_number> <token> [temp/formatted_review.json]

Parameters:

  • owner: Repository owner (e.g., Ascend)
  • repo: Repository name (e.g., msinsight)
  • pr_number: PR number (e.g., 277)
  • token: GitCode access token
  • temp/formatted_review.json: Output from Step 4 (default: temp/formatted_review.json)

Example:

python scripts/post_review.py Ascend msinsight 277 your_token_here temp/formatted_review.json

Flow (必须严格遵守):

  1. Read temp/formatted_review.json from Step 4
  2. Display preview of all comments
  3. ⚠️ 必须等待用户明确确认:询问用户 "是否确认提交以上评论?(yes/no)"
  4. 只有用户回复 'yes' 或 '是' 后才执行提交,否则取消
  5. 审查完成后清理 temp 目录(见下方)

🧹 Temp Directory Cleanup

⚠️ 审查完成后必须清理 temp 目录:

# 删除 temp 目录及其所有内容
Remove-Item -Recurse -Force temp/
# 或
rm -rf temp/

清理时机:

  • 当问题数量为 0 时,审查通过后立即清理
  • 当问题数量 >0 时,完成 Step 5(发布评论)后清理
  • 如果用户拒绝发布评论,也需清理

保留情况:无


Severity Scale

ScoreLevelAction
9-10CriticalBlock merge
7-8HighStrongly recommend fix
5-6MediumRecommend fix
3-4LowOptional fix
1-2NitStyle suggestion

Manual Review Checklist

Logic & Correctness

  • [ ] Edge cases (null, empty, max values)
  • [ ] Error handling paths
  • [ ] Concurrency/thread safety
  • [ ] Resource cleanup

Design & Architecture

  • [ ] Single responsibility
  • [ ] No code duplication
  • [ ] Clean interfaces
  • [ ] Clear dependencies

Performance

  • [ ] Algorithm complexity
  • [ ] N+1 queries
  • [ ] Large data handling
  • [ ] Memory usage

Security

  • [ ] Input validation
  • [ ] Output encoding
  • [ ] Authorization checks
  • [ ] Sensitive data handling

Testing

  • [ ] Tests cover changes
  • [ ] Edge cases tested
  • [ ] Error paths tested

API Reference

  • Get PR files: GET /api/v5/repos/{owner}/{repo}/pulls/{number}/files
  • Get diff: GET /api/v5/repos/{owner}/{repo}/pulls/{number}/diff
  • Post comment: POST /api/v5/repos/{owner}/{repo}/pulls/{number}/comments

Scripts

ScriptPurposeStepInputOutputFeatures
review_pr.pyAutomated scanning1PR URL + Tokentemp/review_result.jsonAuto line verification, caching
find_line_numbers.pyFind code line numbers2File path + code snippetLine number(s)Exact match, multi-line support
format_review.pyFormat to JSON4temp/top3_issues.jsontemp/formatted_review.jsonGitCode API format
post_review.pyPost to PR5temp/formatted_review.jsonPR commentsBatch posting with confirmation

Script Details

review_pr.py

New Features (v2.0):

  1. Automatic Line Number Verification

- Downloads modified files from PR branch - Uses code snippets to find exact line numbers - Corrects mismatches automatically

  1. File Caching

- Caches downloaded files to avoid redundant API calls - Cache key: {owner}/{repo}/{sha}/{file_path}

  1. Verification Logging

- Logs line number corrections: Line number corrected: file.ts:275 -> 167 - Warns if verification fails

平台分布

OpenClaw

73.91%
按下载量换算2,545

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills