glue

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Glue

Glue

Use this skill for Glue, a compact IDL for defining models, enums, imports, endpoints, and code generation config.
本技能适用于Glue——一种用于定义模型、枚举、导入、端点和代码生成配置的轻量级IDL。

Workflow

工作流程

  1. Start with the smallest valid
    .glue
    file or
    .gluerc
    config that satisfies the request.
  2. Validate Glue source with
    glue check <file>
    when a CLI is available.
  3. Generate code with
    glue gen <target> -i <file> -o <output>
    , or use
    glue gen
    /
    glue gen --config <path>
    for config-driven generation.
  4. When exact syntax, config fields, or target behavior matters, read
    REFERENCE.md
    if present. Published skill releases include it as a generated mirror of this repository's docs.
  5. If
    REFERENCE.md
    is not present or may be stale, fetch
    https://gluelang.dev/llms.txt
    as the canonical current docs.
  1. 从满足需求的最小有效
    .glue
    文件或
    .gluerc
    配置开始。
  2. 当有CLI可用时,使用
    glue check <file>
    验证Glue源码。
  3. 使用
    glue gen <target> -i <file> -o <output>
    生成代码,或者使用
    glue gen
    /
    glue gen --config <path>
    进行基于配置的代码生成。
  4. 当涉及确切语法、配置字段或目标行为时,若存在
    REFERENCE.md
    则查阅该文档。已发布的技能版本包含该文档,作为本仓库文档的生成镜像。
  5. 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
    .gluerc.yaml
    for config examples. Supported config filenames are
    .gluerc
    ,
    .gluerc.yaml
    ,
    .gluerc.yml
    , and
    .gluerc.json
    .
  • Keep config examples minimal and include
    mode
    on each
    gen
    entry for config-driven generation.
  • 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
    ,
    jsonschema
    , and
    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