Langium logo

Langium

Organization
eclipse-langium
langium

Build, fix, and improve Langium 4.x languages. Recipes, best practices, and troubleshooting for `.langium` grammars, scoping and cross-references, validation, LSP features (formatting, semantic tokens, code actions, hover, completion), code generators, `langium/test` tests, `langium-config.json`, and multi-language projects. Use when working in any project that depends on `langium` or `langium-cli`, or when a Langium language misbehaves (parse errors, unresolved references, missing diagnostics or editor features).

Overview

Publishereclipse-langium
Repositorylangium-ai
Skill namelangium
Stars
31
Forks
4
Bundled files
10
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 10 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by eclipse-langium on GitHub. Read the source before you install it.

Installation

Install the Langium AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/eclipse-langium/langium-ai/tree/main/skills/langium
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/eclipse-langium/langium-ai.git /tmp/langium-ai
mkdir -p .claude/skills
cp -r /tmp/langium-ai/skills/langium .claude/skills/langium
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Langium in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Langium on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Langium is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Langium

Recipes, best practices, and fixes for building languages with Langium. This file routes you to the right reference. Read only the references your task needs.

Version

Written for Langium 4.x, verified against 4.4.0.

Check the version first: node_modules/langium/package.json (or the langium dependency in package.json). If the project uses Langium 3.x or earlier, this skill does not apply. Say so, and recommend upgrading to 4.x before using these recipes. Differences between 4.x minor versions are listed in references/troubleshooting.md.

Orienting in a project

A typical project (scaffolded with yo langium) contains:

WhatWhere to look
Grammarsrc/**/*.langium (path set in langium-config.json)
Generator configlangium-config.json if it exists, otherwise the "langium" key in package.json. If both exist, the CLI ignores the package.json key (unless --file points elsewhere)
Generated codesrc/**/generated/ (ast.ts, grammar.ts, module.ts). Never edit by hand
DI modulesrc/**/<language>-module.ts with create<Language>Services
Validatorssrc/**/<language>-validator.ts
Language server entrysrc/**/main.ts calling startLanguageServer
CLI entry and generatorsrc/cli/main.ts, src/cli/generator.ts
Teststest/**/*.test.ts (vitest)

Regenerate after every grammar or config change: npm run langium:generate (runs langium generate), or npm run langium:watch while editing.

Task router

If you need to...Read
Diagnose any misbehavior (parse errors, unresolved references, silent validators, missing editor features, slowness)references/troubleshooting.md
Write or change grammar rules, expressions (infix), cross-references, types, terminalsreferences/grammar.md
Fix keyword/terminal conflicts, keywords as identifiers, indentation-sensitive or case-insensitive lexing, value conversionreferences/grammar.md
Scaffold a project, configure langium-config.json, run the CLI, wire DI modules, override a service, bundlereferences/project-setup.md
Pick the right import (langium, langium/lsp, langium/node, ...) or file systemreferences/project-setup.md
Add qualified names, imports between files, member access (a.b.c), a builtin library, custom scopingreferences/scoping.md
Fix "Could not resolve reference"references/scoping.md (after references/troubleshooting.md)
Add validation checks, uniqueness checks, document hooks, slow or custom categories, diagnostic codesreferences/validation.md
Add a formatter, semantic tokens, code actions, hover, completion tweaks, inlay hints, signature help, code lensreferences/lsp-features.md
Generate code or text from the AST, write a CLI generator, add tracingreferences/code-generation.md
Write tests for parsing, linking, validation, or LSP featuresreferences/testing.md
Put several languages in one project, reference across languagesreferences/multi-language.md
Understand build phases, DocumentState, DI cycles, generated ast.ts, AST utilitiesreferences/how-langium-works.md

Mental model

.langium grammar ──langium generate──▶ generated/ast.ts, grammar.ts, module.ts
                                              │
create<Language>Services: inject(default modules, generated modules, your module)
                                              │
DocumentBuilder runs each document through:
  Changed → Parsed → IndexedContent → ComputedScopes → Linked → IndexedReferences → Validated
                                              │
LSP requests (hover, completion, ...) wait for the state they need, then call providers

Every behavior is a service. To change behavior, extend the Default* class and register it in your module. Details: references/how-langium-works.md.

Golden rules

  • Regenerate after every grammar edit. Never edit files in generated/.
  • Change behavior by overriding services in your DI module, never by patching Langium or generated code.
  • Extend the Default* implementation and override one method instead of reimplementing an interface.
  • Never resolve references (ref) inside collectExportedSymbols or collectLocalSymbols. Scopes aren't ready yet, so the result is undefined or bound to the wrong target.
  • In an infix rule the first operator group binds tightest. Right associativity is written right assoc '^'.
  • Optional LSP providers (formatter, semantic tokens, code actions, ...) do nothing until registered in the lsp section of your module.
  • Language servers use createDefaultModule / createDefaultSharedModule from langium/lsp. Headless tools may use the Core variants from langium.
  • slow and custom validation categories never run on document updates (updates run only built-in and fast). Trigger them explicitly.
  • Add a langium/test test for every scoping or validation change.
  • Check parser and lexer errors before trusting an AST. After errors the AST is partial.

Entry points

Import fromUse for
langiumCore types and services, inject, Module, AstUtils, CstUtils, URI, EmptyFileSystem, createDefaultCoreModule
langium/lspcreateDefaultModule, createDefaultSharedModule, startLanguageServer, LSP provider base classes (AbstractFormatter, AbstractSemanticTokenProvider, DefaultCompletionProvider, ...)
langium/nodeNodeFileSystem for Node.js language servers and CLIs
langium/testparseHelper, validationHelper, expectError, expectCompletion, ...
langium/generateexpandToNode, joinToNode, toString, tracing
langium/grammarServices for the Langium grammar language itself (rarely needed)

Use NodeFileSystem for language servers and CLIs that read files from disk. Use EmptyFileSystem in the browser and in all tests, including vitest tests, which run in Node.js but work on in-memory documents.

Reading the source and examples

Langium publishes its TypeScript sources, so read node_modules/langium/src/<area>/ to see the Default* implementation before overriding it (references/, validation/, lsp/, workspace/, parser/, generate/, test/).

Canonical examples at eclipse-langium/langium/examples:

ExampleShows
domainmodelQualified names, custom scoping, formatter, rename, builtin library
arithmeticsinfix expressions, code actions, case-insensitive keywords, interpreter
requirementsTwo languages in one project with cross-language references
statemachineMinimal language with a code generator

Related skills

  • lai: the langium-ai CLI for descriptors, system prompts, and evaluations of LLM output in Langium projects.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Langium AI skill do?

Build, fix, and improve Langium 4.x languages. Recipes, best practices, and troubleshooting for `.langium` grammars, scoping and cross-references, validation, LSP features (formatting, semantic tokens, code actions, hover, completion), code generators, `langium/test` tests, `langium-config.json`, and multi-language projects. Use when working in any project that depends on `langium` or `langium-cli`, or when a Langium language misbehaves (parse errors, unresolved references, missing diagnostics or editor features).

Why use Langium on TypingMind?

Because you install it once and use it with any model. Langium is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Langium in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/eclipse-langium/langium-ai/tree/main/skills/langium. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Langium?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Langium?

As many as you like. As long as a model supports skills, you can use Langium with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Langium AI skill free?

Yes. It is published on GitHub by eclipse-langium under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