AGENT SKILL

sley

Build, change, debug, or review in-process workflow graphs with Sley in Python or TypeScript. Applies when code imports `sley` or `@jigging/sley`, or the request explicitly names Sley.

License 许可
MPL-2.0
所属仓库
jiggy/jig
最近更新
2026-11-14
Stars
★ 0
Forks
0

01 前言 Front Matter

name
sley
license
MPL-2.0
description
Build, change, debug, or review in-process workflow graphs with Sley in Python or TypeScript. Applies when code imports `sley` or `@jigging/sley`, or the request explicitly names Sley.

02 资源文件 9

03 SKILL.md 正文

Sley

Make the workflow's meaningful paths visible while leaving local work as ordinary code. A graph earns its place only when it is easier to scan than the conditions, callbacks, or counters it replaces.

Choose the path

Build the graph

  1. Trace the existing workflow from inputs to observable outcomes. Keep helper calls and local conditions as ordinary code.
  2. Create a Node only for a meaningful workflow step, decision, retry boundary, or independently scheduled unit of work.
  3. Put whole-run facts in context.state. Carry branch-specific work through context.input. Use context.end(value) only for a completed branch value that must settle or be combined.
  4. Connect each allowed transition with source.link(target, action?). The target is required; the optional action names the decision outcome.
  5. Route with context.emit(...). A successful Node with no control call takes its unlabelled path. A leaf with no matching unlabelled link exits its Flow normally and needs no end().
  6. Wrap the entry element in a Flow. Use run(initialState) for the final shared state and start(initialState).result() only when terminal or failure detail is required.

Handlers communicate through state, input, emissions, and terminal outputs. They return no application value. Control calls buffer intent and do not stop the function; use the host language's return when later statements must not run.

Keep the boundary honest

  • Sley owns in-process graph execution. The application owns payload validation, storage, service policy, timeouts, persistence, tracing, and distribution.
  • Each run shallow-copies the initial top-level state once. Every branch shares that run-owned state, including nested object references. Coordinate concurrent writes exactly as ordinary concurrent code requires.
  • Prefer branch inputs and terminal outputs over shared counters or result lists when work fans out.
  • Validate untrusted state or input before writes, effects, or control calls.
  • Pair fan-out with the Flow that owns its combine boundary. Nest around owned behavior or policy, not file organization.
  • Give every cycle a domain exit and an explicit activation guard.
  • Put retry around the smallest safe repeatable operation. Recover at the smallest boundary with enough context to choose the fallback.

Completion criterion

Finish when every changed route has an observable check, the project's existing type and test commands pass, and every remaining Node represents topology or runtime policy that an ordinary function call would hide.

04 同仓库更多 Skills