code-style

Enforce mirror, reuse, and symmetry principles to keep new code consistent with surrounding code. Use when writing new code in an existing codebase, adding new features, refactoring, or making any code changes.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "code-style" with this command: npx skills add tobihagemann/turbo/tobihagemann-turbo-code-style

Code Style: Mirror, Reuse, Symmetry

When writing new code in an existing codebase, follow these principles:

  1. Mirror the surrounding code exactly: Match brace style, comment style, naming conventions, blank line spacing, code density, and level of detail by reading nearby code first.
  2. Reuse existing patterns: Find the closest analogous feature and replicate its structure (method decomposition, control flow, annotations, guard clauses). Don't introduce new patterns when an existing one fits.
  3. Reuse existing code: Before writing a new helper, check if an existing method can be reused or generalized. If a new helper is needed, model it after its closest sibling.
  4. Maintain symmetry: If adding fooB() parallel to fooA(), ensure naming, parameter order, and structure are symmetric. Rename fooA() if needed.
  5. Logical ordering: Place new methods, switch cases, and fields in the order that mirrors the existing grouping or business lifecycle, not just appended at the end.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

find-dead-code

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

codex

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

simplify-code

No summary provided by upstream source.

Repository SourceNeeds Review