diff --git a/.pi/prompts/review-nix.md b/.pi/prompts/review-nix.md index 7339187..218d42d 100644 --- a/.pi/prompts/review-nix.md +++ b/.pi/prompts/review-nix.md @@ -3,29 +3,8 @@ description: Review Nix changes against repository Nix style rules argument-hint: "[target]" --- -Use the `nix-style` skill. -Audit ${ARGUMENTS:-the staged diff} for violations of the repository Nix style rules. +Read `.pi/prompts/review-style.md`. +Apply that template with these values: -Report only actionable findings. -Order findings by severity. -Do not report preferences unless a loaded rule states them. - -Use this format for each finding: - -```text -`code-path:line` -> `smallest reviewed-code excerpt that shows the violation` - -`rule-file:line`: Finding title. -Summary: why the code breaks the rule -Fix: suggested fix -``` - -Keep the code excerpt to one to three lines when possible. -Use a longer excerpt only when the violation needs surrounding context. -Use `...` to omit unrelated lines from a multi-line excerpt. -Use a skill-relative rule citation, such as `let.md:7`. -Make the fix direct. -Do not include alternatives when one fix best follows the cited rule. - -It is acceptable to report no findings when the reviewed Nix already follows the loaded rules. +- skill: `nix-style` +- target: `${ARGUMENTS:-the staged diff}` diff --git a/.pi/prompts/review-rust.md b/.pi/prompts/review-rust.md index 112930b..795ca67 100644 --- a/.pi/prompts/review-rust.md +++ b/.pi/prompts/review-rust.md @@ -3,29 +3,8 @@ description: Review Rust changes against repository Rust style rules argument-hint: "[target]" --- -Use the `rust-style` skill. -Audit ${ARGUMENTS:-the staged diff} for violations of the repository Rust style rules. +Read `.pi/prompts/review-style.md`. +Apply that template with these values: -Report only actionable findings. -Order findings by severity. -Do not report preferences unless a loaded rule states them. - -Use this format for each finding: - -```text -`code-path:line` -> `smallest reviewed-code excerpt that shows the violation` - -`rule-file:line`: Finding title. -Summary: why the code breaks the rule -Fix: suggested fix -``` - -Keep the code excerpt to one to three lines when possible. -Use a longer excerpt only when the violation needs surrounding context. -Use `...` to omit unrelated lines from a multi-line excerpt. -Use a skill-relative rule citation, such as `tests.md:7`. -Make the fix direct. -Do not include alternatives when one fix best follows the cited rule. - -It is acceptable to report no findings when the reviewed Rust already follows the loaded rules. +- skill: `rust-style` +- target: `${ARGUMENTS:-the staged diff}` diff --git a/.pi/prompts/review-style.md b/.pi/prompts/review-style.md new file mode 100644 index 0000000..9a72640 --- /dev/null +++ b/.pi/prompts/review-style.md @@ -0,0 +1,33 @@ +--- +description: Review changes against a repository style skill +argument-hint: " [target]" +--- + +Use the `$1` skill. +Review target: `${@:2}`. +If the target is empty, audit the staged diff. +Audit the target for violations of the loaded style rules. + +Report only actionable findings. +Order findings by severity. +Do not report preferences unless a loaded rule states them. + +Use this format for each finding: + +```text +`code-path:line` +> `smallest reviewed-code excerpt that shows the violation` + +`rule-file:line`: Finding title. +Summary: why the code breaks the rule +Fix: suggested fix +``` + +Keep the code excerpt to one to three lines when possible. +Use a longer excerpt only when the violation needs surrounding context. +Use `...` to omit unrelated lines from a multi-line excerpt. +Use a skill-relative rule citation, such as `tests.md:7`. +Make the fix direct. +Do not include alternatives when one fix best follows the cited rule. + +It is acceptable to report no findings when the target follows the loaded rules.