fix(templates): make archive sync guidance profile-agnostic when sync skill is uninstalled (#913)#1443
Conversation
… skill is uninstalled (Fission-AI#913)
📝 WalkthroughWalkthroughArchive and bulk-archive instructions now directly merge delta specs when ChangesArchive spec synchronization
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (5)
skills/openspec-archive-change/SKILL.mdskills/openspec-bulk-archive-change/SKILL.mdsrc/core/templates/workflows/archive-change.tssrc/core/templates/workflows/bulk-archive-change.tstest/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. |
There was a problem hiding this comment.
🗄️ 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 literalopenspec/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) |
There was a problem hiding this comment.
🗄️ 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 togetBulkArchiveChangeSkillTemplate().src/core/templates/workflows/bulk-archive-change.ts#L395-L395: apply the same requirement togetOpsxBulkArchiveCommandTemplate().
📍 Affects 2 files
skills/openspec-bulk-archive-change/SKILL.md#L133-L133(this comment)src/core/templates/workflows/bulk-archive-change.ts#L135-L135src/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 |
There was a problem hiding this comment.
🎯 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.
Linked Issue
Fixes #913
Observed Failure
Under the default
coreprofile (propose,explore,apply,archive),openspec-sync-specsis not installed on user projects. However, the archive and bulk-archive workflow instructions unconditionally directed the agent to runopenspec-sync-specswhen syncing delta specs during archiving. When an agent attempted to executeopenspec-sync-specson the core profile, execution failed with a missing-skill error.Root Cause
archive-change.tsandbulk-archive-change.tstemplates contained hardcoded instructions pointing atopenspec-sync-specswithout providing a fallback when thesyncskill/workflow is not installed on the active profile.Implementation
src/core/templates/workflows/archive-change.tsandsrc/core/templates/workflows/bulk-archive-change.tsto provide profile-agnostic guidance: whenopenspec-sync-specsis not installed, the agent is instructed to perform the spec sync directly by merging delta specs into main specs underopenspec/specs/.pnpm run generate:skills) and updated parity hashes (pnpm run regen:parity-hashes).Regression Coverage & Validation
pnpm test-> 112 test files passed (2253 tests), including all skill template parity tests.pnpm build-> Build completed cleanly.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