본문으로 건너뛰기
cccskills
무료GitHub에 공개

git-analysis

Analyze git repository changes, branch differences, and commit history. Use when analyzing branches, comparing changes, examining commit history, or preparing for PR/commit operations.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(5)

  • SKILL.md5.4 KB
  • REFERENCE.md10.0 KB
  • scripts/get_branch_diff.sh1.6 KB
  • scripts/get_commit_history.sh1.1 KB
  • skill-report.json97.7 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Git Analysis

This Skill provides comprehensive git repository analysis capabilities for understanding branch changes, commit history, and code differences.

Capabilities

  • Analyze branch differences and merge bases
  • Extract structured commit history
  • Identify changed files and their statistics
  • Determine default branches and remote configuration
  • Support PR creation, code review, and commit operations

When to Use

Use this Skill when you need to:

  • Analyze what changed in a branch
  • Prepare information for PR creation
  • Review commit history
  • Compare branches
  • Understand code changes for commits or reviews

Core Analysis Steps

1. Identify Default Branch

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.

2. Find Merge Base

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.

3. Analyze Changes

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

4. Check Current State

Understand unstaged and staged changes:

# Check untracked files
git status

# Check staged changes
git diff --cached

# Check unstaged changes
git diff

Helper Scripts

This Skill includes helper scripts for common operations:

get_branch_diff.sh

Extracts branch differences including:

  • Default branch name
  • Merge base commit
  • Commit list with statistics
  • Changed files summary

Usage:

bash scripts/get_branch_diff.sh

Output format:

DEFAULT_BRANCH: main
MERGE_BASE: abc123def456
COMMITS: 5
CHANGED_FILES: 12

get_commit_history.sh

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

Best Practices

  1. Always use merge-base: Compare from merge base, not from current base branch state
  2. Run commands in parallel: When gathering multiple pieces of information, run independent git commands in parallel
  3. Structure the output: Parse git output into structured data for easier consumption
  4. Handle errors gracefully: Check if commands succeed before proceeding

Common Patterns

Pattern 1: Full Branch Analysis

# 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

Pattern 2: Commit History Extraction

# 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

Pattern 3: Change Summary

# 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)"

Integration with Other Skills

This Skill works well with:

  • github-pr-best-practices: Use git analysis results to generate PR content
  • Commit message generation: Analyze changes to create meaningful commit messages
  • Code review: Understand what changed for review purposes

Error Handling

Handle 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

Output Format Recommendations

When presenting git analysis results:

  1. Summary first: Start with high-level statistics
  2. Structured data: Use consistent formatting for easy parsing
  3. Contextual information: Include branch names and dates
  4. Actionable insights: Highlight what's important for the task

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)
...

Related Git Commands Reference

See REFERENCE.md for detailed git command documentation and advanced usage patterns.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials, and use cases from Claude Academy (academy.claude.com), Anthropic's learning hub. Trigger on: "how do I", "how can I", "getting started with", "what can Claude do", "teach me", "learn to use"; questions about artifacts, projects, skills, plugins, connectors, MCP; requests about rolling Claude out to a team, class, or organization; and any ask for training materials, onboarding content, or learning resources. Use it when the user is learning how to use a feature or product — not when they are mid-task and just want the task done. This skill composes with other skills: after consulting product documentation to answer how a Claude feature works, also check here for a matching course or tutorial — a docs-grounded answer and an Academy recommendation belong together. Only recommend on a strong match; never invent Academy content.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aiskillstore/marketplace4422026년 10월 21일 업데이트

Trigger for: explaining current FAR, DFARS, or agency-supplement text; determining documented acquisition-policy status for an agency and FAR part; comparing codified text, RFO model text, and agency deviations; tracing acquisition rulemaking; finding procurement comment periods; analyzing public comments; refreshing prior policy analysis; or producing an Acquisition Policy Impact Brief. Use published federal sources and supplied policy documents without making legal or procurement-specific applicability determinations. Do not use for clause selection, market research execution, opportunities, pricing, grants, or cooperative agreements.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aiskillstore/marketplace4422026년 10월 21일 업데이트

Systematic framework for extracting actionable items from documents and organizing them into prioritized, trackable checklists. Use when converting reports, meeting notes, audits, or any document with embedded action items into structured TODO lists.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aiskillstore/marketplace4422026년 10월 21일 업데이트

Browser automation for AI agents via inference.sh. Navigate web pages, interact with elements using @e refs, take screenshots, record video. Capabilities: web scraping, form filling, clicking, typing, drag-drop, file upload, JavaScript execution. Use for: web automation, data extraction, testing, agent browsing, research. Triggers: browser, web automation, scrape, navigate, click, fill form, screenshot, browse web, playwright, headless browser, web agent, surf internet, record video

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aiskillstore/marketplace4422026년 10월 21일 업데이트

This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aiskillstore/marketplace4422026년 10월 21일 업데이트

Run AI apps via inference.sh CLI - image generation, video creation, LLMs, search, 3D, Twitter automation. Models: FLUX, Veo, Gemini, Grok, Claude, Seedance, OmniHuman, Tavily, Exa, OpenRouter, and many more. Use when running AI apps, generating images/videos, calling LLMs, web search, or automating Twitter. Triggers: inference.sh, infsh, ai model, run ai, serverless ai, ai api, flux, veo, claude api, image generation, video generation, openrouter, tavily, exa search, twitter api, grok

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aiskillstore/marketplace4422026년 10월 21일 업데이트

aiskillstore의 스킬 모두 보기

이 스킬의 문제 신고