Engineering Conventions Code Style

Coding Conventions for AI

Tell AI your code style once. List the stack and the engine returns the naming rules and conventions it implies — plus your own house rules carried verbatim.

Overview

AI writes plausible code that quietly ignores your conventions — class components in a hooks codebase, hard-coded colors in a tokenized design system. This setup captures the conventions for Atlas UI, a shared React component library, where a breaking change ripples across every product team. You list the house rules (additive props, tokens not hard-coded values); the engine adds the React, TypeScript, and Vitest conventions and naming rules automatically. The AI stops guessing your style and starts following it.

How to use this resource

  1. List the stack

    React, TypeScript, Vitest — each maps to known naming and convention rules.

  2. Add your house rules

    Additive props, tokens over hard-coded values; these travel verbatim.

  3. Hand the AI the conventions

    It writes code that matches the codebase instead of generic defaults.

Why This Works

  • Stack detection means you list "TypeScript" and get "no any, strict mode on" for free
  • Your own conventions are carried word-for-word, never paraphrased
  • A design-system library is exactly where convention drift causes the most damage

Best for

  • Shared libraries and design systems
  • Teams with a documented style guide
  • Codebases AI keeps writing against the grain of

Not for

  • Reviewing a specific diff against the rules — use the Code Review Prompt Generator
  • Defining a reviewer persona — use the System Prompt Generator

FAQ

How does listing 'TypeScript' produce naming rules I never typed?

Each stack name maps to its known conventions, so entering TypeScript pulls in 'No any — prefer unknown with narrowing; keep strict mode on' and the naming rule 'camelCase for variables and functions, PascalCase for types and components,' while React adds the function-components-with-hooks rule. The builder writes these into the profile text; you still paste it into your assistant, which does the actual coding.

Where do I put the generated Atlas UI profile so Cursor actually loads it?

The template's own note says to save it at your repo root as '.cursorrules' (or '.cursor/rules/project.mdc') so Cursor loads it for every request, which means the Atlas UI conventions travel with the code and every teammate inherits the same context. For ChatGPT or Claude, paste it into custom instructions or a project instead. It's project knowledge you re-update, not persistent memory.

How do my house rules like 'additive props' stay separate from the auto-added stack rules?

They all sit under one Team Conventions section, so what tells them apart is the source tag. Your typed rules appear untagged and verbatim — 'Props are additive — never rename or remove a prop without a major version' and 'Design tokens come from the theme, never hard-coded values' — while stack-inferred rules carry a marker like '(React)' or '(Vitest)'. The builder never paraphrases the ones you wrote.

More resources from Project Context Builder

Resources that pair well

Related tools

Guides for this resource

Tip: Save time by exploring related resources and tools that integrate with this resource.