lai-gen-language-skill
Skill for generating a skill for understanding a specific Langium-based DSL. Used in cooperation with the lai & langium skills for understanding.
eclipse-langium · 已有静态检查记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add eclipse-langium/langium-ai --skill lai-gen-language-skill技能说明
name: lai-gen-language-skill description: Skill for generating a skill for understanding a specific Langium-based DSL. Used in cooperation with the lai & langium skills for understanding. user-invocable: true
Generate Language Skill
This guide instructs an agent on how to generate a comprehensive, standalone skill document (a markdown file) for working with a specific Langium-based DSL. The output skill should give any agent or developer a deep understanding of the target language — its syntax, semantics, use cases, patterns, and pitfalls — without requiring access to the original project sources at runtime.
You may also use the lai and langium skills to achieve a better understanding of langium-ai and the Langium-based DSL in question that we wish to generate a skill for.
When to Use
- After a descriptor and system prompt have been generated and refined (
lai gen descriptor,lai gen sysprompt) - When you want to produce a reusable knowledge artifact (e.g., a SKILL.md or CLAUDE.md section) that teaches an agent how to work with your DSL
- When onboarding new developers or agents to an existing DSL project
- When creating documentation that goes beyond a system prompt — covering not just "how to generate code" but "how to think in this language"
Inputs
Gather these from the project before generating the skill:
- Language descriptor (
language.descriptor.yml) — the structured YAML descriptor produced bylai gen descriptor - Grammar file (
.langium) — the full grammar definition - Example files — all example programs referenced in the descriptor
- Validator source — the custom validator implementation (if any)
- Scope provider source — the custom scoping implementation (if any)
- Other custom services — linker, name provider, type provider, etc.
- Test files — existing tests that demonstrate expected behavior and edge cases
- Documentation — any referenced docs (README, language guides, etc.)
- Existing system prompt — the generated system prompt, which already contains a curated view of the language
Output Location
The generated skill must be placed in the project's existing skills directory, following the standard skill folder convention:
-
Detect the skills directory. Check for these paths in order and use the first that exists:
.claude/skills/(Claude Code projects).agents/skills/(generic agent projects)- If neither exists, create
.claude/skills/by default.
-
Create a named folder. Inside the skills directory, create a folder named after the language (lowercase), e.g.,
.claude/skills/latria/. -
Write
SKILL.md. The skill document must be namedSKILL.mdinside that folder. -
Include YAML frontmatter. The file must begin with frontmatter so agent frameworks can discover and register the skill:
---
name: <language-name>
description: <one-line description of what the skill covers>
user-invocable: false
---
The name should match the folder name (lowercase). The description should summarize the skill's scope concisely. Set user-invocable: false for language knowledge skills (they are reference material, not callable actions).
Example output path: .claude/skills/latria/SKILL.md
Output Format
The generated skill should be a single markdown file (after the frontmatter) with the following structure. Not all sections are required — include only those that apply to the target language.
# <Language Name> Language Skill
A comprehensive guide to understanding and working with the <Language Name> DSL.
---
## Overview
What the language is for, its domain, and its primary use cases.
Who uses it, what problems it solves, and where it fits in a larger toolchain.
## Core Concepts
The fundamental abstractions and mental model of the language.
Define the key terms and how they relate to each other.
This section should let a reader build an accurate mental model before seeing any syntax.
## Syntax Reference
### Entry Rule and Program Structure
What a valid program looks like at the top level.
### Key Grammar Rules
The most important grammar constructs, explained with examples.
Not a dump of the full grammar — a curated walkthrough of the rules that matter most.
### Literals, Types, and Primitives
Built-in types, literal syntax, and type system basics (if applicable).
### Keywords and Reserved Words
List of keywords with brief descriptions of what they do.
## Semantics
### Validation Rules
What the validator enforces — the semantic constraints beyond syntax.
List each rule with a brief explanation and an example of code that violates it.
### Scoping and Name Resolution
How cross-references resolve. What names are visible where.
Include examples of valid and invalid reference patterns.
### Linking Behavior
How the linker connects references to declarations.
Any custom linking behavior specific to this language.
### Type System
Type checking rules, type compatibility, inference (if applicable).
## Examples
### Minimal Valid Program
The smallest program that parses and validates without errors.
### Common Patterns
Idiomatic patterns that appear frequently in real usage.
Each pattern should have a name, a code example, and a brief explanation.
### Advanced Patterns
More complex constructs that combine multiple language features.
## Dos and Don'ts
### Do
- Concrete, actionable guidelines for writing correct and idiomatic code.
- Each item should explain *why*, not just *what*.
### Don't
- Common mistakes and anti-patterns with explanations.
- Each item should include an example of the mistake and how to fix it.
## Common Errors and Fixes
A table or list of frequent errors (parser errors, validation errors),
what causes them, and how to resolve them.
## Edge Cases
Surprising or non-obvious behaviors. Boundary conditions.
Things that look like they should work but don't (or vice versa).
## Interoperability
How the lang
阅读完整来源 ↗