Rewrite the active OpenSpec change artifacts under `openspec/changes/CHANGE_NAME/` so they match the code currently implemented on the branch relative to `main`. Use when implementation drift appears after `/opsx:apply`, after review-driven tweaks, or whenever the user asks to sync, refresh, catch up, or align OpenSpec change docs with the real code before verify or archive.
Treat the current branch implementation as the source of truth and update the active change docs to describe what was actually built.
Keep the edits inside openspec/changes/<name>/ unless the user explicitly asks for a later sync into openspec/specs/.
Select the change
If the user names a change, use it.
Otherwise, discover active changes first:
openspec list --json
Then:
Announce the selected change and the comparison base branch. Default to main. If does not exist locally, stop and ask for the correct base branch instead of guessing.
mainLoad the change context
Prefer the OpenSpec CLI:
openspec status --change "<name>" --json
openspec instructions apply --change "<name>" --json
If the CLI is unavailable or errors, fall back to direct filesystem discovery under openspec/changes/<name>/ and read whichever of these files exist:
proposal.mddesign.mdtasks.mdopenspec/changes/<name>/specs/*/spec.mdFor each capability touched by the change, read the base-branch main spec from the base branch itself, not from the working tree:
git show <base>:openspec/specs/<capability>/spec.md
If that path does not exist on the base branch, treat the capability as new. The change docs are deltas against the base branch, not standalone full specs.
Measure implementation drift
Inspect the branch against the selected base branch before editing docs:
git diff --name-only <base>...HEAD
git diff --stat <base>...HEAD
Use the full branch diff only as a discovery aid. Then narrow the evidence set to files that clearly implement the selected change based on:
Read the changed code, tests, and configuration files that explain the actual behavior. Prefer implementation evidence over earlier artifact wording.
Pay special attention to:
/opsx:applyIf the branch contains unrelated work and you cannot confidently isolate the selected change, stop and ask instead of folding the whole branch into one change's docs.
Rewrite the change artifacts to match the code
Update only the active change artifacts unless the user explicitly asks for more:
proposal.md when the change scope, capability list, or impact statement materially shifteddesign.md when the implemented architecture, data flow, API shape, or tradeoffs differ from the drafttasks.md so completed work is checked off, obsolete tasks are removed or reworded, and remaining follow-ups reflect realitymainFor delta specs:
## ADDED Requirements for behavior that exists on this branch but not in main## MODIFIED Requirements when branch behavior changes an existing requirement from main## REMOVED Requirements when the branch intentionally removes behavior present in main## RENAMED Requirements only for genuine renamesKeep delta specs minimal and capability-scoped. Do not copy an entire main spec into the change unless the whole requirement actually changed.
Decide whether the change should still be the same change
Stop and recommend a new change instead of force-fitting the docs when:
Small scope adjustments, clarified requirements, and design corrections should stay in the same change.
Validate the rewritten docs
Re-read the updated artifacts against both:
git show <base>:openspec/specs/*/spec.mdConfirm:
tasks.md status matches realityReport the outcome
Summarize:
openspec/specs/ unless the user explicitly asks to sync main specs too.main reference, stop and ask for the correct base branch.openspec/specs/; use openspec-sync-specs instead.openspec-verify-change instead.openspec-apply-change instead.change openspec change docs in current branch to align with the implemented codecatch up the current OpenSpec change docs with what we actually builtrewrite this change's proposal, specs, design, and tasks so they match the branch against mainrefresh the active openspec change docs before verify