mps-aspect-structure-concepts
Skill1.7k starsChanged 2 months agoApache-2.0View on GitHub
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` / `mps_mcp_query_structure` reference. Use when authoring or modifying a language's structure model.
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-migrationsSkill
- 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
7 rules. About 0 are common, 1 is distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 50
Locate language: use mps_mcp_get_project_structure to find the language and its structure model.
- Very specific: line 51
Module creation: if needed, create the module via mps_mcp_create_module using an absolute path.
- Distinctive: line 59
Use inheritance and abstract concepts for shared logic.
- Very specific: line 66
Proper cardinality: make sure intended child collections have the cardinality of 0..n or 1..n.
- Very specific: line 68
Bulk operations: use mps_mcp_alter_structure for creating multiple concepts or enums efficiently.
- Very specific: line 70
Reload runtime: always rebuild the language (via mps_mcp_alter_nodes with MAKE and rebuild="true") after structural changes to make …
- Very specific: line 106
Keep the wrapper bare: give it an own property, an own containment link, or a plain conceptAlias and it stops qualifying *implicitly*, so …
≈ “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 Structure Aspect — Concepts
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.
Concepts (ConceptDeclaration), interface concepts (InterfaceConceptDeclaration), enumerations (EnumerationDeclaration), and constrained data types (ConstrainedDataTypeDeclaration) are root nodes in a language's structure model. They use the language jetbrains.mps.lang.structure.
Critical Directives
- Implement
INamedConceptinstead of declaringnamedirectly. Anameproperty declared directly on a concept is an antipattern in MPS — implementjetbrains.mps.lang.core.structure.INamedConceptinstead. - Smart reference check (CRITICAL): before setting a
conceptAlias, determine whether the concept is an "Implicit Smart Reference". If it has exactly one mandatory reference and no properties or children of its own, do NOT set aconceptAlias— the concept should be transparent in the editor and completion menu so the user types the target's name directly. Examples: variable references, method calls, routine calls. - Leave alias empty on transparent collections too (e.g.
StatementList). - Set alias on concepts that can be root — that's how the user reaches them through the new-root menu.
- Always rebuild the language with
mps_mcp_alter_nodes MAKEandrebuild="true"after structural changes, so the new concepts are discoverable by runtime tools.
Section index — one row, one read
Each row names the file(s) for one operation. Read them — two files in one parallel batch — and nothing else in references/.
| Job | Read |
parameter wire shape, rejected keys, booleans, …Ref/…Reference suffixes, nulls | references/structure-operation-api/tool-conventions.md |
| create concepts (greenfield) | references/structure-operation-api/create-concepts.md — on the first CREATE_CONCEPTS call also references/structure-operation-api/tool-conventions.md |
| create an enumeration | references/structure-operation-api/create-enum.md |
| add/change/delete a property | references/structure-operation-api/update-concept-property.md |
| add/change/delete a child | references/structure-operation-api/update-concept-child.md |
| add/change/delete a reference | references/structure-operation-api/update-concept-reference.md |
| rename a property / child / reference | references/structure-operation-api/rename-concept-feature.md |
| enum literals | references/structure-operation-api/get-enumeration-literals.md |
| is-subconcept / subconcepts / assignable concepts / superconcepts | references/structure-operation-api/concept-hierarchy-queries.md |
| completion/scope candidates for a reference | references/structure-operation-api/get-assignable-references.md |
| find aspect roots for a concept | references/structure-operation-api/list-concept-aspects.md |
| smart-reference check | references/structure-operation-api/is-smart-reference.md |
Prerequisites
- Requires the target language and its
structuremodel. - Uses the
jetbrains.mps.lang.structurelanguage. - Concepts, interface concepts, and enums are root nodes in the
structuremodel.
Workflow
- Locate language: use
mps_mcp_get_project_structureto find the language and itsstructuremodel. - Module creation: if needed, create the module via
mps_mcp_create_moduleusing an absolute path. - Define elements:
- ConceptDeclaration: core entities.
- InterfaceConceptDeclaration: orthogonal functionality.
- EnumerationDeclaration: fixed values.
- ConstrainedDataTypeDeclaration: regex-restricted properties.
- Attributes (annotations): concepts extending
NodeAttribute/PropertyAttribute/ChildAttribute/LinkAttributethat graft extra children/data onto other concepts without editing them — see Attributes section below.
- Inheritance & interfaces:
- Use inheritance and abstract concepts for shared logic.
- Implement
jetbrains.mps.lang.core.structure.INamedConceptif the concept needs anameproperty.
- Smart reference assessment: see directives above.
- Set alias on concepts that can be root: helps the user instantiate the concept through a menu.
- Leave alias empty on smart references and transparent collections: e.g.
StatementList. - Property definition:
- For enum properties: create the
EnumerationDeclarationfirst, then set the propertydataTypeto reference it.
- For enum properties: create the
- Proper cardinality: make sure intended child collections have the cardinality of
0..nor1..n.- Reference links are always single-valued —
0..1or1. There is no0..nreference in MPS, and nomultipleparameter for references. Model a[0..n]reference as a0..nchild role holding smart-reference wrapper concepts; see "Multi-valued references" below.
- Reference links are always single-valued —
- Bulk operations: use
mps_mcp_alter_structurefor creating multiple concepts or enums efficiently.- Local references within the same JSON blueprint can use names for resolution.
- Reload runtime: always rebuild the language (via
mps_mcp_alter_nodeswithMAKEandrebuild="true") after structural changes to make concepts discoverable.
Multi-valued references ([0..n])
An MPS reference link is always single-valued: 0..1 (optional) or 1 (mandatory). Cardinality on
references does not exist, so multiple: true is rejected on both write paths —
UPDATE_CONCEPT_REFERENCE and a references entry of a CREATE_CONCEPTS blueprint. Only a
children entry takes multiple.
Model a [0..n] reference as a thin smart-reference wrapper concept held in a 0..n child
role on the owner. The wrapper is a non-rootable BaseConcept subconcept with exactly one mandatory
reference, no alias, and no own properties or children — so the editor shows it transparently and the
user just types the target's name. This is what MPS itself does: ConceptDeclaration.implements is a
0..n child list of InterfaceConceptReference, each holding one intfc reference.
[
{
"name": "CourseRef",
"shortDescription": "Reference to a Course",
"references": [
{ "role": "course", "target": "Course", "optional": false }
]
},
{
"name": "Curriculum",
"rootable": true,
"conceptAlias": "curriculum",
"implements": ["jetbrains.mps.lang.core.structure.INamedConcept"],
"children": [
{ "role": "courses", "target": "CourseRef", "multiple": true, "optional": true }
]
}
]Keep the wrapper bare: give it an own property, an own containment link, or a plain conceptAlias
and it stops qualifying implicitly, so the user has to instantiate it explicitly instead of typing
the target's name. Two things do still make a non-bare concept smart, but neither is worth the
trouble here: an explicit SmartReferenceAttribute, which short-circuits every structural check, and
a smart alias of the form pre<{role}>post, which MPS's editor honours (though
IS_SMART_REFERENCE reports it as not smart). Confirm with mps_mcp_query_structure
IS_SMART_REFERENCE on the wrapper: expect isSmartReference: true and
characteristicReferenceName naming its single reference role.
Attributes (Annotations)
Attributes let one language attach extra children, references, or property data to nodes of a concept it does not own — without editing or subclassing that concept. The host carries a universal smodelAttribute child slot (0..n, every BaseConcept has it); the attribute's own declaration says where it may attach. Used heavily for cross-cutting concerns: generator macros (NodeMacro/PropertyMacro/ReferenceMacro), documentation/description comments, requirement traces, error suppression.
- Declare an attribute = a
ConceptDeclarationthat extends one ofNodeAttribute(whole node),PropertyAttribute(one property),ChildAttribute(one child link), orLinkAttribute(one reference link), plus anAttributeInfo(alias@attribute info) in itssmodelAttributerole specifying the extension point:role(the attach key),attributed(which concept(s) may receive it —BaseConcept= any), andmultiple(one vs. many per node). CREATE_CONCEPTScannot express theAttributeInfo— create the concept extending the base attribute, then add theAttributeInfowithmps_mcp_update_node. Full walkthrough, concept reference, and the canonicalRequirementTraceblueprint live inreferences/attributes-and-annotations.md.
Related Skills
mps-aspect-editor-menus-and-keymaps— once concepts exist, define their editors (often the next step).mps-aspect-constraints— property validators, scopes, andcanBe*rules layered on top of structure.mps-aspect-behavior— virtual methods per concept.mps-aspect-actions— node factories for newly created concepts.mps-language-inheritance— forextendedLanguagesand concept super/interface relationships.
Reference Index
Start here — most common case: creating or changing concepts, enumerations, or data types → read the file(s) in the matching Section index row above. Attributes/annotations → only references/attributes-and-annotations.md.
- Open the Section index row (files under
references/structure-operation-api/, listed in the index atreferences/structure-operation-api.md) for the exactmps_mcp_alter_structureormps_mcp_query_structureoperation you are about to call — JSON parameter formats, structure blueprint schemas,makeflag handling, andmakeStatussemantics. - Open
references/attributes-and-annotations.mdfor attributes/annotations: the four attribute kinds (NodeAttribute/PropertyAttribute/ChildAttribute/LinkAttribute), how to choose between them (feature-pinned kinds need a visible feature cell — whole-role markers should be aNodeAttribute+LinkDeclarationreference, converted at runtime viaMetaAdapterByDeclaration), theAttributeInfoextension-point spec (role,attributed,multiple), the two-step MCP creation flow, thesmodelAttributeslot, and worked examples (RequirementTrace, generator macros, doc/comment annotations).
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.

