PowerShell Orchestration State Machine
Canonical checkpoint and resume behavior for orchestration agents running multi-step PowerShell delivery flows.
When to Use This Skill
Use this skill when:
- A workflow spans multiple delegations and commands.
- Execution may be interrupted and must resume deterministically.
- An orchestrator must avoid repeating completed steps.
Canonical Checkpoint Location
artifacts/orchestration/powershell-orchestrator-state.json
Required Checkpoint Fields
objective
change_budget_estimate
path_selected (small or large)
promotion-type
short-name
relativeFile
long-name
issue-num
feature-folder
work-mode (minor-audit, full-feature, or full-bug; normalize legacy full to full-feature before persistence)
plan-path (minimal or full plan path)
completed_steps
next_step
last_updated
For short-path runs, also persist:
small_path_qc_summary
small_path_audit_artifacts
bootstrap_mode (manual-bootstrap or auto-small-dev)
phase0_execution_summary
resume_after_manual_bootstrap (next step token)
Portable Prepared-State Projection
When the PowerShell delivery flow resumes from a provider-neutral prepared-state
handoff, the active destination projection is
artifacts/orchestration/orchestrator-state.json. Validate and retain:
- the destination provider, checkpoint expression, selected projector,
plan-path, and exact recorded next_step;
- the portable handoff ID, envelope and latest-history SHA-256 values, selected
adapter, source validator, identity, repository/workspace/branch binding,
exact plan proof, lifecycle, capabilities, and scheduler context;
- the source checkpoint path/hash/archive facts and opaque historical receipt
references without converting them into Claude receipts; and
destination_evidence: { status: "pending_first_delegation", receipts: [] }
until the first new Claude delegation after materialization.
Do not rediscover the plan or rerun any phase listed in
portable_handoff.lifecycle.completed_phases. Resume only the recorded
transition. Record Claude model, launch, worktree, and receipt evidence through
Claude-native fields for new work; functional parity does not require copying
Codex field names or launch representations.
For a scheduled parallel or epic child, validate the run/item, parent
checkpoint path/hash, scheduler and child owners, return contract, exact plan
hash, child checkpoint hash, and result hash before returning a result. The
ordinary child may update only its bounded status/result projection. Cohort or
wave order, barriers, fan-in, integration, cleanup, worktree lifecycle, and
parent completion remain owned by the parent scheduler.
Update Protocol
- Write checkpoint after every completed orchestration sub-step.
- Treat checkpoint as source-of-truth for progress state.
- Never claim mission completion until checkpoint marks final state.
Resume Protocol
On invocation:
- Read checkpoint if it exists.
- If incomplete, resume from
next_step without re-running completed_steps.
- If missing or completed, start at phase-0 intake.
- If user explicitly requests restart, reset checkpoint and start phase-0.
1---2name: powershell-orchestration-state-machine-23description: Checkpoint schema and resume protocol for long-running PowerShell orchestration workflows.4---56# PowerShell Orchestration State Machine78Canonical checkpoint and resume behavior for orchestration agents running multi-step PowerShell delivery flows.910## When to Use This Skill1112Use this skill when:13- A workflow spans multiple delegations and commands.14- Execution may be interrupted and must resume deterministically.15- An orchestrator must avoid repeating completed steps.1617## Canonical Checkpoint Location1819- `artifacts/orchestration/powershell-orchestrator-state.json`2021## Required Checkpoint Fields2223- `objective`24- `change_budget_estimate`25- `path_selected` (`small` or `large`)26- `promotion-type`27- `short-name`28- `relativeFile`29- `long-name`30- `issue-num`31- `feature-folder`32- `work-mode` (`minor-audit`, `full-feature`, or `full-bug`; normalize legacy `full` to `full-feature` before persistence)33- `plan-path` (minimal or full plan path)34- `completed_steps`35- `next_step`36- `last_updated`3738For short-path runs, also persist:39- `small_path_qc_summary`40- `small_path_audit_artifacts`41- `bootstrap_mode` (`manual-bootstrap` or `auto-small-dev`)42- `phase0_execution_summary`43- `resume_after_manual_bootstrap` (next step token)4445## Portable Prepared-State Projection4647When the PowerShell delivery flow resumes from a provider-neutral prepared-state48handoff, the active destination projection is49`artifacts/orchestration/orchestrator-state.json`. Validate and retain:5051- the destination provider, checkpoint expression, selected projector,52 `plan-path`, and exact recorded `next_step`;53- the portable handoff ID, envelope and latest-history SHA-256 values, selected54 adapter, source validator, identity, repository/workspace/branch binding,55 exact plan proof, lifecycle, capabilities, and scheduler context;56- the source checkpoint path/hash/archive facts and opaque historical receipt57 references without converting them into Claude receipts; and58- `destination_evidence: { status: "pending_first_delegation", receipts: [] }`59 until the first new Claude delegation after materialization.6061Do not rediscover the plan or rerun any phase listed in62`portable_handoff.lifecycle.completed_phases`. Resume only the recorded63transition. Record Claude model, launch, worktree, and receipt evidence through64Claude-native fields for new work; functional parity does not require copying65Codex field names or launch representations.6667For a scheduled parallel or epic child, validate the run/item, parent68checkpoint path/hash, scheduler and child owners, return contract, exact plan69hash, child checkpoint hash, and result hash before returning a result. The70ordinary child may update only its bounded status/result projection. Cohort or71wave order, barriers, fan-in, integration, cleanup, worktree lifecycle, and72parent completion remain owned by the parent scheduler.7374## Update Protocol7576- Write checkpoint after every completed orchestration sub-step.77- Treat checkpoint as source-of-truth for progress state.78- Never claim mission completion until checkpoint marks final state.7980## Resume Protocol8182On invocation:831) Read checkpoint if it exists.842) If incomplete, resume from `next_step` without re-running `completed_steps`.853) If missing or completed, start at phase-0 intake.864) If user explicitly requests restart, reset checkpoint and start phase-0.