mps-collections-and-closures
Skill by JetBrains
Explains how to write JetBrains MPS BaseLanguage code that uses the collections and closures language extensions. It is a reference for developers building behavior methods, checking rules, generator queries and plugin code.
Install mps-collections-and-closures
Built from the published package, never by AI.
git clone --depth 1 https://github.com/JetBrains/MPS /tmp/MPS && mkdir -p ~/.claude/skills && cp -r /tmp/MPS/.claude/skills/mps-collections-and-closures ~/.claude/skills/mps-collections-and-closuresRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install mps-collections-and-closures in Claude Code
git clone --depth 1 https://github.com/JetBrains/MPS /tmp/MPS && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/MPS/.claude/skills/mps-collections-and-closures ~/.gemini/antigravity-cli/skills/mps-collections-and-closuresAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install mps-collections-and-closures in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill is a reference for writing JetBrains MPS BaseLanguage code that uses the collections and closures language extensions. It covers collection types such as sequence, list, set and map, sorted variants, creators, and sequence operations like where, select, translate, any and sortBy. It also covers list, set and map mutators, closure literals, yield, skip, stop, recursion with invoke, SAM conversion and downcast to a Java interface.
The skill is organized as a lookup catalog in a references folder. An assistant reads one file based on the symptom, such as a closure that does not type-check or an iteration that fails. It also gives critical directives, such as adding a type child to inferred closure parameters, and it validates results with MPS MCP tools. It is aimed at developers writing MPS code in behavior methods, typesystem rules, generator queries, constraints, intentions and plugins.
Written from the project's SKILL.md and checked against it.
What it can do
- Collection types and creatorsCovers sequence, list, set and map types, their sorted variants, and creators.
- Sequence operationsDescribes operations such as where, select, translate, any, sortBy and toList.
- Foreach selectionExplains when to use the collections foreach versus the BaseLanguage foreach.
- Closure literalsCovers ClosureLiteral, inferred closure parameters, FunctionType, yield, skip and stop.
- Recursion and SAM conversionCovers recursion with invoke and SAM conversion of closures to Java interfaces.
- Downcast to Java interfacesGives a DowncastExpression blueprint for calling Java interface methods such as Iterable.iterator.
- Error troubleshootingProvides a symptom, cause and fix table for confusing collections and closures errors.
- Type queriesUses mps_mcp_query_types with OPERATION_TYPE and IS_SUBTYPE to check result and assignability types.
- ValidationUses mps_mcp_check_root_node_problems to check a root node for problems.
What you need
- MPS MCP tools for validation and type queries
- Companion skill mps-model-manipulation for node-based bodies
- collections.runtime solution
- Closures runtime jar for generated closures code
Try asking
- Write a BaseLanguage method that filters a sequence with where and returns a list
- Fix my closure error about different parameter numbers in this MPS behavior method
- Show me how to call Iterable.iterator() on a list using a downcast expression
Good to know
- Parser cannot produce collection types or operations, so these shapes are hand-built from the blueprints
- Most smodel bodies also need the mps-model-manipulation companion skill
- Do not hand-edit serialized .mps files unless explicitly requested; inspect and report instead
- If MPS MCP tools are unavailable, the source says to inspect only and report
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .claude/skills/mps-collections-and-closures/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to mps-collections-and-closures
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
mps-collections-and-closures: common questions
What is the difference between the collections foreach and the BaseLanguage foreach?
The collections ForEachStatement is used for sequence, list and set, while the BaseLanguage ForeachStatement is used for Java arrays and iterables. Choosing the wrong one causes a type error.
Why does my inferred closure parameter cause strange errors?
The source says every InferredClosureParameterDeclaration needs a type child, using UndefinedType as a placeholder. Omitting it can cause misleading parameter number or null operation errors.
Can I use this skill without MPS?
The source describes MPS BaseLanguage and MPS MCP tools for validation, so it is built for MPS projects. It does not describe use outside MPS.
How do I install mps-collections-and-closures?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is mps-collections-and-closures free?
The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.
Is mps-collections-and-closures safe to use?
It scores 79 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to mps-collections-and-closures?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
