| name | curator-reviewer |
| description | Review PRs against PhysicsNeMo Curator standards. Runs 8 review passes covering API conformance, correctness, licensing, quality gates, test coverage, performance, code quality, and style consistency. Produces a prioritized report (P0/P1/P2/NIT) and optionally posts review comments to the PR.
|
Curator PR Reviewer
This skill provides a structured, opinionated code review workflow for
PhysicsNeMo Curator pull requests. It checks changed code against the
project's API conventions, quality gates, and style patterns, then
produces a prioritized findings report.
Report-only — no automatic fixes are applied. The reviewer presents
findings and the user decides what to act on.
When to Use
- Reviewing any PR to
NVIDIA/physicsnemo-curator
- Self-reviewing your own work before requesting external review
- After Greptile review to catch project-specific issues it may miss
Priority Levels
| Priority | Label | Meaning | Action required |
|---|
| P0 | Must Fix | Blocks merge. API violations, broken contracts, missing SPDX. | Always |
| P1 | Should Fix | Missing test coverage, performance problems, resource leaks. | Before merge |
| P2 | Consider | Over-commenting, verbose code, naming inconsistencies. | Discretion |
| NIT | Stylistic | Differs from codebase conventions but not wrong. | Optional |
Workflow
Follow these steps in order. Use the TodoWrite tool to track each pass.
Step 0: Fetch the PR
Identify the PR to review. Accept a PR number, URL, or auto-detect from
the current branch.
gh pr view <number> --repo NVIDIA/physicsnemo-curator
gh pr diff <number> --repo NVIDIA/physicsnemo-curator
Record:
- PR number, title, author, branch
- List of changed files (additions, modifications, deletions)
- Total lines added / removed
Read each changed file in full (not just the diff) — context matters.
For modified files, also read the base version to understand what changed.
Step 1: API Conformance (P0)
Check every new or modified Source, Filter, or Sink against the ABCs in
src/physicsnemo_curator/core/base.py.
Source[T] checklist:
Filter[T] checklist:
Sink[T] checklist:
Pipeline checklist:
Flag any deviation as P0.
Step 2: Correctness & Safety (P0)
Check for:
Flag any issue as P0.
Step 3: License & Headers (P0)
Every new file must start with:
For Rust files, use // comment syntax with the same text.
Check:
Flag missing headers as P0.
Step 4: Quality Gates (P0)
Run the automated quality checks against changed files:
uv run ruff check <changed_files>
uv run ty check --exclude 'examples-old/**' --exclude 'benchmarks/**'
uv run interrogate
Check:
Any quality gate failure is P0.
Step 5: Test Coverage (P1)
Evaluate testing adequacy:
Run coverage on affected test files if feasible:
uv run pytest test/<domain>/<test_file> --cov=src/physicsnemo_curator/<module> --cov-report=term-missing
Missing tests for public API surfaces are P1. Missing edge case tests
are P2.
Step 6: Performance & Profiling (P1)
Look for performance anti-patterns:
Flag performance issues as P1. Profiling-specific concerns
(missing ProfiledPipeline support, metric collection gaps) are P2.
Step 7: Code Quality (P2)
Review for clean, concise implementation:
Step 8: Style Consistency (NIT)
Compare against existing patterns in the package. These are not
correctness issues — they're about matching what's already there.
Output Format
After completing all passes, compile findings into a structured report.
## PR Review: #<number> — <title>
**Author:** <author> | **Branch:** <branch> | **Files changed:** <count>
### Summary
<1-3 sentence overall assessment. Is this ready to merge, close to
ready, or needs significant work?>
### Findings
#### P0 — Must Fix
| # | File:Line | Pass | Finding | Suggestion |
|---|-----------|------|---------|------------|
| 1 | `src/.../foo.py:42` | API | Missing `name` ClassVar | Add `name: ClassVar[str] = "..."` |
#### P1 — Should Fix
| # | File:Line | Pass | Finding | Suggestion |
|---|-----------|------|---------|------------|
#### P2 — Consider
| # | File:Line | Pass | Finding | Suggestion |
|---|-----------|------|---------|------------|
#### NIT — Stylistic
| # | File:Line | Pass | Finding | Suggestion |
|---|-----------|------|---------|------------|
### Test Coverage Assessment
<What's tested, what's missing, coverage % if measured>
### Performance Notes
<Any profiling concerns, streaming issues, or memory patterns>
If there are zero findings for a priority level, omit that section.
Step 9: Post to PR (Optional)
After presenting the report, ask the user:
"Would you like me to post these findings as review comments on
PR #<number>?"
If the user says yes, post the findings using gh api as a single
pull request review with line-level comments.
Comment Template
Each comment follows this format:
**[{PRIORITY}]** {TITLE}
{DESCRIPTION}
```suggestion
{SUGGESTED_CODE_FIX}
```
{PRIORITY}: One of P0, P1, P2, NIT
{TITLE}: Short (< 10 words) summary of the issue
{DESCRIPTION}: 1-3 sentences explaining the problem and why it
matters. Reference existing code patterns where relevant.
{SUGGESTED_CODE_FIX}: Optional. If the fix is clear, include it in
a GitHub suggestion block so the author can apply it with one click.
Omit the suggestion block if the fix requires broader refactoring.
Posting via gh api
Submit all comments as a single review (not individual comments):
gh api repos/NVIDIA/physicsnemo-curator/pulls/<number>/reviews \
--method POST \
--field event="COMMENT" \
--field body="<overall summary>" \
--field 'comments=[
{
"path": "<file>",
"line": <line_number>,
"body": "<formatted comment>"
}
]'
Use event="COMMENT" (not REQUEST_CHANGES or APPROVE) — the
reviewer reports findings but the merge decision is the user's.
For findings that apply to a file but not a specific line (e.g. missing
SPDX header, missing test file), use line 1 of the relevant file, or
include them only in the review body summary.
Review Body Template
The top-level review body summarizes the full review:
## Curator Review: <count> finding(s)
**P0:** <n> | **P1:** <n> | **P2:** <n> | **NIT:** <n>
<1-2 sentence summary of overall assessment>
Checklist
Use this checklist to verify the review is complete:
Reference: Project Standards
Quick reference for the standards checked by this review.
Quality Thresholds
| Check | Threshold | Tool |
|---|
| Python lint | Zero errors | ruff check (rules: E, F, W, I, D, UP, N, B, A, C4, SIM, TCH, PTH, ERA) |
| Python format | ruff defaults | ruff format (line length 120, double quotes) |
| Type checking | Zero errors | ty check (Python 3.12) |
| Docstring coverage | 99% | interrogate (excludes test/, docs/) |
| Test coverage | 80% minimum | pytest-cov |
| Rust lint | Zero warnings | clippy -D warnings |
| Rust format | rustfmt defaults | cargo fmt |
| License | SPDX on all files | Manual check |
| Commits | Conventional Commits | <type>(<scope>): <summary> |
API Contracts (from core/base.py)
Source[T]:
name: ClassVar[str]
description: ClassVar[str]
params() -> list[Param]
__len__() -> int
__getitem__(index: int) -> Generator[T]
Filter[T]:
name: ClassVar[str]
description: ClassVar[str]
params() -> list[Param]
__call__(items: Generator[T]) -> Generator[T]
flush() -> str | None (optional, for stateful filters)
Sink[T]:
name: ClassVar[str]
description: ClassVar[str]
params() -> list[Param]
__call__(items: Iterator[T], index: int) -> list[str]
Naming Conventions
| Component | Class name | File name | Test class | Test file |
|---|
| Source | <Name>Source | <name>.py | Test<Name>Source | test_<name>.py |
| Filter | <Name>Filter | <name>.py | Test<Name>Filter | test_<name>.py |
| Sink | <Name>Sink | <name>_writer.py | Test<Name>Sink | test_<name>.py |
Test Markers
@pytest.mark.requires("mesh")
@pytest.mark.requires("da")
@pytest.mark.e2e
@pytest.mark.slow
@pytest.mark.benchmark