graph semantics¶
The graph field in skill.md declares the allowed phase transitions. The OS uses it to validate every transition the LLM proposes.
Structure¶
Each key is a phase name. Each value is a list of allowed next-phase names. The special token end means "this transition terminates the workflow."
Allowed shapes¶
Linear¶
Branching¶
graph:
triage: [draft, escalate]
draft: [review]
review: [revise, end]
revise: [review]
escalate: [end]
The LLM at triage may pick draft or escalate. Either choice is validated against the graph.
Self-loops are NOT supported¶
A phase cannot list itself as a next phase. Revision loops use a separate phase (e.g. review → revise → review).
Resolution rules¶
entry(declared inskill.md) must be a key ingraph.- Every value-list entry must either be a key in
graphorend. endmay only appear in transitions from a phase whosephases/<name>.mdhascan_finish: true.- Skills with sub-skill nodes (
@sub_skillin graph) follow the same rules; the OS resolves the embedded skill at compile time.
Sub-skills (graph nodes)¶
A graph entry may reference another skill by prefixing with @:
run_skill Control IR ops use the same name resolution: reyn/project/ → reyn/local/ → src/reyn/stdlib/skills/.
Linter checks¶
reyn lint <skill_name> enforces:
- All graph keys correspond to phase files in
phases/. - All graph values are either keys, sub-skill references, or
end. entryexists.- Phases with
can_finish: truehave a path toend. - No unreachable phases.
See also¶
- skill-md.md —
entry,final_output - phase-md.md —
can_finish - Concepts: principles P2 (skill defines structure)