playbook/codex/skills/systematic-debugging/SKILL.md

46 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
name: systematic-debugging
description: "Systematic debugging for bugs, failing tests, regressions (TSL/C++/Python). Triggers: debug, failing test, regression, crash, 复现, 定位, 排查, 调试."
---
# Systematic Debugging系统化调试
## When to Use
- Bugs, crashes, failing/flaky tests, regressions
- “It doesnt work” reports with unclear reproduction
## Inputsrequired
- Expected vs actual behavior
- Repro command/steps (or best-known approximation)
- Logs/traces/screenshots/error output
- Environment details (OS, versions, configs)
## Proceduredefault
1. **Reproduce**
- Make the failure deterministic if possible
- Minimize repro steps (smallest input/command)
2. **Localize**
- Identify failing component and boundary conditions
- Add temporary logging/assertions if needed (then remove)
3. **Hypothesize & Test**
- Form a small number of hypotheses
- Design quick experiments to falsify each hypothesis
4. **Fix & Verify**
- Fix the root cause (not just symptoms)
- Add/update tests; rerun the minimal relevant suite
## Output Contractstable
- Repro: exact steps/command
- Diagnosis: root cause + evidence
- Fix: what changed + why it works
- Verification: commands + outputs/exit codes
- Follow-ups: hardening or cleanup tasks
## Guardrails
- Avoid changing multiple variables at once
- Prefer instrumentation and evidence over guessing
- Keep fixes minimal and scoped