Run-once
patchmill run-once advances one actionable issue through the configured
production line. It is the main command for turning a ready issue into a plan,
implementation, review result, visual evidence, pull request, or direct landing.
Preview the next action first:
Dry-run mode previews the next eligible issue and workflow transition without mutating the issue host or git repository. It is intentionally cheap: it does not load workflow artifacts or write resumable issue state. The CLI can still write its normal JSONL run log.
Choose an issue
Section titled “Choose an issue”By default, run-once selects one open issue in an actionable workflow state,
such as the configured ready label or an approval label that allows work to
continue.
Common options:
--issue <number>processes one specific open actionable issue.--plan-onlyruns the spec and plan stages as needed, then stops before implementation.--quietsuppresses terminal progress while still writing the JSONL run log.
What execute mode does
Section titled “What execute mode does”When run-once executes work, the high-level sequence is:
- Select a ready issue or resume a retryable in-progress run.
- Verify repository preconditions, including branch safety and clean worktree checks.
- Load the issue body, comments, and Patchmill-owned workflow artifact comments.
- Validate published artifact checksums before mutating labels, comments, or run state.
- Claim the issue and prepare an isolated issue worktree when the next stage needs one.
- Materialize published specs and plans under their recorded docs paths when source artifacts are present.
- Generate missing specs or plans required by the repository workflow policy.
- Stop for human spec or plan approval when configured approval gates require it.
- Run optional development-environment preparation.
- Run implementation with the configured skills and runtime instructions.
- Run configured review, visual-evidence, and landing procedures when the workflow asks for them.
- Record run state and handoff information.
Use workflow artifacts when humans have already written the spec or plan that Patchmill should reuse.
Approval gates
Section titled “Approval gates”Repositories can require human approval before implementation proceeds. When a
required gate is reached while creating or finding an artifact, run-once
writes the artifact, applies the configured review label, and exits with a spec-
or plan-related result such as spec-created, spec-found, plan-created, or
plan-found.
If you explicitly select an issue that is already waiting on a review label,
run-once reports approval-required instead of advancing it.
Typical gates are:
- spec approval: review the generated or published spec before planning;
- plan approval: review the implementation plan before agents edit code.
After review, add the configured approved label, such as spec-approved or
plan-approved, then run patchmill run-once again.
Development environment and implementation
Section titled “Development environment and implementation”If skills.developmentEnvironment is configured, Patchmill runs that skill from
the issue worktree after the plan is available and before implementation starts.
Use this for local services, seeded data, Tilt, Docker, Kubernetes, or other
runtime setup agents need before changing code.
Implementation then runs with the configured implementation skill. Optional
toolchain, review, visualEvidence, and landing skills add repository
rules for validation commands, review passes, screenshot evidence, and the
choice between direct landing and opening a pull request.
Run state and retries
Section titled “Run state and retries”run-once writes logs under the configured run state directory, which defaults
to .patchmill/runs/. If a retryable run is already in progress, a later
execute run resumes it before selecting new work.
Use run-once as the supported operational loop. The continuous patchmill run
factory loop is still development testing and should not replace run-once for
normal usage yet.