# Debug Code with Root Cause Analysis

Debugging can stall when symptoms, causes, fixes, and tests are handled separately. This skill guides a five-phase workflow for diagnosis, repair, validation, and regression prevention.

## Install

```bash
npx skillstore add dnyoussef/when-debugging-code-use-debugging-assistant
```

## Metadata

- Status: approved
- Slug: dnyoussef-when-debugging-code-use-debugging-assistant
- Skillstore revision: r1
- Version status: missing
- Tree hash: 71747fa30669a3b75db60bc11d503db21acd7a7dd892f393b69570e73f1d85cf
- Author: DNYoussef
- GitHub username: DNYoussef
- License: MIT
- Repository: https://github.com/DNYoussef/ai-chrome-extension/tree/main/.claude/skills/debugging/when-debugging-code-use-debugging-assistant
- Ref: c579efd02184f1128d6741d16e6c8d951d7d4208
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: confirmation\_required
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands, env\_access, filesystem
- Quality score: 38
- Quality tier: warning
- Public page: https://skillstore.pages.dev/skills/dnyoussef-when-debugging-code-use-debugging-assistant
- Manifest: https://skillstore.pages.dev/api/skills/dnyoussef-when-debugging-code-use-debugging-assistant/manifest

## Capabilities

- Captures symptoms with errors, logs, reproduction steps, and environment details.
- Structures root cause analysis with tracing, boundary checks, and recent change review.
- Prompts fix generation with tradeoff analysis and implementation notes.
- Guides validation through test execution and regression coverage planning.
- Stores phase outputs under debugging memory keys for coordinated sessions.

## Use Cases

- Diagnose a Production Regression: Trace a reported failure from symptoms to root cause, then prepare a tested fix plan.
- Turn Failures into Regression Tests: Convert a failing scenario into reproduction steps, validation tests, and prevention notes.
- Standardize Bug Fix Reviews: Collect consistent debug reports that explain cause, fix choice, validation, and follow-up work.

## Prompt Templates

### Start a Bug Investigation

```
Use the debugging assistant to investigate this issue: [describe the problem]. Ask for any missing reproduction details first.
```

### Analyze a Failing Test

```
Use the debugging workflow on this failing test: [test name and failure]. Identify the likely root cause and needed validation.
```

### Compare Fix Options

```
Apply the fix generation phase to this root cause: [root cause]. Compare two approaches and recommend the safer change.
```

### Debug a Multi-Service Regression

```
Run the full five-phase debugging process for this cross-service regression: [incident summary]. Include validation and prevention steps.
```

## Limitations

- Requires access to relevant source code, logs, and a usable test environment.
- Does not guarantee correct fixes without developer review and validation.
- The shell command can run configured test commands and claude-flow hooks.
- Some automation expects Claude Code and claude-flow tooling to be available.

## Best Practices

- Provide exact error text, reproduction steps, recent changes, and affected files.
- Run the proposed validation tests before accepting any generated fix.
- Review command automation and project configuration before enabling the shell workflow.

## Anti Patterns

- Changing code before the issue is reproducible or clearly scoped.
- Suppressing a failing test without proving the underlying cause.
- Running untrusted project test commands without reviewing local configuration first.

## Security Audit

- Audited at: 2026-07-05T12:23:48.039\+00:00
- Summary: Most static findings are false positives from Markdown examples, Graphviz labels, and /dev/null redirection. The executable shell workflow has real risks from eval on a project-configured test command and repeated npx execution of a mutable alpha package. No prompt injection attempt was found in the reviewed files.

## Stats

- Views: 180
- Downloads: 6
- Favorites: 0
- Popularity score: 0
