fix-bug
Implement bug fixes for Rust code. Use when improvements, issues, GitHub Issue links, or error messages are provided. Triggers on keywords like "fix", "bug", "issue", "error", "broken".
Best use case
fix-bug is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Implement bug fixes for Rust code. Use when improvements, issues, GitHub Issue links, or error messages are provided. Triggers on keywords like "fix", "bug", "issue", "error", "broken".
Teams using fix-bug should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/fix-bug/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How fix-bug Compares
| Feature / Agent | fix-bug | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Implement bug fixes for Rust code. Use when improvements, issues, GitHub Issue links, or error messages are provided. Triggers on keywords like "fix", "bug", "issue", "error", "broken".
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Bug Fix Workflow
A systematic workflow for implementing bug fixes.
## Phase 1: Understand the Bug
### Issue/Error Analysis
1. **GitHub Issue**: Fetch details from issue number
- Check reproduction steps, expected vs actual behavior
- Review labels, milestones, linked PRs
2. **Error Message**: Parse the stack trace
- Identify error type (panic, Result::Err, compile error)
- Locate occurrence point (file:line)
3. **Description Only**: Gather additional information
- Confirm reproduction steps
- Check environment (OS, Rust version, DB type)
## Phase 2: Explore the Code
### Find Related Code
```
Exploration order:
1. File where error occurs
2. Callers (upstream)
3. Related test files
4. Related code in the same module
```
### Project Structure
- `src/cli/`: CLI command handling
- `src/core/`: Domain models (schema, migration)
- `src/db/`: Database adapters, SQL generation
## Phase 3: Diagnose Root Cause
### Root Cause Analysis
1. **Form hypothesis**: "This bug might be caused by X"
2. **Verify hypothesis**: Read code, confirm with tests
3. **Identify cause**: Create minimal reproduction case
### Debugging Techniques
```bash
# Run with stack trace
RUST_BACKTRACE=1 cargo run -- <command>
# Run specific test
cargo test <test_name> -- --nocapture
# Inspect variable values (temporary)
dbg!(variable);
```
## Phase 4: Create Fix Branch
### Branch Creation (Before Making Changes)
```bash
# Create and switch to fix branch
git checkout -b fix/<issue-number>-<short-description>
# Example
git checkout -b fix/10-sqlite-nested-transaction
```
### Branch Naming Convention
- `fix/<issue-number>-<short-description>` - For issue-based fixes
- `fix/<short-description>` - For fixes without issue number
## Phase 5: Implement the Fix
### Coding Conventions
- **Error handling**: No `unwrap()`/`expect()`, propagate with `?`
- **Ownership**: Prefer borrowing over unnecessary `.clone()`
- **Naming**: snake_case (functions), PascalCase (types)
### Fix Scope
- Minimal changes to solve the problem
- Avoid unrelated refactoring
- Consider API breaking changes carefully
### Fix Patterns
**Panic Fix**:
```rust
// Before: Potential panic
let value = map.get(key).unwrap();
// After: Proper error handling
let value = map.get(key)
.ok_or_else(|| anyhow::anyhow!("Key not found: {}", key))?;
```
**Logic Error Fix**:
```rust
// Before: Missing boundary condition
if items.len() > 0 { ... }
// After: Handle empty case
if !items.is_empty() { ... }
```
## Phase 6: Write Tests
### Add Regression Tests
1. **Write a test that reproduces the bug first** (Red)
2. **Confirm the test fails**
3. **Implement the fix** (Green)
4. **Confirm the test passes**
### Test Location
- Unit tests: `#[cfg(test)]` module in the same file
- Integration tests: `src/cli/tests/` directory
### Test Naming Convention
```rust
#[test]
fn test_<feature>_<condition>_<expected_result>() {
// e.g., test_parse_array_type_with_mixed_case_preserves_casing
}
```
## Phase 7: Verify
### Local Verification
```bash
# Format
cargo fmt
# Lint
cargo clippy -- -D warnings
# Run all tests
cargo test
# Run specific test file
cargo test --test <test_file_name>
```
### Pre-Commit Checklist
- [ ] Bug is fixed and verified
- [ ] Regression test is added
- [ ] All existing tests pass
- [ ] No errors from `cargo fmt` / `cargo clippy`
- [ ] Commit message is appropriate
## Commit Message Format
```
fix(<scope>): <summary>
<body - optional>
Fixes #<issue-number>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
```
**Scope examples**: cli, core, db, schema, migration, sql, test
## Phase 8: Create Pull Request
### Push Branch and Create PR via MCP
After verification passes, create a pull request using GitHub MCP tools:
1. **Push the fix branch**
```bash
git push -u origin <branch-name>
```
2. **Create PR using MCP** (`mcp__github__create_pull_request`)
### PR Content
Read the PR template from `.github/pull_request_template.md` and fill in the sections accordingly:
- **Summary**: Brief description of the fix
- **Related Issue**: `Fixes #<issue-number>`
- **Type of Change**: Check "Bug fix"
- **Test Plan**: Check items based on what was tested
- **Checklist**: Check completed items
### MCP Tool Parameters
```
owner: Lazialize
repo: stratum
title: fix(<scope>): <summary>
head: <fix-branch-name>
base: main
body: <PR content from template>
```
## GitHub Issue Integration
When issue number is provided:
1. Fetch issue details with `gh issue view <number>`
2. Include `Fixes #<number>` in commit message after fix
3. Link to issue when creating PR
## Escape Hatches
Stop and confirm with user in these cases:
- Breaking API changes required
- Multiple fix approaches possible
- Cannot identify root cause
- Security-related issuesRelated Skills
bgo
Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.
framework
Expert on SpecWeave framework structure, rules, and spec-driven development conventions. Use when learning SpecWeave best practices, understanding increment lifecycle, or configuring hooks. Covers source-of-truth discipline, tasks.md/spec.md formats, living docs sync, and file organization patterns.
framework-learning
Learn and answer questions from any framework documentstion website quickly and accurately. Crawls a docs site from a seed URL, builds a lightweight URL index (titles/headings/snippets), BM25-ranks pages for a user's question, then fetehces and converts only the top-k pages to clean markdown for grounded answers with source links. Use when a user shares a docs URL and asks "how do I..", "where is..", "explain..", "OAuth/auth", "errors", "configuration" or "API usage"
framework-expert
Unified framework expertise bundle. Lazy-loads relevant framework patterns (React, Vue, Angular, Next.js, Node.js, Python, Laravel, Go, Flutter, Godot) based on detected tech stack.
framework-consciousness
Meta-orchestration skill for holistic TNF system understanding and coordinated capability use.
fp-ts-react
Practical patterns for using fp-ts with React - hooks, state, forms, data fetching. Use when building React apps with functional programming patterns. Works with React 18/19, Next.js 14/15.
fp-ts-pragmatic
A practical, jargon-free guide to fp-ts functional programming - the 80/20 approach that gets results without the academic overhead. Use when writing TypeScript with fp-ts library.
fp-ts-errors
Handle errors as values using fp-ts Either and TaskEither for cleaner, more predictable TypeScript code. Use when implementing error handling patterns with fp-ts.
fox-pilot
Firefox browser automation CLI for AI agents. Use when users ask to automate Firefox, navigate websites, fill forms, take screenshots, extract web data, or test web apps in Firefox. Trigger phrases include "in Firefox", "fox-pilot", "go to [url]", "click on", "fill out the form", "take a screenshot", "scrape", "automate", or any browser interaction request mentioning Firefox.
Fossil SCM Usage
This skill should be used when the user asks to "fossil commit", "fossil branch", "fossil merge", "fossil clone", "fossil sync", "fossil ticket", "fossil stash", "fossil timeline", mentions working with a Fossil repository, asks about Fossil vs Git differences, or needs help with Fossil SCM commands and workflows.
formula-decoder-skill
Decodes mathematical and physical formulas using a 5-stage process: Confusion, Intuition, Symbol Mapping, Limit Testing, and Dimension Ascension. Combines the styles of Feynman, Sanderson, Euclid, and Victor for deep understanding.
formsite-automation
Automate Formsite tasks via Rube MCP (Composio). Always search tools first for current schemas.