Logo von Lai Gen Sysprompt

Lai Gen Sysprompt

Organisation
eclipse-langium
lai-gen-sysprompt

Generate or refine a system prompt for a Langium DSL project. Bootstraps a new system prompt via `lai gen sysprompt` if none exists, then guides targeted refinement based on evaluation results and language changes.

Übersicht

Herausgebereclipse-langium
Repositorylangium-ai
Skill-Namelai-gen-sysprompt
Sterne
31
Forks
4
Mitgelieferte Dateien
Nur Anweisungen
LizenzMIT
Links
  • Anweisungen in Markdown

    Eine SKILL.md-Datei, die das Modell bei Bedarf lädt. So werden nur dann Token verbraucht, wenn eine Anfrage tatsächlich dazu passt.

  • Funktioniert mit jedem LLM

    KI-Skills bestehen aus reinem Markdown, nicht aus anbieterspezifischem Code. Daher funktionieren sie mit GPT, Claude, Gemini, Grok oder einem lokalen Modell.

  • In sich abgeschlossen

    Alles, was das Modell braucht, steht in den Anweisungen — keine zusätzlichen Dateien zum Synchronisieren.

  • Open Source

    Von eclipse-langium auf GitHub veröffentlicht. Prüfen Sie vor der Installation die Quelldateien.

Installation

Installieren Sie den KI-Skill Lai Gen Sysprompt in TypingMind, um ihn mit jedem LLM zu nutzen, oder fügen Sie ihn einem anderen Agenten hinzu, der SKILL.md lesen kann.

1

In TypingMind installieren

TypingMind installiert einen Skill direkt aus seinem GitHub-Ordner. Dabei liest die App SKILL.md, bündelt die Ressourcendateien und speichert das Ergebnis lokal.

  1. Öffnen Sie die App und gehen Sie zu Plugins → Skills.
  2. Wählen Sie „Von GitHub installieren“.
  3. Fügen Sie die unten angegebene URL des Skill-Ordners ein und bestätigen Sie.
    https://github.com/eclipse-langium/langium-ai/tree/main/skills/lai-gen-sysprompt
  4. Aktivieren Sie den Skill in jedem Chat, in dem er verfügbar sein soll.
Plugins → Skills → Skill hinzufügen → Über GitHub-URL. Fügen Sie dann die Ordner-URL ein und klicken Sie auf „Weiter“.
2

In einem anderen Agenten installieren

Jeder Agent, der das Agent-Skills-Format unterstützt, kann diesen Skill nutzen. Kopieren Sie den Ordner in das Skill-Verzeichnis des jeweiligen Agenten.

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/lai-gen-sysprompt .claude/skills/lai-gen-sysprompt
Starten Sie Claude Code nach dem Kopieren neu, damit der neue Skill erkannt wird.

In TypingMind verwenden

Aktivieren Sie Lai Gen Sysprompt in einem beliebigen Chat in TypingMind. Den Rest übernimmt das Modell. Name und Beschreibung des Skills stehen im System-Prompt. Sobald eine Anfrage passt, lädt das Modell selbstständig die vollständigen Anweisungen — Sie müssen den Skill nie manuell aufrufen, und er verbraucht erst Token, wenn er tatsächlich genutzt wird.

Das Modell lädt Lai Gen Sysprompt automatisch, sobald eine passende Anfrage gestellt wird.

Funktioniert mit jedem KI-Modell

KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher ist Lai Gen Sysprompt nicht an das Modell gebunden, für das der Skill geschrieben wurde. Installieren Sie ihn einmal in TypingMind und nutzen Sie ihn mit GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder einem selbst betriebenen lokalen Modell — alles mit Ihren eigenen API-Schlüsseln.

  • Wird nur bei Bedarf geladen

    Der System-Prompt enthält nur den Namen und die Beschreibung. Die Anweisungen werden bei der ersten passenden Anfrage geladen. Ein ungenutzter Skill verursacht daher keine Kosten.

  • Modell im laufenden Chat wechseln

    Da der Skill aus Anweisungen statt aus Code besteht, funktioniert er auch nach einem Modellwechsel — das nächste Modell liest dieselbe SKILL.md-Datei.

Skill-Anweisungen

Dies ist der Inhalt von SKILL.md, den das Modell lädt. Lesen Sie ihn vor der Installation — ein Skill besteht aus Anweisungen, denen Ihr Modell folgt.

Generate or Refine a System Prompt

This skill covers the full lifecycle of a system prompt for a Langium DSL — from initial generation to iterative refinement. If no system prompt exists yet, it bootstraps one using lai gen sysprompt. If one already exists, it guides you through diagnosing issues from evaluation results and making targeted improvements.

You may also use the lai and langium skills for deeper understanding of the CLI workflow and Langium project structure.

When to Use

  • No system prompt yet — you have a descriptor and need to generate the first system prompt
  • Evaluation results show low pass rates or recurring failure categories
  • The system prompt is missing key language details — grammar rules, validation constraints, scoping rules
  • LLM-generated code consistently has specific error patterns
  • The descriptor or language has changed since the prompt was last generated
  • The prompt is too verbose, unfocused, or missing edge cases

Prerequisites

The target Langium project must have:

  1. lai init completed — a lai.config.jsonc exists
  2. A language descriptor (language.descriptor.yml) — generate one first using the lai-gen-descriptor skill if needed
  3. Node.js and npm available

Step 1: Generate the System Prompt (if not present)

If no system prompt exists, generate one from the descriptor:

bash
# generate a system prompt
lai gen sysprompt

# regenerate from scratch, ignoring any existing prompt
lai gen sysprompt --fresh

This produces a markdown file (e.g., language.sysprompt.md) that instructs an LLM how to generate valid code in your DSL. It is driven entirely by the descriptor content.

If a system prompt already exists and you want to refine it, skip to Step 2.

Step 2: Identify What Needs Fixing

Read the current system prompt and any recent evaluation results to understand the gaps:

bash
# check latest evaluation results
lai show latest --verbose

# compare against a previous good run if available
lai compare <good-run-id> latest

Common issues to look for:

  • Missing grammar context — the prompt doesn't include key grammar rules the LLM needs
  • Incorrect or outdated examples — examples no longer match the current language
  • Vague instructions — the prompt tells the LLM what to generate but not how to avoid common mistakes
  • Missing validation rules — the LLM doesn't know about semantic constraints enforced by the validator
  • Overly long or unfocused — too much irrelevant detail dilutes the important parts

Step 3: Refine the Prompt Content

When editing the system prompt markdown file directly, follow these principles:

  • Be specific about error patterns. If evaluations show the LLM consistently produces invalid cross-references, add a section explaining the scoping rules explicitly.
  • Add negative examples. Show what not to generate alongside valid examples. Frame these as "Common mistakes to avoid."
  • Tighten grammar explanations. Instead of dumping the full grammar, highlight the rules that matter most for generation — entry rules, commonly used alternatives, and tricky syntax.
  • Include validation constraints. If the validator rejects certain patterns, document them as explicit constraints: "Every entity must have at least one property" or "Type references must resolve to a declared type."
  • Order sections by importance. Put the most critical generation rules first — LLMs attend more to earlier context.

Target Structure

