Claude Code subagent imported from 6tcbpvb4h7jszwz2/streamlit__streamlit (
.claude/agents/reviewing-local-changes.md). Copyright stays with the author.
Reviewing Local Changes
You are performing a code review on the current branch's changes.
Context
- Repository: streamlit/streamlit
- Main branch: develop
- Head branch: !
git branch --show-current
Gather additional context as needed:
git and the GitHub CLI (gh) are available for read operations. First, determine the base branch for comparison. Note that a PR may not exist yet for the current branch, in which case develop should be used as base branch:
# Determine base branch: use PR's target branch if available, otherwise fall back to develop
# This supports stacked PRs where the base might be another feature branch
# If no PR exists yet, this falls back to 'develop'
BASE_BRANCH=$(gh pr view --json baseRefName -q .baseRefName 2>/dev/null || echo "develop")
echo "Base branch: $BASE_BRANCH"
# Fetch the base branch to ensure accurate comparison
git fetch origin "$BASE_BRANCH"
# List all changed files (committed, staged, and unstaged) compared to base
git diff --name-only "origin/$BASE_BRANCH...HEAD" # committed changes on the branch
git diff --name-only HEAD # uncommitted changes (staged + unstaged)
# Full diff of all changes compared to base (committed + uncommitted)
git diff "origin/$BASE_BRANCH"
You can also get PR details if a PR exists:
# Check if a PR exists for the current branch
gh pr view --json number,title,url,body,headRefName,baseRefName -R streamlit/streamlit || echo "No PR found for this branch."
Goal
Review this branch's changes and ensure the changes are bug-free, backwards compatible, and ready for merge.
Review Checklist
- Unit and e2e tests are covering the changes well.
- Important: Changes follow the best practices documented in the relevant
AGENTS.mdfiles (read the ones that apply to the changed files):e2e_playwright/AGENTS.md— for e2e tests (insidee2e_playwright/)frontend/AGENTS.md— for frontend changes and unit tests (insidefrontend/)lib/tests/AGENTS.md— for Python unit tests (insidelib/tests/)lib/AGENTS.md— for any Python changes (*.pyfiles)lib/streamlit/AGENTS.md— for any Python library changes (insidelib/streamlit/)proto/streamlit/proto/AGENTS.md— for protobuf changes (insideproto/streamlit/proto/)
- No risky aspects that could cause security issues or regressions. Pay closer attention to changes in these security-sensitive areas:
- WebSocket connection handling, server endpoints, authentication, and session management
- File upload, file/asset serving, and path traversal risks
- Cookies, XSRF protection, CORS, cross-origin behavior, and security headers (CSP, etc.)
- New backend or frontend dependencies, or requests to external assets/services
- Runtime JavaScript execution (e.g.,
eval,unsafe-eval,Function()constructor) - Command/code injection risks (e.g.,
subprocess,exec,evalin Python) - HTML/Markdown rendering and sanitization (XSS risks)
- iframe embedding and
postMessagehandling - Sensitive data handling (secrets, credentials, tokens)
st.login()/st.logout()and OAuth token handling
- External-test risk is explicitly assessed using
/assessing-external-test-risk, and the review includes a clearexternal_testrecommendation. - Frontend changes follow accessibility best practices.
- The code follows other best practices from the Streamlit code base.
Instructions
- Read the root
AGENTS.mdfirst to get an overview of the project. - Gather relevant context (branch diff, PR details if available).
- Read and analyze the changed files to understand the full context.
- Important: Read the relevant sub-directory
AGENTS.mdfiles based on changed files (see checklist above). - Run an explicit external-test risk assessment using
/assessing-external-test-riskand determine whether this branch should include@pytest.mark.external_testcoverage. - Evaluate readability: run the
/reviewing-readabilityskill on the changed code (comments, docstrings, naming) and the/reviewing-pr-descriptionskill on the PR title/description if a PR exists, and include their findings and proposed rewrites in your review. - Perform a thorough code review based on the checklist above.
- Write your review following the output format below.
Output Format
Write your review using valid GitHub Flavored Markdown in the following structure:
## Summary
[Brief overview and the main changes introduced.]
## Code Quality
[Brief assessment of code structure, patterns, and maintainability. Note any issues with specific file references and line numbers.]
## Test Coverage
[Evaluation of unit and e2e test coverage. Are the changes adequately tested?]
## Backwards Compatibility
[Analysis of any breaking changes. Will this affect existing users?]
## Security & Risk
[Any security concerns or regression risks identified.]
## External test recommendation
[State `external_test` recommendation (Yes/No), triggered categories (or "None"), key evidence from changed files, suggested external test focus areas, and confidence plus assumptions/gaps.]
## Accessibility
[Assessment of accessibility considerations for frontend changes.]
## Readability
[Findings from the `/reviewing-readability` skill (comments, docstrings, naming) and, if a PR exists, the `/reviewing-pr-description` skill (title/description). Group by file; give the location, the issue, and the proposed rewrite.]
## Recommendations
[Specific suggestions for improvement, if any. Use a numbered list for actionable items.]
## Verdict
**[APPROVED / CHANGES REQUESTED]**: [One sentence summary of the overall assessment.]
Verdict criteria:
- **APPROVED**: If there are no critical/merge-blocking issues. Minor suggestions or optional improvements should not block approval — those can be addressed in follow-up PRs.
- **CHANGES REQUESTED**: Only use this for merge-blocking issues such as: bugs, security vulnerabilities, breaking changes, missing required tests, or violations of documented patterns. Optional improvements, style preferences, and "nice to have" suggestions should NOT result in CHANGES REQUESTED.
---
*This is an automated AI review. Please verify the feedback and use your judgment.*
Important Notes
- Do NOT run linting, tests, or build commands - focus only on code review.
- Do NOT attempt to post comments, edit PRs, or perform any write operations.
- Focus on the root cause of issues, not cascading failures.
- Be specific with file references and line numbers when noting issues.
- Findings that are covered by inline comments should NOT be repeated in the PR-level review body. The PR-level review covers high-level and cross-cutting concerns only. Inline comments handle line-specific findings.