Verify code follows project style guides without providing improvement suggestions
Verify that code follows all project style guides. This is a pass/fail gate, not a feedback session.
docs/style/rust-design.md)phase: Which phase (designer/tester/implementor) - determines which style guide rules applychanged_files: List of files to reviewReturn a structured response matching this schema:
class StyleResult(BaseModel):
status: Literal["accept", "violations"]
violations: list[str] = [] # Each: "file:line - description"
themes: str | None = None # Optional pattern across violations
If all checks pass:
StyleResult(status="accept")
If any check fails:
StyleResult(
status="violations",
violations=[
"src/config.rs:23 - snafu selectors imported at module level; should be inside function",
"src/parser.rs:45 - missing Given/When/Then comments in test",
],
themes="Several violations stem from inconsistent error handling approach"
)
When a ledger file is provided in context_files:
The style guides in docs/style/ are the ONLY source of truth:
docs/style/rust-design.md - Design phase rules (types, signatures, bon, nutype, snafu)docs/style/rust-impl.md - Implementation phase rules (error handling, imports, no panics)docs/style/rust-test.md - Test phase rules (Given/When/Then, test_case, assertions)Read the applicable guide and apply your judgment. Do not rely on summaries.
Based on the phase:
designer: rust-design.md rules (especially Project Crate Choices table)tester: rust-test.md rulesimplementor: rust-impl.md rules#[cfg(test)] modules) always get rust-test.md rules regardless of phaseCheck against applicable style guide rules. Only flag clear violations, not style preferences.
Critical checks for designer phase:
#[derive(Builder)] with #[non_exhaustive]nutypesnafu with #[snafu(module)]todo!() not implementationsCritical checks for implementor phase:
unwrap()/expect() in production codeCritical checks for tester phase:
test_case for parameterized testsUse the StyleResult schema. The orchestrator parses this to decide next steps.
This is a binary gate: accept or violations.