Imported from Yingming-Mao/pto_sdma (
.claude/skills/fix-issue/SKILL.md). Install upstream withnpx skills add Yingming-Mao/pto_sdma --skill fix-issue. Copyright stays with the author.
Fix Issue Workflow
Fetch GitHub issue, create branch, plan, and implement the fix.
Workflow
- Check gh CLI authentication
- Fetch issue content
- Assign issue to me
- Create issue branch
- Enter plan mode to design fix
- Implement the fix
- Run tests (use
testingskill) - Commit changes (use
git-commitskill)
Step 1: Check gh CLI Authentication
gh auth status
If not authenticated, prompt user:
gh CLI is not authenticated. Please run: gh auth login
Stop here if not authenticated.
Step 2: Fetch Issue Content
gh issue view ISSUE_NUMBER
gh issue view ISSUE_NUMBER --json number,title,body,state,labels
Parse: Issue number, title, description, state (open/closed), labels
If issue is closed: Ask user if they still want to work on it.
Step 3: Assign Issue to Me
Before assigning, check if someone is already working on the issue:
gh issue view ISSUE_NUMBER --json assignees --jq '.assignees[].login'
If assigned to current user: Continue — already claimed.
If assigned to someone else: Ask the user whether to proceed or pick a different issue.
If unassigned: Assign to yourself (best-effort — skip gracefully if permissions are insufficient):
gh issue edit ISSUE_NUMBER --add-assignee @me
If the assignment fails due to permissions, continue with the workflow — do not block.
Step 4: Create Issue Branch
Branch naming: fix/issue-{number}-{short-description}
Use a prefix that matches the issue type:
| Issue Type | Branch Prefix |
|---|---|
| Bug fix | fix/ |
| New feature | feat/ |
| Refactoring | refactor/ |
| Documentation | docs/ |
| Other | support/ |
git checkout main && git pull origin main
BRANCH_NAME="fix/issue-${ISSUE_NUM}-short-description"
git checkout -b "$BRANCH_NAME"
Important: Always branch from origin/main. Never use other remotes.
Step 5: Enter Plan Mode
Use EnterPlanMode to design the fix.
Plan should cover:
- Root cause analysis (for bugs)
- Files that need changes
- Implementation strategy
- Testing approach (simulation, hardware, or both)
- Which runtime(s) are affected
Step 6: Implement the Fix
After plan approval, follow project conventions:
- Make code changes following plan
- Follow
.claude/rules/conventions - Stay within your assigned directory (see
CLAUDE.mdDirectory Ownership) - Add/update tests if applicable
Step 7: Run Tests
/testing
Fix any failures before committing.
Step 8: Commit Changes
/git-commit
Commit message format:
Fix: brief description
Fixes #ISSUE_NUMBER
Detailed explanation of the fix.
Common Issue Types
| Type | Approach |
|---|---|
| Bug fix | Reproduce, root cause, fix, add regression test |
| Feature request | Plan design, implement, add tests |
| Refactoring | Plan changes, ensure tests pass |
| Documentation | Fix/improve docs, verify examples work |
Checklist
- gh CLI authenticated
- Issue content fetched and understood
- Issue assignment attempted (best-effort)
- Issue branch created from latest
origin/main - Plan created and approved
- Fix implemented following
.claude/rules/ - Tests passing
- Changes committed with issue reference (
Fixes #N)
Remember
Reference the issue number in commit messages using Fixes #ISSUE_NUMBER for auto-linking.
