Q

Quick Fix Operator

A command template for utilities workflows. Streamlines development with pre-configured patterns and best practices.

CommandClipticsutilitiesv1.0.0MIT
0 views0 copies

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

ConceptDescription
Bug analysisUnderstands the reported issue and expected behavior
Root cause locationFinds the exact file and line causing the problem
Minimal fixMakes the smallest change needed to resolve the bug
VerificationRuns existing and new tests to confirm the fix works
Bug Report --> Analyze --> Locate Root Cause
                                |
                          Implement Fix
                                |
                          Run Tests
                                |
                        PASS? --> Report
                          |
                          No --> Iterate

Configuration

OptionDefaultDescription
verifytrueRun tests after applying the fix
scopeminimalFix scope (minimal = smallest change, comprehensive = handle related issues)
add-testtrueAdd a regression test for the bug
dry-runfalseShow the proposed fix without applying it
commitfalseAuto-commit the fix with a descriptive message

Best Practices

  1. Describe the bug precisely -- include the error message, expected behavior, and how to reproduce it.
  2. Always verify with tests -- a fix that breaks other things is worse than the original bug.
  3. Add regression tests -- every bug fix should include a test that would have caught the bug originally.
  4. Keep fixes minimal -- resist the urge to refactor during a bug fix. Refactoring is a separate task.
  5. Review the diff -- check the changes to ensure the fix is correct and does not introduce new issues.

Common Issues

  1. Fix addresses symptom, not cause -- if the fix patches a surface symptom, provide more context about the expected behavior.
  2. Tests fail after fix -- the fix may have changed behavior that existing tests depend on. Review the failing tests.
  3. Cannot locate the bug -- if Claude cannot find the issue, provide the full stack trace or step-by-step reproduction.
Community

Reviews

Write a review

No reviews yet. Be the first to review this template!

Similar Templates