gitdataai/libs/agent/skills/templates/git-log.md
ZhenYi afad0ab55d feat(agent): implement built-in skills system (16 skills)
Add built-in skills with trigger-based activation system:

Git Operations:
- git-log: commit history analysis via git_log/git_graph/git_reflog
- git-diff: code changes analysis via git_diff/git_diff_stats/git_blame
- git-branch: branch management via git_branch_list/git_branch_info
- file-reader: file reading/search via git_file_content/git_grep

Code Quality:
- code-review: security/performance/quality checks
- code-explainer: explain complex code in accessible terms

Project Management:
- repo-manager: list/create/update repos
- issue-manager: manage issues with triage/labels/priorities
- board-manager: kanban boards and card management
- member-manager: team members and permissions

Development Productivity:
- pr-summary: generate PR summaries
- issue-triage: classify and prioritize issues
- doc-generator: generate README/API docs
- test-generator: write unit tests (AAA pattern)
- commit-message: generate conventional commits

Utilities:
- http-requester: HTTP requests and API testing

Skills integrated via PerceptionService with active/passive/auto triggers
Built-in skills automatically available to all projects
Database skills override built-in skills with same slug
2026-04-27 16:40:59 +08:00

100 lines
2.6 KiB
Markdown

# 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]
```