agent-ops-git-analysis

Analyze git repository for insights: contributor stats, commit patterns, branch health, and change analysis. Outputs actionable reports.

16 stars

Best use case

agent-ops-git-analysis is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Analyze git repository for insights: contributor stats, commit patterns, branch health, and change analysis. Outputs actionable reports.

Teams using agent-ops-git-analysis should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/agent-ops-git-analysis/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/cli-automation/agent-ops-git-analysis/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/agent-ops-git-analysis/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How agent-ops-git-analysis Compares

Feature / Agentagent-ops-git-analysisStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Analyze git repository for insights: contributor stats, commit patterns, branch health, and change analysis. Outputs actionable reports.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Git Analysis Skill

Generate repository insights and health reports from git history.

## Commands

All analysis uses standard `git` commands. No external dependencies required.

### Quick Stats

```bash
# Total commits
git rev-list --count HEAD

# Contributors count
git shortlog -sn --all | wc -l

# First and last commit dates
git log --reverse --format=%ci | head -1
git log -1 --format=%ci

# Files in repository
git ls-files | wc -l

# Lines of code (approximate)
git ls-files | xargs wc -l 2>/dev/null | tail -1
```

### Contributor Analysis

```bash
# Commits per author
git shortlog -sn --all

# Commits per author (last 30 days)
git shortlog -sn --since="30 days ago"

# Most active files by author
git log --author="Name" --name-only --pretty=format: | sort | uniq -c | sort -rn | head -20
```

### Commit Patterns

```bash
# Commits by day of week
git log --format=%ad --date=format:%A | sort | uniq -c | sort -rn

# Commits by hour
git log --format=%ad --date=format:%H | sort | uniq -c | sort -n

# Commits per month (last year)
git log --since="1 year ago" --format=%ad --date=format:%Y-%m | sort | uniq -c

# Average commits per day (last 30 days)
# commits / 30
```

### Branch Health

```bash
# List all branches with last commit date
git for-each-ref --sort=-committerdate refs/heads/ --format='%(committerdate:short) %(refname:short)'

# Stale branches (no commits in 90 days)
git for-each-ref --sort=committerdate refs/heads/ --format='%(committerdate:iso) %(refname:short)' | while read date branch; do
  if [[ $(date -d "$date" +%s) -lt $(date -d "90 days ago" +%s) ]]; then
    echo "STALE: $branch (last: $date)"
  fi
done

# Merged branches (candidates for deletion)
git branch --merged main | grep -v main

# Branches ahead/behind main
git for-each-ref --format='%(refname:short) %(upstream:track)' refs/heads
```

### Large Files Detection

```bash
# Find large files in history
git rev-list --objects --all | \
  git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' | \
  sed -n 's/^blob //p' | \
  sort -rnk2 | \
  head -20

# Current large files
git ls-files | xargs ls -la 2>/dev/null | sort -rnk5 | head -20
```

### Change Analysis

```bash
# Files most frequently changed (churn)
git log --name-only --pretty=format: | sort | uniq -c | sort -rn | head -20

# Recent hotspots (last 30 days)
git log --since="30 days ago" --name-only --pretty=format: | sort | uniq -c | sort -rn | head -20

# Diff stats between branches
git diff --stat main..feature-branch

# Changed files between commits
git diff --name-status <commit1> <commit2>
```

## Report Templates

### Quick Health Report

```markdown
# Repository Health Report
Generated: {date}

## Overview
- **Total Commits**: {count}
- **Contributors**: {count}
- **Age**: {first_commit_date} to {last_commit_date}
- **Files**: {file_count}

## Activity (Last 30 Days)
- Commits: {count}
- Active Contributors: {count}
- Most Changed Files:
  1. {file} ({changes} changes)
  2. ...

## Branch Status
- Active Branches: {count}
- Stale Branches (>90 days): {count}
- Merged (deletable): {count}

## Hotspots
Files with highest churn (potential refactoring candidates):
1. {file} - {change_count} changes
2. ...

## Recommendations
- {recommendations}
```

### Contributor Report

