From m2m-developer
Analyze and fix GitHub issues end-to-end. Auto-detects project type (Rails, Node, Python, Go, Rust, etc.), fetches issue details, implements fixes, writes tests, runs CI checks, and creates PRs. If CI checks fail, retries up to 5 times. After 5 failed attempts, creates a draft PR and escalates. Use when user asks to fix or work on a GitHub issue.
How this skill is triggered — by the user, by Claude, or both
Slash command
/m2m-developer:fix-issueThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Please analyze and fix GitHub issue #$ARGUMENTS following this complete workflow:
Please analyze and fix GitHub issue #$ARGUMENTS following this complete workflow:
Use gh issue view $ARGUMENTS --json title,body,labels,comments to get full issue details.
Extract and summarize:
Before proceeding, detect the project stack by checking for key files:
Gemfile → Ruby/Rails → use bundle exec rspec, rubocop
package.json → Node/JS/TS → use npm/yarn/pnpm test, eslint
pyproject.toml → Python → use pytest, ruff/flake8
requirements.txt → Python → use pytest, ruff/flake8
Cargo.toml → Rust → use cargo test, cargo clippy
go.mod → Go → use go test, golangci-lint
Makefile → Check targets → use make test, make lint if available
Also check for:
CLAUDE.md or README.md for project-specific conventions.github/workflows/ for CI configuration (tells you exactly what CI runs).rubocop.yml, .eslintrc, ruff.toml, .golangci.yml, etc.)Store the detected stack info - you'll use it throughout the workflow.
# Detect the default branch
DEFAULT_BRANCH=$(git remote show origin | grep 'HEAD branch' | awk '{print $NF}')
# Update and branch from it
git checkout $DEFAULT_BRANCH && git pull origin $DEFAULT_BRANCH
git checkout -b fix/$ARGUMENTS-brief-description
Use fix/ prefix for bugs and feature/ prefix for new features or enhancements. Follow any branch naming conventions found in CLAUDE.md or contributing docs.
CLAUDE.md or CONTRIBUTING.md for project conventionsWrite tests that:
Run only the relevant tests first to iterate quickly:
Ruby/Rails:
bundle exec rspec spec/path/to/relevant_spec.rb
Node/JS/TS:
npm test -- --testPathPattern=path/to/test
# or: npx jest path/to/test
# or: npx vitest run path/to/test
Python:
pytest tests/path/to/test_file.py -v
Go:
go test ./path/to/package/... -v -run TestName
Rust:
cargo test test_name -- --nocapture
First, check if there are existing CI results (e.g., if you've already pushed):
# Check for any CI runs on the current branch
gh run list --branch $(git branch --show-current) --limit 3
If CI has run and there are failures:
# Get the most recent failed run ID
RUN_ID=$(gh run list --branch $(git branch --show-current) --limit 1 --json databaseId,status,conclusion -q '.[0].databaseId')
# Download and inspect the failure logs
gh run view $RUN_ID --log-failed
Analyze CI failures before running checks locally - use the CI output to understand what's failing and why.
If no CI results are available, run the project's CI checks locally. Prefer Makefile targets if available, otherwise use the detected stack commands:
Linting:
# Ruby: bundle exec rubocop
# JS/TS: npm run lint
# Python: ruff check . / flake8
# Go: golangci-lint run
# Rust: cargo clippy
# Or: make lint
Tests:
# Ruby: bundle exec rspec (relevant specs)
# JS/TS: npm test
# Python: pytest
# Go: go test ./...
# Rust: cargo test
# Or: make test
Type checking (if applicable):
# TypeScript: npx tsc --noEmit
# Python: mypy / pyright
Note: For large test suites, focus on specs relevant to your changes rather than the entire suite unless changes are wide-reaching.
IF ANY CHECKS FAIL:
For each failed attempt (up to 5 total):
Analyze the Failure
Create a Fix Plan
Implement the Fix
Re-run Checks
Evaluate Results
If checks still fail after 5 attempts:
Create a draft PR with detailed context:
git add -A
git commit -m "$(cat <<'EOF'
WIP: Fix #$ARGUMENTS - [brief description]
Attempted fix with 5 retry attempts.
CI checks still failing - requires human review.
Attempts made:
1. [What was tried in attempt 1]
2. [What was tried in attempt 2]
3. [What was tried in attempt 3]
4. [What was tried in attempt 4]
5. [What was tried in attempt 5]
Co-Authored-By: Claude Opus 4.6 <[email protected]>
EOF
)"
git push -u origin HEAD
Then create the draft PR:
gh pr create --draft \
--title "WIP: Fix #$ARGUMENTS - [brief description]" \
--body "$(cat <<'EOF'
## Issue
Fixes #$ARGUMENTS
## Changes
[Describe what was changed]
## Status
⚠️ **Automated fix attempted but CI checks still failing after 5 attempts**
## Retry Attempts
1. **Attempt 1**: [What was tried and what failed]
2. **Attempt 2**: [What was tried and what failed]
3. **Attempt 3**: [What was tried and what failed]
4. **Attempt 4**: [What was tried and what failed]
5. **Attempt 5**: [What was tried and what failed]
## Current Failures
[Most recent error output]
## Analysis
[Analysis of why the fixes didn't work and what might be needed]
🤖 Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"
Inform the user and stop the workflow.
IF ALL CHECKS PASS: Proceed to Step 9.
Only if all checks passed:
git add -A
git commit -m "$(cat <<'EOF'
Fix #$ARGUMENTS: [clear, descriptive summary]
[Detailed explanation of the fix]
Closes #$ARGUMENTS
Co-Authored-By: Claude Opus 4.6 <[email protected]>
EOF
)"
git push -u origin HEAD
gh pr create \
--title "Fix #$ARGUMENTS: [brief description]" \
--body "$(cat <<'EOF'
## Issue
Fixes #$ARGUMENTS
## Changes
[Describe the changes made with file references]
## Testing
- [x] Relevant tests passing
- [x] No regressions in related tests
- [x] Linting/type checks passing
- [x] Edge cases covered
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
🤖 Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"
Provide the PR URL to the user.
.github/workflows/ tells you exactly what CI runsgit log for the project's commit message conventionsnpx claudepluginhub month2month/m2m-developer-plugin --plugin m2m-developerFixes GitHub issues end-to-end with GitHub CLI: views issue, researches context, plans fix, creates branch, implements/tests changes, submits PR.
Starts GitHub issue work: fetches details via gh CLI, creates worktree/branch, detects bug/feature, explores codebase, proposes design before implementing.
Fixes GitHub issues using parallel analysis, hypothesis-based root cause analysis, similar issue detection, and prevention recommendations. Use for debugging errors, regressions, bugs, or triaging.