You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In OpenSpec 1.0, the archive command started prompting with this:
1. Sync now (recommended), then archive
2. Archive without syncing
I may be missing some context here, but I am finding it a little hard to understand why I would want to archive without syncing first.
In my experience, Claude Code and Codex usually seem to handle this well and prompt to sync before archiving. However, with OpenCode (and depending on model), I have noticed that sometimes it archives without syncing, and I may not even realize that the sync was skipped.
This feels more noticeable with the OpenSpec 1.2 core profile, where sync is not included by default. If I miss syncing at the point of archiving, I cannot sync afterward unless I customize the setup to include the sync command.
Because of this, I feel it may be simpler and easier to understand if archive always performs a sync before archiving.
Please do let me know if I am missing an important reason for keeping sync separate from archive. I wanted to raise this mainly because the current behavior can be a little confusing in practice.
The enrichment comment has been posted on issue #764. Here's a summary of what was included:
Key findings:
The sync-before-archive prompt is entirely agent-driven via skill template instructions (src/core/templates/workflows/archive-change.ts:63-67), not deterministic code — which is why different agents/models handle it inconsistently.
The sync workflow is not in the core profile (src/core/profiles.ts:14), so core profile users who skip sync at archive time have no recovery path.
Thanks for the detailed report. Here's a codebase analysis to help contextualize this request.
Relevant Code
The sync-before-archive prompt is defined in the archive skill template:
src/core/templates/workflows/archive-change.ts:63-67 — The prompt logic:
If delta spec changes are needed: offers "Sync now (recommended)" vs "Archive without syncing"
If already synced: offers "Archive now", "Sync anyway", "Cancel"
src/core/templates/workflows/archive-change.ts:56-67 — The full sync assessment step: checks for delta specs at openspec/changes/<name>/specs/, compares each with its corresponding main spec, then shows a combined summary before prompting.
src/core/templates/workflows/archive-change.ts:67 — If sync is chosen, it invokes openspec-sync-specs via the Skill tool (a sub-agent). The key line: "Proceed to archive regardless of choice" — this means sync is always optional from the archive flow's perspective.
The same prompt structure is duplicated in the OPSX command template at line 179-180 of the same file.
Core vs. Custom Profile
The issue author correctly identifies that sync is not in the core profile:
src/core/profiles.ts:19-30 — sync is in ALL_WORKFLOWS but only available when using the custom profile
This means core profile users who skip sync at archive time have no standalone /opsx:sync command to run afterward — the delta specs are archived away and can no longer be applied to main specs without manual extraction.
The Core Implementation
The CLI's ArchiveCommand class (src/core/archive.ts:50) handles the actual move operation but does not contain sync logic itself. Spec application is in src/core/specs-apply.ts (used by the CLI's --skip-specs flag path). The sync-at-archive-time decision is entirely agent-driven via the skill template instructions.
Design History
The separation of sync from archive was an intentional design choice introduced in these PRs:
PR fix: use Skill tool for sync invocation in archive templates #632 — Fixed a bug where agents couldn't properly invoke sync during archive (changed from slash command to Skill tool invocation). This is directly relevant — before this fix, agents would improvise sync behavior incorrectly
The Problem Pattern
The issue describes a real gap in the current design:
Agent reliability: The sync prompt is handled by the AI agent interpreting skill template instructions, not by deterministic code. Some models/agents may skip the prompt or default to "archive without syncing" — especially in non-interactive or fast-path scenarios.
No recovery path on core profile: If sync is skipped at archive time and the user is on the core profile, delta specs are moved into the archive directory with no standalone sync command available to recover them.
Silent data loss: The user may not realize sync was skipped, particularly if the agent doesn't clearly surface the choice.
Potential Approaches
Based on the codebase, here are a few paths forward:
Make sync-before-archive the default (as proposed): Remove the "Archive without syncing" option and always sync delta specs before archiving. This would mean modifying the skill templates in src/core/templates/workflows/archive-change.ts (both the skill and command templates) and potentially adding a --skip-sync CLI flag for power users who explicitly want to opt out.
Make sync deterministic in the CLI: Move the sync-at-archive logic from the agent-driven skill template into the ArchiveCommand class in src/core/archive.ts, so it runs as code rather than relying on agent interpretation. The CLI already has specs-apply.ts for this purpose — the --skip-specs flag path uses it.
Add sync to the core profile: Change CORE_WORKFLOWS in src/core/profiles.ts:14 to include 'sync', so core profile users always have a recovery path via /opsx:sync even if they skip at archive time.
Activity
21st-connector commentedon Feb 26, 2026
Task completed.
The enrichment comment has been posted on issue #764. Here's a summary of what was included:
Key findings:
src/core/templates/workflows/archive-change.ts:63-67), not deterministic code — which is why different agents/models handle it inconsistently.syncworkflow is not in the core profile (src/core/profiles.ts:14), so core profile users who skip sync at archive time have no recovery path.Three potential approaches were suggested:
--skip-syncflagsyncto the core profile as a minimum recovery pathView full conversation
Powered by 1Code
[-]Archive without syncing[/-][+][Question/Bug] archive without syncing[/+]21st-connector commentedon Feb 26, 2026
Issue Analysis
Thanks for the detailed report. Here's a codebase analysis to help contextualize this request.
Relevant Code
The sync-before-archive prompt is defined in the archive skill template:
src/core/templates/workflows/archive-change.ts:63-67— The prompt logic:src/core/templates/workflows/archive-change.ts:56-67— The full sync assessment step: checks for delta specs atopenspec/changes/<name>/specs/, compares each with its corresponding main spec, then shows a combined summary before prompting.src/core/templates/workflows/archive-change.ts:67— If sync is chosen, it invokesopenspec-sync-specsvia the Skill tool (a sub-agent). The key line: "Proceed to archive regardless of choice" — this means sync is always optional from the archive flow's perspective.The same prompt structure is duplicated in the OPSX command template at line 179-180 of the same file.
Core vs. Custom Profile
The issue author correctly identifies that
syncis not in the core profile:src/core/profiles.ts:14— Core profile:['propose', 'explore', 'apply', 'archive']src/core/profiles.ts:19-30—syncis inALL_WORKFLOWSbut only available when using the custom profileThis means core profile users who skip sync at archive time have no standalone
/opsx:synccommand to run afterward — the delta specs are archived away and can no longer be applied to main specs without manual extraction.The Core Implementation
The CLI's
ArchiveCommandclass (src/core/archive.ts:50) handles the actual move operation but does not contain sync logic itself. Spec application is insrc/core/specs-apply.ts(used by the CLI's--skip-specsflag path). The sync-at-archive-time decision is entirely agent-driven via the skill template instructions.Design History
The separation of sync from archive was an intentional design choice introduced in these PRs:
/opsx:syncas a standalone command, decoupling sync from archive so specs can be synced anytime during implementationThe Problem Pattern
The issue describes a real gap in the current design:
Potential Approaches
Based on the codebase, here are a few paths forward:
Make sync-before-archive the default (as proposed): Remove the "Archive without syncing" option and always sync delta specs before archiving. This would mean modifying the skill templates in
src/core/templates/workflows/archive-change.ts(both the skill and command templates) and potentially adding a--skip-syncCLI flag for power users who explicitly want to opt out.Make sync deterministic in the CLI: Move the sync-at-archive logic from the agent-driven skill template into the
ArchiveCommandclass insrc/core/archive.ts, so it runs as code rather than relying on agent interpretation. The CLI already hasspecs-apply.tsfor this purpose — the--skip-specsflag path uses it.Add sync to the core profile: Change
CORE_WORKFLOWSinsrc/core/profiles.ts:14to include'sync', so core profile users always have a recovery path via/opsx:synceven if they skip at archive time.Related Issues
harikrishnan83 commentedon May 1, 2026
With sync being part of the core workflow in #1030 this issue resolved. Thanks @TabishB .