Get the FREE Ultimate OpenClaw Setup Guide →

fix-issue

npx machina-cli add skill yu-iskw/coding-agent-fabric/fix-issue --openclaw
Files (1)
SKILL.md
2.4 KB

Fix GitHub Issue

Purpose

A complete workflow for fixing GitHub issues from understanding the problem to creating a pull request.

Arguments

  • $ARGUMENTS: GitHub issue number (e.g., 123 or #123)

Workflow

1. Understand the Issue

gh issue view $ARGUMENTS

Analyze:

  • What is the reported problem?
  • What is the expected behavior?
  • What is the actual behavior?
  • Are there reproduction steps?

2. Research the Codebase

Search for relevant code:

# Search for keywords from the issue
grep -r "keyword" src/

# Find related files
find . -name "*.ts" | xargs grep -l "relatedTerm"

Understand:

  • Which files are involved?
  • What is the current implementation?
  • Where does the bug originate?

3. Create Feature Branch

git checkout -b fix/issue-$ARGUMENTS-<brief-description>

4. Implement the Fix

Apply the minimum necessary change to resolve the issue:

  • Fix the root cause, not symptoms
  • Don't refactor unrelated code
  • Keep changes focused and reviewable

5. Add/Update Tests

Create tests that:

  • Reproduce the original bug (should fail without fix)
  • Verify the fix works (should pass with fix)
  • Cover edge cases

6. Verify the Fix

Run the verification cycle:

pnpm lint
pnpm test
pnpm build

Or invoke the verifier subagent for comprehensive validation.

7. Commit Changes

git add <specific-files>
git commit -m "fix(scope): brief description

Fixes #$ARGUMENTS"

8. Create Pull Request

git push -u origin HEAD

gh pr create --title "fix(scope): description" --body "$(cat <<'EOF'
## Summary
Fixes #$ARGUMENTS

## Problem
[Description of the issue]

## Solution
[How this PR fixes it]

## Testing
- [ ] Added test case for the bug
- [ ] All tests pass
- [ ] Manually verified the fix

## Changes
- [List specific changes]
EOF
)"

Quick Reference

TaskCommand
View issuegh issue view <number>
List issuesgh issue list
Create branchgit checkout -b fix/issue-<n>-<desc>
Link PR to issueInclude Fixes #<n> in commit message
Close issue via PRInclude Closes #<n> in PR body

Source

git clone https://github.com/yu-iskw/coding-agent-fabric/blob/main/.claude/skills/fix-issue/SKILL.mdView on GitHub

Overview

This skill guides you through fixing a GitHub issue from understanding the report to creating a pull request. It emphasizes minimal, focused changes, adding tests, and thorough verification.

How This Skill Works

Use gh to view the issue, search the codebase with grep and file queries to locate the relevant area, and create a feature branch. Implement the fix with the minimum necessary change, add or update tests, run lint, tests, and build (or the verifier), then commit with a conventional message and open a PR linked to the issue.

When to Use It

  • A user reports a bug in a GitHub issue and provides reproduction steps or context.
  • You need to locate the root cause in the codebase and propose a targeted fix.
  • The fix requires adding or updating tests to reproduce the bug and verify the solution.
  • You must run lint, tests, and build (or use the verifier) to ensure quality before merging.
  • You want to link the fix to the original issue and create a PR with Fixes #<issue-number>.

Quick Start

  1. Step 1: View and understand the issue with gh issue view <number> and note reproduction steps.
  2. Step 2: Create a feature branch, implement the minimal fix, and add/update tests.
  3. Step 3: Run pnpm lint, pnpm test, and pnpm build (or the verifier), then commit and open a PR.

Best Practices

  • Carefully reproduce the issue and clearly identify the root cause before coding.
  • Make the minimal, focused change that resolves the problem; avoid unrelated refactors.
  • Add tests that fail before the fix and pass after, covering edge cases if possible.
  • Use a conventional commit message: fix(scope): brief description and include Fixes #<n>.
  • Document the fix in the PR body with Summary, Problem, Solution, Testing, and Changes, and run lint/test/build locally.

Example Use Cases

  • Fix off-by-one error in a pagination calculation causing incorrect page counts.
  • Resolve a null reference when submitting a form with empty or missing fields.
  • Correct API data mapping that yields incorrect fields in the UI.
  • Stabilize a flaky test by improving test data setup and timing assumptions.
  • Fix incorrect error message displayed to users during authentication failures.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers