{"id":24742216,"url":"https://github.com/highkay/codereview-agent","last_synced_at":"2026-04-15T08:38:27.984Z","repository":{"id":274421355,"uuid":"922567280","full_name":"highkay/codereview-agent","owner":"highkay","description":"A codereview agent for small dev team","archived":false,"fork":false,"pushed_at":"2025-01-27T09:16:59.000Z","size":23,"stargazers_count":31,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T20:29:17.914Z","etag":null,"topics":["deepseek","gitea","gitlab","llm"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/highkay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-26T15:03:39.000Z","updated_at":"2025-03-21T05:50:25.000Z","dependencies_parsed_at":"2025-01-27T08:34:54.809Z","dependency_job_id":null,"html_url":"https://github.com/highkay/codereview-agent","commit_stats":null,"previous_names":["highkay/codereview-agent"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/highkay/codereview-agent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/highkay%2Fcodereview-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/highkay%2Fcodereview-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/highkay%2Fcodereview-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/highkay%2Fcodereview-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/highkay","download_url":"https://codeload.github.com/highkay/codereview-agent/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/highkay%2Fcodereview-agent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31833836,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T07:17:56.427Z","status":"ssl_error","status_checked_at":"2026-04-15T07:17:30.007Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deepseek","gitea","gitlab","llm"],"created_at":"2025-01-28T00:22:15.228Z","updated_at":"2026-04-15T08:38:27.945Z","avatar_url":"https://github.com/highkay.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 代码评审Agent\n\n这是一个基于LLM的自动代码评审系统，可以自动对Gitea的Pull Request进行代码评审。\n\n## 主要功能\n\n1. 自动监听Gitea的Pull Request事件\n2. 获取PR中的代码变更并进行分析\n3. 使用LLM进行代码评审，包括：\n   - 安全性评估\n   - 性能分析\n   - 代码可读性\n   - 最佳实践检查\n4. 自动生成评审评论\n5. 支持根据评分自动合并PR\n\n## 技术栈\n\n- Python 3.10+\n- FastAPI\n- HTMX\n- TailwindCSS\n- LiteLLM\n\n## 安装\n\n1. 克隆仓库：\n```bash\ngit clone https://github.com/highkay/codereview-agent.git\ncd codereview-agent\n```\n\n2. 安装依赖：\n```bash\npip install -r requirements.txt\n```\n\n3. 配置系统：\n   - 访问 `http://localhost:8000/config`\n   - 填写必要的配置信息：\n     - Gitea服务器URL和API Token\n     - LLM提供商配置\n     - 评审规则和阈值\n\n## 运行\n\n```bash\npython app/main.py\n```\n\n服务将在 `http://localhost:8000` 启动。\n\n## Gitea配置\n\n1. 在Gitea中添加Webhook：\n   - 进入仓库设置 -\u003e Webhooks -\u003e 添加Webhook\n   - URL设置为：`http://your-server:8000/webhook/gitea`\n   - 选择事件：Pull Request\n\n## 评审规则\n\n系统使用以下维度进行代码评审：\n\n1. 安全性（30%）：\n   - SQL注入\n   - XSS漏洞\n   - 敏感信息泄露\n   - 权限控制\n\n2. 性能（20%）：\n   - 算法复杂度\n   - 资源使用效率\n   - 并发处理\n\n3. 可读性（20%）：\n   - 代码格式\n   - 命名规范\n   - 注释完整性\n\n4. 最佳实践（30%）：\n   - 设计模式\n   - 单元测试\n   - 类型提示\n   - SOLID原则\n\n## 评分规则\n\n- 安全问题：\n  - 高危：-3分/个\n  - 中危：-1分/个\n- 性能问题：-2分/个\n- 可读性问题：-0.5分/个\n- 最佳实践：\n  - 缺少单元测试：-2分\n  - 无类型提示：-1分\n\n## 配置文件\n\n系统使用YAML格式的配置文件（`config.yaml`）：\n\n```yaml\nscm:\n  type: gitea\n  url: https://git.example.com\n  token: xxxx-xxxx\n  context_window: 5\n\nllm:\n  provider: openai\n  model: gpt-4-turbo\n  api_key: sk-xxxx\n  max_tokens: 4096\n\nreview:\n  quality_threshold: 8.5\n  ignore_patterns:\n    - \"*.md\"\n    - \"**/test_*.py\"\n  scoring_rules:\n    security: 0.3\n    performance: 0.2\n    readability: 0.2\n    best_practice: 0.3\n```\n\n## 开发\n\n1. 代码结构：\n```\napp/\n├── core/           # 核心功能\n│   ├── agent.py    # 评审Agent\n│   └── scm.py      # SCM抽象层\n├── models/         # 数据模型\n│   └── config.py   # 配置模型\n├── routers/        # API路由\n│   ├── webhooks.py # Webhook处理\n│   └── config_ui.py# 配置界面\n├── services/       # 服务\n│   └── llm_service.py # LLM服务\n├── static/         # 静态资源\n├── templates/      # 模板\n│   └── config.html # 配置页面\n└── main.py         # 应用入口\n```\n\n2. 添加新功能：\n   - 在相应模块中添加代码\n   - 确保添加适当的测试\n   - 遵循项目的代码风格\n\n## 贡献\n\n欢迎提交Pull Request！在提交之前，请确保：\n\n1. 代码通过所有测试\n2. 添加了必要的文档\n3. 遵循项目的代码规范\n\n## 许可证\n\nMIT License ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhighkay%2Fcodereview-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhighkay%2Fcodereview-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhighkay%2Fcodereview-agent/lists"}