重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
npx skills add https://github.com/odyssey4me/agent-skills --skill gerrit此技能提供 Gerrit 代码审查集成,使用 git-review 和一个 Python 包装器,用于在读取/查看操作时输出 Markdown 格式的查询结果。操作命令(提交、审查、放弃)应直接使用 git-review 或 SSH 命令。
安装 git-review : pip install git-review — 文档
git-review 使用 SSH 与 Gerrit 服务器进行认证。
# 配置 Gerrit 用户名(如果与本地用户不同)
git config --global gitreview.username yourgerrituser
# 测试 SSH 连接
ssh -p 29418 youruser@review.example.com gerrit version
# 将 SSH 密钥添加到 Gerrit
# 1. 如果需要,生成 SSH 密钥: ssh-keygen -t ed25519
# 2. 复制公钥: cat ~/.ssh/id_ed25519.pub
# 3. 添加到 Gerrit: Settings > SSH Keys
Gerrit 支持多种认证方法:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
详情请参阅 Gerrit 认证。
# 对仓库进行一次性设置
git review -s
# 或者手动在仓库根目录创建 .gitreview 文件
cat > .gitreview <<EOF
[gerrit]
host=review.example.com
port=29418
project=myproject
defaultbranch=main
EOF
详情请参阅安装指南。
包装器脚本 (scripts/gerrit.py) 使用 Gerrit SSH 查询命令,并将输出格式化为 Markdown。连接详情从 .gitreview 读取,或通过 --host/--port/--username 标志提供。有关每个命令的读/写分类,请参阅 permissions.md。
# 检查 Gerrit SSH 访问
$SKILL_DIR/scripts/gerrit.py check
# 变更
$SKILL_DIR/scripts/gerrit.py changes list
$SKILL_DIR/scripts/gerrit.py changes view 12345
$SKILL_DIR/scripts/gerrit.py changes search "status:open project:myproject"
# 项目
$SKILL_DIR/scripts/gerrit.py projects list
所有列表命令都支持 --limit N(默认 30)。
全局连接选项:--host, --port(默认 29418), --username。
对于操作命令,请直接使用 git-review 或 SSH 命令:
git review # 提交当前分支以供审查
git review -t topic-name # 提交并指定主题
git review -f # 提交并关闭本地分支
git review --reviewers user1,user2 # 添加审查者
git review -n # 试运行(显示将要执行的操作)
完整参考:git-review 用法
git review -d 12345 # 下载变更 12345
git review -d 12345,3 # 下载变更 12345 的补丁集 3
git review -x 12345 # 拣选变更(不创建分支)
git review -m 12345 # 将本地变更与远程进行比较
下载会创建一个名为 review/username/topic 的本地分支。
# 对已下载的审查进行更改
git commit --amend
git review # 上传新的补丁集
# 更新到最新的补丁集
git review -d 12345 # 重新下载会更新分支
git review -R # 不进行变基(按原样提交)
git review -D # 草稿模式(WIP 变更)
git review --no-cache # 跳过本地缓存
git review -v # 详细输出
git review --track # 跟踪远程分支
文件:.gitreview(仓库根目录)
[gerrit]
host=review.example.com
port=29418
project=myproject/subproject
defaultbranch=main
defaultremote=origin
# 设置 Gerrit 用户名
git config --global gitreview.username myuser
# 设置默认远程仓库
git config --global gitreview.remote gerrit
# 配置协议(ssh/http/https)
git config --global gitreview.scheme ssh
配置存储在 ~/.gitconfig 中。
# 开始新功能工作
git checkout -b feature-branch
# ... 进行更改 ...
git commit -m "Add new feature"
# 提交审查
git review -t feature-topic
# 验证提交
$SKILL_DIR/scripts/gerrit.py changes list # 确认变更出现
# 处理审查意见
# ... 进行更改 ...
git commit --amend
git review
# 验证新补丁集已上传
$SKILL_DIR/scripts/gerrit.py changes view <change-number>
# 下载变更以供审查
git review -d 12345
# 验证下载
$SKILL_DIR/scripts/gerrit.py changes view 12345
# 测试变更
# ... 运行测试,验证代码 ...
# 返回主分支
git checkout main
git branch -D review/user/topic
# 提交并指定主题
git review -t authentication-refactor
# 验证提交
$SKILL_DIR/scripts/gerrit.py changes list
# 所有相关变更将在此主题下分组
git commit -m "Part 2: Update tests"
git review -t authentication-refactor
更多示例请参阅 common-workflows.md。
有关 SSH 命令、JSON 输出和多服务器配置,请参阅 advanced-usage.md。
此技能包装了一个官方 CLI。一个快速、轻量级的模型就足够了。
常见问题和修复方法请参阅 troubleshooting.md。
每周安装数
50
仓库
GitHub 星标数
2
首次出现
2026年1月25日
安全审计
安装于
claude-code44
gemini-cli41
cursor41
opencode41
codex38
github-copilot38
This skill provides Gerrit code review integration using git-review with a Python wrapper for markdown-formatted query output on read/view operations. Action commands (submit, review, abandon) should use git-review or SSH commands directly.
Install git-review : pip install git-review — docs
git-review uses SSH for authentication with Gerrit servers.
# Configure Gerrit username (if different from local user)
git config --global gitreview.username yourgerrituser
# Test SSH connection
ssh -p 29418 youruser@review.example.com gerrit version
# Add SSH key to Gerrit
# 1. Generate SSH key if needed: ssh-keygen -t ed25519
# 2. Copy public key: cat ~/.ssh/id_ed25519.pub
# 3. Add to Gerrit: Settings > SSH Keys
Gerrit supports multiple authentication methods:
See Gerrit Authentication for details.
# One-time setup for a repository
git review -s
# Or manually create .gitreview file in repository root
cat > .gitreview <<EOF
[gerrit]
host=review.example.com
port=29418
project=myproject
defaultbranch=main
EOF
See Installation Guide for details.
The wrapper script (scripts/gerrit.py) uses Gerrit SSH query commands and formats output as markdown. Connection details are read from .gitreview or provided via --host/--port/--username flags. See permissions.md for read/write classification of each command.
# Check Gerrit SSH access
$SKILL_DIR/scripts/gerrit.py check
# Changes
$SKILL_DIR/scripts/gerrit.py changes list
$SKILL_DIR/scripts/gerrit.py changes view 12345
$SKILL_DIR/scripts/gerrit.py changes search "status:open project:myproject"
# Projects
$SKILL_DIR/scripts/gerrit.py projects list
All commands support --limit N for list commands (default 30).
Global connection options: --host, --port (default 29418), --username.
For action commands, use git-review or SSH commands directly:
git review # Submit current branch for review
git review -t topic-name # Submit with topic
git review -f # Submit and close local branch
git review --reviewers user1,user2 # Add reviewers
git review -n # Dry-run (show what would be done)
Full reference: git-review usage
git review -d 12345 # Download change 12345
git review -d 12345,3 # Download patchset 3 of change 12345
git review -x 12345 # Cherry-pick change (no branch)
git review -m 12345 # Compare local changes to remote
Downloads create a local branch named review/username/topic.
# Make changes to downloaded review
git commit --amend
git review # Upload new patchset
# Update to latest patchset
git review -d 12345 # Re-download updates the branch
git review -R # Don't rebase (submit as-is)
git review -D # Draft mode (WIP changes)
git review --no-cache # Skip local cache
git review -v # Verbose output
git review --track # Track remote branch
File: .gitreview (repository root)
[gerrit]
host=review.example.com
port=29418
project=myproject/subproject
defaultbranch=main
defaultremote=origin
# Set Gerrit username
git config --global gitreview.username myuser
# Set default remote
git config --global gitreview.remote gerrit
# Configure scheme (ssh/http/https)
git config --global gitreview.scheme ssh
Configuration stored in ~/.gitconfig
# Start work on new feature
git checkout -b feature-branch
# ... make changes ...
git commit -m "Add new feature"
# Submit for review
git review -t feature-topic
# Verify submission
$SKILL_DIR/scripts/gerrit.py changes list # confirm change appears
# Address review comments
# ... make changes ...
git commit --amend
git review
# Verify new patchset uploaded
$SKILL_DIR/scripts/gerrit.py changes view <change-number>
# Download change for review
git review -d 12345
# Verify download
$SKILL_DIR/scripts/gerrit.py changes view 12345
# Test the change
# ... run tests, verify code ...
# Return to main branch
git checkout main
git branch -D review/user/topic
# Submit with topic
git review -t authentication-refactor
# Verify submission
$SKILL_DIR/scripts/gerrit.py changes list
# All related changes will be grouped under this topic
git commit -m "Part 2: Update tests"
git review -t authentication-refactor
See common-workflows.md for more examples.
See advanced-usage.md for SSH commands, JSON output, and multi-server configuration.
This skill wraps an official CLI. A fast, lightweight model is sufficient.
See troubleshooting.md for common issues and fixes.
Weekly Installs
50
Repository
GitHub Stars
2
First Seen
Jan 25, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
claude-code44
gemini-cli41
cursor41
opencode41
codex38
github-copilot38
Azure 升级评估与自动化工具 - 轻松迁移 Functions 计划、托管层级和 SKU
127,000 周安装
Tinybird Python SDK 使用指南 - 在Python中定义数据源、管道和端点
102 周安装
iOS自动化测试指南:使用xcodebuild与Xcode模拟器进行QA测试
101 周安装
健康检查端点实现指南:Kubernetes探针配置与Node.js/Express最佳实践
105 周安装
SAP ABAP CDS 核心数据服务完整指南:语法、注解、视图实体与最佳实践
100 周安装
GitHub PR审阅线程自动处理工具 - pr-threads-address命令详解与使用指南
103 周安装
NSFC申请代码智能推荐工具 - 基于LaTeX标书内容自动匹配国家自然科学基金代码
44 周安装