← Back to Skills Marketplace
zlszhonglongshen

ai-pr-analysis-companion

by zlszhonglongshen · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
72
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install ai-pr-analysis-companion
Description
AI 智能代码变更分析助手 — 自动分析 GitHub PR 改动范围、技术债务、测试覆盖风险,生成结构化评审报告
README (SKILL.md)

AI 智能代码变更分析助手

GitHub PR 链接 → 自动抓取代码变更 → AI 结构化分析 → 技术债务识别 + 风险评估 + 评审建议 → 飞书报告输出

🎯 解决痛点

  • ❌ PR 代码量大时,人工 review 精力有限,容易遗漏关键问题
  • ❌ 改动涉及多个模块,不知道哪些地方需要重点关注
  • ❌ 新人 review 不熟悉代码库,很难判断改动的影响范围
  • ❌ 评审没有结构性,全凭个人经验,结果参差不齐
  • ❌ 技术债务无法量化,项目越来越难维护

💡 解决方案

[GitHub PR URL]
          ↓
┌──────────────────────┐
│  github             │ → 抓取 PR diff、文件列表、评论历史
└────────┬─────────────┘
         │ PR 元数据 + 变更摘要
   ┌─────▼──────────┐
   │  summarize     │ → AI 结构化分析:改动类型/影响范围/风险点
   └─────┬──────────┘
         │ 分析结果
   ┌─────▼──────────────────┐
   │  code-review-skill      │ → 聚焦代码质量问题、测试覆盖、潜在 Bug
   └─────┬──────────────────┘
         │ 评审结论
   ┌─────▼──────────┐
   │  feishu_doc    │ → 生成结构化报告,发布至飞书文档
   └───────────────┘

📦 包含 Skills

Skill 作用 调用时机
github 抓取 PR diff、文件列表、评论历史 Step 1
summarize AI 结构化分析:改动类型、影响范围、风险点识别 Step 2
code-review-skill 聚焦代码质量、测试覆盖、潜在 Bug 检测 Step 3
feishu_doc 生成结构化报告并发布至飞书文档 Step 4

🔧 前置要求

  1. github CLI:已配置 gh auth login
  2. 飞书机器人:已配置 feishu_doc 写入权限

📝 使用方法

触发方式

分析PR \x3CGitHub PR URL>
代码变更分析 \x3CPR链接>
PR评审 \x3CPR地址>

完整示例

输入:

分析PR https://github.com/owner/repo/pull/123

执行流程:

  1. Step 1 PR 数据抓取(github)

    • gh pr view 123 --repo owner/repo --json title,body,files,additions,deletions,changedFiles
    • gh pr diff 123 --repo owner/repo 获取完整 diff
    • gh api repos/owner/repo/pulls/123/comments 抓取历史评论
  2. Step 2 结构化分析(summarize)

    • 分析改动的模块和文件,识别影响范围
    • 识别高风险改动:数据库迁移、认证逻辑、并发处理、API 契约变更
    • 量化改动规模:文件数、行数增删、涉及语言/框架
  3. Step 3 代码质量评审(code-review-skill)

    • 分析代码风格、命名规范、安全隐患
    • 评估测试覆盖是否充分
    • 指出潜在 Bug、性能问题、边界 case 遗漏
    • 识别技术债务:重复代码、硬编码、缺少注释
  4. Step 4 报告生成与发布(feishu_doc)

    • 生成结构化评审报告,包含:
      • PR 基本信息摘要
      • 改动范围量化
      • 风险评级(高/中/低)
      • 问题清单与修复建议
      • 技术债务评估
    • 发布至飞书文档,支持团队协作评论

📊 报告模板

# PR 评审报告

## 基本信息
- **PR 标题**:xxx
- **作者**:xxx
- **改动规模**:+xxx/-xxx 行,xx 个文件
- **评审时间**:yyyy-mm-dd

## 改动范围摘要
[AI 提取的核心改动说明]

## 风险评级
🟡 中等风险
- 涉及认证模块改动
- 缺少新增功能的单元测试

## 问题清单
1. **[高]** xxx 文件第 xx 行:潜在空指针风险
2. **[中]** xxx 文件:硬编码配置应抽取至配置文件

## 技术债务
- 发现 2 处重复代码,建议抽取为公共方法
- xxx 模块缺少注释,建议补充文档

## 总结建议
[综合评价与合并建议]

风险评级标准

级别 说明 触发条件
🔴 高风险 需重点审查,可能影响线上稳定性 涉及 DB 迁移、认证/鉴权、支付、并发
🟡 中风险 建议关注,可能存在隐藏问题 涉及核心业务逻辑、公共模块改动
🟢 低风险 改动较小或仅有文档/测试更新 仅文档修改、测试补充、依赖更新

⚙️ 配置说明

如需分析私有仓库 PR,需确保:

gh auth login --hostname github.com
gh auth status
Usage Guidance
Before installing, make sure your team is comfortable sending PR-derived analysis to Feishu. For private or security-sensitive repositories, confirm the Feishu document destination and access controls, and avoid publishing reports that contain secrets or proprietary details beyond the intended audience.
Capability Assessment
Purpose & Capability
The requested capabilities fit the stated purpose: fetch PR metadata, diffs, and comments; analyze code review risk; and publish a report to Feishu.
Instruction Scope
The workflow clearly describes full diff/comment collection and Feishu publication, but it could be clearer that private code, review discussion, and derived findings may be included in the external report.
Install Mechanism
The package contains only Markdown and JSON workflow files, with no executable installer, dependency install script, or obfuscated setup behavior.
Credentials
Use of GitHub CLI authentication and Feishu document write permissions is proportionate for a PR-review reporting skill and is disclosed as a prerequisite.
Persistence & Privilege
No local persistence, privilege escalation, or background process is present; generated reports may persist in Feishu according to that workspace's document permissions.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install ai-pr-analysis-companion
  3. After installation, invoke the skill by name or use /ai-pr-analysis-companion
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
ai-pr-analysis-companion 1.0.0 — 首发版本 - 自动抓取 GitHub PR 及其 diff、评论等元数据 - 通过 AI 结构化分析改动类型、影响范围与风险点 - 重点识别技术债务、代码潜在问题与测试覆盖风险 - 一键生成标准化评审报告,并支持发布到飞书文档 - 自定义触发语句,便于集成团队代码评审流程
Metadata
Slug ai-pr-analysis-companion
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is ai-pr-analysis-companion?

AI 智能代码变更分析助手 — 自动分析 GitHub PR 改动范围、技术债务、测试覆盖风险,生成结构化评审报告. It is an AI Agent Skill for Claude Code / OpenClaw, with 72 downloads so far.

How do I install ai-pr-analysis-companion?

Run "/install ai-pr-analysis-companion" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is ai-pr-analysis-companion free?

Yes, ai-pr-analysis-companion is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does ai-pr-analysis-companion support?

ai-pr-analysis-companion is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created ai-pr-analysis-companion?

It is built and maintained by zlszhonglongshen (@zlszhonglongshen); the current version is v1.0.0.

💬 Comments