Community编程与开发github.com

review-style

Verify code follows project style guides without providing improvement suggestions

兼容平台~Claude Code~Codex CLI~Cursor
npx add-skill https://github.com/cbgbt/bottlerocket-forest/tree/main/skills/review-style

name: review-style description: Verify code follows project style guides without providing improvement suggestions

Review Style Skill

Purpose

Verify that code follows all project style guides. This is a pass/fail gate, not a feedback session.

When to Use

  • TDD verification phase
  • PR review for style compliance
  • Any code review requiring style validation

Inputs Required

context_files

  • Style guide for the phase being reviewed (e.g., docs/style/rust-design.md)
  • Changed files to review
  • Ledger file (optional) for multi-cycle reviews

context_data

  • phase: Which phase (designer/tester/implementor) - determines which style guide rules apply
  • changed_files: List of files to review

Response Format

Return 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"
)

Ledger Awareness

When a ledger file is provided in context_files:

  1. Read previous cycles - Check what violations were raised and how implementor responded
  2. Verify RESOLVED items - Confirm fixes were actually applied
  3. Respect DISPUTED items - Do NOT re-raise if implementor's reason is valid
  4. Only raise NEW violations - Issues not previously discussed

Style Guides (Authoritative Sources)

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.

Procedure

1. Identify Applicable Rules

Based on the phase:

  • designer: rust-design.md rules (especially Project Crate Choices table)
  • tester: rust-test.md rules
  • implementor: rust-impl.md rules
  • Test files (#[cfg(test)] modules) always get rust-test.md rules regardless of phase

2. Review Each File

Check against applicable style guide rules. Only flag clear violations, not style preferences.

Critical checks for designer phase:

  • Composite structs (2+ fields) use #[derive(Builder)] with #[non_exhaustive]
  • Validated newtypes use nutype
  • Errors use snafu with #[snafu(module)]
  • Function bodies are todo!() not implementations

Critical checks for implementor phase:

  • No unwrap()/expect() in production code
  • Snafu context selectors imported inside functions
  • No blank lines between imports

Critical checks for tester phase:

  • Given/When/Then comments in every test
  • test_case for parameterized tests

3. Return Structured Result

Use the StyleResult schema. The orchestrator parses this to decide next steps.

What This Skill Does NOT Do

  • Suggest improvements unrelated to violations
  • Provide general constructive feedback
  • Review scope/correctness (use review-scope for that)
  • Flag style preferences not in guides

This is a binary gate: accept or violations.

Individual skills in this repo

This repo contains 19 individual skills — each has its own dedicated page.

ad-hoc-implementation-plan

Transform a rough plan into implement-commit ready artifacts. Allows rigorous review while implementing.

build-kit-locally

Build a kit and publish it to a locally hosted registry for development testing

build-variant-from-local-kits

Build a variant using locally published kits for development validation

deep-research

Create educational documents that build understanding progressively with citations

edit-spec-file

Edit Bottlerocket RPM spec files following project style conventions

fact-find

Quick lookup of specific facts about Bottlerocket with citations

idea-honing

Clarify feature ideas through iterative Q&A, recording insights to guide concept development

implement-commit

Implement commits from an implementation plan using a TDD pipeline

local-registry

Start and manage a local OCI registry for Bottlerocket kit development

prepare-core-kit-release

Prepare bottlerocket-core-kit for release by bumping version and updating changelog

propose-feature-concept

Create a new feature concept document to pitch the idea and explain the problem/solution

propose-feature-design

Create or update feature technical design document with architecture and implementation guidance

propose-feature-requirements

Create or update feature requirements specification using EARS notation with examples and appendices

propose-feature-test-plan

Create a test plan mapping EARS requirements and Critical Constraints to specific tests

propose-implementation-plan

Create an implementation plan with atomic commits that build toward a complete feature

review-code

Deep code review generating PR comments via principled question-driven analysis

review-scope

Verify code changes match intended scope and requirements without exceeding boundaries

test-local-twoliter

Build and test local changes to twoliter before releasing

update-twoliter

Update all Bottlerocket repositories to a new Twoliter version

相关技能