with one click
systematic-debugging-aim
// Use when encountering any bug, test failure, or unexpected behavior in AIM, before proposing fixes
// Use when encountering any bug, test failure, or unexpected behavior in AIM, before proposing fixes
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | systematic-debugging-aim |
| description | Use when encountering any bug, test failure, or unexpected behavior in AIM, before proposing fixes |
Random fixes waste time and create new bugs. Quick patches mask underlying issues.
Core principle: ALWAYS find root cause before attempting fixes. Symptom fixes are failure.
Violating the letter of this process is violating the spirit of debugging.
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
If you haven't completed Phase 1, you cannot propose fixes.
Use for ANY technical issue:
dx make gtest failures)dx make errors)Use ESPECIALLY when:
Complete each phase before proceeding.
BEFORE attempting ANY fix:
Read Error Messages Carefully
Reproduce Consistently
dx make gtest # reproduce test failure
dx make # reproduce build failure
dx bash -c "gdb /root/ofsrc/aim/bin/program core" # analyze core dump
Check Recent Changes
dx git log --oneline -10
dx git diff HEAD~3
Trace Data Flow
dx bash -c "rg 'function_name' /root/ofsrc/aim/src/" # content search (not grep)
dx bash -c "fd 'filename' /root/ofsrc/aim/src/" # file search (not find)
dx bash -c "gdb -batch -ex 'bt' -ex 'quit' /path/to/binary core"
Filesystem ์กด์ฌ โ build graph ํ์ฑ (measurement-first)
ํ์ผ/๋๋ ํ ๋ฆฌ/Makefile์ด git์ ์๋ค๋ ์ฌ์ค๋ง์ผ๋ก ๊ทธ ์ฝ๋๊ฐ ๋น๋ยท์คํ๋๋ค๊ณ ์ถ๋ก ํ์ง ๋ง ๊ฒ. AIM์ SRC_DIRS ๊ธฐ๋ฐ traversal Makefile ์์คํ ์ด๋ผ stranded code(์ด๋ค SRC_DIRS์๋ ๋ฏธํฌํจ๋ ๋๋ ํ ๋ฆฌ)๊ฐ ํํ๋ค.
์ถ๋ก โ ์ธก์ ์ผ๋ก ๊ฒ์ฆ:
# ์ง์
๊ฒฝ๋ก ํ์ธ (SRC_DIRS grep)
dx bash -c "rg -n '<dir_name>' /root/ofsrc/aim/src --glob 'Makefile'"
# ๋น๋ ์ฐ์ถ๋ฌผ ํ์ธ
dx bash -c "find /root/ofsrc/aim/<path> -name '*.gcno' -o -name '*.o' | head -5"
# ์ค์ ํธ์ถ/์คํ ๊ฒฝ๋ก ํ์ธ
dx bash -c "rg '<function_or_module>' /root/ofsrc/aim --glob '!*.bak'"
# ํ
์คํธ ๊ฒฐ๊ณผ ํ์ธ
dx bash -c "ls /root/ofsrc/aim/test/unit/gtest/report/xml/ | grep <suite>"
์ฌ๊ณ ์ฌ๋ก (MR !602): code-reviewer + test-reviewer๊ฐ MODULE = aimocs ๋ ๊ณณ file presence๋ก swap ๋ฐํ ์ถ๋ก โ ๐ด Critical ๊ฒฉ์. ์ค์ ๋ก๋ jxalocsi๊ฐ SRC_DIRS ๋ฏธํฌํจ = stranded โ ์ธก์ ์ผ๋ก dormant ํ์ . ์ถ๋ก ์ฑ๋๊ณผ ์ธก์ ์ฑ๋์ด ๋
๋ฆฝ์ด์ด์ผ false-positive cycle์ ๊นฌ๋ค.
Use Debugging Tools
dx bash -c "gdb /root/ofsrc/aim/bin/program" # interactive debugger
dx bash -c "valgrind --leak-check=full ./program" # memory issues
Docker ๋ด ๊ฒ์: grep โ rg, find โ fd (๋น ๋ฅด๊ณ ์ด๋ฏธ ์ค์น๋จ)
Create Failing Test Case
# Write gtest reproducing the bug
dx make gtest # verify it fails
REQUIRED: Use test-driven-development-aim for the failing test.
Implement Single Fix โ address root cause, ONE change at a time
Verify Fix
dx make gtest # test passes now
dx make # build still clean
If 3+ Fixes Failed: Question Architecture
ALL of these mean: STOP. Return to Phase 1.
| Excuse | Reality |
|---|---|
| "Issue is simple" | Simple issues have root causes too |
| "Emergency, no time" | Systematic is FASTER than thrashing |
| "Just try this first" | First fix sets the pattern. Do it right. |
| "I see the problem" | Seeing symptoms != understanding root cause |
| "One more fix attempt" | 3+ failures = architectural problem |
| Phase | Key Activities | Success Criteria |
|---|---|---|
| 1. Root Cause | Read errors, reproduce, trace data flow | Understand WHAT and WHY |
| 2. Pattern | Find working examples, compare | Identify differences |
| 3. Hypothesis | Form theory, test minimally | Confirmed or new hypothesis |
| 4. Implementation | Create failing gtest, fix, verify | Bug resolved, tests pass |
Available in this directory:
root-cause-tracing.md โ trace bugs backward through call stackdefense-in-depth.md โ add validation at multiple layerscondition-based-waiting.md โ replace arbitrary timeoutsRelated skills:
Called by:
Uses: