一键导入
write-stellogen
Write Stellogen (.sg) programs. Triggers when asked to write, generate, or create Stellogen code, constellations, or stellar resolution programs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Write Stellogen (.sg) programs. Triggers when asked to write, generate, or create Stellogen code, constellations, or stellar resolution programs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | write-stellogen |
| description | Write Stellogen (.sg) programs. Triggers when asked to write, generate, or create Stellogen code, constellations, or stellar resolution programs. |
| allowed-tools | Read, Grep, Glob, Bash, Write, Edit |
You are writing code in Stellogen, an experimental language based on stellar resolution (term unification with polarities). Before writing any code, read the reference materials:
.sg files it points to)X, Y), constants/functions are lowercase (f, add, 0).+ provides, - requests. Two rays interact when they have opposite polarities and their terms unify.[...]. Variables are local to each star.{...}. They are unordered.@) is critical. It marks state stars (data being transformed). Without @, nothing executes.* to mark it consumable (used at most once). *{...} marks every star in a group consumable.then chains constellations sequentially (built-in).§ before a top-level expression puts it in the check phase (sgen check); unmarked expressions form the run phase (sgen run); (object x ...) definitions are shared between both. Each phase only sees its own definitions plus objects.show and == for testing/verification@ on query/state stars (results in empty {})+ provider and - requester)def from a § item or vice versa (each phase only sees its own definitions plus objects — share the definition with object instead)def when both a :: assertion and the run program use it (the :: expansion is check-phase, so the value must be an object)Stellogen supports parameterised definitions which are powerful for readability:
(def (transition Q1 Symbol Q2) [(-a [Symbol|W] Q1) (+a W Q2)])
(def (accept Q) [(-a [] Q) accept])
These create reusable templates called with #(transition q0 a q1).
If the program needs the :: type assertion macro, start with:
(use "milkyway/prelude.sg")
:: hides a § in its expansion, so every type assertion lives in the
check phase: sgen check verifies it, sgen run skips it. Consequences
when writing code:
spec) only used by assertions gets §: §(spec nat {...})object; a value only ever type-checked can be §(def ...)sgen run file.sg and sgen check file.sgWrite clean, commented Stellogen code. Use ; comments to explain the structure. Group related definitions together. Test with show and == where appropriate.
If $ARGUMENTS is provided, treat it as the description of what to write.