Loading...
Loading...
Use when asked to fix, resolve, or address a GitHub PR — including review comments, Copilot suggestions, and CI test failures. Triggers on phrases like "fix PR", "fix PR comments", "resolve review", "address Copilot feedback", "fix review comments", "fix CI", "fix failing tests on PR", or when given a PR number to fix.
npx skill4agent add universokobana/sdlc-agent-skills fix-github-pr# Auto-detect PR from current branch (when no PR number is given)
gh pr view --json number,title,headRefName,baseRefName,statusCheckRollupgh pr list --limit 10 --json number,title,headRefName$PR_NUMBERgh pr view $PR_NUMBER --json number,title,headRefName,baseRefName,statusCheckRollupgit branch --show-currentgit worktree listgit worktree add ../worktrees/<branch-name> <branch-name>gh api repos/:owner/:repo/pulls/$PR_NUMBER/comments \
--jq '.[] | {id, path, line, body, user: .user.login}'# Get check runs status
gh pr checks $PR_NUMBER
# Get detailed failure logs from the failed check
gh run list --branch <branch-name> --limit 5
gh run view <run-id> --log-failedbundle exec rspec spec/path/to/changed_file_spec.rbgit add <changed files>
git commit -m "fix: address PR review comment in <file>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>"gh api repos/:owner/:repo/pulls/comments/$COMMENT_ID \
--method PATCH \
--field body="✅ Corrigido no commit <hash>"bundle exec rspec spec/path/to/failing_spec.rbsuperpowers:systematic-debuggingbundle exec rspec spec/path/to/failing_spec.rbgit add <changed files>
git commit -m "fix: corrigir spec falhando no CI em <file>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>"# Find all changed files and their specs
git diff main...HEAD --name-only | grep -v _spec | while read f; do
spec="spec/${f#app/}"
spec="${spec%.rb}_spec.rb"
[ -f "$spec" ] && echo "$spec"
done
bundle exec rspec <list of spec files>git push origin <branch-name>gh pr checks $PR_NUMBER --watchgh pr comment $PR_NUMBER --body "## Revisão Concluída
**Comentários de revisão endereçados:**
- <list each resolved comment>
**Falhas de CI corrigidas:**
- <list each fixed spec>
Specs dos arquivos modificados estão passando localmente."| Phase | Action | Success Criteria |
|---|---|---|
| 1. Setup | Get PR info + worktree | Correct worktree active |
| 2. Load issues | Comments + CI failures | Full list collected |
| 3. Review comments | Evaluate → implement → spec → commit → resolve | Comment marked resolved |
| 4. CI failures | Reproduce → diagnose → fix → spec → commit | Spec passes locally |
| 5. Final | Run all related specs + push + summary | PR updated, no red specs |
| Excuse | Reality |
|---|---|
| "Comment is trivial, no test needed" | Every behavior change needs a test. |
| "I'll run all specs at the end" | Run per-file specs after EACH change. |
| "I'll resolve comments in batch" | Resolve after EACH commit, not after all. |
| "This change is obvious, skip the worktree" | Use a worktree only when NOT already on the PR branch. Never switch local branches. |
| "The comment is wrong, I'll ignore it" | Reply explaining why — never silently skip. |
| "CI failure is flaky, I'll ignore it" | Reproduce locally first, then decide. |
| "Spec passes locally, CI must be wrong" | Investigate environment differences — don't assume. |
../worktrees/<branch-name>ghsuperpowers:systematic-debugging