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

heatmap

Analyze Git history to find frequently and recently changed files and lines, then rank review targets. Use the results to focus pull request reviews, bug investigations, or security audits on specific code regions and risks.

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

원문원문 설명 보기

Use git heatmap analysis to identify high-churn files and lines as candidates for thorough review or bug hunting. Works for PR reviews, security audits, bug hunts, or any code analysis task.

설치 방법 보기

이럴 때 유용합니다

  • Prioritizing files during pull request reviews
  • Finding starting points for bug investigations
  • Narrowing security audits to frequently changed code
  • Exploring areas of active development

포함된 파일(2)

  • SKILL.md5.6 KB
  • heatmap.py24.2 KB

SKILL.md(원문)

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

Heatmap-Guided Review

Use the bundled heatmap.py script to identify the hottest (most frequently and recently changed) code in a repository, then focus review effort on those areas. Hot code is statistically more likely to contain bugs: it changes often, accumulates complexity, and is where active development risk concentrates.

When to use

Invoke this skill whenever you want to prioritize where to look in a codebase — during PR reviews, bug hunts, security audits, onboarding exploration, or any task where you need to decide which files and lines deserve the closest attention.

Prerequisites

  • Python 3 must be available.
  • The target must be a git repository.
  • The heatmap script is bundled with this skill at ~/.claude/skills/heatmap/heatmap.py. All commands below use HEATMAP as a placeholder:
    HEATMAP="$HOME/.claude/skills/heatmap/heatmap.py"
    
    If heatmap is available on PATH, you may use that instead.

Workflow

Step 1: Determine the repository path and scope

Figure out the git repository root. If the user provided a repo path, use that. If working in a repo already, use the current directory. If reviewing a PR, determine which files were changed.

HEATMAP="$HOME/.claude/skills/heatmap/heatmap.py"
# Find the repo root
git -C <path> rev-parse --show-toplevel

Step 2: Run repo-level heatmap

Get the hottest files in the repository. Use --json for machine-readable output. Adjust --top based on context (20-50 for a broad scan, more for large repos).

python3 "$HEATMAP" repo --json --top 50 <repo_path>

This returns JSON array of objects with: path, heat, commits, last_modified_days.

Step 3: Cross-reference with the task context

For PR reviews: Intersect the heatmap results with the files changed in the PR. Files that are both changed in the PR AND high on the heatmap are the highest-priority review targets — they are already complex/volatile and the PR is adding more changes to them.

# Get PR changed files
git diff --name-only <base_branch>...HEAD

For bug hunts: The hottest files ARE the candidates — frequent recent changes correlate with bugs. Focus on the top 10-20.

For security audits: Filter heatmap results to security-sensitive paths (auth, crypto, input parsing, network, serialization).

For general exploration: Use the heatmap as a map of where active development is happening.

Step 4: Run line-level heatmap on top candidates

For each high-priority file (typically 3-8 files), run the line-level heatmap to find the hottest regions within those files.

python3 "$HEATMAP" file --json <file_path_relative_to_repo> <repo_path>

This returns JSON array of objects with: line, heat, content.

Step 5: Identify hot zones

From the line-level results, identify contiguous regions of high heat. These "hot zones" are where to focus review. Look for:

  • Clusters of hot lines — contiguous blocks of high-heat code indicate areas under active rework. These are prime bug candidates because:

    • Multiple recent changes suggest the logic is not yet settled
    • Each change is an opportunity for regression
    • Complex interactions between recent changes may not be fully tested
  • Hot lines surrounded by cold code — surgical edits in otherwise stable code may indicate bug fixes, workarounds, or special-case handling that deserves scrutiny.

  • Hot function/method boundaries — if a method signature or its first few lines are hot, the contract may have changed recently, affecting all callers.

Step 6: Produce the review focus list

Output a ranked list of review targets, structured as:

## Heatmap Review Targets

