mz-pr-review
БесплатноБез исполняемых скриптовНе проверенLocal code review of current branch vs Materialize standards. Trigger: "review my code", "review my changes", "check my diff", "does this look ok", "what do…
от MaterializeInc★ 6 417 звёзд на GitHubОб этом скилле
Perform a local code review of the current branch's changes against Materialize project standards.
Steps
- Parse arguments from: $ARGUMENTS — a PR number, base branch, or nothing.
- Get the diff using the first method that works:
- PR number given (e.g.
123):gh pr diff 123 - git available:
git diff <base>...HEAD(default base:main) - jj available:
jj diff -r <revset>(default: diff from trunk)
- PR number given (e.g.
- Get the file list from the same diff (add
--statfor git,--statfor jj, orgh pr diff 123 --statfor PR). - Review the diff against the checklists below.
- Present findings organized as: Blocking, Strong suggestions, Nits.
Review checklist
The overall developer guide for reviewing changes is defined in doc/developer/guide-changes.md, always read and follow its guidance.
Tests
- Every behavior change has at least one new or modified test.
- SQL/query behavior → look for
.sltintest/sqllogictest/. - Wire/protocol behavior → look for
.ptintest/pgtest/. - Rust logic/types/APIs → add or extend a Rust unit test in the crate (e.g.
#[cfg(test)]ortests/); run withcargo test -p mz-<crate>. - Prefer testing observable behavior (SQL results, wire protocol) over implementation details.
- Red flag: behavior change with no test changes.
- For more testing guidelines, read
doc/developer/guide-testing.md
LIR schema registry
Applies when the diff changes the serde-visible shape of a type the LIR
schema reaches: src/compute-types/src/plan.rs,
src/compute-types/src/plan/**, a *Func payload, or a plan-reachable type
in mz-expr or mz-repr.
src/compute-types/tests/snapshots/lir_v{N}.jsonis regenerated in the same PR, and the diff matches the intended format change. Red flag: a serde-visible change to a plan type with no snapshot diff.- If
LIR_VERSIONinsrc/compute-types/src/plan.rshad shipped, it is bumped and the oldlir_v{N}.jsonis left untouched rather than rewritten. RowandEvalErrornever appear directly in plan types, only asStableRow/StableEvalError, enforced bylir_schema_contains_only_stable_types.
Scalar function registry
Applies when the diff touches UnaryFunc, BinaryFunc, or VariadicFunc
(src/expr/src/scalar/func.rs, src/expr/src/scalar/func/**, #[sqlfunc]
bodies).
- The registry snapshots under
src/compute-types/tests/snapshots/are regenerated in the same PR. A property change movesfunc_registry.jsonand the current version's entry infunc_registry_digests.json, a#[sqlfunc]declaration or body change movesfunc_registry_source.jsonalone, and a change to a hand-written variant's body moves neither. - Every new variant with a payload has a
Sampleinsrc/expr/src/scalar/func/registry.rs, with a labeled second sample when a property depends on the payload. - A removed function, a changed property, or a
body_fingerprintchange that alters results for some input bumpsLIR_VERSIONinsrc/compute-types/src/plan.rsif that version has shipped, and leaves the old digest infunc_registry_digests.jsonuntouched. Additions need no bump. - The PR description names the added, removed, and changed functions and, for body changes, states whether results change.
Code style (Rust)
- Imports:
std→ external crates →crate::; oneuseper module; prefercrate::oversuper::in non-test code. - Errors: Structured with
thiserror; no bareanyhow!("...").Displayshould not print full error chain. - Async: Use
ore::task::spawn/spawn_blocking, not rawtokio::spawn. - Tests:
#[mz_ore::test]; panic in tests rather than returningResult.
Code style (SQL)
- Keywords capitalized (
SELECT,FROM); identifiers lowercase. - No space between function name and
(.
Error messages
- Primary: short, factual, lowercase first letter, no trailing punctuation.
- Detail/hint: complete sentences, capitalized, period.
- No "unable", "bad", "illegal", "unknown"; say what kind of object.
Sensitive data handling
- Types holding passwords, keys, tokens, or credentials should use
mz_ore::secure::{SecureString, SecureVec}orzeroize::Zeroizing<T>(frommz_ore::secure). - Sensitive types should not derive
CloneorDebug(use customDebugthat redacts). - Stack-local buffers holding derived keys, nonces, or HMAC outputs should be wrapped in
Zeroizing<T>. - See the module docs in
src/ore/src/secure.rsfor full guidance andsrc/ssh-util/src/keys.rsfor a reference implementation.
Architecture
- Simplicity: No incidental complexity; simplify redundant logic.
- No special casing: Prefer composable design over extra booleans/branches.
- Encapsulation: sql-parser = grammar only (no semantic validation); sql = planning + semantics.
- Dependencies: New crates must be justified.
- For more design guidelines read:
doc/developer/best-practices.md
Polish
- No left
Установить mz-pr-review в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
BashReadGrepGlobTaskFAQ
Что делает скилл mz-pr-review?
Local code review of current branch vs Materialize standards. Trigger: "review my code", "review my changes", "check my diff", "does this look ok", "what do you think of this PR", "code review", or look over changes before merging. Also PR number + wants feedback on quality, style, correctness. For changes under `console/`, use mz-console-review instead.
Как установить скилл mz-pr-review?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл mz-pr-review запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic