{"id":"15547568-6fb8-461c-adb5-d8f615ec3131","shortId":"7y7jyt","kind":"skill","title":"iterate-pr","tagline":"Iterate on a PR until CI passes. Use when you need to fix CI failures, address review feedback, or continuously push fixes until all checks are green. Automates the feedback-fix-push-wait cycle.","description":"# Iterate on PR Until CI Passes\n\nContinuously iterate on the current branch until all CI checks pass and review feedback is addressed.\n\n**Requires**: GitHub CLI (`gh`) authenticated.\n\n**Important**: All scripts must be run from the repository root directory (where `.git` is located), not from the skill directory. Use the full path to the script via `${CLAUDE_SKILL_ROOT}`.\n\n## Bundled Scripts\n\n### `scripts/fetch_pr_checks.py`\n\nFetches CI check status and extracts failure snippets from logs.\n\n```bash\nuv run ${CLAUDE_SKILL_ROOT}/scripts/fetch_pr_checks.py [--pr NUMBER]\n```\n\nReturns JSON:\n```json\n{\n  \"pr\": {\"number\": 123, \"branch\": \"feat/foo\"},\n  \"summary\": {\"total\": 5, \"passed\": 3, \"failed\": 2, \"pending\": 0},\n  \"checks\": [\n    {\"name\": \"tests\", \"status\": \"fail\", \"log_snippet\": \"...\", \"run_id\": 123},\n    {\"name\": \"lint\", \"status\": \"pass\"}\n  ]\n}\n```\n\n### `scripts/fetch_pr_feedback.py`\n\nFetches and categorizes PR review feedback using the [LOGAF scale](https://develop.sentry.dev/engineering-practices/code-review/#logaf-scale).\n\n```bash\nuv run ${CLAUDE_SKILL_ROOT}/scripts/fetch_pr_feedback.py [--pr NUMBER]\n```\n\nReturns JSON with feedback categorized as:\n- `high` - Must address before merge (`h:`, blocker, changes requested)\n- `medium` - Should address (`m:`, standard feedback)\n- `low` - Optional (`l:`, nit, style, suggestion)\n- `bot` - Informational automated comments (Codecov, Dependabot, etc.)\n- `resolved` - Already resolved threads\n\nReview bot feedback (from Sentry, Warden, Cursor, Bugbot, CodeQL, etc.) appears in `high`/`medium`/`low` with `review_bot: true` — it is NOT placed in the `bot` bucket.\n\nEach feedback item may also include:\n- `thread_id` - GraphQL node ID for inline review comments (used for replies)\n\n## Workflow\n\n### 1. Identify PR\n\n```bash\ngh pr view --json number,url,headRefName\n```\n\nStop if no PR exists for the current branch.\n\n### 2. Gather Review Feedback\n\nRun `${CLAUDE_SKILL_ROOT}/scripts/fetch_pr_feedback.py` to get categorized feedback already posted on the PR.\n\n### 3. Handle Feedback by LOGAF Priority\n\n**Auto-fix (no prompt):**\n- `high` - must address (blockers, security, changes requested)\n- `medium` - should address (standard feedback)\n\nWhen fixing feedback:\n- Understand the root cause, not just the surface symptom\n- Check for similar issues in nearby code or related files\n- Fix all instances, not just the one mentioned\n\nThis includes review bot feedback (items with `review_bot: true`). Treat it the same as human feedback:\n- Real issue found → fix it\n- False positive → skip, but explain why in a brief comment\n- Never silently ignore review bot feedback — always verify the finding\n\n**Prompt user for selection:**\n- `low` - present numbered list and ask which to address:\n\n```\nFound 3 low-priority suggestions:\n1. [l] \"Consider renaming this variable\" - @reviewer in api.py:42\n2. [nit] \"Could use a list comprehension\" - @reviewer in utils.py:18\n3. [style] \"Add a docstring\" - @reviewer in models.py:55\n\nWhich would you like to address? (e.g., \"1,3\" or \"all\" or \"none\")\n```\n\n**Skip silently:**\n- `resolved` threads\n- `bot` comments (informational only — Codecov, Dependabot, etc.)\n\n#### Replying to Comments\n\nAfter processing each inline review comment, reply on the PR thread to acknowledge the action taken. Only reply to items with a `thread_id` (inline review comments).\n\n**When to reply:**\n- `high` and `medium` items — whether fixed or determined to be false positives\n- `low` items — whether fixed or declined by the user\n\n**How to reply:** Use the `addPullRequestReviewThreadReply` GraphQL mutation with `pullRequestReviewThreadId` and `body` inputs.\n\n**Reply format:**\n- 1-2 sentences: what was changed, why it's not an issue, or acknowledgment of declined items\n- End every reply with `\\n\\n*— Claude Code*`\n- Before replying, check if the thread already has a reply ending with `*- Claude Code*` or `*— Claude Code*` to avoid duplicates on re-loops\n- If the `gh api` call fails, log and continue — do not block the workflow\n\n### 4. Check CI Status\n\nRun `${CLAUDE_SKILL_ROOT}/scripts/fetch_pr_checks.py` to get structured failure data.\n\n**Wait if pending:** If review bot checks (sentry, warden, cursor, bugbot, seer, codeql) are still running, wait before proceeding—they post actionable feedback that must be evaluated. Informational bots (codecov) are not worth waiting for.\n\n### 5. Fix CI Failures\n\nFor each failure in the script output:\n1. Read the `log_snippet` and trace backwards from the error to understand WHY it failed — not just what failed\n2. Read the relevant code and check for related issues (e.g., if a type error in one call site, check other call sites)\n3. Fix the root cause with minimal, targeted changes\n4. Find existing tests for the affected code and run them. If the fix introduces behavior not covered by existing tests, extend them to cover it (add a test case, not a whole new test file)\n\nDo NOT assume what failed based on check name alone—always read the logs. Do NOT \"quick fix and hope\" — understand the failure thoroughly before changing code.\n\n### 6. Verify Locally, Then Commit and Push\n\nBefore committing, verify your fixes locally:\n- If you fixed a test failure: re-run that specific test locally\n- If you fixed a lint/type error: re-run the linter or type checker on affected files\n- For any code fix: run existing tests covering the changed code\n\nIf local verification fails, fix before proceeding — do not push known-broken code.\n\n```bash\ngit add <files>\ngit commit -m \"fix: <descriptive message>\"\ngit push\n```\n\n### 7. Monitor CI and Address Feedback\n\nPoll CI status and review feedback in a loop instead of blocking:\n\n1. Run `uv run ${CLAUDE_SKILL_ROOT}/scripts/fetch_pr_checks.py` to get current CI status\n2. If all checks passed → proceed to exit conditions\n3. If any checks failed (none pending) → return to step 5\n4. If checks are still pending:\n   a. Run `uv run ${CLAUDE_SKILL_ROOT}/scripts/fetch_pr_feedback.py` for new review feedback\n   b. Address any new high/medium feedback immediately (same as step 3)\n   c. If changes were needed, commit and push (this restarts CI), then continue polling\n   d. Sleep 30 seconds, then repeat from sub-step 1\n5. After all checks pass, do a final feedback check: `sleep 10`, then run `uv run ${CLAUDE_SKILL_ROOT}/scripts/fetch_pr_feedback.py`. Address any new high/medium feedback — if changes are needed, return to step 6.\n\n### 8. Repeat\n\nIf step 7 required code changes (from new feedback after CI passed), return to step 2 for a fresh cycle. CI failures during monitoring are already handled within step 7's polling loop.\n\n## Exit Conditions\n\n**Success:** All checks pass, post-CI feedback re-check is clean (no new unaddressed high/medium feedback including review bot findings), user has decided on low-priority items.\n\n**Ask for help:** Same failure after 2 attempts, feedback needs clarification, infrastructure issues.\n\n**Stop:** No PR exists, branch needs rebase.\n\n## Fallback\n\nIf scripts fail, use `gh` CLI directly:\n- `gh pr checks name,state,bucket,link`\n- `gh run view <run-id> --log-failed`\n- `gh api repos/{owner}/{repo}/pulls/{number}/comments`\n\n\n## When to Use\nUse this skill when tackling tasks related to its primary domain or functionality as described above.\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.","tags":["iterate","antigravity","awesome","skills","sickn33","agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding","ai-workflows","antigravity-skills"],"capabilities":["skill","source-sickn33","skill-iterate-pr","topic-agent-skills","topic-agentic-skills","topic-ai-agent-skills","topic-ai-agents","topic-ai-coding","topic-ai-workflows","topic-antigravity","topic-antigravity-skills","topic-claude-code","topic-claude-code-skills","topic-codex-cli","topic-codex-skills"],"categories":["antigravity-awesome-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/sickn33/antigravity-awesome-skills/iterate-pr","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add sickn33/antigravity-awesome-skills","source_repo":"https://github.com/sickn33/antigravity-awesome-skills","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 34768 github stars · SKILL.md body (7,559 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-23T18:51:34.039Z","embedding":null,"createdAt":"2026-04-18T21:39:20.570Z","updatedAt":"2026-04-23T18:51:34.039Z","lastSeenAt":"2026-04-23T18:51:34.039Z","tsv":"'-2':530 '/comments':1097 '/engineering-practices/code-review/#logaf-scale).':163 '/pulls':1095 '/scripts/fetch_pr_checks.py':116,600,869 '/scripts/fetch_pr_feedback.py':170,285,908,968 '0':135 '1':257,409,443,529,652,862,948 '10':960 '123':124,145 '2':133,277,418,672,875,999,1055 '3':131,295,404,428,444,695,884,923 '30':940 '4':592,704,895 '5':129,641,894,949 '6':767,981 '7':844,986,1013 '8':982 'acknowledg':475,542 'action':477,627 'add':430,730,837 'addpullrequestreviewthreadrepli':519 'address':19,60,181,190,308,315,402,441,848,914,969 'affect':710,808 'alon':749 'alreadi':208,290,560,1009 'also':242 'alway':386,750 'api':581,1091 'api.py:42':417 'appear':221 'ask':399,1049,1150 'assum':742 'attempt':1056 'authent':65 'auto':302 'auto-fix':301 'autom':31,202 'avoid':572 'b':913 'backward':659 'base':745 'bash':110,164,260,835 'behavior':719 'block':589,861 'blocker':185,309 'bodi':525 'bot':200,212,228,236,351,356,384,453,611,634,1039 'boundari':1158 'branch':50,125,276,1066 'brief':378 'broken':833 'bucket':237,1082 'bugbot':218,616 'bundl':97 'c':924 'call':582,689,693 'case':733 'categor':153,177,288 'caus':324,699 'chang':186,311,534,703,765,819,926,975,989 'check':28,54,102,136,330,556,593,612,678,691,747,878,887,897,952,958,1021,1029,1079 'checker':806 'ci':9,17,43,53,101,594,643,846,851,873,934,994,1004,1025 'clarif':1059,1152 'claud':94,113,167,282,552,566,569,597,866,905,965 'clean':1031 'clear':1125 'cli':63,1075 'code':336,553,567,570,676,711,766,812,820,834,988 'codecov':204,457,635 'codeql':219,618 'comment':203,252,379,454,462,468,489 'commit':771,775,839,929 'comprehens':424 'condit':883,1018 'consid':411 'continu':23,45,586,936 'could':420 'cover':721,728,817 'criteria':1161 'current':49,275,872 'cursor':217,615 'cycl':38,1003 'd':938 'data':605 'decid':1043 'declin':510,544 'dependabot':205,458 'describ':1115,1129 'determin':500 'develop.sentry.dev':162 'develop.sentry.dev/engineering-practices/code-review/#logaf-scale).':161 'direct':1076 'directori':76,85 'docstr':432 'domain':1111 'duplic':573 'e.g':442,682 'end':546,564 'environ':1141 'environment-specif':1140 'error':662,686,798 'etc':206,220,459 'evalu':632 'everi':547 'exist':272,706,723,815,1065 'exit':882,1017 'expert':1146 'explain':374 'extend':725 'extract':105 'fail':132,140,583,667,671,744,824,888,1072,1089 'failur':18,106,604,644,647,762,785,1005,1053 'fallback':1069 'fals':370,503 'feat/foo':126 'feedback':21,34,58,156,176,193,213,239,280,289,297,317,320,352,364,385,628,849,855,912,918,957,973,992,1026,1036,1057 'feedback-fix-push-wait':33 'fetch':100,151 'file':339,739,809 'final':956 'find':389,705,1040 'fix':16,25,35,303,319,340,368,498,508,642,696,717,757,778,782,795,813,825,841 'format':528 'found':367,403 'fresh':1002 'full':88 'function':1113 'gather':278 'get':287,602,871 'gh':64,261,580,1074,1077,1084,1090 'git':78,836,838,842 'github':62 'graphql':246,520 'green':30 'h':184 'handl':296,1010 'headrefnam':267 'help':1051 'high':179,223,306,493 'high/medium':917,972,1035 'hope':759 'human':363 'id':144,245,248,486 'identifi':258 'ignor':382 'immedi':919 'import':66 'includ':243,349,1037 'inform':201,455,633 'infrastructur':1060 'inlin':250,466,487 'input':526,1155 'instanc':342 'instead':859 'introduc':718 'issu':333,366,540,681,1061 'item':240,353,482,496,506,545,1048 'iter':2,4,39,46 'iterate-pr':1 'json':120,121,174,264 'known':832 'known-broken':831 'l':196,410 'like':439 'limit':1117 'link':1083 'lint':147 'lint/type':797 'linter':803 'list':397,423 'local':769,779,792,822 'locat':80 'log':109,141,584,655,753,1088 'log-fail':1087 'logaf':159,299 'loop':577,858,1016 'low':194,225,394,406,505,1046 'low-prior':405,1045 'm':191,840 'match':1126 'may':241 'medium':188,224,313,495 'mention':347 'merg':183 'minim':701 'miss':1163 'models.py:55':435 'monitor':845,1007 'must':69,180,307,630 'mutat':521 'n':550,551 'name':137,146,748,1080 'nearbi':335 'need':14,928,977,1058,1067 'never':380 'new':737,910,916,971,991,1033 'nit':197,419 'node':247 'none':448,889 'number':118,123,172,265,396,1096 'one':346,688 'option':195 'output':651,1135 'owner':1093 'pass':10,44,55,130,149,879,953,995,1022 'path':89 'pend':134,608,890,900 'permiss':1156 'place':233 'poll':850,937,1015 'posit':371,504 'post':291,626,1024 'post-ci':1023 'pr':3,7,41,117,122,154,171,259,262,271,294,472,1064,1078 'present':395 'primari':1110 'prioriti':300,407,1047 'proceed':624,827,880 'process':464 'prompt':305,390 'pullrequestreviewthreadid':523 'push':24,36,773,830,843,931 'quick':756 're':576,787,800,1028 're-check':1027 're-loop':575 're-run':786,799 'read':653,673,751 'real':365 'rebas':1068 'relat':338,680,1107 'relev':675 'renam':412 'repeat':943,983 'repli':255,460,469,480,492,516,527,548,555,563 'repo':1092,1094 'repositori':74 'request':187,312 'requir':61,987,1154 'resolv':207,209,451 'restart':933 'return':119,173,891,978,996 'review':20,57,155,211,227,251,279,350,355,383,415,425,433,467,488,610,854,911,1038,1147 'root':75,96,115,169,284,323,599,698,868,907,967 'run':71,112,143,166,281,596,621,713,788,801,814,863,865,902,904,962,964,1085 'safeti':1157 'scale':160 'scope':1128 'script':68,92,98,650,1071 'scripts/fetch_pr_checks.py':99 'scripts/fetch_pr_feedback.py':150 'second':941 'secur':310 'seer':617 'select':393 'sentenc':531 'sentri':215,613 'silent':381,450 'similar':332 'site':690,694 'skill':84,95,114,168,283,598,867,906,966,1103,1120 'skill-iterate-pr' 'skip':372,449 'sleep':939,959 'snippet':107,142,656 'source-sickn33' 'specif':790,1142 'standard':192,316 'state':1081 'status':103,139,148,595,852,874 'step':893,922,947,980,985,998,1012 'still':620,899 'stop':268,1062,1148 'structur':603 'style':198,429 'sub':946 'sub-step':945 'substitut':1138 'success':1019,1160 'suggest':199,408 'summari':127 'surfac':328 'symptom':329 'tackl':1105 'taken':478 'target':702 'task':1106,1124 'test':138,707,724,732,738,784,791,816,1144 'thorough':763 'thread':210,244,452,473,485,559 'topic-agent-skills' 'topic-agentic-skills' 'topic-ai-agent-skills' 'topic-ai-agents' 'topic-ai-coding' 'topic-ai-workflows' 'topic-antigravity' 'topic-antigravity-skills' 'topic-claude-code' 'topic-claude-code-skills' 'topic-codex-cli' 'topic-codex-skills' 'total':128 'trace':658 'treat':358,1133 'true':229,357 'type':685,805 'unaddress':1034 'understand':321,664,760 'url':266 'use':11,86,157,253,421,517,1073,1100,1101,1118 'user':391,513,1041 'utils.py:18':427 'uv':111,165,864,903,963 'valid':1143 'variabl':414 'verif':823 'verifi':387,768,776 'via':93 'view':263,1086 'wait':37,606,622,639 'warden':216,614 'whether':497,507 'whole':736 'within':1011 'workflow':256,591 'worth':638 'would':437","prices":[{"id":"6a348e2a-b8bb-4515-8c92-fe854cdafdf4","listingId":"15547568-6fb8-461c-adb5-d8f615ec3131","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"sickn33","category":"antigravity-awesome-skills","install_from":"skills.sh"},"createdAt":"2026-04-18T21:39:20.570Z"}],"sources":[{"listingId":"15547568-6fb8-461c-adb5-d8f615ec3131","source":"github","sourceId":"sickn33/antigravity-awesome-skills/iterate-pr","sourceUrl":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/iterate-pr","isPrimary":false,"firstSeenAt":"2026-04-18T21:39:20.570Z","lastSeenAt":"2026-04-23T18:51:34.039Z"}],"details":{"listingId":"15547568-6fb8-461c-adb5-d8f615ec3131","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"sickn33","slug":"iterate-pr","github":{"repo":"sickn33/antigravity-awesome-skills","stars":34768,"topics":["agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding","ai-workflows","antigravity","antigravity-skills","claude-code","claude-code-skills","codex-cli","codex-skills","cursor","cursor-skills","developer-tools","gemini-cli","gemini-skills","kiro","mcp","skill-library"],"license":"mit","html_url":"https://github.com/sickn33/antigravity-awesome-skills","pushed_at":"2026-04-23T06:41:03Z","description":"Installable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.","skill_md_sha":"8a0771a5bae40972fb36a693a5e2be0ea38728d4","skill_md_path":"skills/iterate-pr/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/iterate-pr"},"layout":"multi","source":"github","category":"antigravity-awesome-skills","frontmatter":{"name":"iterate-pr","description":"Iterate on a PR until CI passes. Use when you need to fix CI failures, address review feedback, or continuously push fixes until all checks are green. Automates the feedback-fix-push-wait cycle."},"skills_sh_url":"https://skills.sh/sickn33/antigravity-awesome-skills/iterate-pr"},"updatedAt":"2026-04-23T18:51:34.039Z"}}