The generated prompt always starts with a fixed set of sections (using ### headings): Introduction, one Grammar section per language, Built-in Library (if any), Validation Rules, Examples, Documentation, and Capabilities. The structure below is guidance for how you may reorganize and expand the prompt during manual refinement — it is not what the generator produces verbatim.

A well-refined system prompt should have this structure:

markdown
# <Language Name> Language System Prompt

## Introduction
Brief description of the language and its purpose.

## Grammar Overview
Key grammar rules relevant to code generation, not necessarily the full grammar.
Highlight entry rules, common patterns, and syntactic constraints.

## Validation Rules
Semantic constraints enforced by the validator that the LLM must respect.
These are the rules that cause evaluation failures when violated.

## Scoping and References
How cross-references resolve, what names are in scope where.
Only include if the language has custom scoping.

## Examples
Valid example programs with brief annotations explaining what they demonstrate.

## Common Mistakes
Patterns the LLM should avoid, derived from evaluation failures.

## Generation Guidelines
Specific instructions for how to produce output: formatting, naming conventions,
required elements, optional elements.

Not all sections are needed for every language — include only what's relevant.

Step 4: LLM-Assisted Refinement (Optional)

If you want to use an LLM to help refine the system prompt rather than editing manually, use a prompt like this. Substitute the variables with actual content from your project:

You are refining a system prompt for the <LANGUAGE_NAME> language.

The system prompt is a markdown document with sections such as Introduction,
Grammar, Validation Rules, Examples, Documentation, and Capabilities. Refine it
for clarity, accuracy, and coverage while preserving its existing section
structure and ordering.

Detail level guidance:
- basic: Keep explanations minimal and focused on essentials only.
- moderate: Provide a balanced level of detail — enough for clarity without being verbose.
- comprehensive: Include thorough explanations, edge cases, and detailed context.

Summarization: <"Condense and summarize where possible" OR "Preserve the full detail of the original content">

Current prompt:
<THE EXISTING SYSTEM PROMPT CONTENT>

<If evaluation results are available, include:>
Recent evaluation failures:
<List of failing test cases with their error messages>

Task:
- Improve clarity and readability
- Ensure technical accuracy
- Add helpful context for code generation
- Address the evaluation failures listed above
- Maintain all key information
- Keep the markdown structure and section ordering
- Match the detail level guidance above

Return the refined prompt in markdown format. Do not add extra commentary, just return the improved prompt.

Step 5: Apply and Verify

After refining the system prompt:

bash
# re-run evaluations against the updated prompt
lai evaluate

# compare against the previous run
lai compare <previous-run-id> latest

# tag the run if it improved
lai tag latest after-refinement

Iterative Refinement Tips

  • Fix one category of failure at a time. Don't try to address all issues in a single edit — make a targeted change, evaluate, and repeat.
  • Track what changed. Use lai tag to mark runs before and after each refinement so you can compare.
  • Don't over-specify. Adding too many constraints can make the LLM produce rigid, unnatural output. Find the balance between correctness and flexibility.
  • Update the descriptor first if the language changed. If grammar rules or validation logic changed, update the descriptor and regenerate before refining — otherwise your refinements may conflict with a future regeneration.

Common Refinement Patterns

SymptomLikely Prompt Fix
LLM produces syntactically invalid codeAdd or improve the Grammar Overview section with key rules
Validation errors in generated codeAdd explicit Validation Rules section listing constraints
Wrong cross-references or unresolved namesAdd Scoping and References section explaining name resolution
LLM ignores language conventionsAdd Generation Guidelines with formatting and naming rules
Repetitive or unnatural outputReduce over-specification; add more diverse examples
LLM misunderstands the language's purposeImprove the Introduction section with domain context

Häufig gestellte Fragen

Was macht der KI-Skill Lai Gen Sysprompt?

Generate or refine a system prompt for a Langium DSL project. Bootstraps a new system prompt via `lai gen sysprompt` if none exists, then guides targeted refinement based on evaluation results and language changes.

Warum Lai Gen Sysprompt in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. Lai Gen Sysprompt besteht aus reinem Markdown statt aus anbieterspezifischem Code. So funktioniert derselbe Skill mit GPT-5, Claude, Gemini, Grok oder einem lokalen Modell – und Sie können das Modell mitten im Chat wechseln, ohne dass der Skill seine Funktion verliert. TypingMind verwendet Ihre eigenen API-Schlüssel. Sie bezahlen die Anbieter daher direkt statt über ein Abonnement pro Nutzerplatz, und Ihre Skills und Chats bleiben in Ihrem eigenen Speicher.

Wie installiere ich Lai Gen Sysprompt in TypingMind?

Öffnen Sie in TypingMind Plugins → Skills → Von GitHub installieren und fügen Sie https://github.com/eclipse-langium/langium-ai/tree/main/skills/lai-gen-sysprompt ein. TypingMind liest die Datei SKILL.md und installiert den Skill, den Sie für jeden Chat einzeln aktivieren können.

Welche KI-Modelle können Lai Gen Sysprompt nutzen?

Jedes Modell, das Sie mit TypingMind verbinden. KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher können GPT, Claude, Gemini, Grok und lokale Modelle diesen Skill laden, wenn eine Anfrage dazu passt.

Wie viele KI-Modelle kann ich mit Lai Gen Sysprompt verwenden?

So viele Sie möchten. In TypingMind können Sie Lai Gen Sysprompt mit jedem Modell verwenden, das Skills unterstützt, etwa mit GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama. Dabei nutzen Sie Ihre eigenen API-Schlüssel.

Ist der KI-Skill Lai Gen Sysprompt kostenlos?

Ja. Der Skill wird von eclipse-langium auf GitHub unter der Lizenz MIT veröffentlicht. Sie bezahlen nur Ihren eigenen KI-Anbieter für die verwendeten Token.

Was sind KI-Skills?

Ein KI-Skill ist ein wiederverwendbares Anweisungspaket, das einem KI-Modell vermittelt, wie es eine bestimmte Aufgabe erledigt. Es folgt dem offenen Format Agent Skills: Die Datei SKILL.md enthält den Namen und die Beschreibung des Skills. Hinzu kommen bei Bedarf Skripte, Vorlagen oder Referenzdateien für das Modell. Das Modell liest die Anweisungen nur, wenn Ihre Anfrage zum Skill passt. Ein installierter Skill verursacht daher erst Kosten, wenn er verwendet wird.

Wie unterscheiden sich KI-Skills von Plugins oder MCP-Servern?

Ein Plugin oder MCP-Server stellt einem Modell neue aufrufbare Tools bereit – Code, der auf einem System ausgeführt wird und ein Ergebnis zurückgibt. Ein KI-Skill vermittelt dem Modell stattdessen Wissen und Vorgehensweisen: wie es eine Aufgabe angeht, welche Schritte es befolgt und wie eine gute Ausgabe aussieht. Skills bestehen aus reinem Markdown und kommen daher ohne Server, API-Schlüssel und Laufzeitumgebung aus. Sie funktionieren mit jedem Modell.

Alle anzeigen

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