agentleFS
tim-osterhustim-osterhus/millrace-skills/skills/durable-workflow-orchestration/SKILL.md

durable-workflow-orchestration

Skill0 starsChanged 7 months agoApache-2.0View on GitHub

Guardrail for designing and reviewing crash-safe durable workflows with explicit checkpoints, retries, pause/resume, and recovery boundaries.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 8 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Place a checkpoint before and after the external side effect.

    line 44
  2. Distinctive:

    Do not rely on in-memory state to survive pause/resume, reconnect, process restart, or eviction.

    line 53
  3. Distinctive:

    If an operation is irreversible, checkpoint before it and name the recovery outcome if it fails after the checkpoint.

    line 54
  4. Distinctive:

    Keep vendor-specific bootstrap or API syntax out of the guardrail.

    line 56
  5. Distinctive:

    call out missing checkpoints, duplicate side effects, unsafe retry boundaries, and state/resume contract bugs when reviewing

    line 70
  6. Distinctive:

    Verify with a concrete proof step such as a checkpoint round-trip, resume test, or review finding.

    line 79
  7. Distinctive:

    No checkpoint before an irreversible side effect.

    line 85
  8. Distinctive:

    Start with the smallest honest boundary and the minimum durable state needed to resume it.

    line 94

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Durable Workflow Orchestration

Purpose

Help agents design or review durable workflows by forcing the durable boundary, state ownership, checkpoint plan, retry rules, and recovery path to be explicit before implementation. This is a guardrail, not a workflow-engine manual.

Use When

  • the task is about a long-running job, multi-step pipeline, agent loop, or background workflow
  • the workflow must pause, resume, retry, wait for approval, or survive a crash, reconnect, or callback
  • the answer depends on where side effects become irreversible or where state must persist between steps
  • the prompt is a review and needs to find duplicate side effects, missing checkpoints, unsafe retry boundaries, or state/resume contract bugs

Do Not Use When

  • the work is a short stateless helper or one-off script
  • the request is only about deployment, auth, browser QA, or generic infrastructure
  • a more specific platform skill already owns the exact runtime seam

Quick Start

Answer from the task prompt and any provided workflow evidence first; only inspect local files or environment state when implementation evidence is explicitly part of the task.

  1. Name the durable unit first: one request, one job, one entity, one session, or another natural shard.
  2. State who owns persistence and which fields are stored as resume state.
  3. Mark the irreversible edges.
  4. Place a checkpoint before and after the external side effect.
  5. Make the approval pause/resume contract explicit.
  6. Reconcile ambiguous success before issuing anything new.
  7. End with one concrete verification step that proves the boundary or recovery path.

Operating Constraints

  • One durable unit should own one natural coordination atom.
  • The orchestrator sequences work; side effects own their own idempotency and compensation.
  • Persist the minimum resume state before a crash, pause, or handoff can occur.
  • Do not rely on in-memory state to survive pause/resume, reconnect, process restart, or eviction.
  • If an operation is irreversible, checkpoint before it and name the recovery outcome if it fails after the checkpoint.
  • Answer from the task prompt and any provided workflow evidence first; only inspect local files or environment state when implementation evidence is explicitly part of the task.
  • Keep vendor-specific bootstrap or API syntax out of the guardrail; choose the runtime later if needed.

Inputs This Skill Expects

  • the workflow goal, trigger, and natural durable boundary
  • the current state model or persistence choice
  • the step list, including any external calls, waits, approvals, or callbacks
  • any existing workflow implementation or review evidence
  • the target runtime only if it changes the seam decision

Output Contract

  • answer in this order: durable boundary -> persisted state owner and stored fields -> irreversible edges -> checkpoint before and after the external side effect -> approval pause/resume contract -> ambiguous-success reconciliation -> one proof step
  • state who owns persistence and what is stored
  • list the step boundaries and the irreversible edges
  • specify retry policy, idempotency strategy, checkpoint plan, and recovery/resume path
  • call out missing checkpoints, duplicate side effects, unsafe retry boundaries, and state/resume contract bugs when reviewing
  • end with one concrete verification step and the evidence it should capture

Procedure

  1. Identify the workflow boundary and the recovery unit.
  2. Split orchestration from side effects and from recovery logic.
  3. Decide what must be persisted before the first irreversible action.
  4. Define which steps are retriable, which are idempotent, and which need compensation instead of retry.
  5. Make pause/resume and callback handling explicit when the workflow can stop midstream.
  6. Verify with a concrete proof step such as a checkpoint round-trip, resume test, or review finding.

Pitfalls And Gotchas

  • One giant async function that hides every step boundary.
  • Hidden in-memory state treated as durable truth.
  • Retries without idempotency or dedupe keys.
  • No checkpoint before an irreversible side effect.
  • Assuming a paused workflow can resume from process memory.
  • Mixing vendor bootstrap details into a vendor-neutral skill.

Rejected Trope

  • Rejected trope: "Just retry the whole workflow until it works."
  • Better alternative: checkpoint before irreversible edges, resume from the last durable boundary, and compensate or dedupe any side effect that can repeat.

Progressive Disclosure

Start with the smallest honest boundary and the minimum durable state needed to resume it. Expand only enough to cover retries, pause/resume, and recovery without turning the skill into a workflow-engine manual.

Verification Pattern

Confirm the durable boundary is explicit, the state owner is named, the checkpoint sits before the irreversible edge, and the retry/idempotency/recovery story is concrete. Next verifier: workflow implementer or reviewer; capture the boundary, checkpoint, resume path, and one proof step.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.