mps-baselanguage

mps-baselanguage is a skill for Claude Code, Codex from JetBrains/MPS. It costs 94 tokens per session (1,818 once invoked), scanned A, original, Apache-2.0.

A guide for authoring Java-like code in JetBrains MPS’s BaseLanguage, where Java code is edited as a structured model rather than plain text. It explains how to create and validate these model nodes.

In plain words
What is it for?
Use it to write classes, methods, fields, expressions, statements, constructors, and persistent references through the Java parser or structured JSON definitions.
Why use it?
It reduces errors caused by using the wrong MPS node type, reference, equality operation, or constructor structure.

Skill for Claude CodeCodex

About the project

JetBrains MPS is a development environment for creating domain-specific languages, which are programming languages designed for a particular field or task. It provides editors with features such as completion, semantic checks, and type checking, and can generate code in languages including Java and XML.

JetBrains/MPS · 1,658 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/jetbrains/mps/mps-baselanguage
Any agent
npx skills add JetBrains/MPS --skill mps-baselanguage
Clone the repo
git clone --depth 1 https://github.com/JetBrains/MPS

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mps-baselanguage

README.md
[![agentmods](https://agentmods.dev/badge/skills/jetbrains/mps/mps-baselanguage.svg)](https://agentmods.dev/skills/jetbrains/mps/mps-baselanguage)
Your own site
<a href="https://agentmods.dev/skills/jetbrains/mps/mps-baselanguage"><img src="https://agentmods.dev/badge/skills/jetbrains/mps/mps-baselanguage.svg" alt="Measured on agentmods" height="20"></a>
Per session 94 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,818 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00094 $0.01818
Opus 5 $0.00047 $0.00909
Sonnet 5 $0.00019 $0.00364
Haiku 4.5 $0.00009 $0.00182

Measured 5d ago against content hash 31274d492f50, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mps-baselanguage scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/mps-baselanguage/SKILL.md · 62 lines

How it starts

The opening of the file, as written. The whole thing — 62 lines — stays where its author put it; the contents beside it link to each section on GitHub.

MPS BaseLanguage (Java) Authoring

jetbrains.mps.baseLanguage is MPS's Java-equivalent language. You edit it as an AST, not as text. Two authoring paths exist: the Java parser (mps_mcp_parse_java_and_insert) for plain Java, and JSON AST blueprints (mps_mcp_insert_root_node_from_json / mps_mcp_update_root_node_from_json / mps_mcp_update_node) for everything else — especially code that uses BaseLanguage extensions (jetbrains.mps.lang.smodel, jetbrains.mps.baseLanguage.closures, jetbrains.mps.baseLanguage.collections) or needs stable persistent member references.

Critical Directives

  • Node equality: always use :eq: and :ne: (concepts NPEEqualsExpression / NPENotEqualsExpression). Never == or .equals() between SNode references.
  • Constructor return type: ConstructorDeclaration.returnType MUST be a VoidType node. Leaving it empty fails validation.
  • ClassCreator wiring: ClassCreator.baseMethodDeclaration points at the constructor declaration, not the class. InstanceMethodCallOperation.baseMethodDeclaration points at the method declaration.
  • Inherited methods: use the declaring class ref for baseMethodDeclaration, not the subclass that calls the method. E.g. addActionListener is declared on AbstractButton, so use the AbstractButton class ref.
  • Expressions in statement lists: any Expression must be wrapped in ExpressionStatement to be valid inside a StatementList.
  • Variable declarations: in method bodies wrap LocalVariableDeclaration in LocalVariableDeclarationStatement. In ForStatement.variable use LocalVariableDeclaration directly, no wrapper.
  • Prefer primitives: use string (StringType) over String (ClassifierType) where possible; same for int, boolean, etc.
  • Compatibility: BaseLanguage core is Java 7 (including generics). When building AST directly (JSON blueprints), there is no lambda/record syntax — use the jetbrains.mps.baseLanguage.closures extension for closures. The Java parser (mps_mcp_parse_java_and_insert) additionally accepts the Java 8+ syntax MPS recognizes — most notably lambdas, which it maps to closures ClosureLiterals (auto-imported when postProcess.importUsedLanguages is on); a lambda only type-checks against a matching functional-type target. Constructs the parser does not recognize (e.g. records) still fail to parse. See references/parse-java-tips.md.
  • Surgical edits: when a single child changes prefer mps_mcp_update_node over rewriting the whole root — full-root rewrites churn persistent IDs and break incoming refs.

Read the full file on GitHub · 62 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 62 lines · 94 tokens per session scan A 31274d492f50

Subscribe to this mod's changes

mps-baselanguage is a skill published in the GitHub repository JetBrains/MPS (1,658 stars, last pushed yesterday), licensed Apache-2.0. It adds 94 tokens to every session and 1,818 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

langium

A comprehensive skill to understanding how Langium-based projects work — from grammar definition through code generation, runtime parsing, linking, validation, and LSP integration.

eclipse-langium/langium-ai · 33 tokens

lai-gen-evals

Expand and refine the evaluation suite for a Langium DSL project. Generates comprehensive eval files that cover syntactic correctness, semantic validity, user intent matching, edge cases, and language understanding.

eclipse-langium/langium-ai · 42 tokens

lai

Guide for using the langium-ai (LAI) CLI to generate language descriptors, synthesize system prompts, run evaluations, and iteratively refine AI-powered tooling in Langium projects. Use when working with lai commands, descriptors, or evaluation files.

eclipse-langium/langium-ai · 52 tokens

lai-gen-mcp

Generate a Model Context Protocol (MCP) server that exposes a Langium DSL's parser and validator as an MCP tool, allowing any MCP-compatible client to validate DSL code and receive diagnostics.

eclipse-langium/langium-ai · 43 tokens

lai-gen-descriptor

Generate or refine a language descriptor for a Langium DSL project. Bootstraps a new descriptor via lai gen descriptor if none exists, then guides refinement of paths, services, examples, documentation, and structure.

eclipse-langium/langium-ai · 49 tokens

lai-gen-language-skill

Skill for generating a skill for understanding a specific Langium-based DSL. Used in cooperation with the lai & langium skills for understanding.

eclipse-langium/langium-ai · 33 tokens