git-code-review
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGit Code Review
Git代码评审
This skill analyzes git commit history for specified users and generates comprehensive code review reports. It fetches commit data, analyzes changes, and provides structured feedback on code quality, best practices, and potential improvements.
本Skill会分析指定用户的Git提交历史,并生成全面的代码评审报告。它会获取提交数据、分析变更内容,针对代码质量、最佳实践以及潜在改进点提供结构化反馈。
Capabilities
功能特性
- User-Specific Git History: Fetch commit history for one or multiple users
- Time-Based Filtering: Filter commits by days (defaults to current day)
- Commit Analysis: Analyze each commit's changes, additions, and deletions
- File-Level Summaries: Summarize changes organized by file
- Line-by-Line Review: Provide detailed feedback on specific code changes
- Report Generation: Create structured markdown reports with recommendations
- Automated Reporting: Save reports to organized directory structure
- 特定用户的Git历史: 获取一个或多个用户的提交历史
- 基于时间的过滤: 按天数过滤提交(默认值为当天)
- 提交分析: 分析每个提交的变更、新增和删除内容
- 文件级汇总: 按文件整理并汇总变更内容
- 逐行评审: 针对具体代码变更提供详细反馈
- 报告生成: 创建带有建议的结构化Markdown报告
- 自动化报告: 将报告保存到规整的目录结构中
Input Requirements
输入要求
Required Parameters:
- User Names: One or multiple git usernames, separated by commas (e.g., "john,mary,alex")
- Days: Optional number of days to look back (defaults to current day)
Data Sources:
- Current git repository must be initialized
- Git command-line tools must be available
- User must have read access to git history
Format:
- Text-based invocation with parameters
- Can be called via Claude interface with user specifications
必填参数:
- 用户名: 一个或多个Git用户名,用逗号分隔(例如:"john,mary,alex")
- 天数: 可选的回溯天数(默认值为当天)
数据来源:
- 当前必须已初始化Git仓库
- 必须具备Git命令行工具
- 用户必须拥有Git历史的读取权限
格式:
- 带参数的文本调用
- 可通过Claude界面并结合用户指定的参数进行调用
Output Formats
输出格式
Report Files:
- Format: Markdown (.md)
- Naming: (e.g.,
username-date.md)john-2025-12-14.md - Location:
current-repo/.claude/git_code_review/
Report Structure:
- Summary: Overview of commits analyzed
- File-Level Analysis: Changes organized by file
- Commit Details: Individual commit analysis
- Line-by-Line Review: Specific code change feedback
- Recommendations: Actionable improvement suggestions
- Best Practices: Relevant coding standards guidance
Content Includes:
- Code snippets with highlighted changes
- Quality assessment scores
- Potential issues flagged
- Performance considerations
- Security implications
- Maintainability suggestions
报告文件:
- 格式: Markdown (.md)
- 命名规则: (例如:
username-date.md)john-2025-12-14.md - 存储位置:
current-repo/.claude/git_code_review/
报告结构:
- 摘要: 已分析提交的概述
- 文件级分析: 按文件整理的变更内容
- 提交详情: 单个提交的分析内容
- 逐行评审: 针对具体代码变更的反馈
- 改进建议: 可落地的优化建议
- 最佳实践: 相关编码规范指导
内容包含:
- 带有高亮变更的代码片段
- 质量评估分数
- 标记出的潜在问题
- 性能考量
- 安全影响
- 可维护性建议
How to Use
使用方法
"Review git commits for users 'john,mary' from the last 3 days"
"Generate code review report for user 'alex' for today's commits"
"Analyze all commits by 'sarah' and 'mike' this week"
"Get detailed code review for current user's recent changes"
"评审用户'john,mary'过去3天的Git提交"
"为用户'alex'今天的提交生成代码评审报告"
"分析'sarah'和'mike'本周的所有提交"
"获取当前用户近期变更的详细代码评审"
Scripts
脚本
- : Main script for fetching git history, analyzing commits, and generating reports
git_code_review.py
- : 用于获取Git历史、分析提交并生成报告的主脚本
git_code_review.py
Best Practices
最佳实践
- Repository Context: Run from within the git repository you want to analyze
- User Validation: Ensure usernames match git commit author names
- Time Windows: Use reasonable day ranges to avoid overwhelming reports
- Review Focus: Prioritize recent changes for most relevant feedback
- Follow-up: Use reports as starting points for team discussions
- 仓库上下文: 在要分析的Git仓库内运行本Skill
- 用户验证: 确保用户名与Git提交作者名匹配
- 时间范围: 使用合理的天数范围,避免报告内容过多
- 评审重点: 优先关注近期变更以获取最相关的反馈
- 后续跟进: 将报告作为团队讨论的起点
Limitations
局限性
- Requires git repository with commit history
- Limited to commit metadata and diff analysis
- Cannot analyze unstaged or uncommitted changes
- Performance may degrade with very large commit histories
- Analysis is based on commit diffs only (no runtime behavior analysis)
- Some git configurations may affect user name matching accuracy
- Binary files are not analyzed for content changes
- 需要带有提交历史的Git仓库
- 仅局限于提交元数据和差异分析
- 无法分析未暂存或未提交的变更
- 当提交历史非常庞大时,性能可能会下降
- 分析仅基于提交差异(不包含运行时行为分析)
- 部分Git配置可能会影响用户名匹配的准确性
- 不会分析二进制文件的内容变更