Logo di Lai Gen Sysprompt

Lai Gen Sysprompt

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

Panoramica

Pubblicato daeclipse-langium
Repositorylangium-ai
Nome della skilllai-gen-sysprompt
Stelle
31
Fork
4
File inclusi
Solo istruzioni
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.

  • Tutto nelle istruzioni

    Tutto ciò che serve al modello è nelle istruzioni: nessun file aggiuntivo da sincronizzare.

  • Open source

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

Installazione

Installa la skill IA Lai Gen Sysprompt 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/lai-gen-sysprompt
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi 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 della skill nella directory 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/lai-gen-sysprompt .claude/skills/lai-gen-sysprompt
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Lai Gen Sysprompt 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 Lai Gen Sysprompt 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 Lai Gen Sysprompt 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à.

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

Domande frequenti

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

Perché usare Lai Gen Sysprompt su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Lai Gen Sysprompt è 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 la skill 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 Lai Gen Sysprompt in TypingMind?

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

Quali modelli IA possono usare Lai Gen Sysprompt?

Qualsiasi modello che colleghi a 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 Lai Gen Sysprompt?

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

La skill IA Lai Gen Sysprompt è 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, template 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.

Elenco completo

Crea subito il tuo spazio di lavoro AI

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