systematic-debugging
Skill này làm gì
Công cụ này giúp tìm nguyên nhân thực sự của các vấn đề kỹ thuật, như lỗi chương trình hoặc hành vi bất thường. Nó hướng dẫn bạn điều tra trước khi sửa, để đảm bảo giải pháp là lâu dài, không chỉ tạm thời.
Khi nào nên dùng
- ✓Khi chương trình báo lỗi mà bạn không hiểu.
- ✓Khi bạn đã thử sửa nhiều lần mà không thành công.
- ✓Trong các tình huống khẩn cấp, khi rất dễ bị cám dỗ sửa nhanh.
Liên kết skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/systematic-debugging/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
“Code của tôi báo một lỗi lạ khi tôi lưu một tệp, tôi nên làm gì để tìm nguyên nhân gốc rễ?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Công cụ gợi ý các bước có tổ chức: đầu tiên, hiểu lỗi và cách tái hiện nó; sau đó, kiểm tra những gì đã thay đổi gần đây. Chỉ sau đó bạn mới đưa ra giả thuyết và thử thay đổi nhỏ nhất có thể để xác nhận nguyên nhân.
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.
Systematic Debugging
Overview
Random fixes waste time and create new bugs. Quick patches mask underlying issues.
Core principle: Investigate before guessing and separate a verified repair from a temporary mitigation. During an incident, an authorized rollback or containment action may restore service while root-cause work continues.
Violating the letter of this process is violating the spirit of debugging.
The Iron Law
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
Start with the observable failure and the smallest useful evidence check. Label any emergency mitigation explicitly and preserve evidence for the later root-cause investigation.
When to Use
Use for ANY technical issue:
- Test failures
- Bugs in production
- Unexpected behavior
- Performance problems
- Build failures
- Integration issues
Use this ESPECIALLY when:
- Under time pressure (emergencies make guessing tempting)
- "Just one quick fix" seems obvious
- You've already tried multiple fixes
- Previous fix didn't work
- You don't fully understand the issue
Don't skip when:
- Issue seems simple (simple bugs have root causes too)
- You're in a hurry (rushing guarantees rework)
- Manager wants it fixed NOW (systematic is faster than thrashing)
The Four Phases
You MUST complete each phase before proceeding to the next.
Phase 1: Root Cause Investigation
BEFORE attempting ANY fix:
Read Error Messages Carefully
- Don't skip past errors or warnings
- They often contain the exact solution
- Read stack traces completely
- Note line numbers, file paths, error codes
Reproduce Consistently
- Can you trigger it reliably?
- What are the exact steps?
- Does it happen every time?
- If not reproducible → gather more data, don't guess
Check Recent Changes
- What changed that could cause this?
- Git diff, recent commits
- New dependencies, config changes
- Environmental differences
Gather Evidence in Multi-Component Systems
WHEN system has multiple components (CI → build → signing, API → service → database):
BEFORE proposing fixes, add diagnostic instrumentation:
For EACH component boundary: - Record allowed field names, sizes, statuses and correlation IDs - Redact secrets and private payloads before logging - Verify environment/config propagation - Check state at each layer Run once to gather evidence showing WHERE it breaks THEN analyze evidence to identify failing component THEN investigate that specific componentExample (multi-layer system):
# In each relevant process, report presence only; never dump secret values. if [ -n "${IDENTITY:-}" ]; then echo 'IDENTITY is set' else echo 'IDENTITY is absent or empty' fi # Read-only validation of an already-built artifact, when available. codesign --verify --verbose=2 "$APP"Interpretation: Compare presence checks at the actual workflow/build boundaries. Artifact verification does not itself prove that the correct signing identity propagated.
Trace Data Flow
WHEN error is deep in call stack:
See
root-cause-tracing.mdin this directory for the complete backward tracing technique.Quick version:
- Where does bad value originate?
- What called this with bad value?
- Keep tracing up until you find the source
- Fix at source, not at symptom
Phase 2: Pattern Analysis
Find the pattern before fixing:
Find Working Examples
- Locate similar working code in same codebase
- What works that's similar to what's broken?
Compare Against References
- If implementing pattern, read reference implementation COMPLETELY
- Don't skim - read every line
- Understand the pattern fully before applying
Identify Differences
- What's different between working and broken?
- List every difference, however small
- Don't assume "that can't matter"
Understand Dependencies
- What other components does this need?
- What settings, config, environment?
- What assumptions does it make?
Phase 3: Hypothesis and Testing
Scientific method:
Form Single Hypothesis
- State clearly: "I think X is the root cause because Y"
- Write it down
- Be specific, not vague
Test Minimally
- Make the SMALLEST possible change to test hypothesis
- One variable at a time
…
Câu hỏi thường gặp
Vì sao không thể chỉ sửa nhanh?
Sửa nhanh có thể che giấu vấn đề thật, gây ra lỗi mới và tốn thời gian hơn về sau. Tìm nguyên nhân gốc rễ đảm bảo giải pháp lâu dài.
“Nguyên nhân gốc rễ” là gì?
Đó là lý do cơ bản khiến vấn đề xảy ra. Thay vì chỉ xử lý triệu chứng (lỗi nhìn thấy), nguyên nhân gốc rễ là vấn đề ban đầu, nếu được sửa thì lỗi sẽ không xảy ra nữa.
Nếu vấn đề liên quan nhiều phần của hệ thống thì sao?
Công cụ yêu cầu kiểm tra giao tiếp giữa các phần, ghi log thông tin tại mỗi “ranh giới” (nơi một phần giao tiếp với phần khác) để xem lỗi xuất hiện đầu tiên ở đâu.
Chi tiết
Mô tả gốc của tác giả
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
Độ phổ biến
- Sao GitHub
- 48k
- Vị trí xếp hạng
- #5918
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
00-andruia-consultant
48kGiúp agent của bạn bắt đầu hoặc cải thiện các dự án AI. Phân tích mã, gợi ý công cụ và lập kế hoạch hành động bằng tiếng Tây Ban Nha.
007
48kCho phép agent của bạn thực hiện kiểm toán bảo mật và mô hình hóa mối đe dọa. Hữu ích để bảo vệ dự án khỏi các cuộc tấn công và lỗ hổng.
10-andruia-skill-smith
48kGiúp agent của bạn tạo hoặc cải thiện các công cụ AI. Xác định cách công cụ hoạt động, viết tài liệu và kiểm tra cấu trúc.
20-andruia-niche-intelligence
48kGiúp agent của bạn tạo bản tóm tắt về một ngành cụ thể. Hữu ích để hiểu bối cảnh, quy tắc, cách người dùng tương tác và rủi ro của dự án.
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á.