mps-aspect-migrations
Skill1.7k starsChanged 2 months agoApache-2.0View on GitHub
Use when authoring or debugging MPS migration scripts that upgrade user models after a language definition changes — covers jetbrains.mps.lang.migration (MigrationScript class-based, PureMigrationScript declarative, MoveConcept/MoveContainmentLink/MoveReferenceLink/MoveProperty, ordering via OrderDependency, data exchange via putData/getData, RefactoringLog, ConceptMigrationReference) and jetbrains.mps.lang.script Enhancement Scripts (MigrationScript with MigrationScriptPart_Instance, ExtractInterfaceMigration, FactoryMigrationScriptPart, CommentMigrationScriptPart) — when a model needs version-gated upgrade, concept rename or removal, link or property rename, instance-level transformation, or composition of migration steps.
Trending
Quiet since October.thin dataabout the whole repository
Who's talking about JetBrains/MPS
- mbeddr/mps-gradle-plugin“Null pointer exception on generate”GitHub · May 18, 2020 · 1 reactions
- nebojsa-vuksic/skill-atlas“Scan every repository of an organization or user”GitHub · Oct 1, 2026
- modelix/modelix.editor“Implement MPS shortcuts”GitHub · Feb 21, 2023
The biggest 3 of 3 mentions linking to the repository that our crawl found. Each line is their own headline.
In this repository83 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- actionsSkill
- bugfix-workflowSkill
- code-styleSkill
- commitsSkill
- debuggingSkill
- mps-aspect-accessoriesSkill
- mps-aspect-actionsSkill
- mps-aspect-behaviorSkill
- mps-aspect-constraintsSkill
- mps-aspect-dataflowSkill
- mps-aspect-editor-menus-and-keymapsSkill
- mps-aspect-editorSkill
- mps-aspect-generation-planSkill
- mps-aspect-generatorSkill
- mps-aspect-intentionsSkill
- mps-aspect-structure-conceptsSkill
- mps-aspect-textgenSkill
- mps-aspect-typesystemSkill
- mps-baselanguageSkill
- mps-build-languageSkill
- mps-consoleSkill
- mps-distribution-buildSkill
- mps-dsl-memorySkill
- mps-ide-pluginSkill
- mps-lang-core-xmlSkill
- mps-language-analysisSkill
- mps-language-aspects-overviewSkill
- mps-language-inheritanceSkill
- mps-language-modularitySkill
- mps-mcp-workflowSkill
- mps-model-manipulationSkill
- mps-node-editingSkill
- mps-project-managementSkill
- mps-quotationsSkill
- mps-run-configurationsSkill
- mps-testsSkill
- registrySkill
- skill-optimization-studySkill
- ssrSkill
- teamcity-cliSkill
- actionsSkill
- bugfix-workflowSkill
- code-styleSkill
- commitsSkill
- debuggingSkill
- mps-aspect-accessoriesSkill
- mps-aspect-actionsSkill
- mps-aspect-behaviorSkill
- mps-aspect-constraintsSkill
- mps-aspect-dataflowSkill
- mps-aspect-editor-menus-and-keymapsSkill
- mps-aspect-editorSkill
- mps-aspect-generation-planSkill
- mps-aspect-generatorSkill
- mps-aspect-intentionsSkill
- mps-aspect-migrationsSkill
- mps-aspect-structure-conceptsSkill
- mps-aspect-textgenSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 29
Do not hand-edit serialized
.mpsmigration files: Use MPS MCP node tools. - Very specific: line 34
Create or locate the migration model with mps_mcp_create_model (moduleName: "<language.fqn>" plus modelName): <language.fqn>.migration for …
- Very specific: line 49
Start here — most common case: if the form is not decided yet, read only references/form-selection.md — it routes you to the single file …
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
MPS Migrations Aspect
Loading companion skills
Companion names in this skill are lazy dependencies: load only those relevant to the current task. If this skill came from an MCP server, use the host's skill loader to resolve the companion's unique discovered entry URI on the same host-assigned originating server. If the host has no server-backed skill loader, stop and report that limitation; do not silently fall back to a filesystem copy. If this skill came from a filesystem catalog, load the named sibling from that same catalog at <skills-root>/<skill-name>/SKILL.md, even if remote skill loaders are also available. Do not invent a tool name or server endpoint.
Two complementary languages upgrade user models when language definitions change:
jetbrains.mps.lang.migration(l:90746344-04fd-4286-97d5-b46ae6a81709) — core migration language withMigrationScript(class-based, programmatic) andPureMigrationScript(declarative, structural).jetbrains.mps.lang.script(l:0eddeefa-c2d6-4437-bc2c-de50fd4ce470) — Enhancement Scripts that apply concept-instance transformations, used for richer per-node updates.
These address the same problem at different abstraction levels: lang.migration handles structural language refactorings (concept moves/renames, removed concepts); lang.script handles content transformations (modifying properties, children, references of existing instances).
Critical Directives
- Do not confuse the two
MigrationScriptconcepts. One is inlang.migration(BL ClassConcept, version-gated). The other (alias "Enhancement Script") is inlang.script(instance-level transformer). Always disambiguate by language ref. fromVersionis the version migrated FROM, not to — and both forms get it from a node factory. BothMigrationScriptandPureMigrationScripthave a node factory: creating either through a factory-running path (mps_mcp_create_root_node,mps_mcp_insert_root_node_from_json, the IDE's New root,replace with new initialized) setsfromVersionto the language's current version and bumps that version by 1 — do not setfromVersionyourself. Paths that skip factories —dryRun, copies (COPY_NODE, copy/paste,.copy),SNodeBuilder/quotations/plainnew node<>()/add new root, andupdate_root_node_from_jsonon an existing root — do not bump, so a copied script duplicates its source'sfromVersion("Multiple scripts for version N"); fix the copy'sfromVersion, thenSYNC_VERSION. The language version is never set by hand:SYNC_VERSIONderives it from the scripts, is idempotent, and is safe to repeat. Do not hand-edit the.mpl: MPS holds the descriptor in memory and would overwrite the edit.- Any "language version" mismatch from the checker or the generator →
SYNC_VERSION. The mismatch error also carries a "Set correct language version" quick fix (FixLanguageVersion), attached to the script(s) with the highestfromVersionin both directions — but it is not auto-applicable, socheck_root_node_problems(autoApplyQuickFixes = true)will not apply it; apply it explicitly withmps_mcp_apply_intentionwhen you want that route instead ofSYNC_VERSION. Duplicate or missing versions carry no quick fix:SYNC_VERSIONreports them inmigrationProblemswithout fixing them — correct the offending script'sfromVersion, then sync again. - A version change is not effective for migration execution until the language module is rebuilt. The checker compares against the descriptor, but the migration executor reads the version off the generated
LanguageRuntime, so a bumped-but-unbuilt language silently never offers the migration.SYNC_VERSIONreports this asruntimeStale: truewith aruntimeRecoveryAction(the factory's bump needs the same make); clear it withmps_mcp_alter_nodesMAKE(rebuild=true) on the language module. - The language's own version is not the
languageVersionsstamp.usedLanguages[].version/dependencyVersionsin a module descriptor record which version of another language that module was last migrated against.SYNC_VERSIONdeliberately leaves them alone — refreshing them marks pending migrations as already applied. - Model naming is convention-driven and load-bearing.
lang.migrationscripts live in<language.fqn>.migration.lang.scriptEnhancement Scripts live in<language.fqn>.scripts. MPS discovers them by these names at startup. - Migration scripts run in dependency order, determined by
OrderDependency/ExecuteAfterDeclaration. Always declare ordering when the result of one script feeds the next. - Do not hand-edit serialized
.mpsmigration files. Use MPS MCP node tools.
Workflow
- Decide form:
PureMigrationScriptfor structural moves/renames/removals;MigrationScriptfor programmatic transforms; Enhancement Script for instance-level updates. See references/form-selection.md. - Create or locate the migration model with
mps_mcp_create_model(moduleName: "<language.fqn>"plusmodelName):<language.fqn>.migrationforlang.migration(aspect IDmigration);<language.fqn>.scriptsfor Enhancement Scripts (aspect IDscripts). Both aspect IDs are case-sensitive and carry no@suffix — see aspect-model-stereotypes.md. Add the used languages required for that form. - Both forms: creating the script through a factory-running MCP write tool (step 4) sets
fromVersionand bumpslanguageVersionvia the concept's node factory — leave both alone. After the insert, or after editing/deleting/copying a script, or on any version-mismatch error, callmps_mcp_update_module(moduleName = "<language>", operation = "SYNC_VERSION"). IfmigrationProblemsin its response is not empty, fix the listed scripts'fromVersionand sync again. - Build the script body (declarative parts, BL
execute()method, orMigrationScriptPart_Instanceupdater) using the JSON blueprints in references/json-blueprints.md. - Wire ordering (
OrderDependency/ExecuteAfterDeclaration) and data flow (putData/getData) if needed. - Validate via
mps_mcp_check_root_node_problems, thenMAKEthe language module (rebuild=true) so the generatedLanguageRuntimecarries the new version, then run the migration on a test model. Skipping the make leavesruntimeStale: trueand the migration is never offered.
Related Skills
mps-aspect-typesystem,mps-aspect-constraints— when a migration depends on or alters typesystem rules.mps-aspect-generator— when version changes also touch generator templates.mps-quotations— forQuotationConsequenceconsequence bodies insideMigrationScript.execute().mps-model-manipulation— BL + smodel constructs used insideMigrationScript.execute()and Enhancement Script updaters; for the rewrite itself open onlyreferences/property-and-mutation-ops.mdin themps-model-manipulationskill root after loading that companion skill from the same origin.
Reference Index
Start here — most common case: if the form is not decided yet, read only references/form-selection.md — it routes you to the single file for the chosen form (declarative rename/move → references/pure-migration-parts.md; programmatic body → references/migration-script-body.md; instance sweep → references/enhancement-scripts.md), plus references/json-blueprints.md when inserting through MCP.
- Form selection guide — open before authoring to pick between
PureMigrationScript,MigrationScript, and Enhancement Script for the change at hand. Covers ordering, data flow, and model setup. See references/form-selection.md. lang.migrationconcept reference — open when you need exact members, cardinalities, properties, or concept IDs forMigrationScript,PureMigrationScript,IMigrationUnit, ordering and data-exchange concepts, andRefactoringLog. See references/lang-migration-reference.md.PureMigrationPart, node references, and move specializations — open when defining concept/link/property renames or composing migration units viaIncludeMigrationPart. See references/pure-migration-parts.md.MigrationScriptexecute-body constructs — open when writing the BL body of a programmaticMigrationScript: pattern variable references,ConsequenceFunctionvsQuotationConsequence,ConceptMigrationReference. See references/migration-script-body.md.lang.scriptEnhancement Scripts — open when iterating over concept instances to update properties/children/references, or when wiringExtractInterfaceMigration,FactoryMigrationScriptPart, orCommentMigrationScriptPart. See references/enhancement-scripts.md.- Verified JSON blueprints — open when constructing a real migration as JSON for MCP tools. Includes
MigrateReferences,SNodeTypeCastExpression_completelyRemoved, andMigrate_ParametrizedIntentions. See references/json-blueprints.md. - Concept ID quick reference — open when assembling JSON that requires
conceptReferencestrings forlang.migrationandlang.script. See references/concept-ids.md. FIND_INSTANCESrecipes — open to enumerate existing migration scripts or enhancement scripts in the project. See references/find-instances.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

