Quick Fix Github Issue
A command template for git workflow workflows. Streamlines development with pre-configured patterns and best practices.
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
| Aspect | Details |
|---|---|
| Issue Analysis | Reads title, description, labels, and comments via GitHub CLI |
| Code Investigation | Searches codebase for relevant files using error messages and keywords |
| Root Cause Identification | Traces the bug from symptom to source code location |
| Fix Implementation | Makes minimal, focused changes that address the root cause |
| Test Verification | Adds 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
| Parameter | Type | Default | Description |
|---|---|---|---|
| issue | integer | required | GitHub issue number to fix |
| repo | string | current | Repository in owner/repo format (defaults to current repo) |
| branch | string | auto-generate | Branch name for the fix (defaults to fix/issue-N-slug) |
| auto_commit | boolean | true | Automatically commit the fix with issue reference |
| run_tests | boolean | true | Run the test suite after implementing the fix |
Best Practices
-
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.
-
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.
-
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.
-
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.
-
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
-
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.
-
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.
-
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.
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.