skills/git-xray/SKILL.md
Run diagnostic git commands to assess a codebase's health before reading any code. Use this skill whenever the user asks you to understand a new codebase, audit a repo, assess technical debt, find risky code, check project health, figure out where to start reading, identify bus factor risks, or explore an unfamiliar repository. Also use it when the user asks 'what's going on in this repo', 'where are the problem areas', 'give me a health check', or 'what should I look at first'. If the user wants to understand a codebase at a strategic level before diving into code, this is the skill to use.
npx skillsauth add nibzard/skills-kit git-xrayInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Before reading a single line of code, run five diagnostic git commands to build a strategic picture of the repository. These commands reveal which files are hotspots, who built what, where bugs cluster, whether the project has momentum, and how often the team is firefighting. The whole process takes under a minute and transforms your initial exploration from random wandering into targeted investigation.
This approach is based on the insight that commit history is a behavioral record of a codebase — it tells you what actually happened, not what the architecture docs claim happened.
Inspired by: Five git commands that tell you where a codebase hurts before you open a single file by Ally Piechowski.
Run these five commands in order. Each builds on the picture from the previous ones.
git log --format=format: --name-only --since="1 year ago" | sort | uniq -c | sort -nr | head -20
This surfaces the 20 most-modified files in the past year. High-churn files often indicate areas people are afraid to touch properly — they keep getting patched rather than fixed. A 2005 Microsoft Research study found that churn-based metrics predicted defects more reliably than complexity metrics.
Adapt the time window: If the repo is younger than a year, drop --since entirely. If it's very large or very old, 1 year is a good default. Check repo age first:
git log --reverse --format='%ad' --date=short | head -1
git shortlog -sn --no-merges
This ranks contributors by commit count across the full history.
Then check recent activity:
git shortlog -sn --no-merges --since="6 months ago"
What to look for:
Caveat: Squash-merge workflows compress multiple authors into one committer. If you see suspiciously uniform authorship, note this limitation.
git log -i -E --grep="fix|bug|broken" --name-only --format='' | sort | uniq -c | sort -nr | head -20
This maps files by how often they appear in bug-related commits.
The key cross-reference: Compare this list against the churn list from step 1. Files appearing on both lists are the highest-risk code in the repository — they're repeatedly patched but never properly resolved. Flag these prominently.
Limitation: This only works as well as the team's commit message discipline. If commit messages are vague or inconsistent, this command will undercount.
git log --format='%ad' --date=format:'%Y-%m' | sort | uniq -c
This shows commit frequency by month across the project's full history.
Patterns to identify:
git log --oneline --since="1 year ago" | grep -iE 'revert|hotfix|emergency|rollback'
This counts reverts, hotfixes, and emergency deployments.
Interpretation: Frequent entries here point to systemic issues — weak testing, inadequate staging environments, or a deployment process that makes people nervous. This is about process health, not individual blame.
After running all five commands, produce a structured report. The value isn't in the raw numbers — it's in the cross-references and the story they tell together.
# Git X-Ray: [repo name]
## Top Findings
[2-3 bullet points with the most important/actionable discoveries]
## Churn Hotspots
[Top 10 most-changed files, with notes on any that also appear in the bug list]
## Contributor Landscape
[Total contributors, bus factor assessment, recent vs historical contributors]
## Bug Clusters
[Top bug-associated files, with cross-reference to churn list]
[Files on BOTH lists get a ⚠️ flag — these are the highest-priority investigation targets]
## Project Momentum
[Trend description: accelerating, steady, declining, or irregular]
[Notable inflection points with approximate dates]
## Stability & Firefighting
[Revert/hotfix count and frequency]
[Assessment of deployment/testing health]
## Recommended Reading Order
[Based on all the above, suggest which files/areas to investigate first and why]
The "Recommended Reading Order" section is the payoff — it turns the diagnostics into a concrete action plan for where to start reading code.
-- path/to/subdirectory if the user is interested in a specific area.content-media
Fetch transcripts from YouTube videos. Use when user asks to get, download, extract, or retrieve YouTube video transcripts, captions, or subtitles. Also activates for video content analysis, summarizing YouTube videos, or processing video content.
tools
Use tmux to run and test our interactive CLI/TUI end-to-end. Includes how to start, send keys, capture output, and cleanly stop (double Ctrl+C).
development
Create new Agent Skills interactively or from templates. Use when user wants to create, generate, scaffold, or build a new skill, or mentions creating skills, writing skills, skill templates, skill development.
development
Universal release workflow: detect project type, init versioning if needed, run tests, bump version, tag, push, and create GitHub release. Works with Python, Go, Node.js, Rust, Java, .NET, Ruby, PHP, and multi-language projects.