
follow-up-on-pr
Follow up on an existing PR by rebasing on the base branch, addressing reviewer comments, fixing CI issues, and pushing updates. Use when the user provides a PR URL or number and wants to get it ready for merge.
- Installs
- 111
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/factory-ai/factory-plugins --skill follow-up-on-pr- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads follow-up-on-pr automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Follow Up on PR
Take over an existing PR, bring it up to date, address all feedback, and push it to a merge-ready state. This skill is language- and framework-agnostic — substitute your project's actual build, lint, test, and format commands where examples are shown.
Inputs
- PR URL or number (required): e.g.
https://github.com/<owner>/<repo>/pull/9996or#9996 - Branch name (optional): If not provided, extract from PR metadata
Workflow
1. Study the PR
Fetch the PR via FetchUrl (or gh pr view) to get:
- File changes (diffs)
- Reviewer comments (inline and general)
- CI workflow status and logs
- PR description and any linked ticket
Read all changed files in depth. Understand the intent and scope of the change.
If the PR fixes a specific issue (e.g. error report, user-reported bug): investigate the root cause before reviewing the code. Confirm the fix addresses the actual problem. PRs are sometimes already superseded by other fixes.
2. Fetch and Check Out the Branch
git fetch origin <branch-name> <base-branch>
git checkout <branch-name>
If the branch doesn't exist locally, git checkout will create a tracking branch from origin/<branch-name>.
3. Rebase on Latest Base Branch
git pull origin <base-branch> --rebase
If conflicts occur:
- Read each conflicted file to understand both sides
- Resolve conflicts, preserving the PR's intent while incorporating base-branch changes
git add <resolved-files>git rebase --continue
If rebase is clean: Verify the state with git log --oneline -5 and git diff --stat origin/<base-branch>..HEAD.
4. Address Reviewer Comments
Review comments were already fetched in step 1. For each unresolved comment:
- Read the comment and understand what's being asked
- Make the code change (or explain why it's not needed)
- Add tests if requested
- Commit the fix with a descriptive message
Already-addressed comments: Check if a reply already exists (in_reply_to_id field). Skip comments that have been resolved.
5. Run Local CI Checks
Run the project's lint, format, typecheck/compile, and test commands for the affected areas. Discover them by reading the repo root (e.g. Makefile, package.json, pyproject.toml, Cargo.toml, go.mod, build.gradle, mix.exs, Gemfile, composer.json, justfile, Taskfile.yml, README.md, or the CI workflow config).
Prefer filter / target flags to scope runs to the affected areas — it is faster than running the whole repo. Common patterns:
- JS/TS monorepos:
npm run test -- --filter=<workspace>,pnpm -r --filter <pkg> test,nx test <project> - Python:
pytest <path>,tox -e <env> - Rust:
cargo test -p <crate>,cargo clippy -p <crate> - Go:
go test ./<pkg>/...,golangci-lint run ./<pkg>/... - Java/Kotlin:
./gradlew :<module>:test,./mvnw -pl <module> test - Bazel:
bazel test //path/...
See the create-pr skill's "CI Checks Reference" section for a broader template of local commands matching common CI checks.
Distinguishing pre-existing failures from PR issues: Some CI failures exist on the base branch and are unrelated to the PR. If a failure occurs in a file not touched by the PR, verify it exists on the base branch too before spending time fixing it. Common pre-existing issues include module / package resolution errors for recently-added dependencies.
E2E tests: If the PR changes user-facing behavior (UI flow, defaults, keyboard handling, CLI output), E2E tests may break even if the code is correct. Read the failing test to understand what it expects, then update it to match the new behavior. Don't assume E2E failures are flaky — read them first.
6. Commit and Push
git add -A
git commit -m "<type>(<scope>): <description>"
git push origin <branch-name> --force-with-lease
If a commit-scanning bot blocks the push (Droid-Shield, GitGuardian, TruffleHog, etc.): This happens when unrelated test fixtures contain strings that look like secrets. The agent cannot override these. Tell the user to push manually or temporarily disable the scanner per your org's docs.
7. Reply to Reviewer Comments
Reply to each addressed comment on the PR so reviewers know their feedback was handled.
For inline review comments (the most common type):
# Reply to a specific inline comment thread
gh api repos/<owner>/<repo>/pulls/<N>/comments/<COMMENT_ID>/replies \
-X POST \
-f body="<explanation of what was done>"
For general PR-level summary:
gh pr comment <N> --body "<summary of all changes made>"
To check thread resolution status (optional):
gh api graphql -f query='{
repository(owner: "<owner>", name: "<repo>") {
pullRequest(number: <N>) {
reviewThreads(first: 20) {
nodes {
isResolved
comments(first: 3) { nodes { body author { login } } }
}
}
}
}
}'
8. Update PR Description
If the changes made during follow-up are significant (new tests, architectural changes, additional scope), update the PR description:
gh pr edit <N> --body "<updated description>"
Use your org's PR template format. Update the testing section to reflect the additional tests added.
Verification
Before considering the task complete, confirm:
- Branch is rebased on the latest base branch
- All reviewer comments are addressed with code changes
- Local lint, typecheck/compile, and tests pass for affected packages
- Changes are pushed to remote
- All reviewer comments have replies explaining what was done
- PR description is up to date
FAQ
What does the follow-up-on-pr skill do?
Follow up on an existing PR by rebasing on the base branch, addressing reviewer comments, fixing CI issues, and pushing updates. Use when the user provides a PR URL or number and wants to get it ready for merge.
How do I install follow-up-on-pr?
Run npx skills add https://github.com/factory-ai/factory-plugins --skill follow-up-on-pr in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/follow-up-on-pr/ (personal) or .claude/skills/follow-up-on-pr/ (project).
Which AI agents can use follow-up-on-pr?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is follow-up-on-pr safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains follow-up-on-pr?
It is published by factory-ai in factory-ai/factory-plugins, and it is an official skill from the maker of the technology it covers. It has 111 recorded installs.
More from factory-ai/factory-plugins
no-use-effect
factory-ai/factory-plugins
Enforce the no-useEffect rule when writing or reviewing React code. ACTIVATE when writing React components, refactoring existing useEffect calls, reviewing PRs with useEffect, or when an agent adds useEffect "just in case." Provides the five replacement patterns and the useMountEffect escape hatch.
human-writing
factory-ai/factory-plugins
Remove signs of AI-generated writing from text to make it sound more natural and human-written. Use when editing or reviewing any form of document including: markdown, technical docs, emails, blog posts, PRDs, or any dedicated writing content. Based on Wikipedia's comprehensive "Signs of AI writing" guide. Detects and fixes patterns including: inflated symbolism, promotional language, superficial -ing analyses, vague attributions, em dash overuse, rule of three, AI vocabulary words, negative parallelisms, and excessive conjunctive phrases.
simplify
factory-ai/factory-plugins
Review changed code for reuse, quality, and efficiency, then fix any issues found.
frontend-design
factory-ai/factory-plugins
Open the skill to read its SKILL.md instructions.
visual-design
factory-ai/factory-plugins
Image generation and presentations. Use when: - User asks for images: logos, icons, app assets, diagrams, flowcharts, architecture diagrams, patterns, textures, photo edits, restorations - User needs a presentation or slide deck Covers nanobanana CLI for image generation and Slidev for presentations.
security-review
factory-ai/factory-plugins
Scan code changes for security vulnerabilities using STRIDE threat modeling, validate findings for exploitability, and output structured results for downstream patch generation. Supports PR review, scheduled scans, and full repository audits.
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.