mps-aspect-intentions
Skill1.7k starsChanged 2 months agoApache-2.0View on GitHub
Use when defining or editing MPS intentions (the Alt+Enter context-action aspect) — adding `IntentionDeclaration` roots, parameterized or surround-with variants, description/isApplicable/execute 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`.
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-migrationsSkill
- 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
4 rules. About 0 are common, 0 are distinctive, and 4 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.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 19
Use n as C (MPS SNodeTypeCastExpression with asCast=true) — never a Java (C) n cast.
- Very specific: line 20
Use :eq: (NPEEqualsExpression) instead of == whenever either operand might be null.
- Very specific: line 23
After editing, validate with mps_mcp_check_root_node_problems on the intention root and rebuild the language before testing.
- Very specific: line 27
Ensure an intentions model exists in the language (create with mps_mcp_create_model, passing moduleName: "<lang>" and modelName: …
≈ “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 Intentions 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.
Intentions are user-invoked transformations shown in the Alt+Enter popup on a node. They are the canonical way to offer optional refactorings (wrap, convert, introduce, preview) alongside quick-fixes. Authoring lives in <lang>/languageModels/intentions.mps, language jetbrains.mps.lang.intentions.
Critical Directives
- Edit intention roots through MPS MCP tools (
mps_mcp_insert_root_node_from_json,mps_mcp_update_node,mps_mcp_parse_java_and_insert). Do not hand-edit serialized.mpsfiles. - The intentions model must list every language used in any block body as a used language. In particular, the
add new initialized(...)surface syntax requiresjetbrains.mps.lang.actions— add it withmps_mcp_model_used_language(kind="language"). Plain (non-NF_*) variants likeparent.role.add new(C)do not need this import. - Use
n as C(MPSSNodeTypeCastExpressionwithasCast=true) — never a Java(C) ncast. - Use
:eq:(NPEEqualsExpression) instead of==whenever either operand might benull. - The execute body runs on the EDT inside an MPS write action automatically — do not spawn threads or open dialogs that block.
descriptionFunctionruns every time the Alt+Enter popup opens — keep it cheap.- After editing, validate with
mps_mcp_check_root_node_problemson the intention root and rebuild the language before testing.
Common-Path Workflow
- Ensure an
intentionsmodel exists in the language (create withmps_mcp_create_model, passingmoduleName: "<lang>"andmodelName: "<lang>.intentions"— aspect IDintentions, case-sensitive, no@suffix; see aspect-model-stereotypes.md). Used languages:jetbrains.mps.lang.intentions; addjetbrains.mps.lang.actionsif you will use factory-initialized splicing. - Insert an
IntentionDeclarationroot withmps_mcp_insert_root_node_from_json(see blueprint inreferences/json-blueprints.md). Setname,forConcept, andisAvailableInChildNodesif the popup should bubble from descendants. - Fill
descriptionFunction(returns a short label String),executeFunction(the transformation), and optionallyisApplicableFunction(gate predicate) andchildFilterFunction(per-descendant filter whenisAvailableInChildNodes=true). - For multiple menu entries per blueprint use
ParameterizedIntentionDeclarationwithparamType+queryFunction; useIntentionParameterwherever you want "the current value" inside other blocks. - For wrap-the-selection transforms use
SurroundWithIntentionDeclarationand readeditorContext.getSelectedNodes(). - Validate (
mps_mcp_check_root_node_problems), rebuild the language, exercise via Alt+Enter on a sandbox instance. Headlessly: after MAKE, callmps_mcp_list_node_intentionson a sandbox node to confirm the intention is registered and shows the expected description, thenmps_mcp_apply_intention(nodeReference = <the entry's targetNode>, intentionId = <the entry's id>)to smoke-testexecuteFunction(for parameterized declarations also pass the rowdescription). Surround-with intentions are not covered by these tools.
Implicit parameters available in every block
| Alias | FQN | Where |
node | jetbrains.mps.lang.intentions.structure.ConceptFunctionParameter_node | All blocks; typed as forConcept. In ChildFilterFunction this is the nearest enclosing forConcept ancestor. |
editorContext | jetbrains.mps.lang.sharedConcepts.structure.ConceptFunctionParameter_editorContext | All blocks; the current EditorContext. |
childNode | jetbrains.mps.lang.intentions.structure.ConceptFunctionParameter_childNode | Only inside ChildFilterFunction; the descendant under the cursor. |
parameter (IntentionParameter) | jetbrains.mps.lang.intentions.structure.IntentionParameter | Only inside ParameterizedIntentionDeclaration blocks; resolves to the current queried value. |
Related Skills
mps-aspect-actions— when the intention needs factory-initialized children, the NodeFactories live there.mps-aspect-constraints— for gating that should apply everywhere (not just Alt+Enter), prefer can-be rules overisApplicable.mps-aspect-editor-menus-and-keymaps— when the action belongs on a substitute/transformation menu or a keystroke, not in the Alt+Enter popup.mps-model-manipulation— full smodel/baseLanguage/collections reference; covers theNF_*family and the dualIsEmptyOperation. For anexecuteFunctionbody — the AST edit itself — open onlyreferences/property-and-mutation-ops.mdin themps-model-manipulationskill root after loading that companion skill from the same origin.mps-node-editing— MCP recipes for inserting children, updating references, and staged construction.mps-aspect-structure-concepts— when adding the concept thatforConcepttargets.mps-quotations— when the execute body builds a complex subtree literal.mps-tests→EditorTestCase— for testing that an intention is offered and produces the expected tree.
Reference Index
Start here — most common case: one plain intention (description / isApplicable / execute) → read only references/blocks-and-parameters.md, plus references/json-blueprints.md when inserting the root through MCP; the execute body's AST edits → only references/execute-idioms.md; the intention never shows up → only references/common-failures.md.
- Open
references/blocks-and-parameters.mdwhen wiringdescriptionFunction,isApplicableFunction,executeFunction, orchildFilterFunction, or when you need to look up the implicit parameter concept FQNs for any of them. - Open
references/execute-idioms.mdwhen writing anexecuteFunctionbody — typical AST-editing operations (insert sibling, isInstanceOf, asCast, list add, select-in-editor), the verbatimWrapInParensandAddOnEntryexamples, the attach-an-annotation (node attribute) idiom (forConcept = BaseConcept+ context-gatedisApplicable,.@role.add(...)vs.@Mark = ...), and theSelectInEditorOperationJSON shape live there. - Open
references/factory-initialized.mdwhen anexecuteFunctionallocates new nodes and you want the concept's NodeFactory to seed defaults — theNF_*family table, theadd new initialized(<default>)semantics, and the used-language requirement live there. - Open
references/parameterized-intentions.mdwhen authoring or debugging aParameterizedIntentionDeclaration—paramType+queryFunctionsemantics,IntentionParameterusage, the per-valueisApplicableFunctionfilter, and the fullSetCardinalityToexample and JSON skeleton are there. - Open
references/surround-and-child-filter.mdwhen authoring aSurroundWithIntentionDeclarationor when configuringisAvailableInChildNodes+ aChildFilterFunction— verbatimWrapInParensandAddOnEntry.childFilterFunctionwalk-throughs are there. - Open
references/json-blueprints.mdwhen inserting an intention root viamps_mcp_insert_root_node_from_json— minimal blueprints forIntentionDeclaration,ParameterizedIntentionDeclaration, andSurroundWithIntentionDeclarationand the validated concept-reference table. - Open
references/common-failures.mdwhen an intention does not appear, fires on the wrong node, leaves the caret in the wrong place, or shows duplicates — the symptom/cause/fix table is there.
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.

