Files
fission-ai__openspec/openspec/changes/fix-opencode-commands-directory/proposal.md
Fabián Silva 61eb999f7c fix(opencode): use plural commands/ directory to match OpenCode convention (#760)
* fix(opencode): use plural `commands/` directory to match OpenCode convention

The OpenCode adapter was using `.opencode/command/` (singular) but OpenCode's
official documentation specifies `.opencode/commands/` (plural). This aligns
with every other adapter in the codebase. Legacy cleanup updated to detect
old singular-path artifacts. Fixes #748.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(legacy): detect both opsx-* and openspec-* patterns, auto-cleanup in CI

- Extend LegacySlashCommandPattern.pattern to accept string | string[]
- OpenCode legacy entry now detects both opsx-*.md and openspec-*.md
- Auto-cleanup legacy artifacts in non-interactive mode instead of
  aborting with exit 1 (safe: slash commands are OpenSpec-managed,
  config cleanup only removes markers)
- Add 7 tests (6 legacy detection + 1 non-interactive init)
- Update spec with array pattern support and auto-cleanup scenario

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: update task description to reflect dual-pattern support

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Tabish Bidiwale <30385142+TabishB@users.noreply.github.com>
2026-02-27 00:08:22 -08:00

1.2 KiB

Why

The OpenCode adapter uses .opencode/command/ (singular) for its commands directory, but OpenCode's official documentation specifies .opencode/commands/ (plural). Every other adapter in the codebase also uses plural directory names (.claude/commands/, .cursor/commands/, .factory/commands/, etc.). This inconsistency was introduced in Oct 2025 without documented rationale. Fixes #748.

What Changes

  • OpenCode adapter path changes from .opencode/command/ to .opencode/commands/
  • Legacy cleanup adds .opencode/command/ (old singular path) for backward compatibility
  • Documentation updated to reflect the new plural path

Capabilities

New Capabilities

None.

Modified Capabilities

  • command-generation: OpenCode adapter path changes from singular command/ to plural commands/ to match OpenCode's official directory convention

Impact

  • src/core/command-generation/adapters/opencode.ts — adapter path
  • src/core/legacy-cleanup.ts — legacy cleanup pattern + add old singular path
  • docs/supported-tools.md — documentation table
  • test/core/command-generation/adapters.test.ts — test assertion