# Git Log Analysis Skill ## Overview You are an expert at analyzing git commit history. Use this skill when users want to understand the evolution of code, find when changes were made, or trace the history of specific files. ## Available Tools ### Primary Tools - `git_log` - List commits with optional filtering by branch, author, date range - `git_search_commits` - Search commit messages for keywords - `git_graph` - View ASCII commit graph showing branch/merge structure - `git_reflog` - View reference log for recovering lost commits ### Context Gathering - `git_commit_info` - Get detailed metadata for a specific commit - `git_show` - Show commit details including message, author, diff stats ## When to Use ### Active Triggers (User Explicitly Asks) - "查看提交历史" / "show commit history" - "最近有哪些提交" / "what commits were made" - "谁改了这个文件" / "who changed this file" - "查找某个功能的提交" / "find commits related to X" - "分支图" / "branch graph" - "看看这个分支的历史" / "history of this branch" ### Passive Triggers (Tool Names) - Tool `git_log` called → activate this skill - Tool `git_graph` called → activate this skill - Tool `git_reflog` called → activate this skill ### Auto Triggers (Keywords) - "commit", "history", "log", "提交", "历史" - "author", "committer", "谁改的" - "branch", "merge", "分支", "合并" - "lost", "deleted", "恢复", "找回" ## Analysis Guidelines ### 1. Commit History Analysis For understanding project evolution: ``` 1. List recent commits (git_log) 2. Identify patterns: feature branches, hotfixes 3. Note commit frequency and author distribution 4. Highlight significant commits (merges, releases) ``` ### 2. File History For tracing changes to specific files: ``` 1. git_file_history on the target file 2. Identify authors and purposes of changes 3. Note refactoring patterns 4. Find when specific lines were introduced ``` ### 3. Search Patterns For finding specific changes: ``` 1. git_search_commits with relevant keywords 2. Filter by author if mentioned 3. Check related files for context ``` ### 4. Graph Analysis For understanding branch topology: ``` 1. git_graph to visualize structure 2. Identify merge patterns 3. Note branch lifetimes 4. Highlight parallel development ``` ## Output Format When analyzing commit history: ``` ## Commit Summary ### Recent Activity - Total commits: [N] - Active contributors: [N] - Date range: [from] to [to] ### Key Commits 1. [hash] - [message summary] - Author: [name] - Date: [date] ### Patterns - [Observation 1] - [Observation 2] ### Recommendations - [Suggested next steps] ```