fix: map skill references for skills-only delivery - #891
Conversation
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe PR fixes a bug where skills-only delivery mode generated SKILL.md files containing Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
|
Hey @Tylor110077, thanks for digging into this! The bug is real and your fix correctly addresses the symptoms. After reviewing, I want to flag something before we merge. The core issue here is that transformer selection logic has to be duplicated across We have an existing change proposal called "unify-template-generation-pipeline" that was designed to solve exactly this class of problem. It introduces a first-class transform pipeline where each transform declares when it applies, so instead of duplicated ternaries we'd have a single declarative transform with an explicit We're going to prioritize that change, and this fix would land naturally as part of it. I don't want your work to go to waste though. Your mapping table ( Holding off on merging for now, but really appreciate you tracking this down and writing it up cleanly. 🙏 |
|
Hi @TabishB, I found your comment about the I maintain a fork (stanleykao72/OpenSpec) where we've been running OpenSpec daily for an Odoo 18 Enterprise project. Over the past month, we hit the exact same "duplicated transformer logic" problem and ended up building a plugin system that solves it. The key pieces:
The fork has ~1,600 passing tests and has been production-tested across 150+ sessions. Would the upstream be interested in a plugin system PR? I'm happy to extract the general-purpose parts (no domain-specific content) and submit it for review. The For reference, here's what the fork adds: 26 commits ahead of upstream/main |
|
@stanleykao72 Hey, that's super cool. I think I'd definitely be interested, but I'd need a better understanding of how each piece works. Let me take a look and get back to you. |
|
Closing as already fixed on The bug this PR targets (#879) is closed as completed, and the fix is in the tree.
const COMMAND_TO_SKILL_NAME: Record<string, string> = {
'explore': 'openspec-explore',
'new': 'openspec-new-change',
'continue': 'openspec-continue-change',
'apply': 'openspec-apply-change',
...
};
function replaceCommandsWithSkillReferences(text: string, prefix: string): string {
return text.replace(/\/opsx:([a-z-]+)/g, (match, commandId: string) => {
const skillName = COMMAND_TO_SKILL_NAME[commandId];
return skillName === undefined ? match : `${prefix}${skillName}`;
});
}How it got there:
The shipped version also handles a case this PR did not: tools whose skill invocation prefix isn't Note this PR and #985 were duplicate fixes for the same issue — both are being closed for the same reason, with no reflection on either. Reopen if you spot a path still emitting |
Summary
transformToSkillReferences()for skills-only deliveryinitandupdateTesting
npx vitest run test/utils/command-references.test.ts test/core/init.test.tsnpm run buildCloses #879
Summary by CodeRabbit