Code Style: Exist, Reuse, Mirror, Symmetry
A prioritized rule set that makes Claude write minimal new code that blends into your existing codebase.
What it does
Gives Claude seven ordered rules for writing code inside an existing project — earlier rules win when they conflict:
- Prove the code needs to exist: drop one-implementation abstractions, single-caller config points, unreachable branches, and speculative scaffolding. New tests must name the regression they protect, and should extend an existing test when it covers the same contract.
- Reuse code: check whether an existing method can be reused or generalized before adding a helper.
- Reuse patterns: find the closest analogous feature and replicate its decomposition, control flow, and guard clauses.
- Mirror surrounding code: match brace style, comment style, naming, blank-line spacing, and code density by reading nearby files first.
- Maintain symmetry: when adding
fooB()next tofooA(), align names, parameter order, route paths, config keys, event names, env vars, CLI flags, and file naming — renaming the older name by default unless it's a published contract. - Logical ordering: insert methods, switch cases, and fields where the existing grouping or business lifecycle says, not at the end.
- Default to no comment: refactor until the comment is unnecessary; keep only load-bearing constraints.
Trust-boundary validation, data-loss-preventing error handling, security controls, accessibility, and explicit requests override the minimalism rule.
Who it's for
- Developers shipping changes into legacy or team-owned codebases who want stylistic consistency.
- Teams tired of AI-generated over-abstraction, redundant comments, and low-value tests.
- Tech leads who want a language-agnostic, written review standard.
Examples
- New endpoint: model a
GET /orders/:idhandler on the existingGET /users/:idone, matching route naming, error handling, and file placement. - Symmetric sibling: add
exportToJson()besideexportToCsv()with identical parameter order and config key naming, renaming the old key if the pair becomes asymmetric. - Refactor request: ask "clean up this module" and Claude traces callers, removes dead branches and single-implementation interfaces, and replaces comments with better extraction.
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/tobihagemann/turbo/HEAD/claude/skills/code-style/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on AI Skill Mart. Copy the claude/skills/code-style folder from the GitHub repo tobihagemann/turbo into my ~/.claude/skills/code-style/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/tobihagemann/turbo.git /tmp/turbo && mkdir -p ~/.claude/skills && cp -r /tmp/turbo/claude/skills/code-style ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal.
- Clone the repository into a temp directory:
git clone https://github.com/tobihagemann/turbo.git /tmp/turbo - Create the skills directory if needed:
mkdir -p ~/.claude/skills - Copy just this skill:
cp -r /tmp/turbo/claude/skills/code-style ~/.claude/skills/ - Verify that
~/.claude/skills/code-style/SKILL.mdexists. - Restart Claude Code and try a prompt like "add this feature following the existing patterns in this repo".
- To share with your team, place the same folder under
.claude/skills/in your project root and commit it.