Agent Skills: ๐Ÿž ์ฒด๊ณ„์  ๋””๋ฒ„๊น… (Dev Coding Debug)

์ฒด๊ณ„์ ์ธ ๋””๋ฒ„๊น…(Systematic Debugging) ์ ˆ์ฐจ๋ฅผ ํ†ตํ•ด ๋ฒ„๊ทธ์˜ ์›์ธ์„ ์ฐพ๊ณ  ํ•ด๊ฒฐํ•ฉ๋‹ˆ๋‹ค. (Source: obra/superpowers)

UncategorizedID: lastdays03/claude_skills/dev-coding-debug

Install this agent skill to your local

pnpm dlx add-skill https://github.com/lastdays03/claude_skills/tree/HEAD/.agent/skills/dev-coding-debug

Skill Files

Browse the full folder contents for dev-coding-debug.

Download Skill

Loading file treeโ€ฆ

.agent/skills/dev-coding-debug/SKILL.md

Skill Metadata

Name
dev-coding-debug
Description
์ฒด๊ณ„์ ์ธ ๋””๋ฒ„๊น…(Systematic Debugging) ์ ˆ์ฐจ๋ฅผ ํ†ตํ•ด ๋ฒ„๊ทธ์˜ ์›์ธ์„ ์ฐพ๊ณ  ํ•ด๊ฒฐํ•ฉ๋‹ˆ๋‹ค. (Source: obra/superpowers)

๐Ÿž ์ฒด๊ณ„์  ๋””๋ฒ„๊น… (Dev Coding Debug)

์ด ์›Œํฌํ”Œ๋กœ์šฐ๋Š” obra/superpowers์˜ **"The Iron Law"**๋ฅผ ์ค€์ˆ˜ํ•ฉ๋‹ˆ๋‹ค. ๊ทผ๋ณธ ์›์ธ ๊ทœ๋ช… ์—†์ด๋Š” ์ ˆ๋Œ€ ์ฝ”๋“œ๋ฅผ ์ˆ˜์ •ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

1. ์ดˆ๊ธฐํ™” (Initialization)

  1. ์›์น™ ํ™•์ธ: this document๋ฅผ ์ฝ๊ณ  Iron Law๋ฅผ ์ƒ๊ธฐํ•ฉ๋‹ˆ๋‹ค.
  2. ์ฆ์ƒ ์ •์˜: ์‚ฌ์šฉ์ž๋กœ๋ถ€ํ„ฐ ์ •ํ™•ํ•œ ์—๋Ÿฌ ๋ฉ”์‹œ์ง€์™€ ํ˜„์ƒ์„ ์ž…๋ ฅ๋ฐ›์Šต๋‹ˆ๋‹ค.

2. ์กฐ์‚ฌ (Phase 1: Root Cause Investigation)

"์ถ”์ธกํ•˜์ง€ ๋ง๊ณ  ์ฆ๊ฑฐ๋ฅผ ์ˆ˜์ง‘ํ•˜์„ธ์š”."

  1. ์—๋Ÿฌ ๋ถ„์„: ์Šคํƒ ํŠธ๋ ˆ์ด์Šค์™€ ์—๋Ÿฌ ์ฝ”๋“œ๋ฅผ ์ •๋ฐ€ ๋ถ„์„ํ•ฉ๋‹ˆ๋‹ค.
  2. ์žฌํ˜„ (Reproduction): ๋ฒ„๊ทธ๋ฅผ ํ™•์‹คํ•˜๊ฒŒ ๋ฐœ์ƒ์‹œํ‚ค๋Š” ์ตœ์†Œ ๋‹จ์œ„์˜ ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ž‘์„ฑํ•ฉ๋‹ˆ๋‹ค. (ํ•„์ˆ˜)
  3. ๊ธฐ๊ธฐ/๋กœ๊ทธ ์ถ”๊ฐ€ (Instrumentation): ๋ฐ์ดํ„ฐ๊ฐ€ ์˜ค์—ผ๋˜๋Š” ์ง€์ ์„ ์ฐพ๊ธฐ ์œ„ํ•ด ๋กœ๊ทธ๋ฅผ ์ถ”๊ฐ€ํ•˜๊ณ , ๋ฐ์ดํ„ฐ ํ๋ฆ„์„ ์—ญ์ถ”์ (Trace)ํ•ฉ๋‹ˆ๋‹ค.

