Q

Quick Fix Github Issue

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

CommandClipticsgit workflowv1.0.0MIT
0 views0 copies

Quick Fix Github Issue

Analyze a GitHub issue, locate relevant code, implement the fix, and prepare a commit with proper issue references.

When to Use This Command

Run this command when you need to:

  • Take a GitHub issue and automatically investigate, fix, and commit the solution
  • Analyze an issue's description and comments to understand the problem before implementing
  • Create a fix with tests, proper commit messages, and issue-closing references

Consider alternatives when:

  • The issue requires discussion and design decisions before implementation
  • The issue is a feature request that needs product input rather than a code fix

Quick Start

Configuration

name: quick-fix-github-issue type: command category: git-workflow

Example Invocation

claude command:run quick-fix-github-issue --issue 234

Example Output

Issue #234: "Login fails with special characters in password"
Labels: bug, auth, priority-high
Reporter: @user123

Analysis:
  Problem: Password validation regex rejects valid special characters
  Location: src/auth/validation.ts:28
  Root cause: Regex pattern does not escape brackets and braces

Investigation:
  [+] Read issue description and 3 comments
  [+] Searched codebase for password validation logic
  [+] Found regex pattern at src/auth/validation.ts:28
  [+] Reproduced with test case: password "p@ss{w0rd}"

Fix Applied:
  [+] Updated regex to allow all printable special characters
  [+] Added 6 test cases for special character passwords
  [+] Verified existing tests still pass (142/142)

Files Changed:
  Modified: src/auth/validation.ts (+4, -2)
  Added: tests/auth/special-chars.test.ts (+48)

Commit: fix(auth): Allow special characters in password validation

  Update password regex to accept brackets, braces, and other
  printable special characters that were incorrectly rejected.

  Fixes #234

Ready to push. Create PR with: claude command:run easy-create-pr

Core Concepts

Issue Fix Workflow Overview

AspectDetails
Issue AnalysisReads title, description, labels, and comments via GitHub CLI
Code InvestigationSearches codebase for relevant files using error messages and keywords
Root Cause IdentificationTraces the bug from symptom to source code location
Fix ImplementationMakes minimal, focused changes that address the root cause
Test VerificationAdds test cases and verifies all existing tests still pass

Fix Execution Workflow

  Issue Number
       |
       v
  +-------------------+
  | Fetch Issue       |---> gh issue view, comments, labels
  +-------------------+
       |
       v
  +-------------------+
  | Analyze Problem   |---> Extract symptoms, error messages
  +-------------------+
       |
       v
  +-------------------+
  | Search Codebase   |---> Grep for keywords, error strings
  +-------------------+
       |
       v
  +-------------------+
  | Implement Fix     |---> Minimal change at root cause
  +-------------------+
       |
       v
  +-------------------+
  | Add Tests         |---> Reproduce and verify fix
  +-------------------+
       |
       v
  +-------------------+
  | Commit With Ref   |---> fix(scope): msg + Fixes #N
  +-------------------+

Configuration

ParameterTypeDefaultDescription
issueintegerrequiredGitHub issue number to fix
repostringcurrentRepository in owner/repo format (defaults to current repo)
branchstringauto-generateBranch name for the fix (defaults to fix/issue-N-slug)
auto_commitbooleantrueAutomatically commit the fix with issue reference
run_testsbooleantrueRun the test suite after implementing the fix

Best Practices

  1. Read All Comments Before Fixing - Issue comments often contain critical context, reproduction steps, and previous investigation findings. Skipping comments means potentially missing the actual root cause.

  2. Create a Failing Test First - Write a test that reproduces the bug before implementing the fix. This confirms you understand the problem and ensures the fix actually resolves it.

  3. Make the Smallest Possible Fix - Resist the urge to refactor or improve adjacent code while fixing a bug. Minimal changes are easier to review, less likely to introduce regressions, and simpler to revert if needed.

  4. Reference the Issue in the Commit - Use "Fixes #234" in the commit footer so GitHub automatically closes the issue when the PR merges. This maintains traceability between code changes and bug reports.

  5. Verify All Existing Tests Pass - Run the complete test suite, not just the new test. A fix that resolves one bug but breaks something else is not a fix; it is a trade.

Common Issues

  1. Issue Description Lacks Reproduction Steps - The bug report is vague and does not explain how to trigger the issue. Check issue comments for additional context, or ask the reporter for steps before attempting a fix.

  2. Multiple Root Causes Found - The investigation reveals that the issue has several contributing factors. Fix the primary cause in this PR and create follow-up issues for secondary causes rather than bundling everything into one change.

  3. Tests Pass Locally But Fail in CI - Environment differences between local and CI cause test failures. Check for hardcoded paths, timezone dependencies, or missing environment variables that differ between environments.

Community

Reviews

Write a review

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

Similar Templates