Agent skill
iii-effect-system
Builds composable, pipeable function chains on the iii engine. Use when building functional pipelines, effect systems, or typed composition layers where each step is a pure function with distributed tracing.
Install this agent skill to your Project
npx add-skill https://github.com/iii-hq/iii/tree/main/skills/iii-effect-system
SKILL.md
Effect Systems & Typed Functional Infrastructure
Comparable to: Effect-TS
Key Concepts
Use the concepts below when they fit the task. Not every effect pipeline needs all of them.
- Each effect is a registered function with a single responsibility (parse, enrich, persist, notify)
- Effects compose by calling one function from another via
trigger - The entire pipeline is traceable end-to-end through OpenTelemetry
- Errors propagate naturally — a failing effect stops the chain
- An HTTP trigger provides the entry point; effects chain from there
Architecture
HTTP request
→ fx::parse-user-input (validate + normalize)
→ fx::enrich (add metadata, lookup external data)
→ fx::persist (write to state)
→ fx::notify (fire-and-forget side effect)
← composed result returned to caller
iii Primitives Used
| Primitive | Purpose |
|---|---|
registerWorker |
Initialize the worker and connect to iii |
registerFunction |
Define each effect |
trigger({ function_id, payload }) |
Compose effects synchronously |
trigger({ ..., action: TriggerAction.Void() }) |
Fire-and-forget side effects |
trigger state::set, state::get |
Persist data between effects |
registerTrigger({ type: 'http' }) |
Entry point |
Reference Implementation
See ../references/effect-system.js for the full working example — a user signup pipeline where input is parsed, enriched with external data, persisted to state, and a welcome notification is fired.
Common Patterns
Code using this pattern commonly includes, when relevant:
registerWorker(url, { workerName })— worker initializationtrigger({ function_id, payload })— synchronous composition (effect A calls effect B)- Each effect as its own
registerFunctionwithfx::prefix IDs - Error throwing for validation failures (errors propagate up the chain)
trigger({ ..., action: TriggerAction.Void() })— fire-and-forget for non-critical side effectsconst logger = new Logger()— structured logging per effect
Adapting This Pattern
Use the adaptations below when they apply to the task.
- Replace simulated logic with real work (API calls, database queries, ML inference)
- Add new effects by registering functions and calling them via
trigger - For unreliable steps, use
TriggerAction.Enqueue({ queue })instead of synchronoustrigger - Keep effects pure where possible — accept input, return output, no hidden side effects
- Function IDs should be domain-prefixed (e.g.
fx::validate-email,fx::geocode-address)
Pattern Boundaries
- If a request is about durable multi-step workflows with retries and DLQ handling, prefer
iii-workflow-orchestration. - If the task involves multiple independent agents handing off work, prefer
iii-agentic-backend. - Stay with
iii-effect-systemwhen the primary concern is composable, traceable function pipelines with synchronous chaining.
When to Use
- Use this skill when the task is primarily about
iii-effect-systemin the iii engine. - Triggers when the request directly asks for this pattern or an equivalent implementation.
Boundaries
- Never use this skill as a generic fallback for unrelated tasks.
- You must not apply this skill when a more specific iii skill is a better fit.
- Always verify environment and safety constraints before applying examples from this skill.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
iii-dead-letter-queues
Inspects and redrives jobs that exhausted all retries. Use when handling failed queue jobs, debugging processing errors, or implementing retry strategies.
iii-cron-scheduling
Registers cron triggers with 7-field expressions to run functions on recurring schedules. Use when scheduling periodic jobs, timed automation, crontab replacements, cleanup routines, report generation, health checks, batch processing, or any task that should run every N seconds, minutes, hours, or on a weekly/monthly calendar.
iii-http-invoked-functions
Registers external HTTP endpoints as iii functions using registerFunction(id, HttpInvocationConfig). Use when adapting legacy APIs, third-party webhooks, or immutable services into triggerable iii functions, especially when prompts ask for endpoint maps like { path, id } iterated into registerFunction calls.
iii-channels
Binary streaming between workers via channels. Use when building data pipelines, file transfers, streaming responses, or any pattern requiring binary data transfer between functions.
iii-event-driven-cqrs
Implements CQRS with event sourcing on the iii engine. Use when building command/query separation, event-sourced systems, or fan-out architectures where commands publish domain events and multiple read model projections subscribe independently.
iii-agentic-backend
Creates and orchestrates multi-agent pipelines on the iii engine. Use when building AI agent collaboration, agent orchestration, research/review/synthesis chains, or any system where specialized agents hand off work through queues and shared state.
Didn't find tool you were looking for?