3. ๋ถ„์„ (Phase 2: Pattern Analysis)

"์ •์ƒ์ ์ธ ํŒจํ„ด๊ณผ ๋ฌด์—‡์ด ๋‹ค๋ฅธ๊ฐ€์š”?"

  1. ์ •์ƒ ์‚ฌ๋ก€ ์ฐพ๊ธฐ: ํ”„๋กœ์ ํŠธ ๋‚ด์—์„œ ์ž˜ ๋™์ž‘ํ•˜๋Š” ์œ ์‚ฌํ•œ ์ฝ”๋“œ๋ฅผ ์ฐพ์Šต๋‹ˆ๋‹ค.
  2. ๋น„๊ต ๋ถ„์„: ์ •์ƒ ์ฝ”๋“œ์™€ ๋ฌธ์ œ๊ฐ€ ์žˆ๋Š” ์ฝ”๋“œ์˜ ์ฐจ์ด์ ์„ ํ•œ ์ค„ ํ•œ ์ค„ ๋น„๊ตํ•ฉ๋‹ˆ๋‹ค.
  3. ์ฐจ์ด์  ๋ชฉ๋ก: ์‚ฌ์†Œํ•ด ๋ณด์ด๋Š” ์ฐจ์ด์ ์ด๋ผ๋„ ๋ชจ๋‘ ๋‚˜์—ดํ•ฉ๋‹ˆ๋‹ค.

4. ๊ฐ€์„ค (Phase 3: Hypothesis & Testing)

"๊ณผํ•™์  ๋ฐฉ๋ฒ•๋ก ์„ ์ ์šฉํ•˜์„ธ์š”."

  1. ๊ฐ€์„ค ์ˆ˜๋ฆฝ: "X ๋•Œ๋ฌธ์— Y๊ฐ€ ๋ฐœ์ƒํ•œ๋‹ค"๋Š” ๊ฐ€์„ค์„ ํ•˜๋‚˜ ์„ธ์›๋‹ˆ๋‹ค.
  2. ์ตœ์†Œ ๊ฒ€์ฆ: ๊ฐ€์„ค์„ ํ™•์ธํ•˜๊ธฐ ์œ„ํ•ด ๋ณ€์ˆ˜ ํ•˜๋‚˜๋งŒ ๋ณ€๊ฒฝํ•˜์—ฌ ํ…Œ์ŠคํŠธํ•ฉ๋‹ˆ๋‹ค. (์ˆ˜์ •์ด ์•„๋‹˜)
  3. ๋ฐ˜๋ณต: ๊ฐ€์„ค์ด ํ‹€๋ ธ๋‹ค๋ฉด ๋ณ€๊ฒฝ ์‚ฌํ•ญ์„ ๋˜๋Œ๋ฆฌ๊ณ (Revert), ์ƒˆ๋กœ์šด ๊ฐ€์„ค์„ ์„ธ์›๋‹ˆ๋‹ค. ๊ธฐ์กด ๋ณ€๊ฒฝ ์œ„์— ๋ง์น  ๊ธˆ์ง€.

5. ํ•ด๊ฒฐ (Phase 4: Implementation)

"์ฆ์ƒ์ด ์•„๋‹Œ ์›์ธ์„ ๊ณ ์น˜์„ธ์š”."

  1. ์‹คํŒจ ํ…Œ์ŠคํŠธ (Red): ์‹๋ณ„๋œ ์›์ธ์„ ํƒ€๊ฒŸ์œผ๋กœ ํ•˜๋Š” ์‹คํŒจ ํ…Œ์ŠคํŠธ ์ผ€์ด์Šค๋ฅผ ํ™•์ •ํ•ฉ๋‹ˆ๋‹ค.
  2. ๋‹จ์ผ ์ˆ˜์ • (Green): ๊ทผ๋ณธ ์›์ธ์„ ์ œ๊ฑฐํ•˜๋Š” ์ตœ์†Œํ•œ์˜ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•ฉ๋‹ˆ๋‹ค.
  3. ๊ฒ€์ฆ (Verification): ํ…Œ์ŠคํŠธ ํ†ต๊ณผ ๋ฐ ํšŒ๊ท€ ํ…Œ์ŠคํŠธ(Regression Test) ์ˆ˜ํ–‰.
  4. ์ •๋ฆฌ (Cleanup): ๋””๋ฒ„๊น…์šฉ ๋กœ๊ทธ์™€ ์ž„์‹œ ์ฝ”๋“œ๋ฅผ ๊นจ๋—์ด ์‚ญ์ œํ•ฉ๋‹ˆ๋‹ค.

