/trogonstack-eda:eda-bound-process-lifetimefrom trogonstack-eda
Designs or reviews event-driven process managers, sagas, and multi-step workflows so every instance provably ends within a known maximum lifetime (T_max). Produces a lifecycle table with deadlines, named exits, and T_max derivation.
Ships in trogonstack-eda. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A process that can wait forever will eventually be waiting forever. Give every wait a deadline and an exit, count every loop, and the longest an instance can live becomes a number you compute instead of a hope.
A process manager (saga, workflow, multi-step aggregate) coordinates other actors: it sends a command, then waits for something to come back. Each wait is a bet that the other side answers. When the bet has no deadline, the instance can sit in that state indefinitely, and nobody can say when it ends.
Once every waiting state has a deadline and every loop has a count, the maximum lifetime T_max follows from the definition: add the deadlines along the longest path. That number turns operational problems into waiting:
deploy_time + T_max, then the old code is deleted. No in-flight state migration.T_max plus an audit margin, not forever by default.The restriction is the feature. You give up "wait as long as it takes", and in exchange the lifetime question becomes decidable. There is no framework or DSL behind this skill: it is a discipline applied to whatever state table, code, or design document exists, and the output is a lifecycle table a team can later encode and check mechanically.
Some things are entities, not processes: an account, a session log, a connection, a subscription. They have no terminal outcome by design. Do not force deadlines onto them. The bounded processes are the flows that coordinate them (opening an account, refreshing a credential, settling a payment). A periodic reconciler is a loop, not a process; bound each run, not the reconciler. A process that truly must run indefinitely (a perpetual monitor) is decomposed into chained bounded instances, each handing off to the next.
Apply them in order. A state or loop that fails an earlier principle is a finding; the later principles shape the fix. Each one names its reference; read it when the situation matches, not up front.
Instant transitions (decide, emit, move on) cost no lifetime. Only waiting states do: a command was sent and the process needs an event it does not control (a reply, a callback, a human, a provider, a timer). The first job is to separate waiting states from instant ones, because only waiting states need deadlines. Waits dominate T_max; the only other term is a small stated bound per transition for delivering and handling each input (principle 7).
Read references/principles/waits-are-where-lifetime-goes.md when building the state list or when it is unclear whether a state waits.
A deadline without an exit is a log line; an exit without a deadline is a hope. Each waiting state needs both: how long, and which event ends the state when time runs out (Expired, OutcomeUnknown, Failed with a typed reason). Choosing what the timeout means is a business decision, and the skill asks for it rather than inventing it. A background reaper that sweeps "stuck" instances is evidence of a missing deadline, not a substitute for one.
Read references/principles/deadline-and-exit.md when a state lacks either, when choosing a deadline value, or when a reaper exists.
The deadline fires as a message the process schedules for itself on entering the waiting state, delivered into the same stream or correlation as every other input. The process never reads a wall clock to decide. If the real reply arrives first, the late timer must be refused or absorbed like any other stale command. The scheduler's delivery delay is part of the bound and has to be stated.
Read references/principles/time-is-a-message.md when designing how deadlines fire, or when the code polls, sleeps, or compares timestamps to decide.
retry up to 3 times is bounded; retry until it works is not. repeat at most 10 iterations is bounded; while not shipped is not. A loop whose exit depends only on the outside world adds unbounded lifetime even if every single wait inside it has a deadline. Count it, or move the repetition out of the process (a fresh instance per attempt, chained).
Read references/principles/loops-are-counted.md when the design has retries, polling, repeat-until, or a state that can be re-entered.
Waiting for A and B together is one wait, not two: one deadline covers the join, and the partial states (got A, got B) inherit it rather than restarting it. Waiting for A or B is one wait that the first arrival ends. A phase that spans several states (consent requested, then callback received) is often one window set when the phase begins. Restarting a timer per partial state silently multiplies the bound.
Read references/principles/shared-windows.md when the process waits on several inputs at once, or when a deadline is set once and spans several states.
Every path ends in a typed terminal state (Completed, Failed, Expired, Cancelled, Killed). Once there, duplicates, late replies, and late timers change nothing: they are refused or recorded as no-ops. Deterministic message identity (derived from the instance and step, not random) makes redelivery harmless. Without absorption, a late timer can reopen a finished instance and the bound is fiction.
Read references/principles/terminal-states-absorb.md when checking what happens after the end, or when a late or duplicate input could move a finished instance.
T_max is the longest path from the initial state to any terminal state, where each arming of a waiting window contributes its deadline (a shared window once, a retried window once per attempt), plus the scheduler's delivery delay for each arming and a stated reaction bound for each transition. Without stated delay bounds, T_max is a target, not a guarantee. Compare it to a declared budget. A budget exceeded is a design conversation, not a rounding error.
Read references/principles/longest-path.md when computing T_max, when there is no budget yet, or when the result surprises anyone.
Works the same for a new design and for a review of an existing one (code, ADR state table, sequence diagram, prose).
T_max (principle 7). Show the derivation. Ask for the budget if none is declared.T_max derivation, and residuals.| State | Kind | Entered by | Left by | Window | Deadline | On deadline |
|---|---|---|---|---|---|---|
| <name> | initial / waiting / instant / terminal | <event> | <events> | <window name or -> | <duration or MISSING> | <exit event or MISSING> |
Self-loops go in "Left by" as <event> (stays). Read references/review/lifecycle-table.md for a filled example and how to encode the table so a program can check it.
### <short title>
- Location: <file:line, ADR section, or diagram element>
- State: <the waiting state or loop>
- Waiting on: <the input the process does not control>
- Missing: <deadline | exit | count | absorption | budget>
- Consequence: <what happens when the input never comes: stuck instance, unbounded retention, blocked cutover>
- Principle: <by name>
- Fix: <deadline value or how to choose it, exit event, window, and who schedules the timer>
- Residual: <what the fix still does not cover, or "none">
Read references/review/finding-template.md for a fully worked example.
Without a framework, the lifecycle table is the artifact. When a team wants the bound enforced rather than reviewed, the table becomes a declaration next to the schema (a protobuf custom option, a YAML file) and a small program checks it in CI: every name resolves, every waiting state is covered by a timer, every state reaches a terminal one, no cycles except self-loops, and T_max fits the budget. A conformance test then proves the hand-written state machine agrees with the declaration.
Read references/review/declare-and-check.md when the user wants enforcement, a schema annotation, or a CI check.
T_max is derived step by step, counts windows per arming, includes the timer delivery delay and the reaction bound, and is compared with a budget (or the verdict says none is declared).references/principles/deadline-and-exit.md (opens in a new tab)references/principles/longest-path.md (opens in a new tab)references/principles/loops-are-counted.md (opens in a new tab)references/principles/shared-windows.md (opens in a new tab)references/principles/terminal-states-absorb.md (opens in a new tab)references/principles/time-is-a-message.md (opens in a new tab)references/principles/waits-are-where-lifetime-goes.md (opens in a new tab)references/review/declare-and-check.md (opens in a new tab)references/review/finding-template.md (opens in a new tab)references/review/lifecycle-table.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
saga, process-manager, workflow-design, bounded-lifetime, state-table
npx claudepluginhub trogonstack/agentskills --plugin trogonstack-eda2 skills in this plugin
Other plugins' skills for the same job