
iii-state-management
Creates scoped key-value stores, reads and writes state entries, lists keys, and performs partial updates across functions. Use when persisting data between invocations, managing user sessions, caching computed values, storing feature flags, sharing state between workers, or building a KV data layer as an alternative to Redis or DynamoDB.
- Installs
- 180
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/iii-hq/iii --skill iii-state-management- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads iii-state-management automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
State Management
Comparable to: Redis, DynamoDB, Memcached
Key Concepts
Use the concepts below when they fit the task. Not every state operation needs all of them.
- State is a scoped key-value store accessed via built-in trigger functions
- state::set writes a value; state::get reads it (returns
nullfor missing keys) - state::list retrieves all keys in a scope; state::delete removes a key
- state::update performs a partial merge using an
opsarray for fine-grained changes - Payloads use
scope,key, andvalueto address state entries - State is shared across all functions — use meaningful scope names to avoid collisions
Architecture
Function
→ trigger('state::set', { scope, key, value })
→ trigger('state::get', { scope, key })
→ trigger('state::update', { scope, key, ops })
→ trigger('state::delete', { scope, key })
→ trigger('state::list', { scope })
→ iii-state → KvStore / Redis adapter
iii Primitives Used
| Primitive | Purpose |
|---|---|
trigger({ function_id: 'state::set', payload }) | Write a value to state |
trigger({ function_id: 'state::get', payload }) | Read a value from state |
trigger({ function_id: 'state::list', payload }) | List all keys in a scope |
trigger({ function_id: 'state::delete', payload }) | Remove a key from state |
trigger({ function_id: 'state::update', payload: { ops } }) | Partial merge with operations array |
Reference Implementation
See ../references/state-management.js for the full working example — functions that read, write, update, and delete state entries across a shared scope.
Also available in Python: ../references/state-management.py
Also available in Rust: ../references/state-management.rs
Common Patterns
Code using this pattern commonly includes, when relevant:
registerWorker(url, { workerName })— worker initializationtrigger({ function_id: 'state::set', payload: { scope, key, value } })— write statetrigger({ function_id: 'state::get', payload: { scope, key } })— read state (returnsnullif missing)trigger({ function_id: 'state::update', payload: { scope, key, ops } })— partial mergetrigger({ function_id: 'state::list', payload: { scope } })— enumerate keystrigger({ function_id: 'state::delete', payload: { scope, key } })— remove entryconst logger = new Logger()— structured logging
Adapting This Pattern
Use the adaptations below when they apply to the task.
- Name scopes after your domain (e.g.
user-sessions,order-data,config) - Use
state::getwith anullcheck to handle missing keys gracefully - Use
state::updatewithopsfor partial updates instead of read-modify-write cycles - Combine with
iii-queue-processingto persist results after async job completion
Engine Configuration
iii-state must be enabled in iii-config.yaml with either the kv adapter (file-based or in-memory) or the separate redis adapter. See ../references/iii-config.yaml for the full annotated config reference.
Pattern Boundaries
- If the task needs reactive side effects when state changes, prefer
iii-state-reactions. - If the task needs real-time client push when data updates, prefer
iii-realtime-streams. - Stay with
iii-state-managementwhen the primary need is reading and writing persistent key-value data.
When to Use
- Use this skill when the task is primarily about
iii-state-managementin 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.
FAQ
What does the iii-state-management skill do?
Creates scoped key-value stores, reads and writes state entries, lists keys, and performs partial updates across functions. Use when persisting data between invocations, managing user sessions, caching computed values, storing feature flags, sharing state between workers, or building a KV data layer as an alternative to Redis or DynamoDB.
How do I install iii-state-management?
Run npx skills add https://github.com/iii-hq/iii --skill iii-state-management in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/iii-state-management/ (personal) or .claude/skills/iii-state-management/ (project).
Which AI agents can use iii-state-management?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is iii-state-management safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains iii-state-management?
It is published by iii-hq/iii in iii-hq/iii. It has 180 recorded installs.
More from iii-hq/iii
iii-engine-config
iii-hq/iii
Configure a managed iii engine through worker-compose.yaml or a directly supervised engine through config.yaml. Use for engine ports, RBAC via the rbac-proxy worker, observer limits, streams, sandboxes, and configuration storage.
iii-getting-started
iii-hq/iii
Install the iii engine, set up your first worker, and get a working backend running. Use when a user wants to start a new iii project, install the SDK, or needs help with initial setup and configuration.
iii-error-handling
iii-hq/iii
Handle iii engine and SDK errors across Node, Python, Rust, and browser workers. Use when interpreting error codes, retryability, RBAC denial, timeouts, handler failures, or SDK-specific exception surfaces.
iii-architecture-patterns
iii-hq/iii
Use when composing iii primitives into backend architectures: durable workflows, reactive backends, observer side effects, agentic pipelines, event-driven CQRS, effect pipelines, and trigger-transform-action automation.
iii-sdk-reference
iii-hq/iii
Use when working with iii SDK APIs across Node.js, browser, Python, Rust, or Go: package installation, worker initialization, function/trigger registration, observers, invocation, local dispatch, channels, logging, OpenTelemetry, and language-specific caveats.
iii-core-primitives
iii-hq/iii
Use when registering iii functions, binding triggers, observing functions, selecting sync/void/enqueue invocation, creating workers, inspecting the live worker registry, installing registry workers, authoring event sources, moving channel data, or adapting external HTTP functions across TypeScript, Python, and Rust.
Popular data & databases skills
supabase-postgres-best-practices
supabase/agent-skills
Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pgcron, pgmq), vector/semantic search (pgvector), and restoring dumps (pgrestore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.
prisma-client-api
prisma/skills
Prisma Client API reference covering model queries, filters, operators, and client methods. Use when writing database queries, using CRUD operations, filtering data, or configuring Prisma Client. Triggers on "prisma query", "findMany", "create", "update", "delete", "$transaction".
prisma-database-setup
prisma/skills
Deprecated compatibility name for prisma-orm-setup. Use only when a user or existing integration explicitly invokes prisma-database-setup; otherwise select prisma-orm-setup.
prisma-cli
prisma/skills
Prisma ORM 7 CLI reference for existing Prisma 7 applications or explicitly selected Prisma 7 workflows. Covers prisma init, generate, migrate, db, dev, studio, and mcp. For setup, connection repair, or Prisma 8, use prisma-orm-setup; not the Prisma Platform CLI.
prisma-postgres
prisma/skills
Deprecated compatibility name for prisma-postgres-setup. Use only when a user or existing integration explicitly invokes prisma-postgres; otherwise select prisma-postgres-setup.
prisma-postgres-setup
prisma/skills
Obtain or reuse a Prisma Postgres database and connect an application. Use when the user needs a database and has none configured ("I need a database", "add a Postgres database", "set up a database for this app"), runs or mentions create-db or npx create-db, or asks to set up or connect Prisma Postgres, including in v0 and the Vercel Marketplace. Hands Prisma ORM configuration to prisma-orm-setup; reuses an existing connection first and honors an explicit provider, driver, alternative ORM, or database-only choice.