refactor(prompts): generalize style review template

This commit is contained in:
2026-09-17 01:35:17 -04:00
parent d6cbd4e319
commit d2063624b8
3 changed files with 40 additions and 20 deletions

View File

@@ -3,8 +3,29 @@ description: Review Nix changes against repository Nix style rules
argument-hint: "[target]"
---
Read `.pi/prompts/review-style.md`.
Apply that template with these values:
Use the `nix-style` skill.
Audit ${ARGUMENTS:-the staged diff} for violations of the repository Nix style rules.
- skill: `nix-style`
- target: `${ARGUMENTS:-the staged diff}`
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.

View File

@@ -1,10 +0,0 @@
---
description: Review Rust changes against repository Rust style rules
argument-hint: "[target]"
---
Read `.pi/prompts/review-style.md`.
Apply that template with these values:
- skill: `rust-style`
- target: `${ARGUMENTS:-the staged diff}`

View File

@@ -1,12 +1,21 @@
---
description: Review changes against a repository style skill
argument-hint: "<skill> [target]"
description: Review changes against repository style rules
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.
Review target: `${ARGUMENTS:-the staged diff}`.
Audit the target for violations of the repository style rules.
Choose skills from the reviewed files:
- Use the `nix-style` skill for `*.nix` files.
- Use the `rust-style` skill for `*.rs` files.
- Use the `rust-style` skill for `Cargo.toml` files.
- Use the `rust-style` skill for Bazel files that define Rust targets.
If the target includes multiple matching file types, use all matching skills.
If the target is a diff, choose skills from the changed files.
Do not use a style skill when no reviewed file matches it.
Report only actionable findings.
Order findings by severity.