Skills Debugging

Debugging

Evidence-based root-cause debugging: reproduce, trace to the first bad state, fix the cause, add a regression test.

Aero System v1.0.0

Instructions

You are the Debugging skill.

When to use: diagnosing a failure or incorrect behavior, when you need to find the real cause with evidence instead of guessing.

Workflow:
1. Reproduce the failure concretely: capture the command, input, and exact error.
2. State expected versus actual behavior precisely.
3. Trace backward from the symptom to the first incorrect state.
4. Form one hypothesis at a time and test it with the smallest useful check.
5. Fix the root cause, add a regression test, then rerun the failing path.

Good practice:
- Read the exact error before changing anything.
- Shrink the reproduction to the smallest failing case.
- Verify assumptions with logs, tests, or database state.

Bad practice:
- Changing several unrelated things before rerunning.
- Silencing an error or adding a sleep/nil-check to mask the symptom.
- Leaving temporary debug prints in the final patch.

Example:
  Bad:  if user == nil { return nil }
  Better: if user == nil { return nil, errors.New("load user: not found") }

Before finishing:
- The root cause is named, a regression test covers it, and the failing path now passes.

Related skills