Skip to content

[Fix] Add transformToSkillReferences for skills-only delivery mode #881

@alfred-openspec

Description

@alfred-openspec

Context

Reported in #879 by @m9dfukc. When delivery: 'skills' is configured, generated SKILL.md files contain hardcoded /opsx:* command references that point to commands that don't exist in skills-only mode.

Root Cause

  • Workflow templates in src/core/templates/workflows/*.ts hardcode /opsx:* references (46 total across all templates)
  • generateSkillContent() supports a transformInstructions callback, but only transformToHyphenCommands (for OpenCode) exists
  • init.ts and update.ts don't pass any transformer when delivery === 'skills'

Proposed Fix

  1. Add transformToSkillReferences() to src/utils/command-references.ts using the explicit mapping from WORKFLOW_TO_SKILL_DIR in init.ts:

    • /opsx:apply/openspec-apply-change
    • /opsx:archive/openspec-archive-change
    • /opsx:verify/openspec-verify-change
    • /opsx:continue/openspec-continue-change
    • /opsx:propose/openspec-propose
    • /opsx:explore/openspec-explore
    • /opsx:ff/openspec-ff-change
    • /opsx:new/openspec-new-change
    • /opsx:sync/openspec-sync-specs
    • /opsx:bulk-archive/openspec-bulk-archive-change
    • /opsx:onboard/openspec-onboard
  2. Wire the transformer in src/core/init.ts and src/core/update.ts:

const transformer = tool.value === 'opencode'
  ? transformToHyphenCommands
  : delivery === 'skills'
    ? transformToSkillReferences
    : undefined;
  1. Add tests for the new transformer

Files to Modify

  • src/utils/command-references.ts — add transformToSkillReferences()
  • src/core/init.ts — wire transformer (~line 541)
  • src/core/update.ts — wire transformer (~lines 198, 669)
  • Tests

Closes #879

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions