AI Writing Guide
import { Aside } from ‘@astrojs/starlight/components’;
This page is for AI assistants and code generators that need to produce valid CCL. If you’re implementing a CCL parser, see the AI Quickstart instead.
CCL Output Rules
Section titled “CCL Output Rules”When generating CCL text, follow these rules exactly:
- One entry per line:
key = value - First
=splits key from value: Everything after the first=is the value - Indent with 2 spaces for nested content (consistent indentation is required, 2 spaces is conventional)
- Empty keys for lists:
= item(no key before=) - Comments:
/= texton its own line (no inline comments) - No quoting: Values are literal strings. Never add quotes around values
- No escaping: There are no escape sequences. Write characters literally
- No trailing commas, braces, or brackets: CCL uses indentation, not delimiters
Generating CCL from Structured Data
Section titled “Generating CCL from Structured Data”From JSON/Object to CCL
Section titled “From JSON/Object to CCL”Given this JSON:
{ "server": { "host": "0.0.0.0", "port": "8080" }, "name": "MyApp"}Produce:
server = host = 0.0.0.0 port = 8080name = MyAppFrom Arrays to CCL Lists
Section titled “From Arrays to CCL Lists”Given this JSON:
{ "servers": ["web1.example.com", "web2.example.com"]}Produce:
servers = = web1.example.com = web2.example.comNested Objects with Arrays
Section titled “Nested Objects with Arrays”Given this JSON:
{ "deploy": { "regions": ["us-east-1", "eu-west-1"], "strategy": "rolling" }}Produce:
deploy = regions = = us-east-1 = eu-west-1 strategy = rollingCommon Generation Mistakes
Section titled “Common Generation Mistakes”Adding Quotes
Section titled “Adding Quotes”/= WRONG: Don't quote valuesname = "My Application"port = "8080"
/= CORRECT: Values are literal stringsname = My Applicationport = 8080Using JSON/YAML Syntax
Section titled “Using JSON/YAML Syntax”/= WRONG: No braces, brackets, or colonsserver = { host: "localhost", port: 8080 }items = ["a", "b", "c"]
/= CORRECT: Use indentation and empty keysserver = host = localhost port = 8080items = = a = b = cInline Comments
Section titled “Inline Comments”/= WRONG: No inline commentsport = 8080 # default porthost = localhost /= main server
/= CORRECT: Comments on their own line/= Default portport = 8080/= Main serverhost = localhostDot-Separated Key Paths
Section titled “Dot-Separated Key Paths”/= WRONG: Dots are literal characters, not path separatorsdatabase.host = localhostdatabase.port = 5432
/= CORRECT: Use indentation for hierarchydatabase = host = localhost port = 5432Escape Sequences
Section titled “Escape Sequences”/= WRONG: No escape sequences existmessage = Hello\nWorldpath = C:\\Users\\admin
/= CORRECT: Write literal charactersmessage = Hello Worldpath = C:\Users\adminType Handling
Section titled “Type Handling”All CCL values are strings. When generating CCL from typed data:
| Source type | CCL output | Example |
|---|---|---|
| String | As-is | name = Alice |
| Integer | Decimal string | port = 8080 |
| Float | Decimal string | rate = 0.95 |
| Boolean | true or false | debug = true |
| Null/None | Empty value | optional = |
| Array | Empty-key list | = item per element |
| Object | Indented section | Nested key-value pairs |
Validation Checklist
Section titled “Validation Checklist”Before returning generated CCL, verify:
- Every entry has exactly the format
key = valueor= value(list item) or/= text(comment) - No quotes around values
- No braces, brackets, or trailing commas
- Indentation is consistent (2 spaces per level)
- Comments are on their own lines, starting with
/= - Nested structures use indentation, not dot-separated keys
- Arrays use empty-key syntax (
= item), not repeated keys with the same name at the same level (both work, but empty keys are conventional inside sections)
Full Example
Section titled “Full Example”A complete CCL configuration file demonstrating all patterns:
/= Application configuration/= Generated by deployment tool
app = name = order-service version = 3.2.1 environment = production
server = host = 0.0.0.0 port = 8080 workers = 4
database = host = db.prod.internal port = 5432 name = orders pool_size = 20 ssl = true
cache = driver = redis host = cache.prod.internal port = 6379 ttl = 3600
allowed_origins = = https://app.example.com = https://admin.example.com = https://api.example.com
logging = level = info format = json outputs = stdout = enabled = true file = enabled = true path = /var/log/orders/app.log rotation = daily
feature_flags = new_checkout = true beta_api = false /= Rollout started 2025-02-20 progressive_loading = true