LLM Prompt Compiler
The LLM Prompt compiler converts a xtyle definition into a structured Markdown document designed for use as an LLM system prompt. Feed the output to Claude, GPT, or any language model to generate on-brand content without manually describing your brand in every conversation.
Installation
Section titled “Installation”npm install @xtylejs/compiler-llm-promptCLI Usage
Section titled “CLI Usage”xtyle compile brand.xtyle.json --target llm-promptOutput is written to ./out/<name>.brand.md by default.
Programmatic Usage
Section titled “Programmatic Usage”import { compile } from "@xtylejs/compiler-llm-prompt";
const markdown = compile(definition);The compile function takes a full xtyle definition and returns a Markdown string.
Output Structure
Section titled “Output Structure”The compiler walks the entire definition and produces sections for each pillar that has content. Sections are omitted when the definition doesn’t include relevant data.
| Section | Source | Content |
|---|---|---|
| Identity | verbal.identity | Brand name, tagline, descriptions at multiple lengths |
| Colors | visual.palette + visual.semantic | Semantic color roles with resolved hex values |
| Typography | visual.typography | Font families, weights, type scale |
| Components | visual.components | Component parts, sizes, variants, states |
| Jargon | verbal.jargon | Domain-specific terms with definitions and deprecated alternatives |
| Approved Copy | verbal.copy | Pre-approved text fragments keyed by purpose |
| Boilerplate | verbal.boilerplate | Standard text (legal, disclaimers, footers) |
| Voice | voice.* | Tone, values, vocabulary, anti-patterns, audience, positioning, art direction, register |
Example Output
Section titled “Example Output”Given the Midnight Diner definition, the compiler produces:
# Midnight Diner
*open late. no questions asked.*
Late-night ramen from a dark counter in a quiet alley.
## Colors
| Role | Value || --- | --- || primary | #F5A623 || surface | #0D0D0D || accent | #C0392B |
## Typography
- **heading:** Barlow Condensed, sans-serif- **body:** Inter, system-ui, sans-serif
- **normal:** 400- **bold:** 700
## Jargon
- **the usual** — whatever you had last time, remembered without asking- **extra fire** — additional chili oil, applied without judgment
## Voice
### Tone- **energy:** warm, low-key, like the cook who knows your name but doesn't need to chat- **formality:** casual always. never formal.- **humor:** deadpan. if you get it, you get it.
### Anti-Patterns- food photography language- hospitality industry buzzwords- exclamation marksUse Case
Section titled “Use Case”The primary use case is feeding brand identity to an LLM as a system prompt:
System: [contents of midnight-diner.brand.md]User: Write a social media post announcing our new winter menu.The LLM receives the full brand context — voice, vocabulary constraints, tone, positioning, approved terminology — and generates content that stays on-brand without manual guidance in every prompt.
This works across all three pillars:
- Visual context tells the LLM about the brand’s color palette and typography when generating design-adjacent content
- Verbal tokens provide exact terminology, approved copy, and jargon definitions
- Voice guidance constrains tone, vocabulary, and anti-patterns so the output matches the brand’s personality