davesnx/setup/mlx-syntax
Claude Code and agent skill by davesnx/setup
- community
Checking that the SKILL.md file is still in the repository.
Syntax guide for mlx, the JSX syntax for OCaml. Use when writing, reading, or reviewing a .mlx file, when the user asks for JSX or HTML-like elements in OCaml, or when a function must be callable as an mlx tag.
Install
npx vskill@latest install davesnx/setup/mlx-syntaxSKILL.md
Requisite
If the project has no mlx dialect yet, run the setup-mlx skill first.
mlx syntax
mlx is a super-set of OCaml with html-like expressions added. Everything else is plain OCaml, and a .mlx file can hold ordinary OCaml code. An element is an html-like expression: bind it, return it from a match arm, put it in a list, or pass it as an argument without parentheses
Elements are function calls
<div a=1>x</div> calls the function div with ~a:1, ~children:[x], and a final (). A lowercase tag names a function in scope. An uppercase tag names a module and calls its createElement; a runtime ppx may map that call to make. In a module path the last segment decides: <Ui.button /> calls Ui.button, <Ui.Button /> calls Ui.Button.createElement. A self-closing tag passes ~children:[]. The closing tag repeats the opening name.
Props
name=value passes ~name:value. A bare name puns ~name:name. ?name passes an optional argument through, and ?name=value passes ?name:value.
OCaml keywords as prop names
OCaml keywords are not prop names: class, type, method, open are syntax errors. Use the trailing-underscore label the component defines, such as class_.
Children
Children are simple expressions separated by whitespace: literals, identifiers, field access, parenthesized expressions, and elements. They arrive as one list in ~children. A string literal is a plain string; the runtime decides how it renders.
Component signature
A function is callable as a tag when its props are labeled arguments, it takes ~children or ?children, and it ends with unit. Declare ~children on a leaf component too: every call passes it. An uppercase tag needs a module whose createElement has the same shape.
Parenthesize compound expressions
A prop value or a child must be a simple expression. Wrap if, match, fun, let, infix operators, negative numbers, and applications with arguments in parentheses. Braces are an OCaml record literal, so {x} is a record, not interpolation.
Known limits
- Fragments
<>...</>do not exist. Wrap the children in an element or use
a list of elements. If you use reason-react use <React.Fragment>
- Spread
...propsand...childrendo not exist. Forward children with a
children prop, <Child children />
- Comments
(* ... *)are allowed between props and between children.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingagents/skills/mlx-syntax/SKILL.md
Popularity
- Repository stars
- 11
- Repository forks
- 1
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/davesnx/setup/mlx-syntax)