Skip to content

Commit 9923da9

Browse files
akoclaude
andcommitted
docs: add version-awareness skill and review checklist for version compatibility
- New skill .claude/skills/version-awareness.md teaches agents to check SHOW FEATURES before generating MDL - Add "Version compatibility" section to PR review checklist (registry entry, executor pre-check, test directives, skill updates) - Reference version-awareness skill in "Before Writing MDL" section Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5a531c2 commit 9923da9

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Version Awareness
2+
3+
This skill teaches you to check the project's Mendix version before generating MDL, so you never write syntax the project can't support.
4+
5+
## Before Generating MDL
6+
7+
Always check the project's Mendix version before writing MDL:
8+
9+
```sql
10+
SHOW STATUS; -- shows connected project version
11+
SHOW FEATURES; -- shows all features with availability for this version
12+
SHOW FEATURES IN integration; -- filter by area
13+
```
14+
15+
If you're not connected to a project, query any version directly:
16+
17+
```sql
18+
SHOW FEATURES FOR VERSION 10.24;
19+
```
20+
21+
## Version-Conditional Patterns
22+
23+
If a feature shows "No" in the Available column, **do not use it**. Use the documented workaround instead.
24+
25+
Common version gates:
26+
27+
| Feature | Requires | Workaround for older versions |
28+
|---------|----------|-------------------------------|
29+
| VIEW ENTITY | 10.18+ | Regular entity with microflow data source |
30+
| Page parameters | 11.0+ | Pass data via non-persistent entity |
31+
| REST query params | 11.0+ | Build query string manually in microflow |
32+
| DB runtime connection | 11.0+ | Hardcode connection in Database Connector config |
33+
| Design properties v3 | 11.0+ | Use Atlas v2 design properties |
34+
35+
The executor will reject commands that target unavailable features with an actionable error — but checking upfront avoids wasted work.
36+
37+
## Upgrade Planning
38+
39+
When migrating to a newer version:
40+
41+
```sql
42+
SHOW FEATURES ADDED SINCE 10.24; -- what's new if upgrading from 10.24
43+
```
44+
45+
## Checklist
46+
47+
Before writing any MDL for a connected project:
48+
49+
1. Run `SHOW STATUS` to confirm the Mendix version
50+
2. If using view entities, page parameters, REST clients, or database queries — run `SHOW FEATURES` to verify availability
51+
3. If a feature is unavailable, use the workaround pattern
52+
4. Run `mxcli check script.mdl -p app.mpr --references` to validate before execution

CLAUDE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,13 @@ New or modified MDL syntax must follow the design guidelines:
240240
- [ ] **LLM-friendly** — one example is sufficient for an LLM to generate correct variants
241241
- [ ] **Diff-friendly** — adding one property is a one-line diff
242242

243+
### Version compatibility
244+
New features that depend on a specific Mendix version must be version-gated:
245+
- [ ] **Registry entry** — feature added to `sdk/versions/mendix-{9,10,11}.yaml` with correct `min_version`
246+
- [ ] **Executor pre-check**`checkFeature()` called before BSON writes, with actionable error and hint
247+
- [ ] **Test coverage** — version-gated tests use `-- @version:` directives or `requireMinVersion()`
248+
- [ ] **Skill updated**`.claude/skills/version-awareness.md` updated if the feature has a workaround for older versions
249+
243250
### Full-stack consistency for MDL features
244251
New MDL commands or language features must be wired through the full pipeline:
245252
- [ ] **Grammar** — rule added to `MDLParser.g4` (and `MDLLexer.g4` if new tokens)
@@ -353,6 +360,7 @@ Regenerate after modifying `MDLLexer.g4` or `MDLParser.g4`: `make grammar`. See
353360
## IMPORTANT: Before Writing MDL Scripts or Working with Data
354361

355362
**Read the relevant skill files FIRST before writing any MDL, seeding data, or doing database/import work:**
363+
- `.claude/skills/version-awareness.md` - **CHECK project version first** - Run `SHOW FEATURES` before using version-gated syntax
356364
- `.claude/skills/design-mdl-syntax.md` - **READ before designing new MDL syntax** - Design principles, decision framework, anti-patterns, checklist
357365
- `.claude/skills/write-microflows.md` - Microflow syntax, common mistakes, validation checklist
358366
- `.claude/skills/create-page.md` - Page/widget syntax reference

0 commit comments

Comments
 (0)