6. ์ข…๋ฃŒ (Completion)

  1. ํšŒ๊ณ : ์–ด๋–ค ๋ถ€๋ถ„์ด ๊ทผ๋ณธ ์›์ธ์ด์—ˆ๋Š”์ง€ ์‚ฌ์šฉ์ž์—๊ฒŒ ์„ค๋ช…ํ•˜๊ณ  ์ข…๋ฃŒํ•ฉ๋‹ˆ๋‹ค.

Standards & Rules

Systematic Debugging (Dev Coding Debug)

Core Principles (The Iron Law)

NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST.

If you haven't completed Phase 1 (Root Cause) and Phase 2 (Pattern Analysis), you cannot propose fixes. Symptom fixes are failure.

๐Ÿ—๏ธ The Four Phases

Phase 1: Root Cause Investigation

Goal: Understand WHAT and WHY.

  1. Read Errors: sticky to the error message. Don't skip stack traces.
  2. Reproduce: Can you trigger it reliably? If not, gather more data.
  3. Instrumentation: For multi-component systems, log data flow at boundaries.
  4. Trace: Follow the bad value backwards to its source (root-cause-tracing).

Phase 2: Pattern Analysis

Goal: Find the standard before fixing.

  1. Find Working Examples: Locate similar code that works.
  2. Compare: Read reference implementations completely.
  3. Identify Differences: List every difference, however small.

Phase 3: Hypothesis and Testing

Goal: Scientific Method.

  1. Single Hypothesis: "I think X is the root cause because Y".
  2. Test Minimally: Change ONE variable at a time to test the hypothesis.
  3. Verify: If it didn't work, revert and form a NEW hypothesis. NO layering fixes.

Phase 4: Implementation

Goal: Fix the root cause, not the symptom.

  1. Failing Test: Create a minimal reproduction test case (Red).
  2. Single Fix: Address the identified root cause (Green).
  3. Verify: Ensure no regressions.

๏ฟฝ๏ธ Supporting Techniques

1. Root Cause Tracing ("Why did this happen?")

Don't just fix the bad value. Find where it came from.

  • Technique: Ask "What called this with a bad value?" repeatedly until you find the source.
  • Rule: Fix at the source, not at the symptom.

2. Defense-in-Depth ("Make it impossible")

Don't just validate at one place.

  • Layer 1 (Entry): Reject invalid input at IDL/API boundary.
  • Layer 2 (Logic): Ensure data makes sense for the operation.
  • Layer 3 (Guard): Environment checks (e.g., test vs prod).
  • Layer 4 (Debug): Logging for forensics.

3. Condition-Based Waiting (No sleep)

Never guess how long something takes.

  • Bad: sleep(50)
  • Good: waitFor(() => condition)
  • Why: Flaky tests often come from arbitrary timeouts.

๏ฟฝ๐Ÿšฉ Red Flags (STOP immediately)

  • "Quick fix for now"
  • "Just try changing X"
  • "One more fix attempt" (Limit: 3 attempts. Then question Architecture.)
  • Proposing solutions before tracing.

โœ… Quality Standards

  • Reproduction Script: Must exist before fixing.
  • Log Cleanup: All temporary instrumentation removed.
  • Safe YAML: Frontmatter descriptions quoted.

Checklist

  • [ ] Phase 1: Did you identify the exact line/reason for failure?
  • [ ] Phase 2: Did you compare with a working example?
  • [ ] Phase 4: Is there a test case that failed before and passes now?
  • [ ] Cleanup: Are all print/console.log removed?