[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-jetbrains-mps-aspect-generator":3,"mdc--wc0xrm-key":35,"related-repo-jetbrains-mps-aspect-generator":1753,"related-org-jetbrains-mps-aspect-generator":1826},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":22,"repoUrl":23,"updatedAt":24,"license":25,"forks":26,"topics":27,"repo":30,"sourceUrl":33,"mdContent":34},"mps-aspect-generator","define JetBrains MPS generator rules","Use when defining or modifying MPS generators — author a generator module, add or edit root\u002Freduction\u002Fweaving\u002Fpattern mapping rules, attach template macros ($COPY_SRC, $LOOP, $IF, $PROPERTY, $REF, $SWITCH, $MAP_SRC, $WEAVE, $INSERT, $LABEL, $TRACE, $VAR), wire mapping labels, build template switches, write pre\u002Fpost mapping scripts, navigate `genContext`, or debug \"rule didn't fire\", missing references, empty output, infinite reduction loops, and generated-Java compile failures.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},"jetbrains","JetBrains","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fjetbrains.png",[12,16,19],{"name":13,"slug":14,"type":15},"Architecture","architecture","tag",{"name":17,"slug":18,"type":15},"Engineering","engineering",{"name":20,"slug":21,"type":15},"Code Analysis","code-analysis",1650,"https:\u002F\u002Fgithub.com\u002FJetBrains\u002FMPS","2026-07-17T06:06:58.042999",null,311,[28,29],"domain-specific-language","dsl",{"repoUrl":23,"stars":22,"forks":26,"topics":31,"description":32},[28,29],"JetBrains Meta programming System","https:\u002F\u002Fgithub.com\u002FJetBrains\u002FMPS\u002Ftree\u002FHEAD\u002Fplugins\u002Fmcp-tools\u002Fresources\u002Fjetbrains\u002Fmps\u002Fagents\u002Fmcp\u002Fskills\u002Fmps-aspect-generator","---\nname: mps-aspect-generator\ndescription: Use when defining or modifying MPS generators — author a generator module, add or edit root\u002Freduction\u002Fweaving\u002Fpattern mapping rules, attach template macros ($COPY_SRC, $LOOP, $IF, $PROPERTY, $REF, $SWITCH, $MAP_SRC, $WEAVE, $INSERT, $LABEL, $TRACE, $VAR), wire mapping labels, build template switches, write pre\u002Fpost mapping scripts, navigate `genContext`, or debug \"rule didn't fire\", missing references, empty output, infinite reduction loops, and generated-Java compile failures.\ntype: reference\n---\n\n# MPS Generator Aspect\n\nA **generator** transforms models written in the source language into models of one or more *target* languages (usually BaseLanguage or another DSL). It is a separate MPS module — a *generator module* — owned by the language and driven by **templates**: target-language code snippets annotated with **macros**.\n\n## Generator architecture (read first)\n\nA generator translates from the problem domain (source language) toward the implementation domain, often as a **cascade**: each generator lowers the abstraction level by producing its target language, which becomes the next generator's input, until a base language (usually BaseLanguage) is reached and TextGen emits plain text.\n\nA generator definition has a **stable part** and a **variable part**:\n- the **stable part** does not change with the model being generated — engines, base classes, helpers. Provide it **once in a runtime solution** (an MPS `Solution` the language declares as a runtime module — as MPS-authored source or a bundled JAR), not as a template.\n- the **variable part** *is* the templates + macros, which react to the input model and choose different output.\n\nIdiomatic generators keep the stable part **out** of the templates and emit thin code that **calls into** the runtime solution. Before adding rules, decide how much is stable: see the **architecture ladder** in `references\u002Fcookbook.md` and the stable-vs-variable split + wiring in `mps-aspect-accessories\u002Freferences\u002Fruntime-solutions.md` (worked example: the `Kaja` language + its `JavaKaja` runtime).\n\n## Critical Directives\n\n- **Edit the generator, not `source_gen\u002F`.** If a bug appears in generated Java, the fix almost always belongs in a template, macro body, or concept behavior. Patch generated output only when explicitly told to.\n- **`applicableConcept` must be a structure-model node ref** (`r:\u003CmodelUUID>(\u003Clang>.structure)\u002F\u003CnodeId>`), never the `c:\u003ClangUUID>\u002F\u003CconceptId>` form. Wrong form → silent `Unresolved reference: c:...`. See `references\u002Frule-consequences.md`.\n- **A `TemplateDeclaration` used as a reduction target requires at least one `TemplateFragment`** on the produced subtree, or the rule fires and emits nothing.\n- **Module dependencies vs. model used-languages are two distinct layers** (see `references\u002Fmodule-structure.md`). Adding a class to the wrong one yields \"cannot resolve\" in generated Java or unusable concepts in templates.\n- **Macros attach via the `smodelAttribute` child role, and co-located macros are chained in child order — order is semantics.** `$IF$` before `$LOOP$` gates the whole loop in the outer context; `$LOOP$` before `$IF$` evaluates the condition per iteration. The `$LOOP$` + `$COPY_SRC$` pair is order-insensitive only because `$COPY_SRC$` is terminal — don't generalize. See `references\u002Fmacro-catalog.md`.\n- **Reductions can self-loop** when they produce their own concept — break out with `DismissTopMappingRule`, a marker subconcept, or `$COPY_SRC$`.\n- **Cross-rule\u002Fcross-template references go through mapping labels.** Direct references survive only within a single fragment.\n\n## Common-path workflow\n\n1. **Locate or create the generator module.** List languages with `mps_mcp_get_project_structure(moduleKind=\"Language\")` and find yours by `name`: each language entry carries a `generators` array (unconditional — not gated on `includeDependencies`) listing every owned generator's `name` and `reference`. Prefer this over `startingPoint=\"\u003Clanguage-name>\"` — a language and its owned generator share a base name, so a *name* starting point can resolve to the **generator** module instead, and then the `generators` array is never emitted. (If you already hold the language's persistent `reference`, `startingPoint=\"\u003Creference>\"` resolves by id and is also unambiguous.) To go the other direction, each generator entry carries a `sourceLanguage` field (only when `includeDependencies=true`) with the owning language's `name` and `reference`; follow it with `mps_mcp_get_project_structure(startingPoint=\"\u003CsourceLanguage.reference>\", includeModels=true)`. If no generator exists yet: `mps_mcp_create_module(type=\"generator\", parentLanguage=\"\u003Clang>\")`.\n2. In `template\u002Fmain@generator.mps` (the `generator` model stereotype — `name@generator`; see [aspect-model-stereotypes.md](..\u002Fmps-mcp-workflow\u002Freferences\u002Faspect-model-stereotypes.md) for all model identifiers), add the used languages you target (`jetbrains.mps.devkit.templates` is the quickest umbrella) and ensure the target language is also a *module* `generate-into` dependency on the language `.mpl` (see `references\u002Fmodule-structure.md`).\n3. Create or edit the `MappingConfiguration` root (`mps_mcp_create_root_node` with the FQN in `references\u002Fconcept-fqns.md`).\n4. Add the rule(s):\n   - `Root_MappingRule` for whole-root mapping;\n   - `Reduction_MappingRule` for in-place rewrites (inline `RuleConsequence` or `TemplateDeclarationReference`);\n   - `Weaving_MappingRule` to add content into an already-generated container.\n5. Author target-language templates; attach macros as `smodelAttribute` children. Mark the produced subtree with `TemplateFragment` (or `RootTemplateAnnotation` on a target root).\n   - **A `RootTemplateAnnotation` alone does NOT register a root mapping.** It only marks a target root as a template; a `Root_MappingRule` (step 4) whose `template` reference points to that annotated root is also required. Without the rule, generation silently produces no output for that root — MAKE still reports success.\n6. Declare any mapping labels on the `MappingConfiguration`; tag writers (`labelDeclaration` ref or `$LABEL$` macro); read with `genContext.get\u002Fpick output \u003Clabel> for (\u003Cinput>)` inside `$REF$` or other queries.\n7. Validate with `mps_mcp_check_root_node_problems` on the `MappingConfiguration` and every template (re-run with `onlyNodesWithProblems = false` if siblings look \"missing\").\n8. `mps_mcp_alter_nodes MAKE` over the generator and a sample model; **read the generated text** (see *Reading generator output* below). Use the Generator Tracer \u002F `$TRACE$` macros to bisect misgenerated fragments.\n\nIf MPS MCP tools are unavailable, do not hand-edit serialized `.mps` files unless explicitly asked — inspect only and report.\n\n## Reading generator output\n\nAfter a `MAKE`, generators write Java (and TextGen artifacts like `.xml`, `.scxml`) to the owning module's `source_gen\u002F` directory. **No `mps_mcp_*` tool reads this output** — but the MPS MCP server exposes the same generic IDE file tools, so generated text is readable over MCP *today*. Don't drop to a raw shell `find`\u002F`cat`.\n\n**Path convention.** Output lands at `\u003Cmodule-dir>\u002Fsource_gen\u002F\u003Cmodel-namespace>\u002F\u003Cjava-package>\u002F\u003CFile>.java`, where the model namespace's dots become directory separators. Example: model `Kaja.sandbox` in solution `Kajak.sandbox` → `samples\u002Frobot_Kaja\u002Fsolutions\u002FKajak.sandbox\u002Fsource_gen\u002FKaja\u002Fsandbox\u002Fsandbox\u002FKarel.java` (trailing `sandbox\u002F` is the Java package). TextGen artifacts (`.scxml`, etc.) follow the same layout. A module may override its output root, so if `source_gen\u002F` is not beside the module descriptor, check the module's output path.\n\n**Tools.** Use the generic IDE file tools (exposed by the MPS MCP server, also by IDEA's; pass `projectPath` to disambiguate) — not `mps_mcp_*`:\n- `find_files_by_glob` — discover what was generated, e.g. project-root-relative `**\u002FKajak.sandbox\u002Fsource_gen\u002F**\u002F*.java`. Note this matches only `.java`; use `list_directory_tree` to also see TextGen artifacts (`.scxml`, `trace.info`, …).\n- `list_directory_tree` — browse the output directory.\n- `read_file` — read a specific generated file (output is line-capped; use its `max_lines`\u002F`start_line` args for large files).\n\n**Staleness.** On-disk `source_gen\u002F` reflects the *last* MAKE. Re-run `MAKE` before reading so the output matches the current model, otherwise you may read stale text.\n\n## Related Skills\n\n- `mps-aspect-generation-plan` — priorities, checkpoints, plan contributions; pair this with priority-ordering questions.\n- `mps-aspect-textgen` — converting the final model to plain text (last pipeline stage).\n- `mps-aspect-behavior` — put non-trivial per-concept logic in behavior methods called from macros.\n- `mps-model-manipulation` — smodel-access idioms (`SPropertyAccess`, `SLinkAccess`, `Node_GetChildrenOperation`) inside query bodies.\n- `mps-quotations` — quotation\u002Fanti-quotation syntax for building nodes inside `$INSERT$` and `$MAP_SRC$.mapperFunction`.\n- `mps-baselanguage` — host language for macro query bodies and `RulesFunctions_*` helpers.\n\n## Reference Index\n\n- Generator module structure (descriptor deps, model used-languages, MappingConfiguration roles): `references\u002Fmodule-structure.md` — read when setting up a generator or fixing \"cannot resolve\"\u002Fmissing-concept issues.\n- RuleConsequence catalog (`TemplateDeclarationReference`, `Inline*`, `AbandonInput`, `DismissTop`) + the critical `applicableConcept` ref-form gotcha: `references\u002Frule-consequences.md`.\n- Macro catalog and JSON blueprints for COPY_SRC\u002FCOPY_SRCL\u002FPROPERTY\u002FIF\u002FLOOP\u002FCALL: `references\u002Fmacro-catalog.md` — read before attaching any macro.\n- `$MAP_SRC$` in depth (replace input, mapperFunction, postMapperFunction, label-on-site): `references\u002Fmacro-map-src.md`.\n- `$REF$` \u002F ReferenceMacro in depth (label-based and name-based forms, return types): `references\u002Fmacro-reference.md`.\n- Less-common macros — `$WEAVE$`, `$VAR$`, `$TRACE$`, `$LABEL$`, `$INSERT$`: `references\u002Fmacros-rare.md`.\n- Query-body subconcepts and their implicit parameters (`IfMacro_Condition`, `SourceSubstituteMacro_*`, etc.): `references\u002Fquery-bodies.md`.\n- Mapping labels — declare\u002Fwrite\u002Fread pattern, `get` vs `pick` vs `get list`: `references\u002Fmapping-labels.md`.\n- Weaving rules — `contextNodeQuery`, when to use vs. reductions: `references\u002Fweaving-rules.md`.\n- Template switches — when to switch, `extends` across generator modules: `references\u002Ftemplate-switches.md`.\n- Pattern reduction rules — structural-pattern matching with typed holes: `references\u002Fpattern-rules.md`.\n- Mapping scripts (pre \u002F post) — bulk passes and `modifiesModel`: `references\u002Fmapping-scripts.md`.\n- Utility models, template functions, fragments — where to place non-trivial generator-time helpers: `references\u002Futility-models.md`.\n- `genContext` operations catalog (every `GenerationContextOp_*` with editor alias and purpose): `references\u002Fgeneration-context.md`.\n- Generation algorithm — pipeline stages (selection → implicit grouping\u002Fordering → explicit priorities → step-by-step transformation → TextGen), micro-steps, weaving vs. reduction ordering: `references\u002Falgorithm.md`.\n- Cookbook recipes — multi-root, cross-ref, unique IDs, extensible generators, loop-extraction refactor: `references\u002Fcookbook.md`.\n- Common failures — symptom-to-cause-to-fix table: `references\u002Fcommon-failures.md`.\n- Validated concept FQNs and minimal `MappingConfiguration` blueprint: `references\u002Fconcept-fqns.md`.\n- Calling from\u002Finto the generator — behaviors, `RulesFunctions_*`, utility models: `references\u002Fcalling-into-generator.md`.\n",{"data":36,"body":38},{"name":4,"description":6,"type":37},"reference",{"type":39,"children":40},"root",[41,50,93,100,112,131,180,238,244,461,467,936,949,954,1026,1090,1114,1202,1233,1239,1352,1358],{"type":42,"tag":43,"props":44,"children":46},"element","h1",{"id":45},"mps-generator-aspect",[47],{"type":48,"value":49},"text","MPS Generator Aspect",{"type":42,"tag":51,"props":52,"children":53},"p",{},[54,56,62,64,70,72,77,79,84,86,91],{"type":48,"value":55},"A ",{"type":42,"tag":57,"props":58,"children":59},"strong",{},[60],{"type":48,"value":61},"generator",{"type":48,"value":63}," transforms models written in the source language into models of one or more ",{"type":42,"tag":65,"props":66,"children":67},"em",{},[68],{"type":48,"value":69},"target",{"type":48,"value":71}," languages (usually BaseLanguage or another DSL). It is a separate MPS module — a ",{"type":42,"tag":65,"props":73,"children":74},{},[75],{"type":48,"value":76},"generator module",{"type":48,"value":78}," — owned by the language and driven by ",{"type":42,"tag":57,"props":80,"children":81},{},[82],{"type":48,"value":83},"templates",{"type":48,"value":85},": target-language code snippets annotated with ",{"type":42,"tag":57,"props":87,"children":88},{},[89],{"type":48,"value":90},"macros",{"type":48,"value":92},".",{"type":42,"tag":94,"props":95,"children":97},"h2",{"id":96},"generator-architecture-read-first",[98],{"type":48,"value":99},"Generator architecture (read first)",{"type":42,"tag":51,"props":101,"children":102},{},[103,105,110],{"type":48,"value":104},"A generator translates from the problem domain (source language) toward the implementation domain, often as a ",{"type":42,"tag":57,"props":106,"children":107},{},[108],{"type":48,"value":109},"cascade",{"type":48,"value":111},": each generator lowers the abstraction level by producing its target language, which becomes the next generator's input, until a base language (usually BaseLanguage) is reached and TextGen emits plain text.",{"type":42,"tag":51,"props":113,"children":114},{},[115,117,122,124,129],{"type":48,"value":116},"A generator definition has a ",{"type":42,"tag":57,"props":118,"children":119},{},[120],{"type":48,"value":121},"stable part",{"type":48,"value":123}," and a ",{"type":42,"tag":57,"props":125,"children":126},{},[127],{"type":48,"value":128},"variable part",{"type":48,"value":130},":",{"type":42,"tag":132,"props":133,"children":134},"ul",{},[135,163],{"type":42,"tag":136,"props":137,"children":138},"li",{},[139,141,145,147,152,154,161],{"type":48,"value":140},"the ",{"type":42,"tag":57,"props":142,"children":143},{},[144],{"type":48,"value":121},{"type":48,"value":146}," does not change with the model being generated — engines, base classes, helpers. Provide it ",{"type":42,"tag":57,"props":148,"children":149},{},[150],{"type":48,"value":151},"once in a runtime solution",{"type":48,"value":153}," (an MPS ",{"type":42,"tag":155,"props":156,"children":158},"code",{"className":157},[],[159],{"type":48,"value":160},"Solution",{"type":48,"value":162}," the language declares as a runtime module — as MPS-authored source or a bundled JAR), not as a template.",{"type":42,"tag":136,"props":164,"children":165},{},[166,167,171,173,178],{"type":48,"value":140},{"type":42,"tag":57,"props":168,"children":169},{},[170],{"type":48,"value":128},{"type":48,"value":172}," ",{"type":42,"tag":65,"props":174,"children":175},{},[176],{"type":48,"value":177},"is",{"type":48,"value":179}," the templates + macros, which react to the input model and choose different output.",{"type":42,"tag":51,"props":181,"children":182},{},[183,185,190,192,197,199,204,206,212,214,220,222,228,230,236],{"type":48,"value":184},"Idiomatic generators keep the stable part ",{"type":42,"tag":57,"props":186,"children":187},{},[188],{"type":48,"value":189},"out",{"type":48,"value":191}," of the templates and emit thin code that ",{"type":42,"tag":57,"props":193,"children":194},{},[195],{"type":48,"value":196},"calls into",{"type":48,"value":198}," the runtime solution. Before adding rules, decide how much is stable: see the ",{"type":42,"tag":57,"props":200,"children":201},{},[202],{"type":48,"value":203},"architecture ladder",{"type":48,"value":205}," in ",{"type":42,"tag":155,"props":207,"children":209},{"className":208},[],[210],{"type":48,"value":211},"references\u002Fcookbook.md",{"type":48,"value":213}," and the stable-vs-variable split + wiring in ",{"type":42,"tag":155,"props":215,"children":217},{"className":216},[],[218],{"type":48,"value":219},"mps-aspect-accessories\u002Freferences\u002Fruntime-solutions.md",{"type":48,"value":221}," (worked example: the ",{"type":42,"tag":155,"props":223,"children":225},{"className":224},[],[226],{"type":48,"value":227},"Kaja",{"type":48,"value":229}," language + its ",{"type":42,"tag":155,"props":231,"children":233},{"className":232},[],[234],{"type":48,"value":235},"JavaKaja",{"type":48,"value":237}," runtime).",{"type":42,"tag":94,"props":239,"children":241},{"id":240},"critical-directives",[242],{"type":48,"value":243},"Critical Directives",{"type":42,"tag":132,"props":245,"children":246},{},[247,264,311,334,352,427,451],{"type":42,"tag":136,"props":248,"children":249},{},[250,262],{"type":42,"tag":57,"props":251,"children":252},{},[253,255,261],{"type":48,"value":254},"Edit the generator, not ",{"type":42,"tag":155,"props":256,"children":258},{"className":257},[],[259],{"type":48,"value":260},"source_gen\u002F",{"type":48,"value":92},{"type":48,"value":263}," If a bug appears in generated Java, the fix almost always belongs in a template, macro body, or concept behavior. Patch generated output only when explicitly told to.",{"type":42,"tag":136,"props":265,"children":266},{},[267,278,280,286,288,294,296,302,304,310],{"type":42,"tag":57,"props":268,"children":269},{},[270,276],{"type":42,"tag":155,"props":271,"children":273},{"className":272},[],[274],{"type":48,"value":275},"applicableConcept",{"type":48,"value":277}," must be a structure-model node ref",{"type":48,"value":279}," (",{"type":42,"tag":155,"props":281,"children":283},{"className":282},[],[284],{"type":48,"value":285},"r:\u003CmodelUUID>(\u003Clang>.structure)\u002F\u003CnodeId>",{"type":48,"value":287},"), never the ",{"type":42,"tag":155,"props":289,"children":291},{"className":290},[],[292],{"type":48,"value":293},"c:\u003ClangUUID>\u002F\u003CconceptId>",{"type":48,"value":295}," form. Wrong form → silent ",{"type":42,"tag":155,"props":297,"children":299},{"className":298},[],[300],{"type":48,"value":301},"Unresolved reference: c:...",{"type":48,"value":303},". See ",{"type":42,"tag":155,"props":305,"children":307},{"className":306},[],[308],{"type":48,"value":309},"references\u002Frule-consequences.md",{"type":48,"value":92},{"type":42,"tag":136,"props":312,"children":313},{},[314,332],{"type":42,"tag":57,"props":315,"children":316},{},[317,318,324,326],{"type":48,"value":55},{"type":42,"tag":155,"props":319,"children":321},{"className":320},[],[322],{"type":48,"value":323},"TemplateDeclaration",{"type":48,"value":325}," used as a reduction target requires at least one ",{"type":42,"tag":155,"props":327,"children":329},{"className":328},[],[330],{"type":48,"value":331},"TemplateFragment",{"type":48,"value":333}," on the produced subtree, or the rule fires and emits nothing.",{"type":42,"tag":136,"props":335,"children":336},{},[337,342,344,350],{"type":42,"tag":57,"props":338,"children":339},{},[340],{"type":48,"value":341},"Module dependencies vs. model used-languages are two distinct layers",{"type":48,"value":343}," (see ",{"type":42,"tag":155,"props":345,"children":347},{"className":346},[],[348],{"type":48,"value":349},"references\u002Fmodule-structure.md",{"type":48,"value":351},"). Adding a class to the wrong one yields \"cannot resolve\" in generated Java or unusable concepts in templates.",{"type":42,"tag":136,"props":353,"children":354},{},[355,368,369,375,377,383,385,390,391,396,398,403,405,411,413,418,420,426],{"type":42,"tag":57,"props":356,"children":357},{},[358,360,366],{"type":48,"value":359},"Macros attach via the ",{"type":42,"tag":155,"props":361,"children":363},{"className":362},[],[364],{"type":48,"value":365},"smodelAttribute",{"type":48,"value":367}," child role, and co-located macros are chained in child order — order is semantics.",{"type":48,"value":172},{"type":42,"tag":155,"props":370,"children":372},{"className":371},[],[373],{"type":48,"value":374},"$IF$",{"type":48,"value":376}," before ",{"type":42,"tag":155,"props":378,"children":380},{"className":379},[],[381],{"type":48,"value":382},"$LOOP$",{"type":48,"value":384}," gates the whole loop in the outer context; ",{"type":42,"tag":155,"props":386,"children":388},{"className":387},[],[389],{"type":48,"value":382},{"type":48,"value":376},{"type":42,"tag":155,"props":392,"children":394},{"className":393},[],[395],{"type":48,"value":374},{"type":48,"value":397}," evaluates the condition per iteration. The ",{"type":42,"tag":155,"props":399,"children":401},{"className":400},[],[402],{"type":48,"value":382},{"type":48,"value":404}," + ",{"type":42,"tag":155,"props":406,"children":408},{"className":407},[],[409],{"type":48,"value":410},"$COPY_SRC$",{"type":48,"value":412}," pair is order-insensitive only because ",{"type":42,"tag":155,"props":414,"children":416},{"className":415},[],[417],{"type":48,"value":410},{"type":48,"value":419}," is terminal — don't generalize. See ",{"type":42,"tag":155,"props":421,"children":423},{"className":422},[],[424],{"type":48,"value":425},"references\u002Fmacro-catalog.md",{"type":48,"value":92},{"type":42,"tag":136,"props":428,"children":429},{},[430,435,437,443,445,450],{"type":42,"tag":57,"props":431,"children":432},{},[433],{"type":48,"value":434},"Reductions can self-loop",{"type":48,"value":436}," when they produce their own concept — break out with ",{"type":42,"tag":155,"props":438,"children":440},{"className":439},[],[441],{"type":48,"value":442},"DismissTopMappingRule",{"type":48,"value":444},", a marker subconcept, or ",{"type":42,"tag":155,"props":446,"children":448},{"className":447},[],[449],{"type":48,"value":410},{"type":48,"value":92},{"type":42,"tag":136,"props":452,"children":453},{},[454,459],{"type":42,"tag":57,"props":455,"children":456},{},[457],{"type":48,"value":458},"Cross-rule\u002Fcross-template references go through mapping labels.",{"type":48,"value":460}," Direct references survive only within a single fragment.",{"type":42,"tag":94,"props":462,"children":464},{"id":463},"common-path-workflow",[465],{"type":48,"value":466},"Common-path workflow",{"type":42,"tag":468,"props":469,"children":470},"ol",{},[471,613,686,714,771,832,876,904],{"type":42,"tag":136,"props":472,"children":473},{},[474,479,481,487,489,495,497,503,505,511,513,518,520,525,527,533,535,539,541,545,547,552,554,559,561,567,569,575,577,583,585,590,591,596,598,604,606,612],{"type":42,"tag":57,"props":475,"children":476},{},[477],{"type":48,"value":478},"Locate or create the generator module.",{"type":48,"value":480}," List languages with ",{"type":42,"tag":155,"props":482,"children":484},{"className":483},[],[485],{"type":48,"value":486},"mps_mcp_get_project_structure(moduleKind=\"Language\")",{"type":48,"value":488}," and find yours by ",{"type":42,"tag":155,"props":490,"children":492},{"className":491},[],[493],{"type":48,"value":494},"name",{"type":48,"value":496},": each language entry carries a ",{"type":42,"tag":155,"props":498,"children":500},{"className":499},[],[501],{"type":48,"value":502},"generators",{"type":48,"value":504}," array (unconditional — not gated on ",{"type":42,"tag":155,"props":506,"children":508},{"className":507},[],[509],{"type":48,"value":510},"includeDependencies",{"type":48,"value":512},") listing every owned generator's ",{"type":42,"tag":155,"props":514,"children":516},{"className":515},[],[517],{"type":48,"value":494},{"type":48,"value":519}," and ",{"type":42,"tag":155,"props":521,"children":523},{"className":522},[],[524],{"type":48,"value":37},{"type":48,"value":526},". Prefer this over ",{"type":42,"tag":155,"props":528,"children":530},{"className":529},[],[531],{"type":48,"value":532},"startingPoint=\"\u003Clanguage-name>\"",{"type":48,"value":534}," — a language and its owned generator share a base name, so a ",{"type":42,"tag":65,"props":536,"children":537},{},[538],{"type":48,"value":494},{"type":48,"value":540}," starting point can resolve to the ",{"type":42,"tag":57,"props":542,"children":543},{},[544],{"type":48,"value":61},{"type":48,"value":546}," module instead, and then the ",{"type":42,"tag":155,"props":548,"children":550},{"className":549},[],[551],{"type":48,"value":502},{"type":48,"value":553}," array is never emitted. (If you already hold the language's persistent ",{"type":42,"tag":155,"props":555,"children":557},{"className":556},[],[558],{"type":48,"value":37},{"type":48,"value":560},", ",{"type":42,"tag":155,"props":562,"children":564},{"className":563},[],[565],{"type":48,"value":566},"startingPoint=\"\u003Creference>\"",{"type":48,"value":568}," resolves by id and is also unambiguous.) To go the other direction, each generator entry carries a ",{"type":42,"tag":155,"props":570,"children":572},{"className":571},[],[573],{"type":48,"value":574},"sourceLanguage",{"type":48,"value":576}," field (only when ",{"type":42,"tag":155,"props":578,"children":580},{"className":579},[],[581],{"type":48,"value":582},"includeDependencies=true",{"type":48,"value":584},") with the owning language's ",{"type":42,"tag":155,"props":586,"children":588},{"className":587},[],[589],{"type":48,"value":494},{"type":48,"value":519},{"type":42,"tag":155,"props":592,"children":594},{"className":593},[],[595],{"type":48,"value":37},{"type":48,"value":597},"; follow it with ",{"type":42,"tag":155,"props":599,"children":601},{"className":600},[],[602],{"type":48,"value":603},"mps_mcp_get_project_structure(startingPoint=\"\u003CsourceLanguage.reference>\", includeModels=true)",{"type":48,"value":605},". If no generator exists yet: ",{"type":42,"tag":155,"props":607,"children":609},{"className":608},[],[610],{"type":48,"value":611},"mps_mcp_create_module(type=\"generator\", parentLanguage=\"\u003Clang>\")",{"type":48,"value":92},{"type":42,"tag":136,"props":614,"children":615},{},[616,618,624,626,631,633,639,641,648,650,656,658,663,664,670,672,678,679,684],{"type":48,"value":617},"In ",{"type":42,"tag":155,"props":619,"children":621},{"className":620},[],[622],{"type":48,"value":623},"template\u002Fmain@generator.mps",{"type":48,"value":625}," (the ",{"type":42,"tag":155,"props":627,"children":629},{"className":628},[],[630],{"type":48,"value":61},{"type":48,"value":632}," model stereotype — ",{"type":42,"tag":155,"props":634,"children":636},{"className":635},[],[637],{"type":48,"value":638},"name@generator",{"type":48,"value":640},"; see ",{"type":42,"tag":642,"props":643,"children":645},"a",{"href":644},"..\u002Fmps-mcp-workflow\u002Freferences\u002Faspect-model-stereotypes.md",[646],{"type":48,"value":647},"aspect-model-stereotypes.md",{"type":48,"value":649}," for all model identifiers), add the used languages you target (",{"type":42,"tag":155,"props":651,"children":653},{"className":652},[],[654],{"type":48,"value":655},"jetbrains.mps.devkit.templates",{"type":48,"value":657}," is the quickest umbrella) and ensure the target language is also a ",{"type":42,"tag":65,"props":659,"children":660},{},[661],{"type":48,"value":662},"module",{"type":48,"value":172},{"type":42,"tag":155,"props":665,"children":667},{"className":666},[],[668],{"type":48,"value":669},"generate-into",{"type":48,"value":671}," dependency on the language ",{"type":42,"tag":155,"props":673,"children":675},{"className":674},[],[676],{"type":48,"value":677},".mpl",{"type":48,"value":343},{"type":42,"tag":155,"props":680,"children":682},{"className":681},[],[683],{"type":48,"value":349},{"type":48,"value":685},").",{"type":42,"tag":136,"props":687,"children":688},{},[689,691,697,699,705,707,713],{"type":48,"value":690},"Create or edit the ",{"type":42,"tag":155,"props":692,"children":694},{"className":693},[],[695],{"type":48,"value":696},"MappingConfiguration",{"type":48,"value":698}," root (",{"type":42,"tag":155,"props":700,"children":702},{"className":701},[],[703],{"type":48,"value":704},"mps_mcp_create_root_node",{"type":48,"value":706}," with the FQN in ",{"type":42,"tag":155,"props":708,"children":710},{"className":709},[],[711],{"type":48,"value":712},"references\u002Fconcept-fqns.md",{"type":48,"value":685},{"type":42,"tag":136,"props":715,"children":716},{},[717,719],{"type":48,"value":718},"Add the rule(s):\n",{"type":42,"tag":132,"props":720,"children":721},{},[722,733,760],{"type":42,"tag":136,"props":723,"children":724},{},[725,731],{"type":42,"tag":155,"props":726,"children":728},{"className":727},[],[729],{"type":48,"value":730},"Root_MappingRule",{"type":48,"value":732}," for whole-root mapping;",{"type":42,"tag":136,"props":734,"children":735},{},[736,742,744,750,752,758],{"type":42,"tag":155,"props":737,"children":739},{"className":738},[],[740],{"type":48,"value":741},"Reduction_MappingRule",{"type":48,"value":743}," for in-place rewrites (inline ",{"type":42,"tag":155,"props":745,"children":747},{"className":746},[],[748],{"type":48,"value":749},"RuleConsequence",{"type":48,"value":751}," or ",{"type":42,"tag":155,"props":753,"children":755},{"className":754},[],[756],{"type":48,"value":757},"TemplateDeclarationReference",{"type":48,"value":759},");",{"type":42,"tag":136,"props":761,"children":762},{},[763,769],{"type":42,"tag":155,"props":764,"children":766},{"className":765},[],[767],{"type":48,"value":768},"Weaving_MappingRule",{"type":48,"value":770}," to add content into an already-generated container.",{"type":42,"tag":136,"props":772,"children":773},{},[774,776,781,783,788,790,796,798],{"type":48,"value":775},"Author target-language templates; attach macros as ",{"type":42,"tag":155,"props":777,"children":779},{"className":778},[],[780],{"type":48,"value":365},{"type":48,"value":782}," children. Mark the produced subtree with ",{"type":42,"tag":155,"props":784,"children":786},{"className":785},[],[787],{"type":48,"value":331},{"type":48,"value":789}," (or ",{"type":42,"tag":155,"props":791,"children":793},{"className":792},[],[794],{"type":48,"value":795},"RootTemplateAnnotation",{"type":48,"value":797}," on a target root).\n",{"type":42,"tag":132,"props":799,"children":800},{},[801],{"type":42,"tag":136,"props":802,"children":803},{},[804,815,817,822,824,830],{"type":42,"tag":57,"props":805,"children":806},{},[807,808,813],{"type":48,"value":55},{"type":42,"tag":155,"props":809,"children":811},{"className":810},[],[812],{"type":48,"value":795},{"type":48,"value":814}," alone does NOT register a root mapping.",{"type":48,"value":816}," It only marks a target root as a template; a ",{"type":42,"tag":155,"props":818,"children":820},{"className":819},[],[821],{"type":48,"value":730},{"type":48,"value":823}," (step 4) whose ",{"type":42,"tag":155,"props":825,"children":827},{"className":826},[],[828],{"type":48,"value":829},"template",{"type":48,"value":831}," reference points to that annotated root is also required. Without the rule, generation silently produces no output for that root — MAKE still reports success.",{"type":42,"tag":136,"props":833,"children":834},{},[835,837,842,844,850,852,858,860,866,868,874],{"type":48,"value":836},"Declare any mapping labels on the ",{"type":42,"tag":155,"props":838,"children":840},{"className":839},[],[841],{"type":48,"value":696},{"type":48,"value":843},"; tag writers (",{"type":42,"tag":155,"props":845,"children":847},{"className":846},[],[848],{"type":48,"value":849},"labelDeclaration",{"type":48,"value":851}," ref or ",{"type":42,"tag":155,"props":853,"children":855},{"className":854},[],[856],{"type":48,"value":857},"$LABEL$",{"type":48,"value":859}," macro); read with ",{"type":42,"tag":155,"props":861,"children":863},{"className":862},[],[864],{"type":48,"value":865},"genContext.get\u002Fpick output \u003Clabel> for (\u003Cinput>)",{"type":48,"value":867}," inside ",{"type":42,"tag":155,"props":869,"children":871},{"className":870},[],[872],{"type":48,"value":873},"$REF$",{"type":48,"value":875}," or other queries.",{"type":42,"tag":136,"props":877,"children":878},{},[879,881,887,889,894,896,902],{"type":48,"value":880},"Validate with ",{"type":42,"tag":155,"props":882,"children":884},{"className":883},[],[885],{"type":48,"value":886},"mps_mcp_check_root_node_problems",{"type":48,"value":888}," on the ",{"type":42,"tag":155,"props":890,"children":892},{"className":891},[],[893],{"type":48,"value":696},{"type":48,"value":895}," and every template (re-run with ",{"type":42,"tag":155,"props":897,"children":899},{"className":898},[],[900],{"type":48,"value":901},"onlyNodesWithProblems = false",{"type":48,"value":903}," if siblings look \"missing\").",{"type":42,"tag":136,"props":905,"children":906},{},[907,913,915,920,921,926,928,934],{"type":42,"tag":155,"props":908,"children":910},{"className":909},[],[911],{"type":48,"value":912},"mps_mcp_alter_nodes MAKE",{"type":48,"value":914}," over the generator and a sample model; ",{"type":42,"tag":57,"props":916,"children":917},{},[918],{"type":48,"value":919},"read the generated text",{"type":48,"value":343},{"type":42,"tag":65,"props":922,"children":923},{},[924],{"type":48,"value":925},"Reading generator output",{"type":48,"value":927}," below). Use the Generator Tracer \u002F ",{"type":42,"tag":155,"props":929,"children":931},{"className":930},[],[932],{"type":48,"value":933},"$TRACE$",{"type":48,"value":935}," macros to bisect misgenerated fragments.",{"type":42,"tag":51,"props":937,"children":938},{},[939,941,947],{"type":48,"value":940},"If MPS MCP tools are unavailable, do not hand-edit serialized ",{"type":42,"tag":155,"props":942,"children":944},{"className":943},[],[945],{"type":48,"value":946},".mps",{"type":48,"value":948}," files unless explicitly asked — inspect only and report.",{"type":42,"tag":94,"props":950,"children":952},{"id":951},"reading-generator-output",[953],{"type":48,"value":925},{"type":42,"tag":51,"props":955,"children":956},{},[957,959,965,967,973,974,980,982,987,989,1002,1004,1009,1011,1017,1019,1025],{"type":48,"value":958},"After a ",{"type":42,"tag":155,"props":960,"children":962},{"className":961},[],[963],{"type":48,"value":964},"MAKE",{"type":48,"value":966},", generators write Java (and TextGen artifacts like ",{"type":42,"tag":155,"props":968,"children":970},{"className":969},[],[971],{"type":48,"value":972},".xml",{"type":48,"value":560},{"type":42,"tag":155,"props":975,"children":977},{"className":976},[],[978],{"type":48,"value":979},".scxml",{"type":48,"value":981},") to the owning module's ",{"type":42,"tag":155,"props":983,"children":985},{"className":984},[],[986],{"type":48,"value":260},{"type":48,"value":988}," directory. ",{"type":42,"tag":57,"props":990,"children":991},{},[992,994,1000],{"type":48,"value":993},"No ",{"type":42,"tag":155,"props":995,"children":997},{"className":996},[],[998],{"type":48,"value":999},"mps_mcp_*",{"type":48,"value":1001}," tool reads this output",{"type":48,"value":1003}," — but the MPS MCP server exposes the same generic IDE file tools, so generated text is readable over MCP ",{"type":42,"tag":65,"props":1005,"children":1006},{},[1007],{"type":48,"value":1008},"today",{"type":48,"value":1010},". Don't drop to a raw shell ",{"type":42,"tag":155,"props":1012,"children":1014},{"className":1013},[],[1015],{"type":48,"value":1016},"find",{"type":48,"value":1018},"\u002F",{"type":42,"tag":155,"props":1020,"children":1022},{"className":1021},[],[1023],{"type":48,"value":1024},"cat",{"type":48,"value":92},{"type":42,"tag":51,"props":1027,"children":1028},{},[1029,1034,1036,1042,1044,1050,1052,1058,1060,1066,1068,1074,1076,1081,1083,1088],{"type":42,"tag":57,"props":1030,"children":1031},{},[1032],{"type":48,"value":1033},"Path convention.",{"type":48,"value":1035}," Output lands at ",{"type":42,"tag":155,"props":1037,"children":1039},{"className":1038},[],[1040],{"type":48,"value":1041},"\u003Cmodule-dir>\u002Fsource_gen\u002F\u003Cmodel-namespace>\u002F\u003Cjava-package>\u002F\u003CFile>.java",{"type":48,"value":1043},", where the model namespace's dots become directory separators. Example: model ",{"type":42,"tag":155,"props":1045,"children":1047},{"className":1046},[],[1048],{"type":48,"value":1049},"Kaja.sandbox",{"type":48,"value":1051}," in solution ",{"type":42,"tag":155,"props":1053,"children":1055},{"className":1054},[],[1056],{"type":48,"value":1057},"Kajak.sandbox",{"type":48,"value":1059}," → ",{"type":42,"tag":155,"props":1061,"children":1063},{"className":1062},[],[1064],{"type":48,"value":1065},"samples\u002Frobot_Kaja\u002Fsolutions\u002FKajak.sandbox\u002Fsource_gen\u002FKaja\u002Fsandbox\u002Fsandbox\u002FKarel.java",{"type":48,"value":1067}," (trailing ",{"type":42,"tag":155,"props":1069,"children":1071},{"className":1070},[],[1072],{"type":48,"value":1073},"sandbox\u002F",{"type":48,"value":1075}," is the Java package). TextGen artifacts (",{"type":42,"tag":155,"props":1077,"children":1079},{"className":1078},[],[1080],{"type":48,"value":979},{"type":48,"value":1082},", etc.) follow the same layout. A module may override its output root, so if ",{"type":42,"tag":155,"props":1084,"children":1086},{"className":1085},[],[1087],{"type":48,"value":260},{"type":48,"value":1089}," is not beside the module descriptor, check the module's output path.",{"type":42,"tag":51,"props":1091,"children":1092},{},[1093,1098,1100,1106,1108,1113],{"type":42,"tag":57,"props":1094,"children":1095},{},[1096],{"type":48,"value":1097},"Tools.",{"type":48,"value":1099}," Use the generic IDE file tools (exposed by the MPS MCP server, also by IDEA's; pass ",{"type":42,"tag":155,"props":1101,"children":1103},{"className":1102},[],[1104],{"type":48,"value":1105},"projectPath",{"type":48,"value":1107}," to disambiguate) — not ",{"type":42,"tag":155,"props":1109,"children":1111},{"className":1110},[],[1112],{"type":48,"value":999},{"type":48,"value":130},{"type":42,"tag":132,"props":1115,"children":1116},{},[1117,1166,1176],{"type":42,"tag":136,"props":1118,"children":1119},{},[1120,1126,1128,1134,1136,1142,1144,1150,1152,1157,1158,1164],{"type":42,"tag":155,"props":1121,"children":1123},{"className":1122},[],[1124],{"type":48,"value":1125},"find_files_by_glob",{"type":48,"value":1127}," — discover what was generated, e.g. project-root-relative ",{"type":42,"tag":155,"props":1129,"children":1131},{"className":1130},[],[1132],{"type":48,"value":1133},"**\u002FKajak.sandbox\u002Fsource_gen\u002F**\u002F*.java",{"type":48,"value":1135},". Note this matches only ",{"type":42,"tag":155,"props":1137,"children":1139},{"className":1138},[],[1140],{"type":48,"value":1141},".java",{"type":48,"value":1143},"; use ",{"type":42,"tag":155,"props":1145,"children":1147},{"className":1146},[],[1148],{"type":48,"value":1149},"list_directory_tree",{"type":48,"value":1151}," to also see TextGen artifacts (",{"type":42,"tag":155,"props":1153,"children":1155},{"className":1154},[],[1156],{"type":48,"value":979},{"type":48,"value":560},{"type":42,"tag":155,"props":1159,"children":1161},{"className":1160},[],[1162],{"type":48,"value":1163},"trace.info",{"type":48,"value":1165},", …).",{"type":42,"tag":136,"props":1167,"children":1168},{},[1169,1174],{"type":42,"tag":155,"props":1170,"children":1172},{"className":1171},[],[1173],{"type":48,"value":1149},{"type":48,"value":1175}," — browse the output directory.",{"type":42,"tag":136,"props":1177,"children":1178},{},[1179,1185,1187,1193,1194,1200],{"type":42,"tag":155,"props":1180,"children":1182},{"className":1181},[],[1183],{"type":48,"value":1184},"read_file",{"type":48,"value":1186}," — read a specific generated file (output is line-capped; use its ",{"type":42,"tag":155,"props":1188,"children":1190},{"className":1189},[],[1191],{"type":48,"value":1192},"max_lines",{"type":48,"value":1018},{"type":42,"tag":155,"props":1195,"children":1197},{"className":1196},[],[1198],{"type":48,"value":1199},"start_line",{"type":48,"value":1201}," args for large files).",{"type":42,"tag":51,"props":1203,"children":1204},{},[1205,1210,1212,1217,1219,1224,1226,1231],{"type":42,"tag":57,"props":1206,"children":1207},{},[1208],{"type":48,"value":1209},"Staleness.",{"type":48,"value":1211}," On-disk ",{"type":42,"tag":155,"props":1213,"children":1215},{"className":1214},[],[1216],{"type":48,"value":260},{"type":48,"value":1218}," reflects the ",{"type":42,"tag":65,"props":1220,"children":1221},{},[1222],{"type":48,"value":1223},"last",{"type":48,"value":1225}," MAKE. Re-run ",{"type":42,"tag":155,"props":1227,"children":1229},{"className":1228},[],[1230],{"type":48,"value":964},{"type":48,"value":1232}," before reading so the output matches the current model, otherwise you may read stale text.",{"type":42,"tag":94,"props":1234,"children":1236},{"id":1235},"related-skills",[1237],{"type":48,"value":1238},"Related Skills",{"type":42,"tag":132,"props":1240,"children":1241},{},[1242,1253,1264,1275,1308,1333],{"type":42,"tag":136,"props":1243,"children":1244},{},[1245,1251],{"type":42,"tag":155,"props":1246,"children":1248},{"className":1247},[],[1249],{"type":48,"value":1250},"mps-aspect-generation-plan",{"type":48,"value":1252}," — priorities, checkpoints, plan contributions; pair this with priority-ordering questions.",{"type":42,"tag":136,"props":1254,"children":1255},{},[1256,1262],{"type":42,"tag":155,"props":1257,"children":1259},{"className":1258},[],[1260],{"type":48,"value":1261},"mps-aspect-textgen",{"type":48,"value":1263}," — converting the final model to plain text (last pipeline stage).",{"type":42,"tag":136,"props":1265,"children":1266},{},[1267,1273],{"type":42,"tag":155,"props":1268,"children":1270},{"className":1269},[],[1271],{"type":48,"value":1272},"mps-aspect-behavior",{"type":48,"value":1274}," — put non-trivial per-concept logic in behavior methods called from macros.",{"type":42,"tag":136,"props":1276,"children":1277},{},[1278,1284,1286,1292,1293,1299,1300,1306],{"type":42,"tag":155,"props":1279,"children":1281},{"className":1280},[],[1282],{"type":48,"value":1283},"mps-model-manipulation",{"type":48,"value":1285}," — smodel-access idioms (",{"type":42,"tag":155,"props":1287,"children":1289},{"className":1288},[],[1290],{"type":48,"value":1291},"SPropertyAccess",{"type":48,"value":560},{"type":42,"tag":155,"props":1294,"children":1296},{"className":1295},[],[1297],{"type":48,"value":1298},"SLinkAccess",{"type":48,"value":560},{"type":42,"tag":155,"props":1301,"children":1303},{"className":1302},[],[1304],{"type":48,"value":1305},"Node_GetChildrenOperation",{"type":48,"value":1307},") inside query bodies.",{"type":42,"tag":136,"props":1309,"children":1310},{},[1311,1317,1319,1325,1326,1332],{"type":42,"tag":155,"props":1312,"children":1314},{"className":1313},[],[1315],{"type":48,"value":1316},"mps-quotations",{"type":48,"value":1318}," — quotation\u002Fanti-quotation syntax for building nodes inside ",{"type":42,"tag":155,"props":1320,"children":1322},{"className":1321},[],[1323],{"type":48,"value":1324},"$INSERT$",{"type":48,"value":519},{"type":42,"tag":155,"props":1327,"children":1329},{"className":1328},[],[1330],{"type":48,"value":1331},"$MAP_SRC$.mapperFunction",{"type":48,"value":92},{"type":42,"tag":136,"props":1334,"children":1335},{},[1336,1342,1344,1350],{"type":42,"tag":155,"props":1337,"children":1339},{"className":1338},[],[1340],{"type":48,"value":1341},"mps-baselanguage",{"type":48,"value":1343}," — host language for macro query bodies and ",{"type":42,"tag":155,"props":1345,"children":1347},{"className":1346},[],[1348],{"type":48,"value":1349},"RulesFunctions_*",{"type":48,"value":1351}," helpers.",{"type":42,"tag":94,"props":1353,"children":1355},{"id":1354},"reference-index",[1356],{"type":48,"value":1357},"Reference Index",{"type":42,"tag":132,"props":1359,"children":1360},{},[1361,1373,1419,1431,1449,1466,1511,1538,1572,1592,1612,1624,1643,1655,1681,1693,1704,1716,1734],{"type":42,"tag":136,"props":1362,"children":1363},{},[1364,1366,1371],{"type":48,"value":1365},"Generator module structure (descriptor deps, model used-languages, MappingConfiguration roles): ",{"type":42,"tag":155,"props":1367,"children":1369},{"className":1368},[],[1370],{"type":48,"value":349},{"type":48,"value":1372}," — read when setting up a generator or fixing \"cannot resolve\"\u002Fmissing-concept issues.",{"type":42,"tag":136,"props":1374,"children":1375},{},[1376,1378,1383,1384,1390,1391,1397,1398,1404,1406,1411,1413,1418],{"type":48,"value":1377},"RuleConsequence catalog (",{"type":42,"tag":155,"props":1379,"children":1381},{"className":1380},[],[1382],{"type":48,"value":757},{"type":48,"value":560},{"type":42,"tag":155,"props":1385,"children":1387},{"className":1386},[],[1388],{"type":48,"value":1389},"Inline*",{"type":48,"value":560},{"type":42,"tag":155,"props":1392,"children":1394},{"className":1393},[],[1395],{"type":48,"value":1396},"AbandonInput",{"type":48,"value":560},{"type":42,"tag":155,"props":1399,"children":1401},{"className":1400},[],[1402],{"type":48,"value":1403},"DismissTop",{"type":48,"value":1405},") + the critical ",{"type":42,"tag":155,"props":1407,"children":1409},{"className":1408},[],[1410],{"type":48,"value":275},{"type":48,"value":1412}," ref-form gotcha: ",{"type":42,"tag":155,"props":1414,"children":1416},{"className":1415},[],[1417],{"type":48,"value":309},{"type":48,"value":92},{"type":42,"tag":136,"props":1420,"children":1421},{},[1422,1424,1429],{"type":48,"value":1423},"Macro catalog and JSON blueprints for COPY_SRC\u002FCOPY_SRCL\u002FPROPERTY\u002FIF\u002FLOOP\u002FCALL: ",{"type":42,"tag":155,"props":1425,"children":1427},{"className":1426},[],[1428],{"type":48,"value":425},{"type":48,"value":1430}," — read before attaching any macro.",{"type":42,"tag":136,"props":1432,"children":1433},{},[1434,1440,1442,1448],{"type":42,"tag":155,"props":1435,"children":1437},{"className":1436},[],[1438],{"type":48,"value":1439},"$MAP_SRC$",{"type":48,"value":1441}," in depth (replace input, mapperFunction, postMapperFunction, label-on-site): ",{"type":42,"tag":155,"props":1443,"children":1445},{"className":1444},[],[1446],{"type":48,"value":1447},"references\u002Fmacro-map-src.md",{"type":48,"value":92},{"type":42,"tag":136,"props":1450,"children":1451},{},[1452,1457,1459,1465],{"type":42,"tag":155,"props":1453,"children":1455},{"className":1454},[],[1456],{"type":48,"value":873},{"type":48,"value":1458}," \u002F ReferenceMacro in depth (label-based and name-based forms, return types): ",{"type":42,"tag":155,"props":1460,"children":1462},{"className":1461},[],[1463],{"type":48,"value":1464},"references\u002Fmacro-reference.md",{"type":48,"value":92},{"type":42,"tag":136,"props":1467,"children":1468},{},[1469,1471,1477,1478,1484,1485,1490,1491,1496,1497,1502,1504,1510],{"type":48,"value":1470},"Less-common macros — ",{"type":42,"tag":155,"props":1472,"children":1474},{"className":1473},[],[1475],{"type":48,"value":1476},"$WEAVE$",{"type":48,"value":560},{"type":42,"tag":155,"props":1479,"children":1481},{"className":1480},[],[1482],{"type":48,"value":1483},"$VAR$",{"type":48,"value":560},{"type":42,"tag":155,"props":1486,"children":1488},{"className":1487},[],[1489],{"type":48,"value":933},{"type":48,"value":560},{"type":42,"tag":155,"props":1492,"children":1494},{"className":1493},[],[1495],{"type":48,"value":857},{"type":48,"value":560},{"type":42,"tag":155,"props":1498,"children":1500},{"className":1499},[],[1501],{"type":48,"value":1324},{"type":48,"value":1503},": ",{"type":42,"tag":155,"props":1505,"children":1507},{"className":1506},[],[1508],{"type":48,"value":1509},"references\u002Fmacros-rare.md",{"type":48,"value":92},{"type":42,"tag":136,"props":1512,"children":1513},{},[1514,1516,1522,1523,1529,1531,1537],{"type":48,"value":1515},"Query-body subconcepts and their implicit parameters (",{"type":42,"tag":155,"props":1517,"children":1519},{"className":1518},[],[1520],{"type":48,"value":1521},"IfMacro_Condition",{"type":48,"value":560},{"type":42,"tag":155,"props":1524,"children":1526},{"className":1525},[],[1527],{"type":48,"value":1528},"SourceSubstituteMacro_*",{"type":48,"value":1530},", etc.): ",{"type":42,"tag":155,"props":1532,"children":1534},{"className":1533},[],[1535],{"type":48,"value":1536},"references\u002Fquery-bodies.md",{"type":48,"value":92},{"type":42,"tag":136,"props":1539,"children":1540},{},[1541,1543,1549,1551,1557,1558,1564,1565,1571],{"type":48,"value":1542},"Mapping labels — declare\u002Fwrite\u002Fread pattern, ",{"type":42,"tag":155,"props":1544,"children":1546},{"className":1545},[],[1547],{"type":48,"value":1548},"get",{"type":48,"value":1550}," vs ",{"type":42,"tag":155,"props":1552,"children":1554},{"className":1553},[],[1555],{"type":48,"value":1556},"pick",{"type":48,"value":1550},{"type":42,"tag":155,"props":1559,"children":1561},{"className":1560},[],[1562],{"type":48,"value":1563},"get list",{"type":48,"value":1503},{"type":42,"tag":155,"props":1566,"children":1568},{"className":1567},[],[1569],{"type":48,"value":1570},"references\u002Fmapping-labels.md",{"type":48,"value":92},{"type":42,"tag":136,"props":1573,"children":1574},{},[1575,1577,1583,1585,1591],{"type":48,"value":1576},"Weaving rules — ",{"type":42,"tag":155,"props":1578,"children":1580},{"className":1579},[],[1581],{"type":48,"value":1582},"contextNodeQuery",{"type":48,"value":1584},", when to use vs. reductions: ",{"type":42,"tag":155,"props":1586,"children":1588},{"className":1587},[],[1589],{"type":48,"value":1590},"references\u002Fweaving-rules.md",{"type":48,"value":92},{"type":42,"tag":136,"props":1593,"children":1594},{},[1595,1597,1603,1605,1611],{"type":48,"value":1596},"Template switches — when to switch, ",{"type":42,"tag":155,"props":1598,"children":1600},{"className":1599},[],[1601],{"type":48,"value":1602},"extends",{"type":48,"value":1604}," across generator modules: ",{"type":42,"tag":155,"props":1606,"children":1608},{"className":1607},[],[1609],{"type":48,"value":1610},"references\u002Ftemplate-switches.md",{"type":48,"value":92},{"type":42,"tag":136,"props":1613,"children":1614},{},[1615,1617,1623],{"type":48,"value":1616},"Pattern reduction rules — structural-pattern matching with typed holes: ",{"type":42,"tag":155,"props":1618,"children":1620},{"className":1619},[],[1621],{"type":48,"value":1622},"references\u002Fpattern-rules.md",{"type":48,"value":92},{"type":42,"tag":136,"props":1625,"children":1626},{},[1627,1629,1635,1636,1642],{"type":48,"value":1628},"Mapping scripts (pre \u002F post) — bulk passes and ",{"type":42,"tag":155,"props":1630,"children":1632},{"className":1631},[],[1633],{"type":48,"value":1634},"modifiesModel",{"type":48,"value":1503},{"type":42,"tag":155,"props":1637,"children":1639},{"className":1638},[],[1640],{"type":48,"value":1641},"references\u002Fmapping-scripts.md",{"type":48,"value":92},{"type":42,"tag":136,"props":1644,"children":1645},{},[1646,1648,1654],{"type":48,"value":1647},"Utility models, template functions, fragments — where to place non-trivial generator-time helpers: ",{"type":42,"tag":155,"props":1649,"children":1651},{"className":1650},[],[1652],{"type":48,"value":1653},"references\u002Futility-models.md",{"type":48,"value":92},{"type":42,"tag":136,"props":1656,"children":1657},{},[1658,1664,1666,1672,1674,1680],{"type":42,"tag":155,"props":1659,"children":1661},{"className":1660},[],[1662],{"type":48,"value":1663},"genContext",{"type":48,"value":1665}," operations catalog (every ",{"type":42,"tag":155,"props":1667,"children":1669},{"className":1668},[],[1670],{"type":48,"value":1671},"GenerationContextOp_*",{"type":48,"value":1673}," with editor alias and purpose): ",{"type":42,"tag":155,"props":1675,"children":1677},{"className":1676},[],[1678],{"type":48,"value":1679},"references\u002Fgeneration-context.md",{"type":48,"value":92},{"type":42,"tag":136,"props":1682,"children":1683},{},[1684,1686,1692],{"type":48,"value":1685},"Generation algorithm — pipeline stages (selection → implicit grouping\u002Fordering → explicit priorities → step-by-step transformation → TextGen), micro-steps, weaving vs. reduction ordering: ",{"type":42,"tag":155,"props":1687,"children":1689},{"className":1688},[],[1690],{"type":48,"value":1691},"references\u002Falgorithm.md",{"type":48,"value":92},{"type":42,"tag":136,"props":1694,"children":1695},{},[1696,1698,1703],{"type":48,"value":1697},"Cookbook recipes — multi-root, cross-ref, unique IDs, extensible generators, loop-extraction refactor: ",{"type":42,"tag":155,"props":1699,"children":1701},{"className":1700},[],[1702],{"type":48,"value":211},{"type":48,"value":92},{"type":42,"tag":136,"props":1705,"children":1706},{},[1707,1709,1715],{"type":48,"value":1708},"Common failures — symptom-to-cause-to-fix table: ",{"type":42,"tag":155,"props":1710,"children":1712},{"className":1711},[],[1713],{"type":48,"value":1714},"references\u002Fcommon-failures.md",{"type":48,"value":92},{"type":42,"tag":136,"props":1717,"children":1718},{},[1719,1721,1726,1728,1733],{"type":48,"value":1720},"Validated concept FQNs and minimal ",{"type":42,"tag":155,"props":1722,"children":1724},{"className":1723},[],[1725],{"type":48,"value":696},{"type":48,"value":1727}," blueprint: ",{"type":42,"tag":155,"props":1729,"children":1731},{"className":1730},[],[1732],{"type":48,"value":712},{"type":48,"value":92},{"type":42,"tag":136,"props":1735,"children":1736},{},[1737,1739,1744,1746,1752],{"type":48,"value":1738},"Calling from\u002Finto the generator — behaviors, ",{"type":42,"tag":155,"props":1740,"children":1742},{"className":1741},[],[1743],{"type":48,"value":1349},{"type":48,"value":1745},", utility models: ",{"type":42,"tag":155,"props":1747,"children":1749},{"className":1748},[],[1750],{"type":48,"value":1751},"references\u002Fcalling-into-generator.md",{"type":48,"value":92},{"items":1754,"total":1825},[1755,1767,1776,1784,1793,1803,1816],{"slug":1756,"name":1756,"fn":1757,"description":1758,"org":1759,"tags":1760,"stars":22,"repoUrl":23,"updatedAt":1766},"mps-aspect-accessories","configure JetBrains MPS module dependencies","Wire MPS module and model dependencies, used languages, used devkits, extended languages, runtime solutions, accessory models, and language\u002Fdependency versions. Use when adding\u002Fremoving module dependencies, importing languages or devkits into a model, declaring runtime solutions, or shipping accessory content visible to consumers without explicit import.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1761,1762,1765],{"name":13,"slug":14,"type":15},{"name":1763,"slug":1764,"type":15},"Configuration","configuration",{"name":17,"slug":18,"type":15},"2026-07-17T06:06:57.311661",{"slug":1768,"name":1768,"fn":1769,"description":1770,"org":1771,"tags":1772,"stars":22,"repoUrl":23,"updatedAt":1775},"mps-aspect-actions","define and edit MPS node factories","Use when defining or editing MPS node factories (the \"actions\" aspect) — `NodeFactories` roots, per-concept `NodeFactory` setup functions that initialize a freshly created node and optionally copy data from a replaced `sampleNode`, plus the actions aspect's `CopyPasteHandlers` and `PasteWrappers` roots. Reach for this skill when a substitution, side transform, completion replacement, or `add new initialized(...)` should preserve fields from the node it is replacing, or when defaults set in a constructor are not enough.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1773,1774],{"name":13,"slug":14,"type":15},{"name":17,"slug":18,"type":15},"2026-07-17T06:04:48.066901",{"slug":1272,"name":1272,"fn":1777,"description":1778,"org":1779,"tags":1780,"stars":22,"repoUrl":23,"updatedAt":1783},"define and edit MPS concept behavior","Use when defining or editing MPS `ConceptBehavior` — per-concept methods (non-virtual \u002F virtual \u002F abstract \u002F static \u002F virtual static), constructors, virtual dispatch (MRO), super and interface-default calls (`super\u003CInterface>.method`), overriding methods from `lang.core.behavior` interfaces such as `ScopeProvider.getScope` \u002F `INamedConcept.getName` \u002F `BaseConcept.getPresentation`, calling sibling methods (`LocalBehaviorMethodCall`) and behavior methods from other aspects via `node.method(...)`. Reach for this skill whenever the task involves authoring or modifying `\u003Clang>\u002FlanguageModels\u002Fbehavior.mps`.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1781,1782],{"name":13,"slug":14,"type":15},{"name":17,"slug":18,"type":15},"2026-07-13T06:45:21.757084",{"slug":1785,"name":1785,"fn":1786,"description":1787,"org":1788,"tags":1789,"stars":22,"repoUrl":23,"updatedAt":1792},"mps-aspect-constraints","define JetBrains MPS language constraints","Use when defining or editing MPS language constraints — property validators \u002F setters \u002F getters, referent search scopes (imperative or inherited via `ScopeProvider.getScope`), `referentSetHandler` side effects, default-scope blocks, `canBeChild` \u002F `canBeParent` \u002F `canBeAncestor` \u002F `canBeRoot` placement rules, `defaultConcreteConcept` for abstract concepts, `set \u003Cread-only>` and `{name}` aliasing, and scope helpers (`SimpleRoleScope`, `ListScope`, `CompositeScope`, `HidingByNameScope`). Reach for this skill whenever the task involves authoring or modifying `\u003Clang>\u002FlanguageModels\u002Fconstraints.mps`.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1790,1791],{"name":13,"slug":14,"type":15},{"name":20,"slug":21,"type":15},"2026-07-23T05:41:33.639365",{"slug":1794,"name":1794,"fn":1795,"description":1796,"org":1797,"tags":1798,"stars":22,"repoUrl":23,"updatedAt":1802},"mps-aspect-dataflow","define and debug MPS dataflow builders","Use when defining or debugging MPS dataflow builders for a concept — control\u002Fdata flow declarations that drive reachability analysis and variable-use checking. Covers DataFlowBuilderDeclaration, BuilderBlock, emit instructions (code for, jump, ifjump, label, read, write, ret, mayBeUnreachable), positions (AfterPosition, BeforePosition, LabelPosition), the jetbrains.mps.lang.dataFlow language, the NodeParameter implicit, BL+smodel usage inside builder bodies, and IBuilderMode for advanced analyses such as nullable\u002Fnon-null tracking.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1799],{"name":1800,"slug":1801,"type":15},"Data Analysis","data-analysis","2026-07-13T06:45:19.114674",{"slug":1804,"name":1804,"fn":1805,"description":1806,"org":1807,"tags":1808,"stars":22,"repoUrl":23,"updatedAt":1815},"mps-aspect-editor","define MPS editor layouts","Use when creating or changing MPS editor definitions — the overall workflow from scaffolding a `ConceptEditorDeclaration` through componentizing reusable `EditorComponentDeclaration`s, refining cell models and cell layouts, applying style sheets and indent-layout style items, wiring smart references, leveraging inheritance via super-concepts and interfaces, inspecting (`print_node_json`, `show_node_representation`) and validating (`check_root_node_problems`). Covers `jetbrains.mps.lang.editor` cell models (`CellModel_RefNode`\u002F`CellModel_RefNodeList`\u002F`CellModel_RefCell`\u002F`CellModel_Property`\u002F`CellModel_Constant`), layout choices, and JSON blueprints for common editor shapes. For the non-layout side (action maps, keymaps, transformation\u002Fsubstitute menus) use `mps-aspect-editor-menus-and-keymaps`.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1809,1812],{"name":1810,"slug":1811,"type":15},"Design","design",{"name":1813,"slug":1814,"type":15},"UI Components","ui-components","2026-07-23T05:41:56.638151",{"slug":1817,"name":1817,"fn":1818,"description":1819,"org":1820,"tags":1821,"stars":22,"repoUrl":23,"updatedAt":1824},"mps-aspect-editor-menus-and-keymaps","author MPS editor menus and keymaps","Use when authoring the **non-layout** parts of the MPS editor aspect — what happens when the user types, presses a key, triggers completion, pastes, or invokes a context action. Covers action maps (`CellActionMapDeclaration`), cell keymaps (`CellKeyMapDeclaration`), transformation menus (`TransformationMenu_Default` \u002F `_Named` \u002F `_Contribution`), substitute menus (`SubstituteMenu_Default` \u002F `SubstituteMenu` \u002F contributions), side transforms (LEFT\u002FRIGHT), legacy cell menus, paste wrappers and copy-paste handlers (in the actions language), completion styling, reference presentation, two-step deletion, and the editor selection API. Trigger terms: `actionMap`, `keyMap`, `delete_action_id`, `transformationMenu`, `substituteMenu`, `Ctrl+Space`, `Ctrl+Alt+B`, side transform, paste wrapper, completion styling, `PasteWrappers`, `CopyPasteHandlers`. For the **layout** side (cells, layouts, style sheets) use `mps-aspect-editor` instead.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1822,1823],{"name":17,"slug":18,"type":15},{"name":1813,"slug":1814,"type":15},"2026-07-23T05:41:49.666535",31,{"items":1827,"total":1909},[1828,1834,1839,1844,1849,1853,1858,1863,1871,1877,1886,1899],{"slug":1756,"name":1756,"fn":1757,"description":1758,"org":1829,"tags":1830,"stars":22,"repoUrl":23,"updatedAt":1766},{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1831,1832,1833],{"name":13,"slug":14,"type":15},{"name":1763,"slug":1764,"type":15},{"name":17,"slug":18,"type":15},{"slug":1768,"name":1768,"fn":1769,"description":1770,"org":1835,"tags":1836,"stars":22,"repoUrl":23,"updatedAt":1775},{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1837,1838],{"name":13,"slug":14,"type":15},{"name":17,"slug":18,"type":15},{"slug":1272,"name":1272,"fn":1777,"description":1778,"org":1840,"tags":1841,"stars":22,"repoUrl":23,"updatedAt":1783},{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1842,1843],{"name":13,"slug":14,"type":15},{"name":17,"slug":18,"type":15},{"slug":1785,"name":1785,"fn":1786,"description":1787,"org":1845,"tags":1846,"stars":22,"repoUrl":23,"updatedAt":1792},{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1847,1848],{"name":13,"slug":14,"type":15},{"name":20,"slug":21,"type":15},{"slug":1794,"name":1794,"fn":1795,"description":1796,"org":1850,"tags":1851,"stars":22,"repoUrl":23,"updatedAt":1802},{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1852],{"name":1800,"slug":1801,"type":15},{"slug":1804,"name":1804,"fn":1805,"description":1806,"org":1854,"tags":1855,"stars":22,"repoUrl":23,"updatedAt":1815},{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1856,1857],{"name":1810,"slug":1811,"type":15},{"name":1813,"slug":1814,"type":15},{"slug":1817,"name":1817,"fn":1818,"description":1819,"org":1859,"tags":1860,"stars":22,"repoUrl":23,"updatedAt":1824},{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1861,1862],{"name":17,"slug":18,"type":15},{"name":1813,"slug":1814,"type":15},{"slug":1250,"name":1250,"fn":1864,"description":1865,"org":1866,"tags":1867,"stars":22,"repoUrl":23,"updatedAt":1870},"modify MPS generation plans","Use when defining or modifying an MPS generation plan — explicit ordering of generators, checkpoints for cross-model reference resolution, forks for parallel branches, IncludePlan composition, conditional PlanContribution activation, ParameterEquals\u002FConceptListSelector fork selectors, and InitModelAttributes for targetFacet routing. Apply when working with @genplan models, the jetbrains.mps.lang.generator.plan language, attaching plans via DevKits or the Custom generation facet, or debugging cross-model mapping label resolution.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1868,1869],{"name":13,"slug":14,"type":15},{"name":17,"slug":18,"type":15},"2026-07-13T06:44:59.507855",{"slug":4,"name":4,"fn":5,"description":6,"org":1872,"tags":1873,"stars":22,"repoUrl":23,"updatedAt":24},{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1874,1875,1876],{"name":13,"slug":14,"type":15},{"name":20,"slug":21,"type":15},{"name":17,"slug":18,"type":15},{"slug":1878,"name":1878,"fn":1879,"description":1880,"org":1881,"tags":1882,"stars":22,"repoUrl":23,"updatedAt":1885},"mps-aspect-intentions","define and edit MPS intentions","Use when defining or editing MPS intentions (the Alt+Enter context-action aspect) — adding `IntentionDeclaration` roots, parameterized or surround-with variants, description\u002FisApplicable\u002Fexecute blocks, child-filter functions, factory-initialized AST splicing, or debugging why an intention is not offered. Lives in the language's `intentions` model and uses `jetbrains.mps.lang.intentions`.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1883,1884],{"name":13,"slug":14,"type":15},{"name":17,"slug":18,"type":15},"2026-07-23T05:41:48.692899",{"slug":1887,"name":1887,"fn":1888,"description":1889,"org":1890,"tags":1891,"stars":22,"repoUrl":23,"updatedAt":1898},"mps-aspect-migrations","author and debug MPS migration scripts","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\u002FMoveContainmentLink\u002FMoveReferenceLink\u002FMoveProperty, ordering via OrderDependency, data exchange via putData\u002FgetData, 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.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1892,1895],{"name":1893,"slug":1894,"type":15},"Debugging","debugging",{"name":1896,"slug":1897,"type":15},"Migration","migration","2026-07-13T06:45:20.372122",{"slug":1900,"name":1900,"fn":1901,"description":1902,"org":1903,"tags":1904,"stars":22,"repoUrl":23,"updatedAt":1908},"mps-aspect-structure-concepts","define concepts in MPS structure aspect","Define concepts, interface concepts, enumerations, and constrained data types in an MPS language's `structure` aspect. Covers smart-reference detection, alias rules, cardinality, INamedConcept usage, bulk creation, and the full `mps_mcp_alter_structure` \u002F `mps_mcp_query_structure` reference. Use when authoring or modifying a language's structure model.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":9},[1905],{"name":1906,"slug":1907,"type":15},"Data Modeling","data-modeling","2026-07-23T05:41:30.705975",188]