Pipeline steps
Read this page when a step of /sdlc:ship skips, fails or asks a question, and you want the rule behind it. The short table of all steps is on the overview page.
Example
/sdlc:ship --dry-run
Prints the pipeline table (steps, arguments, pauses) and stops. Nothing runs, so you see which steps your configuration turns on.
Default pipeline steps
execute → commit → review → archive-openspec → pr → learnings-commit
The order is fixed. Change the set of steps with /sdlc:setup or with --steps (see Flags).
- Opt-in steps run only when you turn them on.
- Conditional steps run on their own when a review has findings to fix.
- A rebase runs between review and the next step. See rebase.
- A final cleanup always runs after the last configured step.
commit
The commit step first stages the changes (everything except the .sdlc-v2/
data directory) and checks the working tree. When changes are staged, ship
runs /sdlc:commit. When the tree is clean, the step completes
at once and /sdlc:commit does not run. The step result is then one of two
lines:
nothing to commit: …— HEAD has not moved since the first commit check of this run. The line counts the waves that/sdlc:executecommitted itself, or says the working tree is clean when/sdlc:executecommitted no waves. Ship also adds it to the decisions log.committed <sha>— a commit landed since the first commit check of this run, for example when an interrupted run resumes after/sdlc:commitfinished. Ship records that commit in the side-effect journal of the saved state.
A run with --steps that leaves out execute follows the same rules.
On the clean-tree routes and on the agent route (/sdlc:commit --push), the step then pushes the branch, best effort. The push skips
the default branch and a repository with no origin remote. A failed push
gives a warning, and the step still succeeds. See
Instructions after each step for the push
table.
rebase
A rebase onto the base branch ([git] baseBranch, else the repository default
branch) happens automatically between review and the next step. Skip it with
the rebase setting in /sdlc:setup. The rebase runs after any review-fix
commits and before the next configured step, so every later commit lands on
the rebased branch.
archive-openspec
archive-openspec archives the OpenSpec change named by --openspec-change
or the plan’s **Source:** header (or an auto-detected active change). It
skips when no change is named or detected. It calls the ship_state actions
openspec-check and openspec-tasks. The tools do the file checks, the
validation and the tasks.md box count. The skill does not run them itself.
- The change is already archived and the archive paths have no uncommitted
change: the step completes with the result
already archived. The archive paths areopenspec/changes/<change>, its archive folderopenspec/changes/archive/<YYYY-MM-DD>-<change>, and the folders underopenspec/specs/that the change has specs for. - The change is already archived but the archive paths have uncommitted changes (an earlier run archived and did not commit): the step commits them, as described below.
- The named change is missing on disk, lacks
proposal.mdor aspecs/*/spec.mdfile (missing artifacts), or failsopenspec validate --strict: the action writes the fail row and the pipeline stops. The step prints the next action, the validate output, and the specs that a newer archived change edited (when there are any). The missing-on-disk message is the same as inverify-openspec. - Outside
--auto, the step asks for consent before every archive, also when all boxes oftasks.mdare checked. With consent, it marks the open boxes done withopenspec-tasks(when there are any), then archives. Under--auto, the step skips the question and does the same. - A declined question records the decision
user declined archiveand skips the step. openspec-checkoropenspec-tasksreturns an error: the step fails with the error text and prints the Suggestion. Fix the cause it names, then run/sdlc:ship --resume.openspec archiveexits non-zero: the step fails with the CLI output. Fix the cause, then run/sdlc:ship --resume. The resumed step starts again, and the box sync finds no open box.
Before the archive, the step checks that the archive paths hold the only tracked edits. /sdlc:commit commits every tracked change, so another tracked edit would enter the archive commit. An untracked file, such as a draft of another change, stays out of the commit.
After the archive, the step stages the archive paths and runs
/sdlc:commit with --auto --no-instructions: the consent
question (or --auto) is already the approval. The commit does not push; the
pr step pushes. The step result is archived, commit <sha>.
The step fails with one of these causes when the commit does not land:
| Fail cause | When | What stays |
|---|---|---|
archive precheck failed |
a tracked edit outside the archive paths is open | your edit. Commit or stash it |
archive lookup failed |
a resume finds no archive folder, or more than one, for the change | the archived files |
archive status check failed |
git status exits non-zero |
the archived files, not staged |
archive stage failed |
git rm --cached or git add on the archive paths exits non-zero |
the archived files |
archive commit failed |
the commit returns an error or no commit sha, is stopped, or times out. The error names each commit worker that may still run (“Workers not stopped”) | the archived files, staged |
resume: an archive commit worker may still commit |
a resume finds a recorded worker that may still run, and you choose stop, or the run is --auto |
the archived files, staged |
Fix the cause, then run /sdlc:ship --resume. The resumed step finds the
change archived. When the archive paths are clean (the commit landed), the
step completes. When they still have changes, the step stages and commits
them again. When the step records its result and that call fails, the step
stays in progress. The resume then finds clean archive paths and completes
the step.
pr
The pr step runs /sdlc:pr with the release level that ship
resolved before the first step. Before it creates or updates the pull
request, the step pushes the branch when the branch has no upstream or has
commits that the upstream does not have:
- The branch has a remote-tracking ref: the push uses
--force-with-leasewith the commit of that ref. A rebased branch replaces the remote branch, but a commit that another person pushed is never lost. - The branch has no remote-tracking ref: the push is
git push -u origin HEAD. - The lease is rejected: the step fails with
remote branch <branch> changed since the last push. pr stopped.No pull request is created or edited. Fetch the branch, review the other commits, integrate them, then run/sdlc:ship --resume.
When you approved a PR title and body in chat in the same session, ship
sends them to /sdlc:pr in an Approved PR draft (publish unchanged): block.
/sdlc:pr then publishes that title and body unchanged and does not draft
again. With no approved draft, or on a resume in a new session, /sdlc:pr
drafts the text itself.
OpenSpec checks at the start of a run
ship_prepare is the tool that starts a run. For a run with an OpenSpec
change, it does the checks below before any step runs.
A plan with OpenSpec artifacts that are not authored
ship_prepare refuses a plan that names an OpenSpec change but whose
artifacts are not authored. This applies to a plan with an
**OpenSpec-Create:** line and no **OpenSpec-Staging:** or
**OpenSpec-Saved:** line. It also applies to a plan with an
**OpenSpec-Staging:** line whose OpenSpec Appendix starts with [TBD. A plan
with an **OpenSpec-Saved:** line is never refused by this check. The refusal
is two entries in errors: the message, then the fix. No state file is
written. Run /sdlc:plan on the plan again to finish the authoring, or remove
the **OpenSpec-Create:** and **Source:** lines to ship without OpenSpec.
A staging folder that belongs to another plan
ship_prepare also refuses a plan whose staging folder belongs to another
plan. The stage.json of that folder names another plan file. The refusal is
two entries in errors: the message that names the owner plan, then the fix.
No file changes. Run ship with the owner plan, or pick another change name in
the plan header and run /sdlc:plan again. Only a run of the owner plan
deletes the staging folder.
A spec shared with another change
When a run names an OpenSpec change, ship_prepare also checks for a shared
spec. The name comes from the staging header, the **Source:** header or
--openspec-change. ship_prepare compares the specs/<capability>/ folders
of the change with those of every other active change and every other staged
change. Each shared capability gives one entry in warnings. The entry names
both changes and the capability. The warning gives you time to agree a merge
order with the other plan. A change that ship_prepare cannot read adds one
warning, with the read error, and does not stop the call. No action is needed
to ship. A dry run (--dry-run) runs no shared-spec check, so it shows none of
these warnings.
The base commit of the change
For the same named change, ship_prepare stores the HEAD sha as
openspecBaseHead in the ship state file. A dry run stores nothing. When
git rev-parse HEAD fails, ship_prepare adds a warning and stores no key.
The only consumer is openspec-check (in verify-openspec and
archive-openspec), and only for the outcome invalid. It then returns
overlaps: each spec of the change that an archived change edited since
openspecBaseHead, for example after a rebase brought that archived change
in. With overlaps, the next action is to rebase the deltas of the change on
the new text of those specs. With no openspecBaseHead key, or a value that is
not a full commit sha, openspec-check skips this check and adds a warning.
Opt-in steps
Set these steps to true in the step table of your project with /sdlc:setup,
or pass them with --steps.
verify-openspec
Validates the current implementation against an active OpenSpec change before
archiving. It calls the ship_state action openspec-check, which checks the
files and runs the strict validation.
- Skipped automatically if there is no active change, even when configured.
- Completes when the change is already archived.
- Fails and stops the pipeline for three outcomes: the change is missing on
disk, the change lacks
proposal.mdor aspecs/*/spec.mdfile (missing artifacts), oropenspec validate --strictfails (invalid). openspec-checkreturns an error (a domain, data or infra error): the step fails with the error text, prints the Suggestion and stops the pipeline. A person must look at the cause before/sdlc:ship --resume, also when the Suggestion asks for another call.- For a change missing on disk with an
**OpenSpec-Saved:**line in the plan, the failure message tells you to merge the OpenSpec PR (branchopenspec/<change>) first, update the branch from the default branch, and run/sdlc:ship --plan <plan-file>again.
harden
Groups the review findings into clusters and runs /sdlc:harden on each one. It commits the guardrail, review-dimension, and Copilot-instruction edits as a separate commit before the PR. Then it runs one fix pass for the deferred findings that are below the review threshold, with its own commit.
flowchart LR
A1[Review and review fix step] --> A2[Below-threshold findings deferred]
A2 --> A3[Clusters and fix-now list]
A3 --> A4[Harden per cluster]
A4 --> A5[Harden commit]
A5 --> A6[One fix pass for fix-now]
A6 --> A7[Fix-pass commit]
A7 --> A8[PR]
When the step runs:
- The step runs after
archive-openspec. Outside--auto, it asks before each cluster. - It skips when there are no review findings, when no cluster qualifies and no deferred finding is left to fix, or when the harden files already have uncommitted edits before the step starts.
- When
hardenis configured,received-reviewgets--no-harden, so hardening runs only once.
The fix pass:
- The fix pass sends the deferred findings to /sdlc:received-review, which fixes each one or leaves it deferred.
- Outside
--auto, the fix pass pauses for you, as the received-review step does, unlessreceivedReview.alwaysFixSeveritiespre-approves every finding. - A fix pass that changes nothing ends as
Fix pass: 0 changes, with no commit. - The fix pass does not run when the working tree has uncommitted changes
outside
.sdlc-v2/andopenspec/, so its commit holds only its own edits.
A failed fix pass ends in one of four ways:
- The pass fails, you stop it, or it returns no result, and it changed no file. The findings stay deferred, and the step completes.
- The pass fails after it changed files. Ship commits those files as the fix-pass commit. The findings that the pass did not fix stay deferred.
- The
git statuscheck of the working tree fails. The step fails, and ship dispatches nothing more. - The staging or the commit of the fix-pass edits fails. The step fails. The findings that the pass already fixed stay fixed, and the edits stay in your working tree.
On --resume, a cluster already hardened is not run again, and a fix pass
that has its commit is not run again. If a resume finds uncommitted fix-pass
edits, ship asks whether to commit them. With --auto it fails the step
instead.
verify-pipeline
Polls CI after the PR is created and analyzes or fixes failures. See /sdlc:verify-pipeline.
Waits between polls
When a poll is still pending, ship records a wait on the step with
ship_state wait. The wait lasts the poll interval plus 30 seconds, from 1
to 3600 seconds. Then ship starts a background sleep for the poll interval
and ends its turn. When the sleep ends, ship polls again. During the wait, the
Stop hook does not count the turn ends of that step as a stall. The next
begin-step or complete-step removes the wait, and a wait ends by itself
after at most 3600 seconds.
- Ship never runs a foreground
sleep: the harness blocks it. - Ship never runs
gh pr checks --watch: it stops early on a skipped job. - Ship records the same kind of wait, for 900 seconds, before it ends a turn while a background agent runs. It records the wait again when the agent still runs at the next turn end.
- When the step ends before the sleep, ship stops the sleep. A sleep that ship
cannot stop writes nothing, and ship names it in the “Workers not stopped”
part of the step result. A sleep with no task ID shows there as
sleep (no task ID). - When the sleep does not start, ship polls again at once, at most 3 times in a row. Then the step fails.
- When a new session or a compaction loses the task ID of a sleep, the sleep ends by itself. The resumed step removes the wait.
await-remote-review
Waits for an automated reviewer (for example Copilot) to respond.
How the verdict is chosen
The step reads the latest submitted review of the first configured reviewer that has a verdict (Copilot by default). The body of that review can carry a Copilot overview header. An open or missed issue is an item of the “open” or “previously missed” block of the overview. Resolved items do not count.
| Latest review | Verdict | Ship does |
|---|---|---|
| state Changes requested, with or without a header | actionable | runs received-review |
| state Commented or Approved, 🟢 Approval recommended, no open or missed issue, every block read in full | approved-clean | continues |
| state Commented or Approved, 🟢 Approval recommended, an open or missed issue, or a block not read in full | actionable | runs received-review |
| state Commented or Approved, 🟡 Changes recommended | actionable | runs received-review |
| state Commented or Approved, 🔵 Needs a closer look | actionable | prints Copilot asks for a closer human look (🔵)., then runs received-review |
| state Approved, no overview header | approved-clean | continues |
| state Commented, no overview header | actionable | runs received-review |
| state Dismissed | no verdict | polls again |
| no verdict before the timeout | timeout | continues |
| the poll state already timed out | skipped | continues |
A poll that ends in error follows the same ext.retryable rule as the CI
poll. A pending poll waits as the CI poll does (see
Waits between polls).
The approved-clean and actionable results also carry ext.overview:
approval-recommended, changes-recommended, needs-closer-look, or empty
when the body has no header. The timeout and skipped results have no
ext.overview. Ship records the verdict in a decide entry, for example:
verdict: actionable; overview: needs-closer-look
Conditional steps
These steps start automatically. They are not part of the step list that you configure.
received-review— Runs when review findings meet or exceed the configured severity threshold. Ship passes it every such finding verbatim. The run records it as a step. With no finding at or above the threshold, the step completes with 0 fixes.commit-fixes— Commits the fixes thatreceived-reviewmade, as a separate commit from your feature commit.
The received-review step
When review is a configured step, the saved state of a run has a
received-review step right after review. The step starts as pending.
It does not block a later step while it is pending.
Ship records the step with two calls. begin-step starts it, and
complete-step ends it. On routes 2 to 6 below, ship makes both calls, also
when nothing needs a fix. A run that fails in this step calls fail in
place of complete-step.
Ship counts three numbers from the review output:
K— the findings at or aboveflags.reviewThreshold.M— the total of findings in the header of the review output.P— the finding headings that ship parsed.
Ship checks the routes in this order. The first route that matches wins.
| Route | When | What ship does | Result of complete-step |
|---|---|---|---|
| 1 | M is known and P is less than M |
Asks whether to run /sdlc:review again. It calls no step action before you answer. Run again: review starts over. Continue: routes 2 to 6 with the parsed findings. With --auto, ship does not ask: it continues. |
none yet |
| 2 | K is 1 or more |
Starts the step, dispatches /sdlc:received-review, runs commit-fixes when /sdlc:received-review changed files, then ends the step. |
K finding(s) sent to received-review |
| 3 | K is 0 and M is 0 |
Starts the step and ends it. It dispatches nothing. | 0 fixes — no findings |
| 4 | K is 0 and M is unknown |
Starts the step and ends it. It dispatches nothing. | 0 fixes — no finding at or above the threshold |
| 5 | K is 0, M is 1 or more, and P is M or more |
Starts the step and ends it. It dispatches nothing. | 0 fixes — all M findings below threshold |
| 6 | K is 0 and P is less than M (you chose Continue) |
Starts the step and ends it. It dispatches nothing. | 0 fixes — parsed P of M findings, none at or above the threshold |
| — | The dispatch fails, you stop it, it returns no result, or commit-fixes fails |
Stops a worker that can still run with TaskStop. When that fails (ship runs nested under another dispatch), records the worker as possibly still running. Then calls fail with the reason. The step is failed, and the issue list of the run shows it. |
none |
In the result text, K, M and P stand for the numbers of the run.
After the routes:
- The
await-remote-reviewstep records the poll verdict in adecideentry. It can dispatch/sdlc:received-reviewagain. That dispatch records its outcome only, withdecideonreceived-review. It makes no secondbegin-step, because that would set the completed step back toin_progress. - On routes 3 to 6, ship dispatches nothing. A finding below the threshold is
not lost: ship saves it for /sdlc:deferred. When the
hardenstep is configured, it tries to fix these findings first. - After the step, ship goes on with the rebase.
On --resume, the saved status of the step decides what ship does:
completed— ship does not call/sdlc:received-reviewagain. It goes on with the rebase.pending,in_progressorfailed, after a completedreview— ship does not run the routes again. The resumed session no longer has the review output, and a second deferral of a finding makes a duplicate entry. When a fix is still in progress and the tree has uncommitted changes, ship fails the step and stops, so you can check the changes. Otherwise it commits finished fixes, records a decision, and ends the step withresumed — review output lost. The findings that have no fix or deferral record show asUNACCOUNTEDin the summary. Run/sdlc:reviewand then/sdlc:received-reviewto get them back. With--auto, ship does the same and asks nothing.
Instructions after each step
After each step, ship runs the follow-up instructions of that step from the
[instructions] config. After the last step, it runs the ship list. Ship
does each instruction in its main session, never in a dispatched agent. It
passes --no-instructions to each skill that it starts, so that skill does
not run its own list. The full rules are on
Follow-up instructions.
| Part of the run | Before | After |
|---|---|---|
| Each step | begin, work, complete | begin, work, complete, run the list of the step |
| After the last step | report, cleanup, summary | run the ship list, then report, cleanup, summary |
| commit and commit-fixes | no push | push, best effort |
| pr | plain push | lease push |
- The commit-check route of the commit step, where no agent runs, also runs the commit list.
- The received-review list runs after the received-review step. The
commit-fixes list runs after commit-fixes. When commit-fixes does not run,
each commit-fixes instruction gets
not runwith the outcomestep did not run. - The harden commits and the verify-pipeline fix commit do not push.
- A failed instruction never fails the step or the run.
Push table:
| Push | When | Failure result |
|---|---|---|
| commit step | after the commit, not on the default branch | warning push failed (<kind>): <stderr>. The commit is kept and is not on the remote. The step succeeds. |
| commit-fixes step | after the commit, not on the default branch | the same warning. The step succeeds. |
| pr step, tracking ref exists | lease push with the tracking commit | error remote branch <branch> changed since the last push. pr stopped. Fix: Fetch the branch, review the other commits, integrate them, then run the pr step again. |
| pr step, no tracking ref | plain push | the existing infrastructure error. The fix depends on the failure kind (auth, network, no-remote, rejected or other). |
Exit routes:
| Exit | What happens to the instructions | Next |
|---|---|---|
a config error in [instructions] at the start |
no step starts, and no run state is written | correct the file that the error names, then run /sdlc:ship again |
--dry-run |
ship writes each instruction as pending. No instruction runs. |
the dry-run table shows the steps, then the run stops |
| a record call fails | ship prints one warning and keeps it for the summary. The instruction record stays as it was. | the loop continues. The summary prints the warning after the instructions line. |
| a step fails, or you stop it | each pending instruction of the run gets not run with step failed or stopped. A running instruction gets failed. The later lists, the ship list too, do not run. |
the resume instruction of the run |
| ship skips a step | each pending instruction of that step gets not run with step skipped. A running instruction gets failed. |
the next step |
| a step fails after a commit push | the same as a failed step. Ship does not undo the push. | the pr step pushes again with a lease |
| the run stops while an instruction runs | the instruction stays running |
/sdlc:ship --resume marks it failed with result not recorded, not run again, then runs the rest of the open lists |
| the run completes | each instruction is done, failed or not run |
the summary shows the instructions line |