CLSkills
Git & Version Controlbeginner

Repo Stats

Share

Generate repository statistics (contributors, commit frequency, file changes)

Repo Stats

Generate repository statistics (contributors, commit frequency, file changes)

Generate repository statistics and visualize contribution patterns.

Instructions

  1. Contributor statistics:
git shortlog -sn --all --no-merges    # commits per author
git log --format='%aN' | sort | uniq -c | sort -rn | head -10
  1. Commit frequency:
# Commits per day of week
git log --format='%ad' --date=format:'%A' | sort | uniq -c | sort -rn

# Commits per month
git log --format='%ad' --date=format:'%Y-%m' | sort | uniq -c

# Commits per hour (find peak coding hours)
git log --format='%ad' --date=format:'%H' | sort | uniq -c | sort -rn
  1. File change frequency (find hotspots):
git log --pretty=format: --name-only | sort | uniq -c | sort -rn | head -20
  1. Code churn (lines added/removed):
git log --shortstat --since="1 month ago" | grep "files changed" | \
  awk '{i+=$4; d+=$6} END {print "Added:", i, "Deleted:", d}'
  1. Repository age and size:
echo "First commit:" $(git log --reverse --format='%ai' | head -1)
echo "Total commits:" $(git rev-list --count HEAD)
echo "Branches:" $(git branch -a | wc -l)
echo "Tags:" $(git tag | wc -l)

Output Format

Present as a formatted summary with key insights (e.g., "most active day is Tuesday", "src/api/ has the most churn").

Quick Info

Difficultybeginner
Version1.0.0
AuthorClaude Skills Hub
gitstatisticsanalytics

Install command:

curl -o ~/.claude/skills/repo-stats.md https://claude-skills-hub.vercel.app/skills/git/repo-stats.md