All skills
getsentry avatar

/iterate-pr

@e7a87fa official
by Sentrygetsentry/skills1k stars
53

Iterate on a PR until actionable CI passes and high/medium review feedback is addressed. Use for PR CI failures, review feedback, or green-check loops; do not wait for human approval, draft status, or merge gates.

Use this Skill: https://skilld.dev/gh/getsentry/skills/iterate-pr

This session only. Nothing lands on disk.

SPEC.md

≈1.3k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Iterate PR Specification

Intent

The iterate-pr skill drives a pull request through actionable CI failures and actionable review feedback until the work is locally fixed, pushed, and rechecked.

Its purpose is CI and feedback iteration, not merge readiness. It must not wait indefinitely for human approvals, required review decisions, draft PR state changes, or other gates that an agent cannot resolve by editing code.

Scope

In scope:

  • Identifying the PR for the current branch.
  • Fetching and categorizing PR review feedback.
  • Fixing high and medium priority review feedback.
  • Asking the user which low priority suggestions to address.
  • Fetching CI checks, failed logs, and failure snippets.
  • Fixing CI failures with local verification before pushing.
  • Monitoring checks until they pass, fail, or reach a non-actionable stop state.
  • Reporting draft/no-checks and human review/approval gates without polling forever.

Out of scope:

  • Waiting for or requesting human approval.
  • Marking draft PRs ready for review unless the user explicitly asks.
  • Merging PRs.
  • Rebasing branches without user direction.
  • Treating Codecov, Dependabot, or other informational comments as review feedback.

Users And Trigger Context

  • Primary users: engineers and coding agents iterating on existing pull requests.
  • Invocation: model-invocable in Claude Code and Codex when the request or current PR state matches this skill's trigger context.
  • Common user requests: fix CI on this PR, iterate on this PR until checks pass, address PR feedback, keep pushing fixes until green.
  • Should not trigger for: creating a PR, writing commits without a PR, reviewing unrelated code, or monitoring merge approval state only.

Runtime Contract

  • Required first actions: resolve the current PR, read isDraft and reviewDecision, fetch current review feedback, and fetch current CI state before editing.
  • Required outputs: concise progress updates, commits and pushes when fixes are made, and a final state that distinguishes passing CI from non-actionable review/draft/approval gates.
  • Non-negotiable constraints: investigate failures before editing, verify locally before pushing, do not push known-broken fixes, do not wait for human approval, and do not treat draft PRs with no checks as pending forever.
  • Expected bundled files loaded at runtime: SKILL.md and, when needed, scripts under scripts/.

Source And Evidence Model

Authoritative sources:

  • GitHub CLI PR and checks output.
  • Sentry LOGAF review guidance.
  • Repository-level agent instructions.
  • Bundled script behavior documented in SKILL.md.

Useful improvement sources:

  • positive examples: PRs where CI failures were fixed and checks passed after the loop.
  • negative examples: PRs where the agent waited on draft status, required review, or approval gates.
  • issue or PR feedback: reviewer comments about missing fixes, false positives, or feedback categorization.
  • validation results: structural skill validation and script syntax checks.

Data that must not be stored:

  • secrets
  • customer data
  • private URLs or identifiers not needed for reproduction
  • full CI logs when small failure snippets are enough

Reference Architecture

  • SKILL.md contains the runtime workflow, script contracts, feedback handling rules, CI loop, and exit conditions.
  • SPEC.md contains this maintenance contract.
  • references/ contains no files currently; add focused troubleshooting or evidence references only if runtime guidance becomes noisy.
  • references/evidence/ contains no files currently; use it for durable positive or negative PR-loop examples if regressions recur.
  • scripts/ contains non-interactive helpers for PR checks, PR feedback, check monitoring, and review-thread replies.
  • assets/ contains no files currently.

Validation

  • Lightweight validation: run uv run skills/skill-writer/scripts/quick_validate.py skills/iterate-pr.
  • Script validation: run uv run -m py_compile skills/iterate-pr/scripts/*.py after script changes.
  • Holdout examples: include a draft PR with no registered checks, a PR with reviewDecision: REVIEW_REQUIRED but passing checks, a PR with an actionable pending CI bot check, and a PR with failed CI logs.
  • Acceptance gates: validator passes, scripts compile, draft/no-check states terminate with a report, human review gates are not treated as actionable pending CI, and actionable CI failures still route back to investigation and fixes.

Known Limitations

  • Human-gate detection depends on check names, states, and descriptions exposed by GitHub or CI integrations.
  • Some repositories may intentionally model deployment or approval workflows as status checks; this skill reports those as blocked/non-actionable unless the user asks to manage that gate.
  • The helper scripts use GitHub CLI output and can drift if gh pr checks changes its JSON schema.

Maintenance Notes

  • Update SKILL.md when the runtime loop, script contracts, feedback policy, or exit conditions change.
  • Update SPEC.md when the skill's scope, validation expectations, or non-actionable gate policy changes.
  • Add focused reference files only when repeated troubleshooting guidance would make SKILL.md hard to scan.
  • Keep public inventories pointed at the canonical skills/iterate-pr skill, not mirrors or aliases.

Source: SKILL.md on GitHub

2 warnings17d5 checks · Risk SAFE
  • Gen Agent Trust Hub17d

    The skill implements a workflow to automate pull request iteration by monitoring CI checks and categorizing review feedback using the GitHub CLI. It ingests external data (such as pull request comments and logs), which creates a potential surface for indirect prompt injection, but it contains no malicious patterns or insecure command executions.

  • Socket17d

    No alerts

  • Snyk17d

    Risk: MEDIUM · 1 issue

  • Runlayer7mo

    2/3 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at e7a87fa. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 2 months ago
disable-model-invocation
false

README badge

README badge for getsentry/skills/iterate-pr

Iterates on a PR by fixing actionable CI failures and addressing high/medium review feedback, stopping at human approval gates or merge blockers. Bundles Python scripts to fetch PR checks, parse review feedback, monitor CI status, and reply to threads, all integrated with the gh CLI.

Generated from the current SKILL.md.

Does this skill wait for human approval before finishing?
No. The skill stops and reports when it encounters human-gate conditions like draft status, merge gates, or review approval requirements, but it does not wait for them.
Which CI bots does this skill wait for?
It waits for actionable review bots: sentry, warden, cursor, bugbot, seer, and codeql. It skips approval gates, codecov, and informational bots.
What are the requirements to run this skill?
You need an authenticated gh CLI, uv installed, the target repository as the current working directory, and access to the bundled Python scripts.
Can this skill handle both CI failures and code review feedback?
Yes. It fixes high and medium priority review feedback and actionable CI failures, then loops until both pass. Low priority feedback requires user input on which to address.
What happens if the same failure occurs twice?
The skill asks the user for help after the same failure appears a second time, rather than continuing to iterate.

Generated from the current SKILL.md. These answers refresh after source changes.