skills/1natsu172/git-analysis/SKILL.md
Analyze git repository changes, branch differences, and commit history. Use when analyzing branches, comparing changes, examining commit history, or preparing for PR/commit operations.
npx skillsauth add aiskillstore/marketplace git-analysisInstall 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.
This Skill provides comprehensive git repository analysis capabilities for understanding branch changes, commit history, and code differences.
Use this Skill when you need to:
Get the repository's default branch (usually main or master):
git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'
This identifies the base branch for comparison.
Determine where the current branch diverged from the default branch:
# Get merge base
git merge-base origin/<default-branch> HEAD
The merge base is the commit where the branch diverged, not the current state of the base branch.
Get comprehensive change information:
# List commits from merge base
git log --oneline <merge-base>..HEAD
# Get detailed commit information
git log --format="%H|%s|%an|%ae|%ad" --date=iso <merge-base>..HEAD
# Get file statistics
git diff --stat <merge-base>..HEAD
# Get full diff
git diff <merge-base>..HEAD
Understand unstaged and staged changes:
# Check untracked files
git status
# Check staged changes
git diff --cached
# Check unstaged changes
git diff
This Skill includes helper scripts for common operations:
Extracts branch differences including:
Usage:
bash scripts/get_branch_diff.sh
Output format:
DEFAULT_BRANCH: main
MERGE_BASE: abc123def456
COMMITS: 5
CHANGED_FILES: 12
Extracts detailed commit history in structured format:
Usage:
bash scripts/get_commit_history.sh <merge-base>
Output format (one commit per line):
hash|subject|author_name|author_email|date
# Get all information in parallel
git status &
git diff --cached &
git diff &
DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')
MERGE_BASE=$(git merge-base origin/$DEFAULT_BRANCH HEAD)
git log --oneline $MERGE_BASE..HEAD
git diff --stat $MERGE_BASE..HEAD
wait
# Get structured commit data
MERGE_BASE=$(git merge-base origin/$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@') HEAD)
git log --format="%H|%s|%an|%ae|%ad" --date=iso $MERGE_BASE..HEAD
# Get high-level change summary
MERGE_BASE=$(git merge-base origin/$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@') HEAD)
echo "Commits: $(git log --oneline $MERGE_BASE..HEAD | wc -l)"
echo "Files changed: $(git diff --stat $MERGE_BASE..HEAD | tail -1)"
This Skill works well with:
github-pr-best-practices: Use git analysis results to generate PR contentHandle common git errors:
# Check if in git repository
if ! git rev-parse --git-dir > /dev/null 2>&1; then
echo "Error: Not in a git repository"
exit 1
fi
# Check if remote exists
if ! git ls-remote origin > /dev/null 2>&1; then
echo "Error: Remote 'origin' not found"
exit 1
fi
# Check if branch has commits
if [ -z "$(git log --oneline $MERGE_BASE..HEAD)" ]; then
echo "Warning: No commits found in branch"
fi
When presenting git analysis results:
Example output structure:
Branch Analysis Summary
-----------------------
Base branch: main
Current branch: feature/new-feature
Diverged at: abc123d (2025-01-15)
Changes:
- 5 commits
- 12 files changed
- 234 insertions, 89 deletions
Recent commits:
1. feat(api): add new endpoint (2025-01-16)
2. test(api): add endpoint tests (2025-01-16)
3. docs(api): update API documentation (2025-01-17)
...
See REFERENCE.md for detailed git command documentation and advanced usage patterns.
development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.