From m2m-developer
Finalize a pull request by fixing test/lint/build failures, running CI checks, updating PR description, and marking ready for review. Auto-detects project type (Rails, Node, Python, Go, Rust, etc.). Handles the feedback loop for PRs where code is written but CI is failing or docs are incomplete. Use when user asks to "finish this PR", "complete the PR", "fix PR failures", or "update PR description".
npx claudepluginhub month2month/m2m-developer-plugin --plugin m2m-developerThis skill is limited to using the following tools:
Complete a pull request by fixing CI failures, running checks, and updating documentation. Auto-detects project type.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Guides TDD-style skill creation: pressure scenarios as tests, baseline agent failures, write docs to enforce compliance, verify with RED-GREEN-REFACTOR.
Guides idea refinement into designs: explores context, asks questions one-by-one, proposes approaches, presents sections for approval, writes/review specs before coding.
Complete a pull request by fixing CI failures, running checks, and updating documentation. Auto-detects project type.
Use this skill when:
Fetch the PR details to understand what was implemented:
# If branch name provided, find the PR
gh pr list --head $ARGUMENTS --json number,title,body,isDraft,headRefName
# Or if PR number provided
gh pr view $ARGUMENTS --json number,title,body,isDraft,headRefName,url,commits
Extract and summarize:
If needed, read the linked issue for full context:
gh issue view <issue-number> --json title,body,labels,comments
Detect the project stack by checking for key files:
Gemfile → Ruby/Rails → bundle exec rspec, rubocop
package.json → Node/JS/TS → npm test, eslint, tsc
pyproject.toml → Python → pytest, ruff/flake8
Cargo.toml → Rust → cargo test, cargo clippy
go.mod → Go → go test, golangci-lint
Makefile → Check targets → make test, make lint
Also check:
CLAUDE.md or README.md for project conventions.github/workflows/ for CI configurationThen review the PR's changes:
# Fetch latest and checkout the PR branch
git fetch origin
git checkout <branch-name>
git pull origin <branch-name>
# Detect default branch
DEFAULT_BRANCH=$(git remote show origin | grep 'HEAD branch' | awk '{print $NF}')
# Review what changed
git diff $DEFAULT_BRANCH...HEAD --stat
git log $DEFAULT_BRANCH..HEAD --oneline
Read the changed files to understand the implementation.
Before running any tests locally, pull the latest CI results from GitHub to understand what's already failing:
# Get the most recent CI check runs for this PR
gh pr checks $ARGUMENTS
# Get detailed workflow run logs if checks are failing
gh run list --branch <branch-name> --limit 3
If there are failing checks:
# Get the run ID of the most recent failed run
RUN_ID=$(gh run list --branch <branch-name> --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 anything locally:
Based on CI results:
Only run checks locally if CI hasn't run yet or you need to verify a fix. Run the project's CI checks based on the detected stack. Prefer Makefile targets if available.
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 / Build (if applicable):
# TypeScript: npx tsc --noEmit / npm run build
# Python: mypy / pyright
# Rust: cargo build
# Go: go build ./...
Focus on tests relevant to the PR's changes for large test suites.
Track the results:
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:
Commit current state with detailed context:
git add -A
git commit -m "$(cat <<'EOF'
WIP: Additional fix attempts for PR
Attempted to fix CI failures with 5 retry attempts.
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 <noreply@anthropic.com>
EOF
)"
git push
Update PR with escalation comment:
gh pr comment $ARGUMENTS --body "$(cat <<'EOF'
⚠️ **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 fixes didn't work and what might be needed]
EOF
)"
Inform the user and stop the workflow.
IF ALL CHECKS PASS: Proceed to Step 5.
Only if all checks passed:
git add -A
git commit -m "$(cat <<'EOF'
Fix CI failures and finalize implementation
[Describe what was fixed - be specific]
- Fixed [specific issue 1]
- Updated [specific issue 2]
All checks now passing.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
EOF
)"
git push
Create a comprehensive PR description based on what was changed:
gh pr edit $ARGUMENTS --body "$(cat <<'EOF'
## Issue
Fixes #X
## Summary
[High-level overview of what was implemented]
## Changes
- [Change 1 with file reference]
- [Change 2 with file reference]
## Testing
- [x] All relevant tests passing
- [x] Linting/formatting checks passing
- [x] Type checking passing (if applicable)
- [x] No regressions
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Refactoring
- [ ] Documentation update
🤖 Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"
Adapt the description to include project-specific sections as appropriate:
If the PR title has "WIP:" prefix and all checks pass, remove it:
CURRENT_TITLE=$(gh pr view $ARGUMENTS --json title -q .title)
NEW_TITLE=$(echo "$CURRENT_TITLE" | sed 's/^WIP: //')
if [ "$NEW_TITLE" != "$CURRENT_TITLE" ]; then
gh pr edit $ARGUMENTS --title "$NEW_TITLE"
fi
If the PR is a draft and all checks pass:
gh pr ready $ARGUMENTS
Report to the user:
✅ PR successfully completed!
**Changes:**
- Fixed [X test failures / lint issues / type errors / etc.]
- Updated PR description with documentation
- All CI checks passing
- PR marked ready for review
**PR URL:** [link]
**Next Steps:**
- PR is ready for code review
- All checks passing
.github/workflows/ tells you exactly what CI runsgit log for the project's conventions