Skip to content

Commit 425dfdb

Browse files
akoclaude
andcommitted
docs: clarify colon vs AS in MDL syntax guidelines
Add guidance that colon is for property definitions (Key: value) and AS is for name-to-name mappings ('old' AS 'new'). Update the AI review workflow to not flag AS in mapping contexts as a syntax violation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3c54d27 commit 425dfdb

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

.claude/skills/design-mdl-syntax.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,30 @@ Rules:
115115
- Trailing comma allowed
116116
- One property per line (single line acceptable for 1-2 properties)
117117

118+
#### Colon `:` vs `AS` — When to Use Each
119+
120+
Use **colon** for property definitions (assigning a value to a named property):
121+
122+
```mdl
123+
CREATE ENTITY Shop.Product (
124+
Name: String(200), -- property: type/value
125+
Price: Decimal,
126+
);
127+
TEXTBOX txtName (Label: 'Name', Attribute: Title)
128+
```
129+
130+
Use **`AS`** for name-to-name mappings (renaming, aliasing, mapping one name to another):
131+
132+
```mdl
133+
CUSTOM NAME MAP (
134+
'kvkNummer' AS 'ChamberOfCommerceNumber', -- old name AS new name
135+
'naam' AS 'CompanyName',
136+
)
137+
ALTER ENTITY Shop.Product RENAME Code AS ProductCode -- old attr AS new attr
138+
```
139+
140+
**Rule of thumb**: if the left side is a *fixed property key* defined by the syntax, use `:`. If the left side is a *user-provided name* being mapped to another name, use `AS`.
141+
118142
### Step 5: Validate
119143

120144
Run these checks before finalizing syntax design:

.github/workflows/ai-review.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ jobs:
107107
- Follows standard CREATE/ALTER/DROP/SHOW/DESCRIBE pattern — no custom verbs for CRUD operations
108108
- Uses Module.Element qualified names everywhere — no bare names, no implicit module context
109109
- Property lists use ( Key: value, ... ) format with colon separators, one per line
110+
- Colon for property definitions (Key: value), AS for name-to-name mappings ('oldName' AS 'newName') — do not flag AS in mapping/renaming contexts as wrong
110111
- Keywords are full English words — no abbreviations, no symbols for domain operations
111112
- Statement reads as English — a business analyst can understand the intent
112113
- No keyword overloading — each keyword has one consistent meaning
@@ -164,7 +165,7 @@ jobs:
164165
messages: [
165166
{
166167
role: "system",
167-
content: "You are a code reviewer for a Go CLI project (mxcli) that reads/modifies Mendix application projects. Key patterns: ANTLR4 grammar → AST → visitor → executor → BSON writer. New MDL features MUST be wired through the full pipeline (grammar → AST → visitor → executor → LSP → DESCRIBE roundtrip). New MDL syntax must follow design guidelines: reads as English (target audience is citizen developers), uses standard CRUD verbs (CREATE/ALTER/DROP/SHOW/DESCRIBE), consistent property format (Key: value), qualified names (Module.Element), no keyword overloading, no symbolic syntax. Generated ANTLR parser files (mdl/grammar/parser/) are noise — note but skip. The project context includes the full CLAUDE.md with architecture details and the review checklist. Review against the checklist thoroughly but concisely."
168+
content: "You are a code reviewer for a Go CLI project (mxcli) that reads/modifies Mendix application projects. Key patterns: ANTLR4 grammar → AST → visitor → executor → BSON writer. New MDL features MUST be wired through the full pipeline (grammar → AST → visitor → executor → LSP → DESCRIBE roundtrip). New MDL syntax must follow design guidelines: reads as English (target audience is citizen developers), uses standard CRUD verbs (CREATE/ALTER/DROP/SHOW/DESCRIBE), consistent property format (Key: value) for property definitions, AS for name-to-name mappings ('old' AS 'new'), qualified names (Module.Element), no keyword overloading, no symbolic syntax. IMPORTANT: colon is for property definitions (Key: value), AS is for name mappings/renaming — do not flag AS in mapping contexts as a syntax violation. Generated ANTLR parser files (mdl/grammar/parser/) are noise — note but skip. The project context includes the full CLAUDE.md with architecture details and the review checklist. Review against the checklist thoroughly but concisely."
168169
},
169170
{
170171
role: "user",

0 commit comments

Comments
 (0)