Langiumのロゴ

Langium

組織
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).

概要

公開者eclipse-langium
リポジトリlangium-ai
スキル名langium
スター
31
フォーク
4
同梱ファイル
10
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 10個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    eclipse-langiumがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキルLangiumをTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/eclipse-langium/langium-ai/tree/main/skills/langium
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

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
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでLangiumを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあると、モデルが自動的にLangiumを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Langiumは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

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.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「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).

TypingMindでLangiumを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Langiumはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにLangiumをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/eclipse-langium/langium-ai/tree/main/skills/langiumを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Langiumを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストが合致したときにこのスキルを読み込めます。

Langiumは何個のAIモデルで使えますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもLangiumを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Langium」は無料ですか?

はい。eclipse-langiumがGitHubでMITライセンスの下で公開しています。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