glue
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGlue
Glue
Use this skill for Glue, a compact IDL for defining models, enums, imports, endpoints, and code generation config.
本技能适用于Glue——一种用于定义模型、枚举、导入、端点和代码生成配置的轻量级IDL。
Workflow
工作流程
- Start with the smallest valid file or
.glueconfig that satisfies the request..gluerc - Validate Glue source with when a CLI is available.
glue check <file> - Generate code with , or use
glue gen <target> -i <file> -o <output>/glue genfor config-driven generation.glue gen --config <path> - When exact syntax, config fields, or target behavior matters, read if present. Published skill releases include it as a generated mirror of this repository's docs.
REFERENCE.md - If is not present or may be stale, fetch
REFERENCE.mdas the canonical current docs.https://gluelang.dev/llms.txt
- 从满足需求的最小有效文件或
.glue配置开始。.gluerc - 当有CLI可用时,使用验证Glue源码。
glue check <file> - 使用生成代码,或者使用
glue gen <target> -i <file> -o <output>/glue gen进行基于配置的代码生成。glue gen --config <path> - 当涉及确切语法、配置字段或目标行为时,若存在则查阅该文档。已发布的技能版本包含该文档,作为本仓库文档的生成镜像。
REFERENCE.md - 若不存在或可能过时,请获取
REFERENCE.md作为当前权威文档。https://gluelang.dev/llms.txt
Guardrails
约束规则
- Stay within documented Glue features; do not invent language constructs, decorators, config fields, or generator options.
- Prefer for config examples. Supported config filenames are
.gluerc.yaml,.gluerc,.gluerc.yaml, and.gluerc.yml..gluerc.json - Keep config examples minimal and include on each
modeentry for config-driven generation.gen - Mention limitations only when relevant to the user's task, especially no generics, no intersections, and limited endpoint auth/parameter support.
- Supported generation targets: ,
typescript,python,rust,go,openapi, andjsonschema.protobuf
- 仅使用已文档化的Glue功能;不得自创语言结构、装饰器、配置字段或生成器选项。
- 配置示例优先使用。支持的配置文件名包括
.gluerc.yaml、.gluerc、.gluerc.yaml和.gluerc.yml。.gluerc.json - 配置示例保持精简,且在基于配置的代码生成中,每个条目需包含
gen字段。mode - 仅当与用户任务相关时才提及限制,尤其是不支持泛型、不支持交集,以及端点认证/参数支持有限。
- 支持的生成目标:、
typescript、python、rust、go、openapi和jsonschema。protobuf
Commands
命令
- Validate:
glue check person.glue - Generate TypeScript:
glue gen typescript -i person.glue -o ./generated/person.ts - Generate from config:
glue gen --config .gluerc.yaml - Generate OpenAPI:
glue gen openapi -i api.glue -o ./openapi.json - Inspect IR:
glue ast person.glue
- 验证:
glue check person.glue - 生成TypeScript:
glue gen typescript -i person.glue -o ./generated/person.ts - 基于配置生成:
glue gen --config .gluerc.yaml - 生成OpenAPI:
glue gen openapi -i api.glue -o ./openapi.json - 查看IR:
glue ast person.glue