mcpbeat Sign in

Finalizing Pr Agent Skill

Finalizes branch changes for merging by simplifying code, running checks, reviewing changes, and creating a PR if needed. Use when ready to merge changes into the target branch.

2k tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
45465
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/streamlit/streamlit --skill finalizing-pr

What it tells the agent to use

found in the instruction text
Task spawns other agents

The instruction itself

14 sections, as written by the author

Finalizing PR

Prepares the current branch for merge by running quality checks, simplifying code, and creating a PR if one doesn't exist.

Be fully autonomous — Do NOT stop or pause to ask for confirmation. Go from current state to merge-ready PR without human intervention. Note any open questions or ambiguities in a PR conversation comment (under the Conversation tab) rather than blocking on them.

Workflow

Follow these steps in order. Run all subagents in foreground (not background) unless otherwise specified—wait for each to complete before proceeding. Subagent model: use the same model as this session on every launch (model: inherit / omit any model override). Do not switch to a different or faster model unless the user explicitly requests it.

> Note: For small changes (documentation tweaks, test-only tweaks, one-liners, or other mini-changes), you can skip steps 1, 2, 3, 6, 7, and 8.

1. Build and install

Run make all in a subagent to ensure the build and installation are up-to-date. Wait for completion before proceeding.

make all

2. Update internal docs

Run the /updating-internal-docs skill in a background subagent to auto-fix internal documentation issues. Instruct it to apply all recommended fixes to internal docs issues related to the local changes.

3. Simplify changes

Run the simplifying-local-changes subagent to clean up and simplify the code changes. Wait for completion before proceeding.

4. Run autofix

Run autofix in a subagent to fix formatting and linting issues. Wait for completion before proceeding.

make autofix

5. Run checks (first pass)

Run the /checking-changes skill in a subagent (uses make check) to validate the changes. Wait for completion, then fix any issues found before proceeding. Don't run other checks besides make check in this step.

6. Review changes

Run the reviewing-local-changes subagent to review the changes. Wait for completion and read the review output.

7. Address review feedback

Review the recommendations from step 6. For each recommendation:

  • If valid and improves code quality: implement the change
  • If not applicable or would over-engineer: skip with brief reasoning

8. Run checks (second pass)

Run the /checking-changes skill in a subagent with E2E_CHECK=true make check to also run changed e2e tests. Wait for completion, then fix any issues found before proceeding. Snapshot mismatches can be ignored (they require manual updates).

9. Create or update PR

> Note: If currently on develop, create a new branch first following the naming conventions in wiki/pull-requests.md.

Check if a PR exists for the current branch:

gh pr view --json number,title,url

If no PR exists, create one following the guidelines in wiki/pull-requests.md (please read!) and the title/description guidance in the /reviewing-pr-description skill. Add appropriate labels and fill in the body based on .github/pull_request_template.md.

Link related issues: Add - Closes #12345 to the PR description for any known GitHub issues this PR resolves.

Required labels:

| Category | Options |

|----------|---------|

| Impact | impact:users (affects user behavior) OR impact:internal (no user behavior change) |

| Change type | change:feature, change:bugfix, change:chore, change:refactor, change:docs, change:spec, change:other |

Note: PRs labeled change:spec (for spec/design documents only) are exempt from Impact label requirements.

# Push branch to origin first (required for gh pr create in non-interactive mode)
git push -u origin HEAD

# Create the PR
gh pr create --base develop --title "[type] Description" --body "$(cat <<'EOF'
## Describe your changes

- Change 1
- Change 2

## GitHub Issue Link (if applicable)

- Closes #12345

## Testing Plan

- [x] Unit Tests (JS and/or Python)
EOF
)" --label "impact:users,change:feature"

If PR exists, check if description needs updating based on current changes.

10. Upload intermediate files

If relevant intermediate files exist (specs, plans, implementation notes in work-tmp/ or untracked in specs/), run the /sharing-pr-agent-artifacts skill to push them to the wiki and comment on the PR with links.

11. AI review and fix loop

Iterate through AI review and fixes until the review passes (max 5 iterations):

for iteration 1 to 5:
    1. Trigger AI review by applying the "ai-review" label
    2. Run the `fixing-pr` subagent in foreground to wait for CI, fix failures, and address review comments
    3. Check AI review verdict in the latest github-actions bot comment
    4. If verdict is "approved" → exit loop
    5. Otherwise → continue to next iteration

Triggering AI review:

gh pr edit --add-label "ai-review"

Checking AI review verdict:

The AI review posts results as a PR review from the github-actions bot. These contain a hidden marker:

<!-- streamlit-ai-review run_id="..." timestamp="..." -->

To find the latest AI review and extract the verdict:

PR_NUM=$(gh pr view --json number -q '.number')

# Get the verdict from the latest AI review
gh api --paginate "repos/streamlit/streamlit/pulls/${PR_NUM}/reviews" \
  | jq -s '[.[][] | select(.user.login == "github-actions[bot]" and (.body | contains("<!-- streamlit-ai-review")))] | sort_by(.submitted_at) | last | .body' \
  | grep -A2 "## Verdict"

The verdict section contains a bold keyword indicating the result:

  • APPROVED → exit loop, PR is ready
  • CHANGES_REQUESTED → continue iterating, address the feedback

Important: After each fixing-pr run, re-check if changes were made. If changes were pushed, the AI review will be stale and needs re-triggering. Continue iterating until the review verdict is "approved" or max iterations reached.

12. Post agent metrics

Post the agent metrics to the PR body:

uv run python scripts/log_agent_metrics.py --post

Other skills for the same job

different authors, same section of the catalogue
MCP Builder
by anthropics
vendor ×13

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

30k tokens scripts
Changelog Generator
by frostant
×9

Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation.

774 tokens
Finishing A Development Branch
by ZhanlinCui
×7

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup

1k tokens
MCP Builder
by JayZeeDesign
×7

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

37k tokens scripts
Vercel React Native Skills
by vercel-labs
vendor ×6

React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.

39k tokens
Vercel React Best Practices
by ratacat
×5

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

34k tokens
Next Best Practices
by vercel-labs
vendor ×4

Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling

20k tokens
Using Git Worktrees
by ZhanlinCui
×4

Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification

1k tokens

How to use it

Copy the folder

Take streamlit/finalizing-pr from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.