iii-architecture-patterns
Use when composing iii primitives into backend architectures: durable workflows, reactive backends, agentic pipelines, event-driven CQRS, effect pipelines, and trigger-transform-action automation.
By iii-hq · 2,271 installs
npx skills add iii-hq/iii --skill iii-architecture-patterns
Source repository · Upstream listing
Architecture Patterns
Use this skill when the task is larger than one function or trigger. Pick the pattern from the
requirement, then implement it with Function , Trigger , Worker , observers, state, queues,
streams, and pub/sub.
Pattern Map
Requirement Pattern iii shape
Sequential work with retries, DLQ, step tracking Durable workflow Functions chained through named queues, progress in state
Keep views, metrics, cache, or clients in sync Reactive backend State triggers plus stream/pubsub side effects
React to another function's calls, results, or failures without changing it Observer side effect iii.observe({ function id, on, filters }, target) ( iii observe )
Specialized AI agents hand work to each other Agentic backend One function per agent, queue handoffs, shared state
Commands publish events and projections update independently Event driven CQRS Command functions, event log in state, subscribe triggers
Pure, traceable composition Effect pipeline Small functions composed synchronously with trigger()
Webhook/cron automation chains Low code automation Trigger, transform, action nodes chained by enqueue
Durable Workflow
Use named queues when steps need different retry, FIFO, or concurrency policy.
TypeScript
Python
Rust
Reactive Backend
Use state triggers when the requirement says "after create/update, do this", "avoid polling", or
"push live updates".
Observer Side Effects
Use an observer when "after X runs (or fails), also do Y" and X should not know about Y: audit
logs, alerts, projections, cache invalidation. Every function is observable since 0.25, and an
observer failure never affects the observed call.
Activations are at most once and fire and forget. When the side effect must complete with retries,
have the target enqueue the work ( TriggerAction.Enqueue ). Filter on caller or
caller.parent to stop echo loops; the engine also drops activations deeper than
observers.max observe depth (8 by default).
Agentic Backend
Model each agent as a function with one responsibility. Store shared context in state and hand off
work through named queues.
Event Driven CQRS
Commands validate and publish domain events. Projections subscribe independently and write
query optimized state.
registerTrigger is deprecated in 0.25 (one warning per process) but stays the way to bind the
built in subscribe , state , cron , http , and queue providers, which have not migrated to
source functions yet.
Selection Rules
Use sync composition for short effect pipelines where the caller needs the final result.
Use enqueue for unreliable, slow, or must complete steps.
Use pub/sub for independent fan out where each subscriber can tolerate event style delivery.
Use state triggers for derived views and side effects that should run automatically after writes.
Use observers for side effects of a specific function's calls, results, or failures, when the
caller should not know about them and at most once delivery is acceptable.
Use cron triggers for scheduled maintenance and periodic starts.
Keep each function small enough to test independently.
When to Use
Use this skill for complete backend patterns: workflows, agentic systems, reactive apps, CQRS,
effect pipelines, and automation chains.
Use this when the request describes product behavior rather than a single SDK API call.
Boundaries
For exact trigger config, function registration syntax, custom triggers, channels, and
HTTP invoked functions, use iii core primitives .
For observer options, filters, and owner delivered event sources, use iii observe .
For engine ports, adapters, engine owned workers, and RBAC ( rbac proxy ), use iii engine config ;
queue retry and FIFO policy live with the queue worker's docs.
For package specific SDK syntax, use iii sdk reference .
Worker backed capability details live with the worker docs, not as top level iii skills.