-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: add smart sync check to /opsx:archive command #452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Instead of blindly asking "want to sync?", archive now performs a quick check to see if delta specs actually need syncing: - Extracts requirement names from delta specs - Checks if corresponding main spec exists - Checks if ADDED requirements appear in main spec - Only prompts if sync appears needed Also improves archive output to always show specs status: - ✓ Synced to main specs - No delta specs -⚠️ Not synced
📝 WalkthroughWalkthroughThis PR replaces the delta-specs prompt flow with a new quick sync-check flow in the skill templates. The updated flow detects delta specs, extracts added requirements, verifies sync status against main specs, and conditionally presents inline warnings with sync options or proceeds without prompting. Output and messaging have been updated to reflect the new Synced / Not Synced / No Delta Specs status concept across archive and command templates. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
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 |
Review CompleteYour review story is ready! Comment !reviewfast on this PR to re-generate the story. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/core/templates/skill-templates.ts (1)
1446-1457: Consider consolidating duplicate output blocks.The "Output On Success (No Delta Specs)" block (lines 1446-1457) is nearly identical to the standard "Output On Success" block (lines 1435-1444), differing only in the
**Specs:**line value. While this explicit documentation is helpful for template consumers, it introduces some duplication.This is acceptable as-is since templates benefit from explicit examples, but if more status variants are added in the future, consider using a single output block with inline notes about the
Specs:line variations.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/core/templates/skill-templates.ts
🧰 Additional context used
🧠 Learnings (9)
📓 Common learnings
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/specs/**/spec.md : Use `## ADDED|MODIFIED|REMOVED|RENAMED Requirements` headers in spec delta files
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/*.md : Scaffold proposal using `proposal.md`, `tasks.md`, optional `design.md`, and delta specs under `openspec/changes/<id>/`
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/*.md : Scaffold proposal using `proposal.md`, `tasks.md`, optional `design.md`, and delta specs under `openspec/changes/<id>/`
Applied to files:
src/core/templates/skill-templates.ts
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/specs/**/spec.md : Use `## ADDED|MODIFIED|REMOVED|RENAMED Requirements` headers in spec delta files
Applied to files:
src/core/templates/skill-templates.ts
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Use `openspec archive <change-id> --skip-specs --yes` for tooling-only changes
Applied to files:
src/core/templates/skill-templates.ts
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/*/tasks.md : Ensure `tasks.md` contains implementation checklist with numbered sections and checkbox items
Applied to files:
src/core/templates/skill-templates.ts
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/specs/**/spec.md : Include at least one `#### Scenario:` per requirement in spec delta files
Applied to files:
src/core/templates/skill-templates.ts
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Move completed changes from `changes/[name]/` to `changes/archive/YYYY-MM-DD-[name]/` after deployment
Applied to files:
src/core/templates/skill-templates.ts
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Search existing work using `openspec spec list --long`, `openspec list` for enumerating changes; use `rg` only for full-text search
Applied to files:
src/core/templates/skill-templates.ts
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Run `openspec validate [change-id] --strict` before requesting approval
Applied to files:
src/core/templates/skill-templates.ts
🔇 Additional comments (6)
src/core/templates/skill-templates.ts (6)
1102-1133: LGTM - Clear smart sync check logic for the skill template.The sync check flow is well-structured:
- Extracts requirement names from delta specs using the
### Requirement: <name>pattern (consistent with learnings about delta spec format).- Checks main spec existence and presence of ADDED requirements.
- Conditionally prompts only when sync is actually needed.
One minor observation: the check only verifies ADDED requirements against main specs. MODIFIED and REMOVED requirements are noted but not validated against the main spec. This seems intentional per the PR objectives (focusing on whether "requirements appear in the main spec"), but worth confirming this is the desired behavior since MODIFIED requirements that don't exist in main specs could also indicate a sync issue.
1169-1169: LGTM - Output format clearly communicates specs status.The three status variants ("✓ Synced to main specs", "No delta specs", "
⚠️ Not synced") provide clear feedback to users about the state of their delta specs.
1180-1181: LGTM - Guardrails updated to reflect the new sync check approach.The guardrails now document the quick sync check behavior, which helps maintain consistency with the implementation instructions above.
1374-1405: Sync check logic is consistent with skill template - good for maintainability.The command template (
getOpsxArchiveCommandTemplate) mirrors the skill template (getArchiveChangeSkillTemplate) sync check logic, which ensures consistent behavior regardless of how users invoke the archive functionality.Minor difference noted: Line 1400 references
/opsx:synclogic while Line 1128 in the skill template references "openspec-sync-specs skill". Both are functionally equivalent but use different terminology appropriate to their context (command vs skill).
1467-1472: Warning output correctly captures all three warning scenarios.The "Output On Success With Warnings" block now includes the delta specs not synced case alongside incomplete artifacts and tasks, providing comprehensive feedback to users.
1498-1500: Guardrails appropriately document the quick sync check approach.The guardrail on line 1498 succinctly describes the sync check mechanism, maintaining consistency with the skill template's guardrails.
Upgrade notesTo get the new behavior, re-run the experimental setup command: openspec artifact-experimental-setupThis regenerates the skill and command files in |
Summary
/opsx:archiveto perform a quick check before prompting about spec syncChanges
Smart sync check logic:
### Requirement: <name>)openspec/specs/<capability>/spec.mdArchive output now shows specs status:
✓ Synced to main specs- all requirements found in main specsNo delta specs- no specs directory in change⚠️ Not synced- user chose to archive without syncingTest plan
/opsx:archiveon a change with unsynced delta specs - should show specific issues and prompt/opsx:archiveon a change with synced delta specs - should proceed without prompting/opsx:archiveon a change without delta specs - should proceed without sync-related checks🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Updates
✏️ Tip: You can customize this high-level summary in your review settings.