Use when the user says "/harness:iterate", "iterate on the code", "implement these changes", "make this change end-to-end", "plan, build, and review", or wants a planned, reviewed code change applied to the connected repository. Chains /ce:plan → /ce:work → /ce:review (autofix safe_auto pass) → summary artifact, all on a feature branch. Does NOT push or open a PR.
Orchestrator note (2026-04-15): When the daemon env var
HARNESS_ITERATE_ORCHESTRATOR=trueis set, the harness intercepts iterate runs and dispatches them to the four-phase orchestrator:iterate-plan(Opus) →iterate-work(Sonnet) →iterate-review(Opus) →iterate-summary(Sonnet). This file's body is not sent to Claude in that path — the per-phase skill files undermarketplace/harness/skills/iterate-{plan,work,review,summary}/are. The body below is the legacy single-Opus-session implementation, kept as a fallback while the orchestrator is gated behind the flag.
End-to-end code iteration against the skillflow's connected repository. You chain three Compound Engineering skills inside this one session, on a feature branch, and write a summary artifact the user can review before deciding to apply, push, or discard.
Given a user instruction ({user_input}):
/ce:plan to produce a structured plan in docs/plans/./ce:work to execute the plan against the codebase./ce:review mode:autofix to apply safe automatic fixes and surface residual findings.docs/iterations/ that captures the branch, what changed, what was auto-fixed, and what's left.Your output is the summary artifact + the branch. You do NOT push, you do NOT open a PR.
git status --porcelain. If non-empty, halt and write a short summary explaining: "Working tree has uncommitted changes; commit or stash them, then re-run this step."{user_input} must be non-empty and concrete enough to plan against. If empty or one-word ("fix it", "improve"), halt and ask the user to provide a clearer instruction..harness/kb/stack-profile.md should exist. If missing, note it in the summary and continue (the chained skills do their own discovery).If any prerequisite fails, do NOT create a branch, do NOT modify code. Write a one-paragraph failure summary and stop.
Load .harness/kb/stack-profile.md, .harness/kb/api-surface.md, .harness/kb/data-layer.md, .harness/kb/ui-patterns.md if present — these condition /ce:plan's research.
Read prior skillflow step outputs from the skillflow's target_dir (default documents/shapings/). Earlier shape/ground/design/brief artifacts are valuable grounding for the planner.
Note the current commit SHA on the default branch — you'll diff against it for the summary.
Load identity context from ~/.harness/identity/ to calibrate the summary voice:
Load: ~/.harness/identity/brand.md (voice for the summary artifact).
If present, briefly confirm: "Using brand identity: {one-line tone summary}".
If missing, proceed silently — the iteration itself doesn't depend on it.
Execute in this exact order. Do NOT skip steps. Commit eagerly between sub-skills so a mid-run cancel leaves a coherent partial state, not a half-edited working tree.
Detect the default branch: git symbolic-ref --short refs/remotes/origin/HEAD | sed 's@^origin/@@'. Fall back to main if the symref isn't set.
Compute a slug from {user_input} (lowercase, kebab-case, ≤40 chars, ASCII only).
Create and switch to the feature branch: harness/iterate/<slug>-<YYYY-MM-DD>. If the branch already exists, append a numeric suffix.
Record the chosen branch name — you'll cite it in the summary.
Invoke /ce:plan with {user_input} as the planning input. Let the skill run its full discovery + write its plan file under docs/plans/. Capture the plan file path that ce:plan writes — you'll reference it in the summary.
After the plan file is written:
Stage and commit the plan file: chore(plan): add iteration plan for <short slug>.
Push that commit onto the feature branch (it's a local commit, not a remote push — git push is forbidden).
Invoke /ce:work <plan-file-path>. Let it execute the plan against the codebase, making whatever code changes the plan describes. Allow ce:work to make its own incremental commits as it works through implementation units.
If /ce:work fails partway:
Do NOT roll back the partial commits. Leave them on the branch.
Skip Step 4 (review on incomplete work is misleading).
Jump to Step 5 and write a summary that flags the failure plus what was completed.
Invoke /ce:review mode:autofix base:origin/<default-branch>. This runs the full review pipeline against the diff and applies findings classified as safe_auto -> review-fixer in a single pass. Findings the auto-fixer cannot safely apply (gated_auto, manual, advisory) come back as structured residual output.
Capture from the review output:
Number of safe_auto fixes applied.
Each residual finding: severity (P0/P1/P2/P3), file:line, title, autofix_class, and suggested fix if present.
The verdict line ("Ready to merge" / "Ready with fixes" / "Not ready").
Path to the per-run artifact under .context/compound-engineering/ce-review/<run-id>/.
If the autofix pass made commits, leave them on the branch.
Determine the skillflow's target_dir from prior step context (default documents/shapings/ if not visible). Compute a parallel iterations dir: replace the trailing shapings segment with iterations, or fall back to documents/iterations/ if no target_dir is detectable.
Write the summary file to <iterations-dir>/iteration-<slug>-<YYYY-MM-DD>.md with this exact frontmatter and structure:
---