# Update PR

Update an existing pull request with new changes.

- Repository: https://github.com/ReflexioAI/claude-smart (790 stars)
- Category: Git and review
- License: Apache-2.0
- Last updated: 2026-10-30
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add ReflexioAI/claude-smart --skill update-pr -g -a claude-code -y`
Codex: `npx skills add ReflexioAI/claude-smart --skill update-pr -g -a codex -y`
Cursor: `npx skills add ReflexioAI/claude-smart --skill update-pr -g -a cursor -y`
Gemini CLI: `npx skills add ReflexioAI/claude-smart --skill update-pr -g -a gemini-cli -y`

## Description

Update an existing pull request with new changes. Use when the user wants to update a PR, push follow-up changes to a PR, refresh a PR description, or sync a PR with latest commits. Triggers on: update pr, update-pr, update the pr, push to pr, refresh pr, sync pr, update pull request.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# PR Updater

Push follow-up changes to an existing PR and update its description to reflect the new work.

---

## Workflow

### Step 1: Pre-flight Checks

1. **Verify GitHub CLI authentication**, run `gh api user --jq '.login'` to confirm the CLI is authenticated. If this fails, the user needs to run `gh auth login` first.
2. **Find the existing PR**, run `gh pr view --json number,title,body,url,baseRefName,state` to find the PR for the current branch. If no PR exists, abort and suggest using `/create-pr` instead. Check the `state` field, if it is not `OPEN`, abort and inform the user that the PR is already merged or closed.
3. **Verify clean git state**, run `git status` to ensure no uncommitted changes. If there are uncommitted changes, commit them **directly**, do NOT delegate to another skill or tell the user to commit first.
4. **Sync submodules**, check if `.gitmodules` exists first. If it does, run `git submodule update --init --recursive`. If not, skip this step.

### Step 2: Sync with Base Branch

Ensure the feature branch is up-to-date with the base branch to avoid merge conflicts:

The rest: https://github.com/ReflexioAI/claude-smart/blob/HEAD/.agents/skills/update-pr/SKILL.md
