Skip to content

Fix Issue Command

Identify and resolve code issues

Instructions

Follow this structured approach to analyze and fix issues: $ARGUMENTS

  1. Issue Analysis
  2. Use gh issue view $ARGUMENTS to get complete issue details
  3. Read the issue description, comments, and any attached logs/screenshots
  4. Identify the type of issue (bug, feature request, enhancement, etc.)
  5. Understand the expected vs actual behavior

  6. Environment Setup

  7. Ensure you're on the correct branch (usually main/master)
  8. Pull latest changes: git pull origin main
  9. Create a new feature branch: git checkout -b fix/issue-$ARGUMENTS

  10. Reproduce the Issue

  11. Follow the steps to reproduce described in the issue
  12. Set up the development environment if needed
  13. Run the application/tests to confirm the issue exists
  14. Document the current behavior

  15. Root Cause Analysis

  16. Search the codebase for relevant files and functions
  17. Use grep/search tools to locate the problematic code
  18. Analyze the code logic and identify the root cause
  19. Check for related issues or similar patterns

  20. Solution Design

  21. Design a fix that addresses the root cause, not just symptoms
  22. Consider edge cases and potential side effects
  23. Ensure the solution follows project conventions and patterns
  24. Plan for backward compatibility if needed

  25. Implementation

  26. Implement the fix with clean, readable code
  27. Follow the project's coding standards and style
  28. Add appropriate error handling and logging
  29. Keep changes minimal and focused

  30. Testing Strategy

  31. Write or update tests to cover the fix
  32. Ensure existing tests still pass
  33. Test edge cases and error conditions
  34. Run the full test suite to check for regressions

  35. Code Quality Checks

  36. Run linting and formatting tools
  37. Perform static analysis if available
  38. Check for security implications
  39. Ensure performance isn't negatively impacted

  40. Documentation Updates

  41. Update relevant documentation if needed
  42. Add or update code comments for clarity
  43. Update changelog if the project maintains one
  44. Document any breaking changes

  45. Commit and Push

    • Stage the changes: git add .
    • Create a descriptive commit message following project conventions
    • Example: fix: resolve issue with user authentication timeout (#$ARGUMENTS)
    • Push the branch: git push origin fix/issue-$ARGUMENTS
  46. Create Pull Request

    • Use gh pr create to create a pull request
    • Reference the issue in the PR description: "Fixes #$ARGUMENTS"
    • Provide a clear description of the changes and testing performed
    • Add appropriate labels and reviewers
  47. Follow-up

    • Monitor the PR for feedback and requested changes
    • Address any review comments promptly
    • Update the issue with progress and resolution
    • Ensure CI/CD checks pass
  48. Verification

    • Once merged, verify the fix in the main branch
    • Close the issue if not automatically closed
    • Monitor for any related issues or regressions

Remember to communicate clearly in both code and comments, and always prioritize maintainable solutions over quick fixes.