fix(templates): restore intentional apply skill/command separation - #1514
Conversation
Revert the deduplication from #1153. Skills and commands are different ways to invoke the apply workflow: commands reference /opsx:*, while skills reference other skills by name and avoid /opsx: (a skill may be installed without the commands). Teams choose skills-only, commands-only, or both through profiles, so generating both is intentional, not drift. #1153 collapsed getApplyChangeSkillTemplate() and getOpsxApplyCommandTemplate() into one shared body and added a test asserting they are byte-identical, erasing four deliberate differences (change-name example, contextFiles note, blocked-state pointer, and completion hint). This restores the two separate templates and removes the identical-body assertion. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe apply skill and command templates now use separate instruction bodies. The skill updates context-file and workflow guidance. The command embeds its own workflow. Tests update hashes and validate transformed command references. ChangesApply workflow templates
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 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: 1
🤖 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 `@src/core/templates/workflows/apply-change.ts`:
- Line 55: Update the blocked-state guidance in
src/core/templates/workflows/apply-change.ts at line 55 to invoke
/openspec-continue-change instead of the bare command name, then regenerate
skills/openspec-apply-change/SKILL.md at line 53 so the committed generated
artifact reflects the corrected invocation.
🪄 Autofix
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: cc048a4c-3be8-4c4a-8827-bdee655b14c2
📒 Files selected for processing (3)
skills/openspec-apply-change/SKILL.mdsrc/core/templates/workflows/apply-change.tstest/core/templates/skill-templates-parity.test.ts
alfred-openspec
left a comment
There was a problem hiding this comment.
Requesting changes because this revert removes the canonical /opsx:* tokens that generation rewrites for skills-only targets. At 3db3381, skills.sh, Codex, and Kimi all receive bare openspec-continue-change text and lose valid input/archive invocations; main correctly emits /openspec-*, $openspec-*, and /skill:openspec-*. Please preserve transformable tokens in the skill template (shared or split) and add default/Codex/Kimi generation regressions. The focused tests pass but miss this break.
Address alfred's review on #1514. A plain revert of #1153 restored the skill template's bare `openspec-continue-change` prose and dropped the archive/input invocations. The generator only rewrites canonical `/opsx:<id>` tokens, so bare prose is dead text for skills-only targets: skills.sh, Codex, and Kimi lost valid continue/apply/archive invocations. Keep the skill and command templates split (no shared constant, no identical-body assertion — the design separation #1153 erased stays reverted), but author the skill's three invocation references as transformable `/opsx:*` tokens. The generator now emits the correct per-target skill invocation: `/openspec-continue-change` (default), `$openspec-continue-change` (Codex), `/skill:openspec-continue-change` (Kimi) — i.e. "invoked as skills," spelled for each tool. Regenerated the static SKILL.md and parity hashes, and added default/Codex/Kimi generation regressions that pin the apply skill's per-target invocations so this break can't recur silently. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Thanks @alfred-openspec — you're right, and I verified the break: for every skill target the plain revert emitted bare Fixed in c953444, keeping both concerns satisfied:
Regenerated the static |
alfred-openspec
left a comment
There was a problem hiding this comment.
Re-reviewed c953444. The canonical references are restored and now rewrite correctly for skills.sh, Codex's shared .agents form, and Kimi; static skills regenerate cleanly. A fresh frozen install, build, lint, 364 focused template/reference/init/update/migration tests, and the full hosted matrix pass.
Status: Ready. This reverts #1153, which we merged by mistake.
What was wrong
#1153 deduplicated the apply skill and command templates into one shared body (
getApplyInstructions()) and added a test asserting the two are byte-identical. But skills and commands are intentionally different ways to invoke the workflow:/opsx:*(e.g./opsx:continue,/opsx:archive)./opsx:— a skill can be installed without the commands.Teams choose skills-only, commands-only, or both via delivery mode, so generating both is a deliberate choice, not drift. The merge erased four intentional skill→command differences:
/opsx:apply add-auth(varies by schema)openspec-continue-change/opsx:continueReady to archive this change.…archive with /opsx:archiveHow it's fixed
Restored
apply-change.tsto two separate template functions, regenerated the staticskills/openspec-apply-change/SKILL.md, and removed the identical-body parity assertion from the test. No other workflow file used this dedup pattern, so the change is self-contained.Proof it works
Working tree matches the exact pre-#1153 state (empty diff vs
0b233efb^).npm run build, then all 86test/core/templates/tests pass — including the generated-SKILL.mdcontent-hash checks, which confirm the static file matches the reverted template.Notes
The underlying report #1139 ("commands and skills are nearly duplicated") is answered separately by delivery mode:
openspec config→ Delivery only → Skills only / Commands only. Closing that issue with the guidance.Summary by CodeRabbit
Documentation
Refactor
Tests