Logo di Langium

Langium

Organizzazione
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).

Panoramica

Autoreeclipse-langium
Repositorylangium-ai
Nome della skilllangium
Stelle
31
Fork
4
File inclusi
10
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • 10 file inclusi

    Script, modelli di documento e riferimenti che il modello può leggere mentre lavora. I file sono di sola lettura e non vengono mai eseguiti.

  • Open source

    Pubblicata da eclipse-langium su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Langium in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/eclipse-langium/langium-ai/tree/main/skills/langium
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Nuova skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella nella cartella delle skill di quell'agente.

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
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Langium in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Langium non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Langium non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

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.

File inclusi

Il modello legge questi file quando servono, mentre la skill è caricata. Sono accessibili in sola lettura e non vengono mai eseguiti.

Domande frequenti

Cosa fa la skill IA 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).

Perché usare Langium su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Langium è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Langium in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/eclipse-langium/langium-ai/tree/main/skills/langium. TypingMind legge il file SKILL.md, include i file associati e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Langium?

Qualsiasi modello che colleghi in TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Langium?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Langium: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Langium è gratuita?

Sì. È pubblicata su GitHub da eclipse-langium con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, modelli o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