Skip to content
Back to skills

Patterns

ASecurity

When the trigger for a function is a change in some piece of state (not a request or a schedule), bind the function to a state-change trigger advertised by a state worker. The engine fires the function whenever the watched key or scope changes. The function code is the same as any other; only the trigger registration differs.

  • 18,821 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 3, 2026
developmentreact

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 3, 2026

npx -y skills add iii-hq/iii --skill patterns --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Patterns?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Patterns
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/iii-hq-patterns-5f5f909b/badge)](https://www.skillsdirectory.com/skills/iii-hq-patterns-5f5f909b)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
<!-- generated by iii-skill-render. DO NOT EDIT (changes here are overwritten on the next render). Edit docs/0-16-0/patterns/reactive-state-pattern.mdx. -->

# Reactive State Pattern


When the trigger for a function is a change in some piece of state (not a request or a schedule),
bind the function to a state-change trigger advertised by a state worker. The engine fires the
function whenever the watched key or scope changes. The function code is the same as any other;
only the trigger registration differs.

## When to use this pattern

When the action is conceptually "whenever this data changes, do this", instead of "on schedule" or
"on demand". Examples: rebuild a derived index when its source state changes, fan out a notification
when a user record updates, propagate a calculated value into another scope when its inputs move.

## Structure

1. A state worker holds the source-of-truth state.
2. A function in some worker handles the change (compute a derived value, send a notification,
   etc.).
3. A trigger advertised by the state worker binds that function to the relevant key or scope so the
   engine fires it on every change.

The trigger type, its config shape, and the state worker's read/write surface are documented in
that worker's Worker Docs.

{/* TODO: full worked example with a state set/write and a derived function. Cover the trigger config shape, scope vs key matching, ordering guarantees, and how to handle bursts of changes. */}

Files in this skill

  • adapter-pattern.mdx1.2 KB
  • adapter-pattern.mdx.skill.md1.2 KB
  • reactive-state-pattern.mdx1.4 KB
  • reactive-state-pattern.mdx.skill.md1.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…