### Priority 1: <file_path> (heat: X, commits: Y)
- **Hot zones**: lines A-B (description of what this code does)
- **Why it matters**: <context — e.g., "most changed file in repo AND modified in this PR">
- **What to look for**: <specific guidance based on the code — race conditions, edge cases, etc.>

### Priority 2: ...

Step 7: Deep review

For each priority target, read the hot zones and perform the actual review. The heatmap tells you WHERE to look; your expertise tells you WHAT to look for. Common patterns in hot code:

  • State management bugs: Hot code often manages complex state. Check for inconsistent updates, missing synchronization, or partial failures.
  • Edge cases: Frequent changes often mean edge cases keep being discovered. Look for more.
  • Regression risk: If code was recently fixed, check whether the fix is complete and doesn't break other paths.
  • Missing tests: Hot code that lacks test coverage is the highest-risk combination.

Output format

Always present findings as a prioritized list with:

  1. File path and heat metrics
  2. Specific line ranges to focus on
  3. What the hot code does (brief)
  4. What risks to look for (specific to the code, not generic)

Tips

  • Heat is relative — compare files against each other, not against an absolute threshold.
  • Files with high heat but few commits have large individual changes (risky). Files with high heat and many commits are under constant churn (also risky, differently).
  • last_modified_days close to 0 means very recent changes — highest chance of unfound bugs.
  • Use --since to adjust the time window. Default is 2 years. For recent bug hunts, try --since "6 months ago".
  • The --no-color flag is useful when piping output, but prefer --json for programmatic use.

리뷰

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

댓글

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

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

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

0 / 1,000자

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

같은 저장소의 스킬

Analyze bug-fix commits in a Git repository to uncover recurring failure patterns. Produce individual bug analyses and a reusable pattern guide that removes project-specific details, helping inform future code reviews.

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

  • Extract recurring bug patterns from past fixes
  • Build a reusable guide for code reviews
  • Analyze fixes within a chosen date range or path
apache/cassandra1만2026년 10월 17일 업데이트

Write Apache Cassandra distributed tests that simulate multiple nodes within one JVM, the Java runtime. The guide covers cluster setup, queries, node restarts, message dropping for failure scenarios, and troubleshooting problems caused by isolated class loading.

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

  • Writing read and write tests across multiple nodes
  • Testing timeouts by dropping messages between nodes
  • Verifying node replacement and restarts
apache/cassandra1만2026년 10월 17일 업데이트

Review selected files for bugs by reading full source code, callers, and related implementations. Apply detailed checklists and investigate suspected issues, then report evidence, confidence levels, and suggested fixes.

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

  • Review selected files in a critical code change
  • Investigate concerns raised by an initial review
  • Check complex state transitions and object lifecycles
apache/cassandra1만2026년 10월 17일 업데이트

Review changes of 1,000 lines or more by dividing work across files, focused areas, and commits. Combine several review methods, check consistency across subsystems, verify bug fixes, and report validated findings alongside a checklist showing review coverage.

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

  • Reviewing feature branches with 1,000 or more changed lines
  • Checking a large change before merging
  • Finding inconsistencies across commits and subsystems
apache/cassandra1만2026년 10월 17일 업데이트

Explain code structure and behavior with text diagrams, including before-and-after views of changes. Trace data flow and state changes, clarify design choices, and examine assumptions, possible failures, and interactions between tasks running at the same time.

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

  • Understanding a patch through before-and-after diagrams
  • Tracing a class's behavior and state changes
  • Mapping component relationships across a codebase
apache/cassandra1만2026년 10월 17일 업데이트

Run a quick first review of code changes with six specialist agents working in parallel. They check logic, input and output, shared state, resources, missing behavior, and API completeness, then combine duplicate findings into a report ranked by confidence.

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

  • Running a quick first review of a patch
  • Screening diffs to prioritize further investigation
  • Checking for missing cleanup and handlers
apache/cassandra1만2026년 10월 17일 업데이트

apache의 스킬 모두 보기

이 스킬의 문제 신고