Skip to content
Development
Skill

/code-style

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

From plugin
turbo
41775 skills

Claude Code

$ npx -y skills add tobihagemann/turbo --skill code-style --agent claude-code

SKILL.md

code-style.SKILL.md
name: code-style
description: "Enforce existence, reuse, mirror, and symmetry principles so new code stays minimal and consistent. Use when writing, changing, or refactoring code in an existing codebase."

Code Style: Exist, Reuse, Mirror, Symmetry

When writing new code in an existing codebase, work through these in order. When two pull in different directions, the earlier one wins.

1. **Establish that the code needs to exist**: Drop work the request does not need — an abstraction with one implementation, a configuration point with one caller, a branch for a state the callers cannot reach, scaffolding for an anticipated requirement. Deleting or narrowing beats adding. Before removing code that already exists, trace its callers and confirm nothing depends on the behavior. A new test must earn its place too: before adding one, name the behavior it protects and the credible regression that makes it fail, and confirm no existing test already fails on that regression. When a mutation run checks the new test, read every test that fails under it, not only the new one: if existing tests also fail, keep the new test only for a regression they miss. When an existing test covers the same contract, extend its cases instead. Drive the test through a boundary production code already uses rather than adding an export, flag, or hook that only the test calls. A test pins the behavior it is named for: when one you add or change also covers another behavior only through how it is set up, give that behavior its own test unless another test already fails when it breaks, and set the first test up the way its siblings are. Input validation at trust boundaries, error handling that prevents data loss, security controls, accessibility affordances, and anything explicitly requested outrank this rule. 2. **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. 3. **Reuse existing patterns**: Find the closest analogous feature and replicate its structure (method decomposition, control flow, annotations, guard clauses). When an existing pattern fits, use it rather than introducing a new one. When following it would force materially more code or indirection than a different approach, take the different approach and apply it across the whole change. 4. **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. 5. **Maintain symmetry**: If adding `fooB()` parallel to `fooA()`, match naming, parameter order, and structure. Symmetry covers every name the new sibling makes asymmetric: identifiers, route paths, config keys, event names, environment variables, CLI flags, and file naming schemes. Rename the existing name by default; keep it as it stands only when it is a published contract whose consumers you cannot update, or cannot update in step with the rename. Treat deployment and registration as costs the change absorbs: updating every place the name is referenced or registered is part of the change. 6. **Logical ordering**: Place new methods, switch cases, and fields in the order that mirrors the existing grouping or business lifecycle, rather than appending at the end. 7. **Default to no comment**: Write code that self-explains through naming, extraction, and structure. When you reach for a comment, first try refactoring so it becomes unnecessary. Add one only for a load-bearing constraint the code cannot express (a hidden invariant, a workaround, a non-obvious performance characteristic). When in doubt, omit it.

Read more
@tobihagemann
Ships withturbo

Reusable workflows for planning, building, reviewing, and shipping with Claude Code and Codex.

Stars on GitHub

Momentum

stars in total
417
Star history of tobihagemann/turbo on GitHub, a chart by star-history.com

Other skills on turbo.

apply-turbo-handoffs

apply-turbo-handoffs

Audit the turbo skill lessons that /self-improve writes into this repo's .turbo/handoff/ from other projects, apply the ones the…

@tobihagemann@tobihagemannInstall Skill
apply-findings

apply-findings

Apply findings by making the suggested code changes. Applies accepted verdicts, escalates ambiguous findings to the user, and…

@tobihagemann@tobihagemannInstall Skill
assess-technical-debt

assess-technical-debt

Assess project-wide structural technical debt: complexity hotspots, deprecated API usage, duplication clusters, architecture rot,…

@tobihagemann@tobihagemannInstall Skill
changelog-rules

changelog-rules

Shared changelog conventions and formatting rules referenced by /create-changelog and /update-changelog. Not typically invoked…

@tobihagemann@tobihagemannInstall Skill
codex-exec

codex-exec

Run autonomous task execution using the codex CLI. Use when the user asks to \"codex exec\", \"run codex exec\", \"execute a task…

@tobihagemann@tobihagemannInstall Skill
commit-rules

commit-rules

Shared commit message rules and technical constraints for skills that write commits. Not typically invoked directly.

@tobihagemann@tobihagemannInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills10d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about code-style.

Which coding agents can use code-style?
code-style installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.