scripts/assets/code-review-instructions.md
AGENTS.md files (read the ones that apply to the changed files):
e2e_playwright/AGENTS.md — for e2e tests (inside e2e_playwright/)frontend/AGENTS.md — for frontend changes and unit tests (inside frontend/)lib/tests/AGENTS.md — for Python unit tests (inside lib/tests/)lib/AGENTS.md — for any Python changes (*.py files)lib/streamlit/AGENTS.md — for any Python library changes (inside lib/streamlit/)lib/streamlit/.agents/skills/AGENTS.md — for bundled agent skills (inside lib/streamlit/.agents/skills/)proto/streamlit/proto/AGENTS.md — for protobuf changes (inside proto/streamlit/proto/)specs/AGENTS.md and evaluate the change against its "Principles of Streamlit API
Design."specs/ for a relevant product spec. Product decisions explicitly described in a
product spec that is already merged into the PR's base branch are considered approved and
aligned; do not relitigate them. Instead, verify that the implementation follows the spec
and separately assess any user-facing behavior that the merged spec does not cover. A new
or modified spec in the current PR is not already approved by this rule.specs/README.md and specs/AGENTS.md). A spec that exists only on this implementation
PR is not sufficient. Bug fixes, DevOps work, and small non-controversial enhancements
do not need a spec.lib/streamlit/AGENTS.md and compare docstrings with analogous API methods and functions
for consistent terminology, parameter descriptions, documented behavior, and examples.lib/streamlit/AGENTS.md ("Streamlit Backend Performance Hot Paths") and
frontend/AGENTS.md ("Streamlit Frontend Performance Hot Paths") guidance.
Watch for unnecessary renders or remounts, unstable props or callbacks, repeated
parsing, copying, serialization, or full-data scans, blocking work, and inefficient
algorithms. Hot-path changes should include performance coverage when practical.eval, unsafe-eval, Function() constructor)subprocess, exec, eval in Python)postMessage handlingst.login()/st.logout() and OAuth token handling/assessing-external-test-risk, and the review includes a clear external_test recommendation.AGENTS.md first to get an overview of the project.AGENTS.md files based on changed files (see checklist above).specs/AGENTS.md, inspect comparable existing Streamlit surfaces, and perform the product
alignment assessment from the checklist. If it does not, mark the Product Alignment section as not
applicable and explain why briefly./assessing-external-test-risk and determine whether this branch should include @pytest.mark.external_test coverage./reviewing-readability skill on the changed code (comments, docstrings, naming) and the /reviewing-pr-description skill on the PR title/description if a PR exists, and include their findings and proposed rewrites in your review.Write your review using valid GitHub Flavored Markdown in the following structure:
## Summary
[Brief overview and the main changes introduced.]
## Product Alignment
[State whether the PR has user-facing product impact. If yes, identify any relevant product
spec already merged into the base branch, treat its documented product decisions as approved,
and assess whether the implementation follows it. If this is a new user-facing feature or
significant public API change with no merged product spec, request that the spec be merged
before this implementation PR. For user-facing aspects not covered by an approved spec,
assess the user value and complexity tradeoff, consistency with analogous Streamlit surfaces,
and alignment with the principles in `specs/AGENTS.md`; clearly identify material issues that
warrant requested changes. If no, state why this section is not applicable.]
## Code Quality
[Brief assessment of code structure, patterns, and maintainability. Call out aspects whose
complexity appears disproportionate to the value they provide. Note any issues with specific
file references and line numbers.]
## Performance
[Assess runtime and frontend performance impact. Apply the backend and frontend hot-path
guidance. Call out unnecessary renders, remounts, repeated work, blocking operations, or
other regressions. Note coverage or benchmarks for hot-path changes. If there is no
meaningful performance impact, say why briefly.]
## 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, material performance regressions, breaking changes, missing required tests, a new user-facing feature or significant public API change without a product spec already merged into the base branch, or clear material violations of documented Streamlit product/API principles and 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.*