```markdown
# Contributor Activity Report
Generated: {date}
Period: {start_date} to {end_date}

## Summary
| Contributor | Commits | Lines Added | Lines Removed |
|-------------|---------|-------------|---------------|
| {name}      | {count} | +{added}    | -{removed}    |

## Activity by Day
{chart or table}

## Focus Areas
Most modified files per contributor...
```

### Diff Report

```markdown
# Change Analysis: {branch1} → {branch2}
Generated: {date}

## Summary
- Files Changed: {count}
- Lines Added: +{added}
- Lines Removed: -{removed}

## Changed Files
| File | Status | +/- |
|------|--------|-----|
| {path} | Modified | +{a}/-{r} |

## High-Impact Changes
Files with >100 lines changed...
```

## Invocation

When user asks for repository analysis:

1. **Determine scope**:
   - Full repository or specific branch?
   - Time period (all time, last N days)?
   - Focus area (contributors, health, changes)?

2. **Run appropriate commands**

3. **Generate report** using templates above

4. **Highlight actionable items**:
   - Stale branches to delete
   - Large files to consider removing
   - High-churn files that may need refactoring
   - Missing recent activity

## Example Invocations

**User**: "How healthy is this repo?"
→ Generate Quick Health Report

**User**: "Who's been most active this month?"
→ Generate Contributor Report for last 30 days

**User**: "What changed between main and feature-x?"
→ Generate Diff Report

**User**: "Any branches we should clean up?"
→ Run branch health commands, list candidates

## Notes

- All commands work with standard git (no external tools required)
- Commands are cross-platform (adjust date commands for Windows)
- Large repositories may need pagination/sampling for performance
- Respect `.gitignore` when analyzing files

Related Skills

deep-codebase-analysis

16
from diegosouzapw/awesome-omni-skill

Agent capable of reading and analyzing the entire source code of a software project to gain a thorough understanding of architecture, communication, design patterns, and business flows. Use when exploring new systems, maintenance, or refactoring.

dataql-analysis

16
from diegosouzapw/awesome-omni-skill

Analyze data files using SQL queries with DataQL. Use when working with CSV, JSON, Parquet, Excel files or when the user mentions data analysis, filtering, aggregation, or SQL queries on files.

analysis

16
from diegosouzapw/awesome-omni-skill

Docent is a platform for analyzing AI agent behavior using large language models. Use this skill anytime you want to use Docent to analyze AI agent behavior.

analysis-report

16
from diegosouzapw/awesome-omni-skill

Generates comprehensive, structured research reports.

azure-ai-vision-imageanalysis-java

16
from diegosouzapw/awesome-omni-skill

Build image analysis applications with Azure AI Vision SDK for Java. Use when implementing image captioning, OCR text extraction, object detection, tagging, or smart cropping.

article-analysis

16
from diegosouzapw/awesome-omni-skill

Analyze blog posts and web articles by fetching content from URLs. Use when the user mentions blog post, article, Substack, Medium, web page, newsletter, or provides a URL to analyze.

order-analysis

16
from diegosouzapw/awesome-omni-skill

分析产品升级工单,识别共性问题并提出产品改进建议。通过 agent-browser工具 访问工单系统,提取工单数据,进行问题分类、趋势分析和根因定位,输出改进方案。

adaptive-temporal-analysis-integration

16
from diegosouzapw/awesome-omni-skill

Integrate adaptive temporal analysis for drift detection.

market-sizing-analysis

16
from diegosouzapw/awesome-omni-skill

This skill should be used when the user asks to \\\"calculate TAM\\\", "determine SAM", "estimate SOM", "size the market", "calculate market opportunity", "what's the total addressable market", or...

Schema Evolution Impact Analysis

16
from diegosouzapw/awesome-omni-skill

Analyze the impact of model/schema changes on downstream code — affected repositories, services, handlers, tests, and migration requirements

performing-ip-reputation-analysis-with-shodan

16
from diegosouzapw/awesome-omni-skill

Analyze IP address reputation using the Shodan API to identify open ports, running services, known vulnerabilities, and hosting context for threat intelligence enrichment and incident triage.

apify-trend-analysis

16
from diegosouzapw/awesome-omni-skill

Discover and track emerging trends across Google Trends, Instagram, Facebook, YouTube, and TikTok to inform content strategy.