gitnexus-impact-analysis
Skill này làm gì
Nó hướng dẫn agent của bạn lập bản đồ các đoạn mã phụ thuộc vào một thứ trước khi bạn sửa nó. Nó dành cho lập trình viên muốn tránh làm hỏng các phần khác của dự án.
Khi nào nên dùng
- ✓Khi bạn sắp sửa một hàm và muốn biết điều gì phụ thuộc vào nó.
- ✓Khi bạn muốn xem phạm vi ảnh hưởng của một thay đổi trước khi commit.
- ✓Khi bạn hỏi liệu một thay đổi có an toàn để thực hiện không.
Liên kết skill
https://github.com/abhigyanpatwari/GitNexus/blob/main/.claude/skills/gitnexus-impact-analysis/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Việc thay đổi tham số của hàm này có an toàn không, và còn nơi nào khác dùng nó?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent xác nhận kho mã, sau đó tìm các đoạn mã gọi hoặc phụ thuộc vào mục tiêu và báo cáo rủi ro. Nó cũng kiểm tra các thay đổi cục bộ để bạn biết chúng ảnh hưởng đến đâu.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Impact Analysis with GitNexus
When to Use
- "Is it safe to change this function?"
- "What will break if I modify X?"
- "Show me the blast radius"
- "Who uses this code?"
- Before making non-trivial code changes
- Before committing — to understand what your changes affect
Bind the repository first
Impact analysis is the gate that authorizes an edit, so it must answer for the repository you are about to edit.
Call list_repos {} before the first tool call. With one indexed repository,
use the examples below as written. With more than one, pass repo on every
call: an omitted repo normally errors, but under an MCP policy with a
configured default it resolves to that default silently. If you cannot tell
which repository is meant, stop and ask — every result below an ambiguous
identity inherits the ambiguity. list_repos is paginated, so page with
offset: pagination.nextOffset until hasMore is false before concluding a
repository is absent.
detect_changes takes worktree when your changes are in a linked worktree
the MCP server was not launched from. The server auto-detects a worktree only
when it was launched from inside one; otherwise git diff runs in the wrong
checkout and reports zero changed symbols — a false clean check that carries
none of the degradation flags described below. In the CLI fallbacks, --repo .
means the current checkout; pass the intended repository path instead when you
are not standing in it.
State the bound identity with your risk report:
Repository: <name> (<path>) Worktree: <path> Index: <commit>, <n> behind HEAD
Workflow
0. list_repos {} → Bind repo (and worktree)
1. impact({target: "X", direction: "upstream"}) or `node .gitnexus/run.cjs impact "X" --direction upstream --repo .`
2. READ gitnexus://repo/{name}/processes → Check affected execution flows
3. detect_changes({scope: "all"}) or `node .gitnexus/run.cjs detect-changes --scope all --repo .`
4. Assess risk and report to user, echoing repo/worktree/index identity
If "Index is stale" → run
node .gitnexus/run.cjs analyzein terminal. Hot-toolstalenessnames which index answered (branch/lastCommit) and how fresh it is (status). Re-analyze only forbehindordiverged—currentis identity,unknownis unmeasurable. If.gitnexus/run.cjsis missing, replacenode .gitnexus/run.cjswithnpx gitnexusin the fallback commands.
Checklist
- [ ] list_repos {} — bind repo; explicit repo when >1 indexed, ask if ambiguous
- [ ] impact({target, direction: "upstream"}) or CLI fallback to find dependents
- [ ] Review d=1 items first (these WILL BREAK)
- [ ] Check high-confidence (>0.8) dependencies
- [ ] READ processes to check affected execution flows
- [ ] detect_changes({scope: "all"}) or CLI fallback for pre-commit check
- [ ] Confirm the checkout you edited is the checkout that was diffed
- [ ] Assess risk level and report, stating repo/worktree/index identity
Understanding Output
| Depth | Risk Level | Meaning |
|---|---|---|
| d=1 | WILL BREAK | Direct callers/importers |
| d=2 | LIKELY AFFECTED | Indirect dependencies |
| d=3 | MAY NEED TESTING | Transitive effects |
Risk Assessment
| Affected | Risk |
|---|---|
| <5 symbols, few processes | LOW |
| 5-15 symbols, 2-5 processes | MEDIUM |
| >15 symbols or many processes | HIGH |
| Critical path (auth, payments) | CRITICAL |
| Zero callers found | UNKNOWN |
UNKNOWN is not a low rung on this scale — it means the walk could not answer.
An empty caller set is equally consistent with "genuinely unused" and "the
callers are not resolvable by the index" (plain-object property access, dynamic
dispatch, cross-language calls), so few-callers ⇒ LOW does not apply. The
result carries a riskNote saying so. Confirm with a text search before
treating the symbol as safe to change or delete.
risk is the edit gate: warn on HIGH/CRITICAL and stop on UNKNOWN until the
uncertainty is resolved. Within single-repo mode, compare File and symbol
targets with local riskSharedAxes (direct/total only). Within group mode,
compare only group results: their riskSharedAxes overlays resolved
cross-repo crossings on that local value. Never use either field to waive the
Câu hỏi thường gặp
Nó có thay đổi mã không?
Mục đích của nó là phân tích trước khi sửa. Nó cung cấp thông tin cho việc thay đổi chứ không tự thực hiện.
Vì sao phải xác nhận kho mã?
Skill nói kết quả mô tả sai kho mã sẽ gây hiểu lầm, nên nó hỏi khi mục tiêu chưa rõ.
Nó có kiểm tra thay đổi trên một nhánh không?
Có. Nó có thể kiểm tra thay đổi cục bộ, kể cả trong một git worktree được liên kết nếu bạn chỉ đường dẫn tới đó.
Chi tiết
Mô tả gốc của tác giả
Use when the user wants to know what will break if they change something, or needs safety analysis before editing code. Examples: \"Is it safe to change X?\", \"What depends on this?\", \"What will break?\"
repo: abhigyanpatwari/GitNexus
Độ phổ biến
- Sao GitHub
- 48k
- Vị trí xếp hạng
- #3609
- Giấy phép
- —
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
gitnexus-cli
48kGiúp agent của bạn chạy các lệnh GitNexus để lập chỉ mục một dự án mã nguồn, kiểm tra trạng thái, xóa chỉ mục hoặc tạo wiki.
gitnexus-debugging
48kGiúp agent của bạn lần theo một lỗi qua codebase, tìm nơi lỗi bắt đầu và đoạn mã nào gọi phần bị lỗi.
gitnexus-exploring
48kGiúp agent của bạn khám phá một codebase lạ, giải thích các phần kết nối với nhau thế nào và một tính năng như đăng nhập hoạt động ra sao.
gitnexus-guide
48kCung cấp cho agent của bạn bảng tra cứu nhanh các công cụ, tài nguyên và đồ thị tri thức của GitNexus, rồi chỉ đến hướng dẫn phù hợp.
Skill tương tự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.