Skip to main content
Handbook/Architect/Page 31 · Conventions

Naming Things Consistently

Share

Share this page

Pass it to someone who needs it.

Star on GitHub

Key takeaway: Write the conventions down

Left to itself, your agent writes each new file in whatever style feels right that session: camelCase here, snake_case there, one file with tabs and the next with spaces. Each piece works, but the codebase reads like five people who never met wrote it. This chapter gets you one consistent hand across the whole project, enforced by a file, not by your memory.

3.7.1Pick one way and keep it

A convention is a decision you make once and then repeat everywhere: quote style, indentation, how files are named, how a boolean reads. Which way you pick matters far less than picking one and never drifting. Two reasonable styles applied consistently beat one perfect style applied half the time.

The purely mechanical decisions (spacing, quotes, trailing commas) you should not decide by hand at all. A formatter like Prettier rewrites every file to one layout on save, and a linter like ESLint flags the rest, so that whole category stops being a discussion.

3.7.2Names that read as one hand

Naming is where a codebase either reads like one author or like a committee. Variables and functions, the named blocks of code you call to do one job, go in camelCase. The other standard buckets are worth adopting as-is: types and components in PascalCase, filenames in kebab-case, constants in UPPER_SNAKE_CASE. Booleans start with is, has, should, or can, so they read like a yes-or-no question.

CategoryInconsistentConsistent
FunctionGetUser, fetch_usergetUser, fetchUser
Booleanactive, loadedisActive, hasLoaded
FileUserCard.tsx, user_card.tsxuser-card.tsx
One rule per kind of name: route each identifier to its casing.

3.7.3Write the conventions down

Rules you only hold in your head get applied when you remember and skipped when you do not. Put them in the rules file your agent already reads every session, so it writes to them from the first line instead of you correcting them after.

Keep it short and concrete, the kind of block you can paste straight in:

## Conventions - Components/types: PascalCase. Vars/functions: camelCase. - Filenames: kebab-case. Constants: UPPER_SNAKE_CASE. - Booleans read as a question: isActive, hasLoaded. - Prettier owns formatting; do not hand-format. - One component per file; match the filename to it.

3.7.4Consistency beats personal taste

Your preference for single quotes is not worth a codebase split down the middle. Once a convention is written, treat it as settled and let the agent apply it everywhere, including code you would have styled differently. The value is uniformity, not being right.

This prompt has your agent record your conventions and follow them from now on:

Ready prompt
Act as a senior engineer. Read my rules file, my folder layout, and my layer boundaries first, then infer the naming and style conventions already in use. Where they conflict, pick one consistent choice per category (casing for types, functions, files, constants; boolean naming; quote and format style) and tell me the calls you made. Nothing you pick may contradict a decision already written in my rules file. If one must, say so and why instead of quietly diverging. Write the result into my rules file as a short Conventions section, then apply it to any code you touch from now on. Keep it tight and concrete. If you need the full reasoning behind this step, read https://zalt.me/guides/vibe-coding/architect/conventions-and-naming My stack and current style:

Do this now: paste the prompt so your agent writes the conventions into your rules file, then read the choices it made and change any single one you disagree with.

Mahmoud Zalt

Mahmoud Zalt

Software engineer, 16+ yrs · built Sistava.com in 3 months, idea to production, using these methods

Resources
Star on GitHubContribute
Donate

Support my work

A small tip keeps the free work coming.

© 2026 Mahmoud Zalt. Free to read, not to republish.
Copyright & license