Quick Fix Operator
A command template for utilities workflows. Streamlines development with pre-configured patterns and best practices.
Quick Fix Operator
Apply a targeted fix to a specific bug or error by analyzing the problem, implementing the minimum change needed, and verifying it passes tests.
When to Use This Command
Run this command when...
- You have a specific bug with a clear reproduction path and need it fixed quickly
- You want Claude to implement, test, and verify a fix in one end-to-end command
- You received a bug report with an error message and want a complete resolution
Avoid this command when...
- The issue requires architectural changes rather than a targeted code fix
- You are unsure what the bug is and need exploratory debugging first
Quick Start
# .claude/commands/quick-fix-operator.md --- allowed-tools: ["Bash", "Read", "Write", "Edit", "Grep", "Glob"] --- Analyze the described bug. Locate the relevant code. Implement a fix. Run tests to verify. Report the changes made.
Example usage:
/quick-fix-operator "Users see a 500 error when submitting the contact form with an empty email"
Example output:
Bug Analysis
============
Issue: Missing validation on email field in contact handler
Root Cause: src/api/contact.ts:28
email passed to sendEmail() without null check
Fix Applied:
Added input validation at line 26-30
Returns 400 with "Email is required" message
Verification:
npm test -- contact.test.ts
3 tests passed (including new empty-email test)
Files changed: src/api/contact.ts, src/api/contact.test.ts
Core Concepts
| Concept | Description |
|---|---|
| Bug analysis | Understands the reported issue and expected behavior |
| Root cause location | Finds the exact file and line causing the problem |
| Minimal fix | Makes the smallest change needed to resolve the bug |
| Verification | Runs existing and new tests to confirm the fix works |
Bug Report --> Analyze --> Locate Root Cause
|
Implement Fix
|
Run Tests
|
PASS? --> Report
|
No --> Iterate
Configuration
| Option | Default | Description |
|---|---|---|
verify | true | Run tests after applying the fix |
scope | minimal | Fix scope (minimal = smallest change, comprehensive = handle related issues) |
add-test | true | Add a regression test for the bug |
dry-run | false | Show the proposed fix without applying it |
commit | false | Auto-commit the fix with a descriptive message |
Best Practices
- Describe the bug precisely -- include the error message, expected behavior, and how to reproduce it.
- Always verify with tests -- a fix that breaks other things is worse than the original bug.
- Add regression tests -- every bug fix should include a test that would have caught the bug originally.
- Keep fixes minimal -- resist the urge to refactor during a bug fix. Refactoring is a separate task.
- Review the diff -- check the changes to ensure the fix is correct and does not introduce new issues.
Common Issues
- Fix addresses symptom, not cause -- if the fix patches a surface symptom, provide more context about the expected behavior.
- Tests fail after fix -- the fix may have changed behavior that existing tests depend on. Review the failing tests.
- Cannot locate the bug -- if Claude cannot find the issue, provide the full stack trace or step-by-step reproduction.
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Git Commit Message Generator
Generates well-structured conventional commit messages by analyzing staged changes. Follows Conventional Commits spec with scope detection.
React Component Scaffolder
Scaffolds a complete React component with TypeScript types, Tailwind styles, Storybook stories, and unit tests. Follows project conventions automatically.
CI/CD Pipeline Generator
Generates GitHub Actions workflows for CI/CD including linting, testing, building, and deploying. Detects project stack automatically.