[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CQXTYSV6K96X43M31RR6WZ":3,"skill-same:01M6CQXTYSV6K96X43M31RR6WZ":76},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":40,"linkOnly":41,"markdownContent":42,"markdownBody":43,"frontMatter":44,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":14,"repositoryHtmlUrl":48,"repositoryHomepageUrl":6,"ownerHtmlUrl":49,"ownerBlogUrl":50,"ownerDescription":6,"updatedAt":51,"install":52,"resources":65},"01M6CQXTYSV6K96X43M31RR6WZ","pr-review-loop",null,"Monitor PR for code review, analyze feedback with AI, implement fixes, and merge when approved with CI green.","dundas\u002Fagentbootup-public","dundas","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F627426?v=4","01M6CQVP2KHXEP7JH9WKKF59S7","David K. Dundas","01M6CQVP76D48NCMMXYDK9CBA8",0,"MIT","https:\u002F\u002Fgithub.com\u002Fdundas\u002Fagentbootup-public\u002Fblob\u002Fmain\u002Ftemplates\u002F.claude\u002Fskills\u002Fpr-review-loop\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000007","代码审查","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39],"review","pr review","pr","loop","review loop","pr review loop","code review","implement","merge","monitor pr","monitor","code","ci","analyze","feedback","quality","2026-11-10 10:12:30",false,"---\nname: pr-review-loop\ndescription: Monitor PR for code review, analyze feedback with AI, implement fixes, and merge when approved with CI green.\ncategory: quality\n---\n\n# PR Review Loop\n\n## Goal\nAutomate the PR review cycle: wait for review → analyze feedback → implement fixes → push → repeat until approved and CI passes → merge.\n\n## Input\n- **PR Number** - The GitHub PR to monitor (required)\n- **Repository** - Owner\u002Frepo (auto-detected from git remote if not provided)\n- **Task Context** - Optional link to task list for updating status\n\n## Output\n- PR merged and branch deleted (success path)\n- Or: PR left open with detailed status comment (if human escalation needed)\n- Task list updated with completion status (if task context provided)\n\n---\n\n## Process\n\n### Phase 1: Initial Setup\n\n1. **Validate PR Exists**\n   ```bash\n   gh pr view [PR-number] --json number,state,title,headRefName\n   ```\n   - Confirm PR is open\n   - Capture branch name for later operations\n\n2. **Check Initial CI Status**\n   ```bash\n   gh pr checks [PR-number] --json name,state,conclusion\n   ```\n   - Log current CI state\n   - Note any already-failing checks\n\n### Phase 2: Review Polling Loop\n\n3. **Poll for Reviews and Comments**\n\n   **IMPORTANT:** Feedback can appear in two places:\n   - **Formal Reviews:** Via GitHub's review system (`APPROVED`, `CHANGES_REQUESTED`, `COMMENTED`)\n   - **PR Comments:** Direct comments on the PR conversation thread\n\n   **Both must be checked** as reviewers often leave feedback as comments without formal review submission.\n\n   ```bash\n   # Check formal review state\n   gh api repos\u002F[owner]\u002F[repo]\u002Fpulls\u002F[PR-number]\u002Freviews \\\n     --jq '[.[] | {state: .state, user: .user.login, body: .body, submitted_at}]'\n\n   # Check PR conversation comments (CRITICAL - reviewers often use this)\n   gh pr view [PR-number] --json comments \\\n     --jq '.comments[] | {body: .body, author: .author.login, createdAt}'\n   ```\n\n   **Polling Strategy:**\n   - Check every 60 seconds\n   - **Maximum duration:** 8 hours (480 checks)\n   - Continue until:\n     - Formal review with `APPROVED` or `CHANGES_REQUESTED` state appears, OR\n     - New PR comments detected since last check (analyze for feedback), OR\n     - Timeout reached\n\n   **Status Updates:**\n   - Every 5 minutes: Log \"Still waiting for review on PR #[number]... (checked N times)\"\n   - After 30 minutes: Add PR comment \"Waiting for code review. Please review when available.\"\n   - After 2 hours: Add PR comment \"Still awaiting review after 2 hours. Ping @reviewers if urgent.\"\n   - **After 8 hours:** Add PR comment \"Review polling timeout reached (8 hours). Please notify when review is complete.\" and escalate to user\n\n   **Timeout Escalation:**\n   ```bash\n   # After 480 checks (8 hours)\n   gh pr comment [PR-number] --body \"⏱️ Review polling timeout reached (8 hours).\n\n   I've been monitoring this PR for review feedback but haven't received any.\n   Please notify me when review is complete and I'll resume monitoring.\n\n   To resume: Run \\`\u002Fpr-review-loop [PR-number]\\`\"\n\n   # Log to user\n   echo \"❌ PR #[number] review timeout after 8 hours. Manual intervention needed.\"\n   # Exit with status code indicating timeout\n   exit 124  # Standard timeout exit code\n   ```\n\n4. **Fetch All Review Feedback**\n   ```bash\n   # Get inline review comments (file-specific)\n   gh api repos\u002F[owner]\u002F[repo]\u002Fpulls\u002F[PR-number]\u002Fcomments \\\n     --jq '[.[] | {path: .path, line: .line, body: .body, user: .user.login, created_at}]'\n\n   # Get PR conversation comments (ALREADY fetched in step 3, analyze here)\n   # Parse for review-like feedback even if not formal review\n   ```\n\n### Phase 3: AI Feedback Analysis\n\n5. **Analyze Review Comments with AI**\n\n   For each review\u002Fcomment, classify as:\n\n   | Category | Criteria | Action |\n   |----------|----------|--------|\n   | **BLOCKING** | \"must fix\", \"blocker\", \"breaks\", \"security issue\", \"won't approve until\", explicit CHANGES_REQUESTED | Must address before merge |\n   | **IMPORTANT** | \"should\", \"please consider\", \"would be better\", suggestions with rationale | Address if reasonable effort |\n   | **NIT** | \"nit:\", \"minor:\", \"optional:\", style preferences, typos | Address if trivial, else note |\n   | **QUESTION** | Questions about implementation, \"why did you...?\" | Respond with explanation |\n   | **PRAISE** | \"LGTM\", \"nice\", \"good work\", positive feedback | Acknowledge, no action needed |\n\n   **AI Analysis Prompt:**\n   ```\n   Analyze this code review comment and classify it:\n\n   Comment: \"[comment text]\"\n   File: [file path] (line [line number])\n\n   Classify as: BLOCKING | IMPORTANT | NIT | QUESTION | PRAISE\n\n   Provide:\n   1. Classification with confidence (high\u002Fmedium\u002Flow)\n   2. Summary of what's being requested\n   3. Suggested fix approach (if applicable)\n   4. Estimated effort (trivial\u002Fsmall\u002Fmedium\u002Flarge)\n   ```\n\n6. **Generate Gap Analysis**\n\n   Create structured analysis:\n   ```markdown\n   ## PR #[number] Review Gap Analysis\n\n   **Review State:** CHANGES_REQUESTED | COMMENTED | APPROVED\n   **CI Status:** passing | failing | pending\n   **Generated:** [timestamp]\n\n   ### Blocking Issues (Must Fix)\n   - [ ] [File:line] - [Summary] - [Suggested fix]\n\n   ### Important Issues (Should Fix)\n   - [ ] [File:line] - [Summary] - [Suggested fix]\n\n   ### Nits (Optional)\n   - [ ] [File:line] - [Summary]\n\n   ### Questions to Answer\n   - [ ] [Question] - [Suggested response]\n\n   ### Verdict\n   - **Ready to Merge:** No\n   - **Blocking Count:** N issues\n   - **Fix Complexity:** [trivial\u002Fsmall\u002Fmedium\u002Flarge]\n   ```\n\n### Phase 4: Fix Implementation Loop\n\n7. **If Blocking Issues Exist → Implement Fixes**\n\n   For each blocking issue:\n\n   a. **Read the relevant file**\n      ```bash\n      # Context around the issue\n      sed -n '[start],[end]p' [file-path]\n      ```\n\n   b. **Implement the fix**\n      - Use appropriate agent based on issue type:\n        - Code logic: `tdd-developer`\n        - Security\u002Fsafety: `reliability-engineer`\n        - Architecture: `technical-planner`\n\n   c. **Run tests to verify fix**\n      ```bash\n      bun test [relevant-test-file]\n      # or\n      npm test -- --testPathPattern=[pattern]\n      ```\n\n8. **Commit and Push Fixes**\n   ```bash\n   # Verify git state before operations\n   git status || {\n     echo \"❌ Error: git status failed. Repository may be in bad state.\"\n     exit 1\n   }\n\n   # Stage changes\n   git add [modified-files]\n\n   # Verify files were staged\n   git diff --cached --name-only | grep -q . || {\n     echo \"❌ Error: No files staged. Check if files were modified.\"\n     exit 1\n   }\n\n   # Commit with descriptive message\n   git commit -m \"fix(review): address PR feedback\n\n   - [Summary of fix 1]\n   - [Summary of fix 2]\n\n   Addresses review comments:\n   - [Reviewer]: [Brief quote of feedback addressed]\n\n   Co-Authored-By: Claude Code \u003Cnoreply@anthropic.com>\" || {\n     echo \"❌ Error: git commit failed. Check for pre-commit hooks or conflicts.\"\n     git status\n     exit 1\n   }\n\n   # Verify commit succeeded\n   git log -1 --oneline || {\n     echo \"❌ Error: Could not verify last commit.\"\n     exit 1\n   }\n\n   # Push to PR branch\n   git push origin [branch-name] || {\n     echo \"❌ Error: git push failed. Check network connection and permissions.\"\n     echo \"Branch may need rebasing if remote has new commits.\"\n     git status\n     exit 1\n   }\n\n   # Verify push succeeded\n   git fetch origin\n   LOCAL=$(git rev-parse HEAD)\n   REMOTE=$(git rev-parse origin\u002F[branch-name])\n   if [[ \"$LOCAL\" != \"$REMOTE\" ]]; then\n     echo \"❌ Warning: Local and remote commits don't match. Push may have failed.\"\n   else\n     echo \"✅ Successfully pushed fixes to PR branch\"\n   fi\n   ```\n\n9. **Add Detailed PR Comment**\n   ```bash\n   gh pr comment [PR-number] --body \"$(cat \u003C\u003C'EOF'\n   ## Review Feedback Addressed\n\n   I've pushed changes to address the review feedback:\n\n   ### Changes Made\n   | File | Change | Addresses |\n   |------|--------|-----------|\n   | `[file1]` | [Description] | @[reviewer]'s comment about [topic] |\n   | `[file2]` | [Description] | @[reviewer]'s suggestion to [topic] |\n\n   ### Fixes Summary\n   - **Blocking issues resolved:** N\u002FN\n   - **Important issues resolved:** N\u002FN\n   - **Nits addressed:** N\u002FN\n\n   ### Questions Answered\n   > [Original question]\n\n   [Response with explanation]\n\n   ### CI Status\n   - Tests: [passing\u002Ffailing]\n   - Lint: [passing\u002Ffailing]\n\n   **Ready for re-review.** Please take another look when you have a chance.\n   EOF\n   )\"\n   ```\n\n10. **Loop Back to Step 3**\n    - Wait for re-review\n    - Re-analyze any new comments\n    - Repeat until no blocking issues\n\n### Phase 5: CI Verification\n\n11. **Wait for CI to Complete**\n    ```bash\n    # Poll CI status\n    while true; do\n      STATUS=$(gh pr checks [PR-number] --json state --jq '.[].state' | sort -u)\n\n      if [[ \"$STATUS\" == \"SUCCESS\" ]]; then\n        echo \"All CI checks passed\"\n        break\n      elif [[ \"$STATUS\" == *\"FAILURE\"* ]]; then\n        echo \"CI failed - analyzing...\"\n        # Fetch failure details and fix\n        break\n      fi\n\n      sleep 30\n    done\n    ```\n\n12. **If CI Fails → Fix and Push**\n    ```bash\n    # Get failed check details\n    gh pr checks [PR-number] --json name,conclusion,detailsUrl \\\n      --jq '.[] | select(.conclusion == \"FAILURE\")'\n    ```\n\n    - Analyze failure logs\n    - Implement fix\n    - Commit with `fix(ci): [description]`\n    - Push and wait for CI to re-run\n\n### Phase 6: Merge and Cleanup\n\n13. **Final Readiness Check**\n\n    **All conditions must be true:**\n    - [ ] Review state is `APPROVED` (or no blocking issues remain)\n    - [ ] All CI checks are green\n    - [ ] No unresolved conversations\n    - [ ] Branch is not behind base (no merge conflicts)\n\n14. **Merge PR**\n    ```bash\n    # Squash merge with detailed message\n    gh pr merge [PR-number] --squash --delete-branch \\\n      --subject \"[PR title]\" \\\n      --body \"$(cat \u003C\u003C'EOF'\n    [Detailed description of changes]\n\n    Reviewed-by: [reviewer(s)]\n\n        EOF\n    )\"\n    ```\n\n15. **Update CHANGELOG.md**\n\n    After successful merge, update the changelog with the new entry:\n\n    ```bash\n    # Get merge commit details\n    MERGE_SHA=$(git rev-parse HEAD)\n    MERGE_DATE=$(date +%Y-%m-%d)\n    PR_TITLE=\"[PR title from PR metadata]\"\n    PR_NUMBER=\"[PR-number]\"\n\n    # Detect change type from PR title or labels\n    # feat: → Added\n    # fix: → Fixed\n    # docs: → Documentation\n    # refactor: → Changed\n    # test: → Testing\n    # chore: → Infrastructure\n\n    # Update CHANGELOG.md\n    # Insert new entry under [Unreleased] or create new version section\n    ```\n\n    **Changelog format (Keep a Changelog):**\n    ```markdown\n    # Changelog\n\n    All notable changes to this project will be documented in this file.\n\n    The format is based on [Keep a Changelog](https:\u002F\u002Fkeepachangelog.com\u002Fen\u002F1.0.0\u002F).\n\n    ## [Unreleased]\n\n    ### Added\n    - Feature description from PR #123 (@username, YYYY-MM-DD)\n\n    ### Fixed\n    - Bug fix description from PR #124 (@username, YYYY-MM-DD)\n\n    ### Changed\n    - Refactor description from PR #125 (@username, YYYY-MM-DD)\n\n    ## [1.0.0] - YYYY-MM-DD\n    ...\n    ```\n\n    **Update logic:**\n    1. Check if `CHANGELOG.md` exists, create if not\n    2. Parse PR title for conventional commit type (feat\u002Ffix\u002Fdocs\u002Fetc.)\n    3. Map to changelog category (Added\u002FFixed\u002FChanged\u002Fetc.)\n    4. Insert entry under `[Unreleased]` section\n    5. Include: description, PR number, author, date\n    6. Commit: `docs(changelog): update for PR #[number]`\n    7. Push to main (post-merge)\n\n16. **Update Task List (if context provided)**\n    - Mark parent task as `[x]` completed\n    - Add merge commit SHA as reference\n    - Trigger next dependent task if applicable\n\n17. **Final Summary Comment**\n    ```bash\n    # Comment is auto-added by GitHub on merge, but we can add context\n    gh pr comment [PR-number] --body \"$(cat \u003C\u003C'EOF'\n    ## Merged Successfully\n\n    - **Merge commit:** [SHA]\n    - **Review iterations:** N\n    - **Total fixes:** N blocking, N important, N nits\n    - **Time to merge:** [duration]\n\n    Task list updated. Moving to next phase.\n    EOF\n    )\"\n    ```\n\n---\n\n## Error Handling\n\n### Merge Conflicts\n```bash\n# Detect conflicts\ngh pr view [PR-number] --json mergeable --jq '.mergeable'\n\n# If \"CONFLICTING\":\n# 1. Fetch latest base branch\ngit fetch origin main\n# 2. Rebase PR branch\ngit checkout [branch-name]\ngit rebase origin\u002Fmain\n# 3. Resolve conflicts (may need human help for complex conflicts)\n# 4. Force push\ngit push --force-with-lease origin [branch-name]\n```\n\n### Review Stuck \u002F No Response\n- After 2 hours with no review: Add polite reminder comment\n- After 24 hours: Escalate to user with summary of PR status\n- Log: \"PR #[number] awaiting review for [duration]. Consider reaching out to reviewers.\"\n\n### CI Flaky Tests\n- If same test fails intermittently:\n  1. Re-run CI: `gh pr checks [PR-number] --rerun`\n  2. If fails again, investigate test stability\n  3. Add `[flaky]` label and document in PR comment\n\n### Protected Branch Rules\n- If merge blocked by branch protection:\n  ```bash\n  gh pr view [PR-number] --json mergeStateStatus --jq '.mergeStateStatus'\n  ```\n  - `BLOCKED`: Missing required reviews or checks\n  - `BEHIND`: Branch needs to be updated\n  - Log specific blocker and wait or escalate\n\n---\n\n## Interaction Model\n\n1. **Autonomous by Default** - Runs without user intervention\n2. **Status Updates** - Logs progress every 5 minutes during polling\n3. **Escalation Points:**\n   - Complex merge conflicts → ask user\n   - Review timeout (24h) → notify user\n   - Repeated CI failures → ask user\n4. **Completion Notification** - Final summary when merged\n\n## Integration Points\n\nThis skill can be invoked by:\n- `task-processor-auto` after creating a PR\n- `task-processor-parallel` for each phase PR\n- `dev-workflow-orchestrator` as part of full pipeline\n- Standalone via `\u002Fpr-review-loop [PR-number]` command\n\n## References\n- See `reference.md` for gh CLI patterns\n- See `.claude\u002Fagents\u002Ftdd-developer.md` for fix implementation\n- See `.claude\u002Fagents\u002Freliability-engineer.md` for security fixes\n","# PR Review Loop\n\n## Goal\nAutomate the PR review cycle: wait for review → analyze feedback → implement fixes → push → repeat until approved and CI passes → merge.\n\n## Input\n- **PR Number** - The GitHub PR to monitor (required)\n- **Repository** - Owner\u002Frepo (auto-detected from git remote if not provided)\n- **Task Context** - Optional link to task list for updating status\n\n## Output\n- PR merged and branch deleted (success path)\n- Or: PR left open with detailed status comment (if human escalation needed)\n- Task list updated with completion status (if task context provided)\n\n---\n\n## Process\n\n### Phase 1: Initial Setup\n\n1. **Validate PR Exists**\n   ```bash\n   gh pr view [PR-number] --json number,state,title,headRefName\n   ```\n   - Confirm PR is open\n   - Capture branch name for later operations\n\n2. **Check Initial CI Status**\n   ```bash\n   gh pr checks [PR-number] --json name,state,conclusion\n   ```\n   - Log current CI state\n   - Note any already-failing checks\n\n### Phase 2: Review Polling Loop\n\n3. **Poll for Reviews and Comments**\n\n   **IMPORTANT:** Feedback can appear in two places:\n   - **Formal Reviews:** Via GitHub's review system (`APPROVED`, `CHANGES_REQUESTED`, `COMMENTED`)\n   - **PR Comments:** Direct comments on the PR conversation thread\n\n   **Both must be checked** as reviewers often leave feedback as comments without formal review submission.\n\n   ```bash\n   # Check formal review state\n   gh api repos\u002F[owner]\u002F[repo]\u002Fpulls\u002F[PR-number]\u002Freviews \\\n     --jq '[.[] | {state: .state, user: .user.login, body: .body, submitted_at}]'\n\n   # Check PR conversation comments (CRITICAL - reviewers often use this)\n   gh pr view [PR-number] --json comments \\\n     --jq '.comments[] | {body: .body, author: .author.login, createdAt}'\n   ```\n\n   **Polling Strategy:**\n   - Check every 60 seconds\n   - **Maximum duration:** 8 hours (480 checks)\n   - Continue until:\n     - Formal review with `APPROVED` or `CHANGES_REQUESTED` state appears, OR\n     - New PR comments detected since last check (analyze for feedback), OR\n     - Timeout reached\n\n   **Status Updates:**\n   - Every 5 minutes: Log \"Still waiting for review on PR #[number]... (checked N times)\"\n   - After 30 minutes: Add PR comment \"Waiting for code review. Please review when available.\"\n   - After 2 hours: Add PR comment \"Still awaiting review after 2 hours. Ping @reviewers if urgent.\"\n   - **After 8 hours:** Add PR comment \"Review polling timeout reached (8 hours). Please notify when review is complete.\" and escalate to user\n\n   **Timeout Escalation:**\n   ```bash\n   # After 480 checks (8 hours)\n   gh pr comment [PR-number] --body \"⏱️ Review polling timeout reached (8 hours).\n\n   I've been monitoring this PR for review feedback but haven't received any.\n   Please notify me when review is complete and I'll resume monitoring.\n\n   To resume: Run \\`\u002Fpr-review-loop [PR-number]\\`\"\n\n   # Log to user\n   echo \"❌ PR #[number] review timeout after 8 hours. Manual intervention needed.\"\n   # Exit with status code indicating timeout\n   exit 124  # Standard timeout exit code\n   ```\n\n4. **Fetch All Review Feedback**\n   ```bash\n   # Get inline review comments (file-specific)\n   gh api repos\u002F[owner]\u002F[repo]\u002Fpulls\u002F[PR-number]\u002Fcomments \\\n     --jq '[.[] | {path: .path, line: .line, body: .body, user: .user.login, created_at}]'\n\n   # Get PR conversation comments (ALREADY fetched in step 3, analyze here)\n   # Parse for review-like feedback even if not formal review\n   ```\n\n### Phase 3: AI Feedback Analysis\n\n5. **Analyze Review Comments with AI**\n\n   For each review\u002Fcomment, classify as:\n\n   | Category | Criteria | Action |\n   |----------|----------|--------|\n   | **BLOCKING** | \"must fix\", \"blocker\", \"breaks\", \"security issue\", \"won't approve until\", explicit CHANGES_REQUESTED | Must address before merge |\n   | **IMPORTANT** | \"should\", \"please consider\", \"would be better\", suggestions with rationale | Address if reasonable effort |\n   | **NIT** | \"nit:\", \"minor:\", \"optional:\", style preferences, typos | Address if trivial, else note |\n   | **QUESTION** | Questions about implementation, \"why did you...?\" | Respond with explanation |\n   | **PRAISE** | \"LGTM\", \"nice\", \"good work\", positive feedback | Acknowledge, no action needed |\n\n   **AI Analysis Prompt:**\n   ```\n   Analyze this code review comment and classify it:\n\n   Comment: \"[comment text]\"\n   File: [file path] (line [line number])\n\n   Classify as: BLOCKING | IMPORTANT | NIT | QUESTION | PRAISE\n\n   Provide:\n   1. Classification with confidence (high\u002Fmedium\u002Flow)\n   2. Summary of what's being requested\n   3. Suggested fix approach (if applicable)\n   4. Estimated effort (trivial\u002Fsmall\u002Fmedium\u002Flarge)\n   ```\n\n6. **Generate Gap Analysis**\n\n   Create structured analysis:\n   ```markdown\n   ## PR #[number] Review Gap Analysis\n\n   **Review State:** CHANGES_REQUESTED | COMMENTED | APPROVED\n   **CI Status:** passing | failing | pending\n   **Generated:** [timestamp]\n\n   ### Blocking Issues (Must Fix)\n   - [ ] [File:line] - [Summary] - [Suggested fix]\n\n   ### Important Issues (Should Fix)\n   - [ ] [File:line] - [Summary] - [Suggested fix]\n\n   ### Nits (Optional)\n   - [ ] [File:line] - [Summary]\n\n   ### Questions to Answer\n   - [ ] [Question] - [Suggested response]\n\n   ### Verdict\n   - **Ready to Merge:** No\n   - **Blocking Count:** N issues\n   - **Fix Complexity:** [trivial\u002Fsmall\u002Fmedium\u002Flarge]\n   ```\n\n### Phase 4: Fix Implementation Loop\n\n7. **If Blocking Issues Exist → Implement Fixes**\n\n   For each blocking issue:\n\n   a. **Read the relevant file**\n      ```bash\n      # Context around the issue\n      sed -n '[start],[end]p' [file-path]\n      ```\n\n   b. **Implement the fix**\n      - Use appropriate agent based on issue type:\n        - Code logic: `tdd-developer`\n        - Security\u002Fsafety: `reliability-engineer`\n        - Architecture: `technical-planner`\n\n   c. **Run tests to verify fix**\n      ```bash\n      bun test [relevant-test-file]\n      # or\n      npm test -- --testPathPattern=[pattern]\n      ```\n\n8. **Commit and Push Fixes**\n   ```bash\n   # Verify git state before operations\n   git status || {\n     echo \"❌ Error: git status failed. Repository may be in bad state.\"\n     exit 1\n   }\n\n   # Stage changes\n   git add [modified-files]\n\n   # Verify files were staged\n   git diff --cached --name-only | grep -q . || {\n     echo \"❌ Error: No files staged. Check if files were modified.\"\n     exit 1\n   }\n\n   # Commit with descriptive message\n   git commit -m \"fix(review): address PR feedback\n\n   - [Summary of fix 1]\n   - [Summary of fix 2]\n\n   Addresses review comments:\n   - [Reviewer]: [Brief quote of feedback addressed]\n\n   Co-Authored-By: Claude Code \u003Cnoreply@anthropic.com>\" || {\n     echo \"❌ Error: git commit failed. Check for pre-commit hooks or conflicts.\"\n     git status\n     exit 1\n   }\n\n   # Verify commit succeeded\n   git log -1 --oneline || {\n     echo \"❌ Error: Could not verify last commit.\"\n     exit 1\n   }\n\n   # Push to PR branch\n   git push origin [branch-name] || {\n     echo \"❌ Error: git push failed. Check network connection and permissions.\"\n     echo \"Branch may need rebasing if remote has new commits.\"\n     git status\n     exit 1\n   }\n\n   # Verify push succeeded\n   git fetch origin\n   LOCAL=$(git rev-parse HEAD)\n   REMOTE=$(git rev-parse origin\u002F[branch-name])\n   if [[ \"$LOCAL\" != \"$REMOTE\" ]]; then\n     echo \"❌ Warning: Local and remote commits don't match. Push may have failed.\"\n   else\n     echo \"✅ Successfully pushed fixes to PR branch\"\n   fi\n   ```\n\n9. **Add Detailed PR Comment**\n   ```bash\n   gh pr comment [PR-number] --body \"$(cat \u003C\u003C'EOF'\n   ## Review Feedback Addressed\n\n   I've pushed changes to address the review feedback:\n\n   ### Changes Made\n   | File | Change | Addresses |\n   |------|--------|-----------|\n   | `[file1]` | [Description] | @[reviewer]'s comment about [topic] |\n   | `[file2]` | [Description] | @[reviewer]'s suggestion to [topic] |\n\n   ### Fixes Summary\n   - **Blocking issues resolved:** N\u002FN\n   - **Important issues resolved:** N\u002FN\n   - **Nits addressed:** N\u002FN\n\n   ### Questions Answered\n   > [Original question]\n\n   [Response with explanation]\n\n   ### CI Status\n   - Tests: [passing\u002Ffailing]\n   - Lint: [passing\u002Ffailing]\n\n   **Ready for re-review.** Please take another look when you have a chance.\n   EOF\n   )\"\n   ```\n\n10. **Loop Back to Step 3**\n    - Wait for re-review\n    - Re-analyze any new comments\n    - Repeat until no blocking issues\n\n### Phase 5: CI Verification\n\n11. **Wait for CI to Complete**\n    ```bash\n    # Poll CI status\n    while true; do\n      STATUS=$(gh pr checks [PR-number] --json state --jq '.[].state' | sort -u)\n\n      if [[ \"$STATUS\" == \"SUCCESS\" ]]; then\n        echo \"All CI checks passed\"\n        break\n      elif [[ \"$STATUS\" == *\"FAILURE\"* ]]; then\n        echo \"CI failed - analyzing...\"\n        # Fetch failure details and fix\n        break\n      fi\n\n      sleep 30\n    done\n    ```\n\n12. **If CI Fails → Fix and Push**\n    ```bash\n    # Get failed check details\n    gh pr checks [PR-number] --json name,conclusion,detailsUrl \\\n      --jq '.[] | select(.conclusion == \"FAILURE\")'\n    ```\n\n    - Analyze failure logs\n    - Implement fix\n    - Commit with `fix(ci): [description]`\n    - Push and wait for CI to re-run\n\n### Phase 6: Merge and Cleanup\n\n13. **Final Readiness Check**\n\n    **All conditions must be true:**\n    - [ ] Review state is `APPROVED` (or no blocking issues remain)\n    - [ ] All CI checks are green\n    - [ ] No unresolved conversations\n    - [ ] Branch is not behind base (no merge conflicts)\n\n14. **Merge PR**\n    ```bash\n    # Squash merge with detailed message\n    gh pr merge [PR-number] --squash --delete-branch \\\n      --subject \"[PR title]\" \\\n      --body \"$(cat \u003C\u003C'EOF'\n    [Detailed description of changes]\n\n    Reviewed-by: [reviewer(s)]\n\n        EOF\n    )\"\n    ```\n\n15. **Update CHANGELOG.md**\n\n    After successful merge, update the changelog with the new entry:\n\n    ```bash\n    # Get merge commit details\n    MERGE_SHA=$(git rev-parse HEAD)\n    MERGE_DATE=$(date +%Y-%m-%d)\n    PR_TITLE=\"[PR title from PR metadata]\"\n    PR_NUMBER=\"[PR-number]\"\n\n    # Detect change type from PR title or labels\n    # feat: → Added\n    # fix: → Fixed\n    # docs: → Documentation\n    # refactor: → Changed\n    # test: → Testing\n    # chore: → Infrastructure\n\n    # Update CHANGELOG.md\n    # Insert new entry under [Unreleased] or create new version section\n    ```\n\n    **Changelog format (Keep a Changelog):**\n    ```markdown\n    # Changelog\n\n    All notable changes to this project will be documented in this file.\n\n    The format is based on [Keep a Changelog](https:\u002F\u002Fkeepachangelog.com\u002Fen\u002F1.0.0\u002F).\n\n    ## [Unreleased]\n\n    ### Added\n    - Feature description from PR #123 (@username, YYYY-MM-DD)\n\n    ### Fixed\n    - Bug fix description from PR #124 (@username, YYYY-MM-DD)\n\n    ### Changed\n    - Refactor description from PR #125 (@username, YYYY-MM-DD)\n\n    ## [1.0.0] - YYYY-MM-DD\n    ...\n    ```\n\n    **Update logic:**\n    1. Check if `CHANGELOG.md` exists, create if not\n    2. Parse PR title for conventional commit type (feat\u002Ffix\u002Fdocs\u002Fetc.)\n    3. Map to changelog category (Added\u002FFixed\u002FChanged\u002Fetc.)\n    4. Insert entry under `[Unreleased]` section\n    5. Include: description, PR number, author, date\n    6. Commit: `docs(changelog): update for PR #[number]`\n    7. Push to main (post-merge)\n\n16. **Update Task List (if context provided)**\n    - Mark parent task as `[x]` completed\n    - Add merge commit SHA as reference\n    - Trigger next dependent task if applicable\n\n17. **Final Summary Comment**\n    ```bash\n    # Comment is auto-added by GitHub on merge, but we can add context\n    gh pr comment [PR-number] --body \"$(cat \u003C\u003C'EOF'\n    ## Merged Successfully\n\n    - **Merge commit:** [SHA]\n    - **Review iterations:** N\n    - **Total fixes:** N blocking, N important, N nits\n    - **Time to merge:** [duration]\n\n    Task list updated. Moving to next phase.\n    EOF\n    )\"\n    ```\n\n---\n\n## Error Handling\n\n### Merge Conflicts\n```bash\n# Detect conflicts\ngh pr view [PR-number] --json mergeable --jq '.mergeable'\n\n# If \"CONFLICTING\":\n# 1. Fetch latest base branch\ngit fetch origin main\n# 2. Rebase PR branch\ngit checkout [branch-name]\ngit rebase origin\u002Fmain\n# 3. Resolve conflicts (may need human help for complex conflicts)\n# 4. Force push\ngit push --force-with-lease origin [branch-name]\n```\n\n### Review Stuck \u002F No Response\n- After 2 hours with no review: Add polite reminder comment\n- After 24 hours: Escalate to user with summary of PR status\n- Log: \"PR #[number] awaiting review for [duration]. Consider reaching out to reviewers.\"\n\n### CI Flaky Tests\n- If same test fails intermittently:\n  1. Re-run CI: `gh pr checks [PR-number] --rerun`\n  2. If fails again, investigate test stability\n  3. Add `[flaky]` label and document in PR comment\n\n### Protected Branch Rules\n- If merge blocked by branch protection:\n  ```bash\n  gh pr view [PR-number] --json mergeStateStatus --jq '.mergeStateStatus'\n  ```\n  - `BLOCKED`: Missing required reviews or checks\n  - `BEHIND`: Branch needs to be updated\n  - Log specific blocker and wait or escalate\n\n---\n\n## Interaction Model\n\n1. **Autonomous by Default** - Runs without user intervention\n2. **Status Updates** - Logs progress every 5 minutes during polling\n3. **Escalation Points:**\n   - Complex merge conflicts → ask user\n   - Review timeout (24h) → notify user\n   - Repeated CI failures → ask user\n4. **Completion Notification** - Final summary when merged\n\n## Integration Points\n\nThis skill can be invoked by:\n- `task-processor-auto` after creating a PR\n- `task-processor-parallel` for each phase PR\n- `dev-workflow-orchestrator` as part of full pipeline\n- Standalone via `\u002Fpr-review-loop [PR-number]` command\n\n## References\n- See `reference.md` for gh CLI patterns\n- See `.claude\u002Fagents\u002Ftdd-developer.md` for fix implementation\n- See `.claude\u002Fagents\u002Freliability-engineer.md` for security fixes\n",{"name":5,"category":39,"description":7},"main","47b89745588c3057f0ccd0517a2eb8967df27054","templates\u002F.claude\u002Fskills\u002Fpr-review-loop","https:\u002F\u002Fgithub.com\u002Fdundas\u002Fagentbootup-public","https:\u002F\u002Fgithub.com\u002Fdundas","derivative.io","2026-09-02 20:12:15",{"source":8,"skillName":5,"commands":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add dundas\u002Fagentbootup-public --skill pr-review-loop",{"tool":58,"command":59},"bunx","bunx skills add dundas\u002Fagentbootup-public --skill pr-review-loop",{"tool":61,"command":62},"pnpm","pnpm dlx skills add dundas\u002Fagentbootup-public --skill pr-review-loop","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdundas\u002Fagentbootup-public\u002Fblob\u002Fmain\u002Ftemplates\u002F.claude\u002Fskills\u002Fpr-review-loop\u002FSKILL.md",true,[66,72],{"path":67,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":70,"sourceHtmlUrl":71},"reference.md","REFERENCE","参考文档",13066,"https:\u002F\u002Fgithub.com\u002Fdundas\u002Fagentbootup-public\u002Fblob\u002Fmain\u002Ftemplates\u002F.claude\u002Fskills\u002Fpr-review-loop\u002Freference.md",{"path":73,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":74,"sourceHtmlUrl":75},"skill-bundle-manifest.json",1003,"https:\u002F\u002Fgithub.com\u002Fdundas\u002Fagentbootup-public\u002Fblob\u002Fmain\u002Ftemplates\u002F.claude\u002Fskills\u002Fpr-review-loop\u002Fskill-bundle-manifest.json",[77,89,109,129,138,159],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":86,"publishedAt":40},"01M6CQZ7DFJB965BJJ5ZZ54CXY","fixture-skill","Secret-free recovery fixture skill.","https:\u002F\u002Fgithub.com\u002Fdundas\u002Fagentbootup-public\u002Fblob\u002Fmain\u002Ftests\u002Fruntime-adapters\u002Ffixtures\u002Fhermes\u002F0.18.2-darwin-arm64-real\u002Froot\u002Fskills\u002Ffixture-skill\u002FSKILL.md",[83],{"categoryNo":84,"categoryName":85,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[87,88],"fixture skill","recovery",{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":100,"publishedAt":40},"01M6CQZ4NN0KVH1Z4E1Y1GJ3X9","user-story-generator","Generate standalone user stories for features without creating a full PRD. Perfect for backlog grooming and story refinement.","https:\u002F\u002Fgithub.com\u002Fdundas\u002Fagentbootup-public\u002Fblob\u002Fmain\u002Ftemplates\u002F.claude\u002Fskills\u002Fuser-story-generator\u002FSKILL.md",[95],{"categoryNo":96,"categoryName":97,"taxonomyType":98,"taxonomyTypeDesc":99},"01JBSEEDCAT000000000000031","产品经理","PROFESSION","适用职业",[101,102,103,104,105,106,107,108],"user story generator","Story","user story","user","prd","documentation","generate","backlog",{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":113,"categories":114,"keywords":121,"publishedAt":40},"01M6CQZ16VC27HMWM31CCKK6BC","user-journey-mapper","Map user flows and journeys through your application for UX design and workflow visualization, independent of testing.","https:\u002F\u002Fgithub.com\u002Fdundas\u002Fagentbootup-public\u002Fblob\u002Fmain\u002Ftemplates\u002F.claude\u002Fskills\u002Fuser-journey-mapper\u002FSKILL.md",[115,118],{"categoryNo":116,"categoryName":117,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":119,"categoryName":120,"taxonomyType":98,"taxonomyTypeDesc":99},"01JBSEEDCAT000000000000032","设计师",[122,123,104,106,124,125,126,127,128],"user journey mapper","journey","ux","visualization","workflow","design","testing",{"skillNo":130,"name":131,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":132,"categories":133,"keywords":134,"publishedAt":40},"01M6CQYXSQQJ4Z5CRAX2SSMHW1","transcript-query","https:\u002F\u002Fgithub.com\u002Fdundas\u002Fagentbootup-public\u002Fblob\u002Fmain\u002Ftemplates\u002F.claude\u002Fskills\u002Ftranscript-query\u002FSKILL.md",[],[135,136,137],"transcript","transcript query","query",{"skillNo":139,"name":140,"nameZh":6,"description":141,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":142,"categories":143,"keywords":148,"publishedAt":40},"01M6CQYT7A1G4CPQTZKXR5TCK9","test-plan-generator","Generate comprehensive E2E test plans from PRDs, task lists, or descriptions with environment-aware prerequisites and issue tracking.","https:\u002F\u002Fgithub.com\u002Fdundas\u002Fagentbootup-public\u002Fblob\u002Fmain\u002Ftemplates\u002F.claude\u002Fskills\u002Ftest-plan-generator\u002FSKILL.md",[144,145],{"categoryNo":116,"categoryName":117,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":146,"categoryName":147,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000010","后端与接口",[149,150,151,152,153,154,155,156,157,39,107,158],"plan","test plan generator","test plan","test","task","issue","e2e test","environment","tracking","e2e",{"skillNo":160,"name":161,"nameZh":6,"description":162,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":163,"categories":164,"keywords":166,"publishedAt":40},"01M6CQYQAWFSPTYE2VTJJVW72G","tasklist-generator","Generate high-level tasks and gated sub-tasks from a PRD, with agent assignments, commit\u002FPR strategy, and relevant files.","https:\u002F\u002Fgithub.com\u002Fdundas\u002Fagentbootup-public\u002Fblob\u002Fmain\u002Ftemplates\u002F.claude\u002Fskills\u002Ftasklist-generator\u002FSKILL.md",[165],{"categoryNo":84,"categoryName":85,"taxonomyType":21,"taxonomyTypeDesc":22},[167,168,169,170,105,107,171,26,172,126],"tasklist generator","gated","files","strategy","tasks","commit"]