fix(templates): correct generated workflow guidance - #1500
Conversation
📝 WalkthroughWalkthroughGenerated OpenSpec workflows retain the selected store across applicable commands, validate synced specs before reporting success, and check optional workflow availability before suggesting it. Tests and a patch changeset document the updated guidance. ChangesGenerated workflow guidance
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant SyncWorkflow
participant OpenSpecCLI
participant MainSpecs
SyncWorkflow->>OpenSpecCLI: Sync specs with selected-root flags
OpenSpecCLI->>MainSpecs: Update main specs
SyncWorkflow->>OpenSpecCLI: Validate specs with openspec validate --specs
OpenSpecCLI-->>SyncWorkflow: Return validation result
SyncWorkflow-->>MainSpecs: Show completion summary after successful validation
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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: 2
🧹 Nitpick comments (1)
test/core/templates/skill-templates-parity.test.ts (1)
207-214: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert the expanded store-capable command list.
This test checks only the generic sticky wording. It would still pass if
contextorviewwere removed fromSTORE_SELECTION_GUIDANCE. Assert the newly added command entries directly.Suggested assertion
expect(STORE_SELECTION_GUIDANCE).toContain( 'append it to every applicable command below, even when the example does not repeat the flag' ); + expect(STORE_SELECTION_GUIDANCE).toContain('`context`, `view`');🤖 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 `@test/core/templates/skill-templates-parity.test.ts` around lines 207 - 214, Expand the test around STORE_SELECTION_GUIDANCE to assert that the store-capable context and view command entries are present directly, in addition to the existing sticky-selection wording checks. Use the exact command identifiers or guidance text from STORE_SELECTION_GUIDANCE so the test fails if either entry is removed.
🤖 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-update-change/SKILL.md`:
- Line 18: Update both CLI fallback commands in the openspec-continue-change
guidance to quote the <name> and <artifact-id> placeholders, matching the
surrounding command syntax and preventing shell redirection when copied.
In `@src/core/templates/workflows/update-change.ts`:
- Line 93: Move the `/opsx:new` availability fallback from the end of the
guardrails into the intent-change steps at the locations represented by the
relevant template sections, placing the precondition immediately before
recommending `/opsx:new`; retain `openspec new change <name>` as the alternative
when unavailable. Update `test/core/templates/update-change.test.ts` to verify
both ordering and fallback text.
---
Nitpick comments:
In `@test/core/templates/skill-templates-parity.test.ts`:
- Around line 207-214: Expand the test around STORE_SELECTION_GUIDANCE to assert
that the store-capable context and view command entries are present directly, in
addition to the existing sticky-selection wording checks. Use the exact command
identifiers or guidance text from STORE_SELECTION_GUIDANCE so the test fails if
either entry is removed.
🪄 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: 565f3baa-ce2b-45a1-93a7-bd53d8c93a43
📒 Files selected for processing (18)
.changeset/fix-generated-workflow-guidance.mdskills/openspec-apply-change/SKILL.mdskills/openspec-archive-change/SKILL.mdskills/openspec-bulk-archive-change/SKILL.mdskills/openspec-continue-change/SKILL.mdskills/openspec-explore/SKILL.mdskills/openspec-ff-change/SKILL.mdskills/openspec-new-change/SKILL.mdskills/openspec-onboard/SKILL.mdskills/openspec-propose/SKILL.mdskills/openspec-sync-specs/SKILL.mdskills/openspec-update-change/SKILL.mdskills/openspec-verify-change/SKILL.mdsrc/core/templates/workflows/store-selection.tssrc/core/templates/workflows/sync-specs.tssrc/core/templates/workflows/update-change.tstest/core/templates/skill-templates-parity.test.tstest/core/templates/update-change.test.ts
alfred-openspec
left a comment
There was a problem hiding this comment.
Reviewed at exact head 29431b9. Focused template, parity, and initialization coverage passes; the generated guidance now preserves selected stores, validates syncs before success, and keeps propose planning-only until a separate apply request.
Deploying openspec-docs with
|
| Latest commit: |
19c648e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://6f184451.openspec-docs.pages.dev |
| Branch Preview URL: | https://codex-fix-generated-workflow.openspec-docs.pages.dev |
Status
LGTM.
What was wrong
Generated workflows could lose a selected store because concrete command examples omitted the sticky
--store <id>rule. The update workflow suggested expanded-only workflows before explaining that they might not be installed, and its/opsx:newCLI fallback reused the active change name. The sync workflow reported success without validating the main specs it had just changed.How it was fixed
openspec validate --specswith the selected root after applying deltas and before sync reports success.openspec init --tools claude, then regenerate the committed skills and parity hashes.Replication / proof
The regression assertions failed on current
mainfor the reported behaviors, then passed with this patch.openspec init --tools claudegenerated:--store "<id>"command.git diff --checkpassed.Notes / nits
This changes generated instructions only. It does not change CLI behavior, APIs, schemas, persisted data, or architecture.
Closes #1493
Summary by CodeRabbit
Improvements
Tests