# Fix Bugs with Root Cause Analysis

Bug fixes can fail when teams skip root cause analysis. This skill guides Claude, Codex, and Claude Code through diagnosis, implementation, tests, and validation.

## Install

```bash
npx skillstore add dnyoussef/smart-bug-fix
```

## Metadata

- Status: approved
- Slug: dnyoussef-smart-bug-fix
- Version: 1.0.0
- Author version: 1.0.0
- Skillstore revision: r1
- Version status: valid
- Tree hash: 42bd1f238c17f97a6937c5789e6cb8191e49e1bc878456e568b4dca839ed65a7
- Author: DNYoussef
- GitHub username: DNYoussef
- License: MIT
- Repository: https://github.com/DNYoussef/ai-chrome-extension/tree/main/.claude/skills/smart-bug-fix
- 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
- Quality score: 38
- Quality tier: warning
- Public page: https://skillstore.pages.dev/skills/dnyoussef-smart-bug-fix
- Manifest: https://skillstore.pages.dev/api/skills/dnyoussef-smart-bug-fix/manifest

## Capabilities

- Collects a bug description, context path, reproduction steps, error logs, and desired analysis depth.
- Runs a root cause analysis phase before recommending or applying a fix.
- Uses Codex to generate alternative approaches and apply a sandboxed fix workflow.
- Runs functionality and regression validation with a bounded iteration count.
- Summarizes root cause, test status, changed files, and performance impact.

## Use Cases

- Fix Feature Regressions: Application developers can trace a regression to its cause, apply a focused fix, and verify tests before review.
- Triage Production Bugs: Incident responders can combine logs, reproduction steps, and impact checks to prepare a safer remediation plan.
- Review Complex Pull Requests: Tech leads can compare alternative fixes and request validation evidence before approving a change.

## Prompt Templates

### Report a Simple Bug

```
Fix this bug with smart-bug-fix: [describe the failure]. Context path: [file or folder]. Explain the root cause and validation.
```

### Add Reproduction Details

```
Use smart-bug-fix on [context path]. Bug: [description]. Reproduction steps: [steps]. Include the likely cause, proposed fix, and tests.
```

### Investigate Logs and Tests

```
Run a deep smart-bug-fix analysis for [bug]. Use [context path], [error logs], and [failing tests]. Compare alternatives before applying changes.
```

### Validate a Production Regression

```
Use smart-bug-fix for a production regression in [system]. Include RCA, Codex fix rationale, regression validation, performance impact, and residual risks.
```

## Limitations

- Requires compatible Claude Flow, Gemini, Codex, jq, and shell tooling to be available.
- May send selected code context to external model services when the workflow uses Gemini.
- Automated fixes still require human review before merging or deploying.
- The documented shell workflow is illustrative and may need project-specific adaptation.

## Best Practices

- Review the root cause evidence before accepting an automated fix.
- Run the workflow in a clean branch with project tests available.
- Confirm any external model use is allowed for the repository.

## Anti Patterns

- Do not run full-auto fixes on production files without a review step.
- Do not pass secrets, private logs, or broad filesystem paths as context.
- Do not treat a passing test summary as deployment approval.

## Security Audit

- Audited at: 2026-07-05T13:02:49.231\+00:00
- Summary: Most static backtick findings are false positives from Markdown fences, inline command names, examples, and diagrams. I confirmed the executable bash workflow and xargs file traversal patterns because they direct agents to run external CLIs over user-provided paths. I also found semantic risks around sending code context to Gemini and using full-auto code modification without an explicit human approval gate.

## Stats

- Views: 270
- Downloads: 9
- Favorites: 0
- Popularity score: 0
