orchestration-check
Determine whether logic belongs in a reactive rule, workflow, or component. Use when adding orchestration logic, designing multi-step processes, or reviewing boundary violations.
- License 许可
- MIT
- 最近更新
- 2026-11-11
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- orchestration-check
- description
- Determine whether logic belongs in a reactive rule, workflow, or component. Use when adding orchestration logic, designing multi-step processes, or reviewing boundary violations.
- argument-hint
- [ "pattern or logic being evaluated" ]
03 SKILL.md 正文
Orchestration Layer Check
What pattern are you evaluating?
$ARGUMENTS
The Two Layers
| Layer | Responsibility | Owns | Does NOT Own |
|---|---|---|---|
| Reactive Engine | State detection, triggers, multi-step coordination | Conditions, actions, step sequence, loop limits, timeouts | Actual work execution |
| Component | Execute single units of work | Execution mechanics, internal state | Workflow awareness, caller context |
Quick Decision
| Pattern | Use |
|---|---|
| Condition X met --> fire action Y (no retry) | Single-trigger reactive rule |
| A --> B --> A --> B... (max N times, with timeouts) | Reactive workflow |
| Execute LLM call, process tools, write files | Component |
The 5 Rules
-
Rules trigger, they don't orchestrate -- A rule fires one action, not a sequence.
- Anti-pattern: Rule A sets
step=1, Rule B watches forstep=1and setsstep=2... - Fix: Use a workflow for multi-step sequences.
- Anti-pattern: Rule A sets
-
Workflows coordinate, they don't execute -- Workflows spawn components, not inline logic.
- Anti-pattern: Workflow step contains 100 lines of processing logic.
- Fix: Move processing into a component, have workflow publish to trigger it.
-
Components are workflow-agnostic -- Components don't know their caller.
- Anti-pattern: Component checks
workflow_idto decide behavior. - Fix: Pass behavior differences as configuration, not caller identity.
- Anti-pattern: Component checks
-
State ownership is exclusive -- Only one layer owns any piece of state.
State Owner Trigger conditions Rules Step progress, iteration count Workflow Execution state (pending tools, loop phase) Component Domain entities Knowledge graph (ENTITY_STATES) -
If it needs a loop limit, it's a workflow -- Simple handoffs use rules; cycles use workflows.
Anti-Patterns
- Rule chains that build up state across multiple firings (should be workflow)
- Workflows with inline processing logic (belongs in components)
- Components checking workflow context to decide behavior (should be caller-agnostic)
- Both rules and workflows tracking the same state (exclusive ownership violated)
State Storage Boundaries
| Category | Storage | In Knowledge Graph? |
|---|---|---|
| Domain entities | ENTITY_STATES KV |
Yes (Graphable) |
| Operational results | Component-specific KV | No |
| Events/work items | JetStream streams | No |
Do NOT write operational results to ENTITY_STATES -- it pollutes the knowledge graph.
Reactive Rule Example (single trigger)
reactive.NewRule("architect-complete-spawn-editor").
WatchKV("AGENT_LOOPS", "LOOP_*").
When("architect role", func(ctx *reactive.RuleContext) bool {
return ctx.State.(*AgentLoopState).Role == "architect"
}).
When("completed", func(ctx *reactive.RuleContext) bool {
return ctx.State.(*AgentLoopState).Outcome == "success"
}).
Publish("agent.task.editor", ...).
Build()
Workflow Example (loop with limit)
reactive.NewWorkflow("review-fix-cycle").
WithStateBucket("REVIEW_FIX_STATE").
WithMaxIterations(3).
WithTimeout(300 * time.Second).
AddRule(/* request-review rule */).
AddRule(/* fix-issues rule */).
AddRule(/* max-iterations-exceeded rule */).
MustBuild()
Read docs/concepts/14-orchestration-layers.md for full documentation.
04 同仓库更多 Skills
store-pattern
Choose the right state management approach for a use case. Decide between component-local state, derived state, runes-based stores, SvelteKit load, or URL state.
new-component
Step-by-step checklist for adding a new Svelte 5 component with proper patterns, tests, and TypeScript types. Use when creating new UI components.
backend-integration
Connect the UI to semstreams backend APIs. Covers proxy routing, fetch patterns, SSR considerations, and real-time data. Use when adding new backend integrations or debugging API issues.
review-pr
Adapter for review-pr.
query-pattern
Choose the right query access pattern (GraphQL, MCP, NATS Direct) for a use case. Use when designing query APIs, adding new access points, or choosing between gateway types.
preflight
Adapter for preflight.