mit einem Klick
creating-pull-requests
// Creates a draft pull request on GitHub with proper labels, branch naming, and description formatting. Use when changes are ready to be submitted as a PR to the streamlit/streamlit repository.
// Creates a draft pull request on GitHub with proper labels, branch naming, and description formatting. Use when changes are ready to be submitted as a PR to the streamlit/streamlit repository.
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.
Address all valid review comments on a PR for the current branch in the streamlit/streamlit repo. Use when a PR has received reviewer feedback that needs to be addressed, including code changes, style fixes, and documentation updates.
Debug Streamlit frontend and backend changes using make debug with hot-reload. Use when testing code changes, investigating bugs, checking UI behavior, or needing screenshots of the running app.
Lists available make commands for Streamlit development. Use for build, test, lint, or format tasks.
Implementation guide for new Streamlit features. Use when adding new elements, widgets, or features that span backend, frontend, and protobufs.
Validates all code changes before committing by running format, lint, type, and unit test checks. Use after making backend (Python) or frontend (TypeScript) changes, before committing or finishing a work session.
| name | creating-pull-requests |
| description | Creates a draft pull request on GitHub with proper labels, branch naming, and description formatting. Use when changes are ready to be submitted as a PR to the streamlit/streamlit repository. |
Create a draft PR on GitHub with appropriate labels after user approval.
Critical constraints:
gh pr createAlways ask the user first:
How would you like to proceed with creating the PR?
- Already Ready: I have a feature branch with all changes committed and pushed
- Automated: Handle branch creation, committing, and pushing automatically
Wait for user response before proceeding.
Validate readiness:
git branch --show-current
git status
git branch -r | grep $(git branch --show-current)
Confirm with user, then proceed to Step 3.
Assumes user has already staged changes with git add.
git status
git checkout develop
git checkout -b {type}/{descriptive-name}
git commit -m "{imperative-verb} {what} {where}"
git push --set-upstream origin $(git branch --show-current)
Branch naming: {type}/{brief-description} in kebab-case.
Types: feature, fix, refactor, chore, docs.
Examples: feature/add-height-plotly-charts, fix/dataframe-memory-leak-scrolling.
Commit message: <imperative verb> <what> <where>, ≤50 chars, no period.
Examples: Add height parameter to plotly charts, Fix memory leak in dataframe scrolling.
All PRs require these 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:other |
Note: security-assessment-completed is added by the reviewer after security assessment, not by the PR author.
Format: [type] Description of change, ≤63 chars (fits squash-merge commit subjects).
Examples: [feature] Add height parameter to plotly charts, [fix] Extra padding on button.
Read .github/pull_request_template.md for the required sections, then fill them in.
Writing rules:
Good:
Adds
heightparameter tost.plotly_chart()usingHeighttype system.
- Deprecates
use_container_height(removed after 2025-12-31)
Bad (lists every change):
- Added
heightparameter to signature- Updated layout config dataclass
- Added validation for height values
- Added unit tests
Testing section — detect from changed files:
| Pattern | Test type |
|---|---|
lib/tests/**/*.py | Python unit tests |
frontend/**/*.test.{ts,tsx} | Frontend unit tests |
e2e_playwright/**/*_test.py | E2E tests |
Check the matching boxes in the PR template. If no test files changed, explain why. Leave "manual testing" unchecked (user fills in).
Write complete PR details to work-tmp/pr_description.md:
---
title: [PR title from 3.2]
labels: impact:{users|internal}, change:{type}
---
[PR description from 3.3]
Ask user: "I've written the PR details to work-tmp/pr_description.md. You can edit the title, labels, or description directly in that file. Reply 'yes' when ready to create the PR, or provide feedback for changes."
Read work-tmp/pr_description.md to get the (potentially edited) title, labels, and description:
# Parse frontmatter from the reviewed file
title=$(grep '^title:' work-tmp/pr_description.md | sed 's/^title: //')
labels=$(grep '^labels:' work-tmp/pr_description.md | sed 's/^labels: //' | sed 's/, /,/g')
# Extract body (everything after the closing --- of frontmatter)
awk '/^---$/{if(++count==2) flag=1; next} flag' work-tmp/pr_description.md > work-tmp/pr_body.md
# Create PR using parsed values
gh pr create \
--title "$title" \
--body-file work-tmp/pr_body.md \
--base develop \
--label "$labels" \
--draft
# Clean up temporary files
rm work-tmp/pr_description.md work-tmp/pr_body.md
For full details on writing principles, labeling, branch naming, and testing plans, see the Pull requests wiki.