best-practice

Installation
SKILL.md

/best-practice

Take a code surface — by default the current branch's diff against main, optionally the whole repo — and align it with current coding best practices. The deliverable is a series of commits, not a report. Each commit applies one type of alignment (e.g. "add type hints to changed files", "replace broad excepts with specific handlers", "add tests for new endpoints") with tests staying green throughout.

The skill aligns to two things in priority order: (1) project conventions the codebase already establishes — naming, file layout, error-handling pattern, logging style, test style; (2) industry baseline — things any modern codebase should have (rigorous tests, no broad exception swallowing, no hardcoded secrets, validation at boundaries, types where the language and project support them). Project conventions trump industry defaults: if the codebase consistently uses positional arguments, alignment doesn't refactor to keyword arguments.

Grounded in .research/code-simplification.md §2 (heuristics), §4 (metrics), §5 (SOLID), §8 (anti-patterns).

When to use

  • User says "/best-practice", "align this branch", "best practices pass", "bring this repo up to standard", "fix conventions across this branch", "make sure best practices are followed".
  • A pull request is about to merge but the branch hasn't been aligned with conventions.
  • A new contributor's branch needs to be brought into the codebase's style and discipline.
  • Periodic codebase sweep: pick a quality dimension (tests, types, error handling, etc.) and align the whole repo to it.
  • Onboarding a project: align everything to a consistent baseline before development continues.

When NOT to use

Related skills

More from patrickruddiman/skills

Installs
4
First Seen
3 days ago