Install
openclaw skills install @changhui123456/test-sync-accessGitCode AI Review Bot listens to PR events, auto-checks compliance, auto-fixes titles, comments issues, and syncs merged PRs via squash and email notification.
openclaw skills install @changhui123456/test-sync-access基于 LangGraph 的 GitCode 仓库智能检视机器人。
| Skill | 功能 | 违规处理 |
|---|---|---|
| pr-title-check | PR 标题合规检查(Conventional Commits 或 Skill 格式) | auto_fix (LLM修正) |
| reviewer-check | 检视责任人检查 | comment (@提交人) |
| code-style-check | 代码规范检查 (LLM) | comment |
| security-check | 安全扫描 (正则+LLM) | comment |
| pr-description-check | PR 描述非空+长度检查 | comment |
| file-size-check | 单文件/总变更大小限制 | comment |
| branch-name-check | 分支命名规范检查 | comment |
| 端点 | 方法 | 功能 |
|---|---|---|
| /admin/skills | GET | 列出所有 Skill 及状态 |
| /admin/skills/reload | POST | 热加载 Skill 配置 |
| /admin/trigger | POST | 手动触发 PR 评测 |
| /admin/config | GET | 查看运行配置(脱敏) |
# 1. 安装依赖
pip install -r requirements.txt
# 2. 配置环境变量
cp .env.example .env
# 编辑 .env 填入 GITCODE_ACCESS_TOKEN 和 GITCODE_WEBHOOK_SECRET
# 3. 启动
python main.py
src/
├── api/ # 接入层 (FastAPI)
│ └── routes/ # 路由 (webhook, health, admin)
├── orchestrator/ # 编排层 (LangGraph)
│ ├── review_engine.py # PR 评测工作流
│ ├── sync_engine.py # Squash 同步引擎
│ └── event_dispatcher.py # 事件分发
├── business/ # 业务层 (Skill/AutoFix/Comment)
│ └── skills/ # 7 个内置 Skill
├── integration/ # 集成层 (GitCode/AI/Email Client)
└── infrastructure/ # 基础设施层 (Config/Log/Queue/Metrics)
config/app_config.yaml — 主配置config/skills_config.yaml — Skill 规则配置.env — 环境变量(Token、Secret 等)# 单元测试
python -m pytest tests/unit/ -v
# 集成测试
python -m pytest tests/integration/ -v
# 全量测试
python -m pytest tests/ -v