Skip to content

fix(templates): make archive sync guidance profile-agnostic when sync skill is uninstalled (#913)#1443

Open
hsusul wants to merge 1 commit into
Fission-AI:mainfrom
hsusul:fix/profile-agnostic-archive-sync-guidance
Open

fix(templates): make archive sync guidance profile-agnostic when sync skill is uninstalled (#913)#1443
hsusul wants to merge 1 commit into
Fission-AI:mainfrom
hsusul:fix/profile-agnostic-archive-sync-guidance

Conversation

@hsusul

@hsusul hsusul commented Jul 26, 2026

Copy link
Copy Markdown

Linked Issue

Fixes #913

Observed Failure

Under the default core profile (propose, explore, apply, archive), openspec-sync-specs is not installed on user projects. However, the archive and bulk-archive workflow instructions unconditionally directed the agent to run openspec-sync-specs when syncing delta specs during archiving. When an agent attempted to execute openspec-sync-specs on the core profile, execution failed with a missing-skill error.

Root Cause

archive-change.ts and bulk-archive-change.ts templates contained hardcoded instructions pointing at openspec-sync-specs without providing a fallback when the sync skill/workflow is not installed on the active profile.

Implementation

  • Updated src/core/templates/workflows/archive-change.ts and src/core/templates/workflows/bulk-archive-change.ts to provide profile-agnostic guidance: when openspec-sync-specs is not installed, the agent is instructed to perform the spec sync directly by merging delta specs into main specs under openspec/specs/.
  • Regenerated committed skills (pnpm run generate:skills) and updated parity hashes (pnpm run regen:parity-hashes).

Regression Coverage & Validation

  • Ran pnpm test -> 112 test files passed (2253 tests), including all skill template parity tests.
  • Ran pnpm build -> Build completed cleanly.
  • Verified git diff --check -> Passed with 0 whitespace issues.

AI Assistance Disclosure

This pull request was prepared with AI pair-programming assistance (Antigravity). All template edits, generated skills updates, and parity test validations were verified locally before submission.

Limitations or Untested Platforms

None.

Unrelated Changes

No unrelated changes were included.

Summary by CodeRabbit

  • Improvements
    • Archiving workflows now support direct specification synchronization when the synchronization workflow is unavailable.
    • Archive processes require delegated synchronization steps to complete before continuing.
    • Bulk archiving provides clearer fallback guidance for merging specification updates.
  • Tests
    • Updated template consistency checks to reflect the revised workflow guidance.

@hsusul
hsusul requested a review from TabishB as a code owner July 26, 2026 01:02
@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Archive and bulk-archive instructions now directly merge delta specs when openspec-sync-specs is unavailable, while archive templates require synchronous delegated sync completion. Template parity tests update hashes for the changed functions and generated skills.

Changes

Archive spec synchronization

Layer / File(s) Summary
Archive skill guidance
skills/openspec-archive-change/SKILL.md, skills/openspec-bulk-archive-change/SKILL.md
Archive workflows now document direct delta-spec merging when openspec-sync-specs is not installed.
Embedded workflow templates
src/core/templates/workflows/archive-change.ts, src/core/templates/workflows/bulk-archive-change.ts
Generated archive instructions add the same fallback and require synchronous completion when synchronization is delegated.
Template parity validation
test/core/templates/skill-templates-parity.test.ts
Expected function and generated-skill content hashes are updated for the modified templates.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers: tabishb, clay-good

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: making archive sync guidance work when the sync skill is unavailable.
Linked Issues check ✅ Passed The templates now avoid unconditionally invoking openspec-sync-specs and provide a direct sync path when it is not installed, matching #913.
Out of Scope Changes check ✅ Passed The changes are confined to archive/bulk-archive workflow templates, regenerated skills, and parity hashes directly tied to the sync-guidance fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@skills/openspec-archive-change/SKILL.md`:
- Line 75: Update the direct spec-sync instruction in
skills/openspec-archive-change/SKILL.md to use the store-aware
<planningHome.root>/openspec/specs/ path instead of the literal openspec/specs/
path. Apply the same change in the archive-change template at
src/core/templates/workflows/archive-change.ts, then regenerate the installed
skill from the updated template.

In `@skills/openspec-bulk-archive-change/SKILL.md`:
- Line 133: Bulk synchronization must execute, complete, and verify inline
before archiving. Update skills/openspec-bulk-archive-change/SKILL.md:133 to
require synchronous execution rather than merely invoking the
openspec-sync-specs approach; apply the same requirement in
getBulkArchiveChangeSkillTemplate() at
src/core/templates/workflows/bulk-archive-change.ts:135 and
getOpsxBulkArchiveCommandTemplate() at
src/core/templates/workflows/bulk-archive-change.ts:395, ensuring each workflow
waits for completion and verification before archive.

In `@src/core/templates/workflows/archive-change.ts`:
- Line 132: Update getOpsxArchiveCommandTemplate() so its instructions for
syncing specs match getArchiveChangeSkillTemplate(): run openspec-sync-specs
inline when available, otherwise perform the spec sync directly, and wait
synchronously for completion before continuing. Apply this consistently to both
existing sync guidance locations in the template.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9e3427b8-1bf9-494c-9728-d5d2507f5b99

📥 Commits

Reviewing files that changed from the base of the PR and between 19d4171 and f0221c5.

📒 Files selected for processing (5)
  • skills/openspec-archive-change/SKILL.md
  • skills/openspec-bulk-archive-change/SKILL.md
  • src/core/templates/workflows/archive-change.ts
  • src/core/templates/workflows/bulk-archive-change.ts
  • test/core/templates/skill-templates-parity.test.ts

- Anything else — ask again rather than archiving

To sync, run the `openspec-sync-specs` workflow inline (agent-driven intelligent merge) for change '<name>', passing the delta spec analysis from above, and wait for it to finish. Do not delegate it to a background task — step 5 would move `changeRoot` out from under a sync that is still reading it, leaving the change archived and the main specs never updated. If your agent can only run it by delegation, delegate synchronously and wait for the result.
To sync, run the `openspec-sync-specs` workflow inline (agent-driven intelligent merge) for change '<name>' (if `openspec-sync-specs` is not installed, perform the spec sync directly by merging delta specs into main specs under `openspec/specs/`), passing the delta spec analysis from above, and wait for it to finish. Do not delegate it to a background task — step 5 would move `changeRoot` out from under a sync that is still reading it, leaving the change archived and the main specs never updated. If your agent can only run it by delegation, delegate synchronously and wait for the result.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Use the store-aware main-spec root for direct sync.

  • skills/openspec-archive-change/SKILL.md#L75-L75: replace literal openspec/specs/ with the <planningHome.root>/openspec/specs/ location established earlier.
  • src/core/templates/workflows/archive-change.ts#L77-L77: update the source template accordingly, then regenerate the installed skill.
📍 Affects 2 files
  • skills/openspec-archive-change/SKILL.md#L75-L75 (this comment)
  • src/core/templates/workflows/archive-change.ts#L77-L77
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/openspec-archive-change/SKILL.md` at line 75, Update the direct
spec-sync instruction in skills/openspec-archive-change/SKILL.md to use the
store-aware <planningHome.root>/openspec/specs/ path instead of the literal
openspec/specs/ path. Apply the same change in the archive-change template at
src/core/templates/workflows/archive-change.ts, then regenerate the installed
skill from the updated template.


a. **Sync specs** if delta specs exist:
- Use the openspec-sync-specs approach (agent-driven intelligent merge)
- Use the openspec-sync-specs approach (agent-driven intelligent merge, or merge delta specs directly into main specs if sync workflow is not installed)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Make bulk synchronization explicitly synchronous.

  • skills/openspec-bulk-archive-change/SKILL.md#L133-L133: require inline execution, completion, and verification before archive.
  • src/core/templates/workflows/bulk-archive-change.ts#L135-L135: apply the requirement to getBulkArchiveChangeSkillTemplate().
  • src/core/templates/workflows/bulk-archive-change.ts#L395-L395: apply the same requirement to getOpsxBulkArchiveCommandTemplate().
📍 Affects 2 files
  • skills/openspec-bulk-archive-change/SKILL.md#L133-L133 (this comment)
  • src/core/templates/workflows/bulk-archive-change.ts#L135-L135
  • src/core/templates/workflows/bulk-archive-change.ts#L395-L395
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/openspec-bulk-archive-change/SKILL.md` at line 133, Bulk
synchronization must execute, complete, and verify inline before archiving.
Update skills/openspec-bulk-archive-change/SKILL.md:133 to require synchronous
execution rather than merely invoking the openspec-sync-specs approach; apply
the same requirement in getBulkArchiveChangeSkillTemplate() at
src/core/templates/workflows/bulk-archive-change.ts:135 and
getOpsxBulkArchiveCommandTemplate() at
src/core/templates/workflows/bulk-archive-change.ts:395, ensuring each workflow
waits for completion and verification before archive.

- Preserve .openspec.yaml when moving to archive (it moves with the directory)
- Show clear summary of what happened
- If sync is requested, run the \`openspec-sync-specs\` workflow inline (agent-driven)
- If sync is requested, run the \`openspec-sync-specs\` workflow inline (agent-driven), or perform the spec sync directly if that workflow is not installed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Propagate the fallback to the OPSX archive command template.

getArchiveChangeSkillTemplate() now handles an unavailable openspec-sync-specs, but getOpsxArchiveCommandTemplate() still tells agents only to run that workflow at Lines 210 and 312. /opsx:archive in the default core profile will therefore still fail with a missing-skill error. Apply the same fallback and synchronous-wait guidance to that template.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/core/templates/workflows/archive-change.ts` at line 132, Update
getOpsxArchiveCommandTemplate() so its instructions for syncing specs match
getArchiveChangeSkillTemplate(): run openspec-sync-specs inline when available,
otherwise perform the spec sync directly, and wait synchronously for completion
before continuing. Apply this consistently to both existing sync guidance
locations in the template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/opsx-archive can offer 'Sync now' even when openspec-sync-specs is not installed (core profile)

1 participant