How to Write a BRAND.md File for AI Coding and Writing Agents
AI workflow · Updated 2026-11-24
A BRAND.md file is a plain Markdown document in your repository root that gives AI coding and writing assistants exact color tokens, type scales, contrast pairs, and voice rules. Placing BRAND.md next to README.md prevents AI tools from inventing off-brand colors, low-contrast text, or generic marketing copy.
Why AI tools ignore static brand PDFs
AI coding agents read plain text files reliably, while static multi-page PDF brand books require heavy parsing and lose exact hex codes or CSS variable names. A Markdown file under 250 lines fits cleanly inside a system prompt or project context window without eating token budgets.
When developers paste a visual screenshot into an AI prompt without BRAND.md, the model guesses approximate hex values and invents generic shadow styles. Storing exact custom property names such as --brand-primary and --brand-ink in BRAND.md stops drift across every pull request.
Writing assistants face the same failure mode. Without an explicit list of banned words and concrete before-and-after sentence examples, large language models default to repetitive corporate adjectives and long introductory throat-clearing.
The six sections every BRAND.md file needs
Keep BRAND.md limited to six factual sections so both humans and language models can scan it in seconds. Every line should state a rule that can be checked objectively rather than a vague moodboard slogan.
| Section | What to include | Mistake prevented |
|---|---|---|
| 1. Identity | Exact brand name, domain, tagline, and primary audience | Stops wrong capitalization and generic audience assumptions |
| 2. Color tokens | 5 semantic CSS variables with HEX, RGB, CMYK, and OKLCH | Stops guessed blues, random grays, and unverified hex values |
| 3. Contrast pairs | Verified WCAG 2.2 AA (4.5:1) and AAA (7.0:1) foreground/background pairs | Stops unreadable white text on pale accents or dark text on dark surfaces |
| 4. Typography | Font stack names, base size, modular scale ratio, and 2 allowed weights (400 and 600) | Stops CDN font imports and random weight mixing |
| 5. Logo rules | Minimum digital width in px, print width in mm, and clearspace X rule | Stops squished marks in mobile headers and favicons |
| 6. Voice & prompt | 3 to 5 tone traits, banned words, Use/Avoid pairs, and a copy-paste prompt | Stops marketing fluff, exclamation marks, and inconsistent voice |
How to write WCAG contrast rules AI agents actually obey
Listing raw color hex codes is not enough because an AI model does not compute sRGB relative luminance in its head before writing CSS. You must list both approved text-on-background pairs and explicitly blocked combinations.
Under W3C WCAG 2.2 SC 1.4.3, normal body text requires a minimum contrast ratio of 4.5:1, while large text requires 3.0:1. Enhanced WCAG AAA readability requires 7.0:1 for normal text. Putting those exact ratios beside each brand pair tells the agent which ink belongs on white cards, tinted surfaces, and primary buttons.
Separating BRAND.md (identity and copy rules) from AGENTS-UI.md (layout spacing, 44 px minimum touch targets, and focus ring rules) makes long coding sessions cleaner because UI agents only load structural CSS rules when editing components.
Minimal BRAND.md color and voice snippet
## Color Tokens
- --brand-primary: #1d4ed8 (Primary buttons, links)
- --brand-surface: #f4f6fa (Page canvas, table headers)
- --brand-ink: #0f172a (Body text, headings)
## Approved Text Pairs
- #0f172a on #f4f6fa -> 16.50:1 (AAA)
- #ffffff on #1d4ed8 -> 6.70:1 (AA)
## Banned Words
- Never write: synergy, next-gen, magic, effortless.Where to drop BRAND.md in coding and writing tools
Commit BRAND.md to the root directory of your Git repository so every developer and agent reads the same version. Most modern AI IDEs and CLI coding agents automatically scan root Markdown instructions or allow referencing @BRAND.md in chat.
For non-code writing work in Claude Projects or ChatGPT Custom Instructions, copy Section 6 (the condensed AI system prompt block) directly into project instructions. Keeping the prompt block under 150 words leaves maximum room for your actual draft documents.
- Repository root: save BRAND.md and AGENTS-UI.md alongside package.json.
- Design handoff: commit design-tokens.json and tokens.css in the same pull request.
- Quarterly audit: update BRAND.md whenever you change a primary button color or add a new banned word.
Common BRAND.md mistakes that cause inconsistent output
Avoid writing abstract brand personality essays such as describing your company as bold yet approachable. Language models interpret vague adjectives unpredictably and compensate by adding decorative badges, gradients, and exclamation marks.
Concrete negative examples work twice as well as positive wishes. Showing one sentence labeled Use next to one sentence labeled Avoid gives the model a clear boundary for sentence length, punctuation, and reading grade level.
Never store confidential API keys, internal revenue numbers, or private customer names inside BRAND.md, because developers frequently paste the file into external chat windows or public starter repositories.
Put these specifications to work immediately: Generate your BRAND.md file in the browser.
Frequently asked questions
How long should a BRAND.md file be?
Keep BRAND.md between 100 and 250 lines. Shorter files stay inside AI context windows reliably without diluting your core color tokens and voice constraints.
Should BRAND.md replace a client PDF brand style guide?
No. Ship a vector PDF for print vendors, executives, and agencies, and ship BRAND.md alongside it for developers and AI tools.
Do I need an AI API to create BRAND.md?
No. Deterministic browser tools convert your exact brand colors, contrast math, and voice inputs into clean BRAND.md Markdown with zero API cost.