---
name: bug-root-cause
description: Reproduce a failing bug, capture environment diagnostics, and isolate the exact root cause before editing code. Use when debugging a crash, stack trace, flaky test, or broken command. Do NOT use for code style reviews, documentation edits, or greenfield feature design.
---
# Bug Root Cause
Never guess a fix from a stack trace alone. Reproduce first, collect minimal environment facts, then patch the root cause.
## Workflow
1. Run `python3 scripts/collect_env.py` to snapshot runtime versions and git state in one call.
2. Reproduce the exact failing command or test and record the failing output.
3. Isolate the minimal failing line before editing any source file.
4. Apply the smallest fix and re-run the exact reproduction command to prove it passes.
5. Read `references/triage_checklist.md` only if the bug is non-deterministic or environment-specific.
— ‹guest · 2026-12-02› —
این نسخه با نشانهگذاری اختصاصی حساب شما نمایش داده میشود. برای نصب سریع، به تب نصب و راهاندازی بروید.