Skip to content

fix(opencode): use commands/ directory (plural) to match OpenCode docs#2453

Open
marcusburghardt wants to merge 1 commit intogithub:mainfrom
marcusburghardt:fix/opencode-commands-dir
Open

fix(opencode): use commands/ directory (plural) to match OpenCode docs#2453
marcusburghardt wants to merge 1 commit intogithub:mainfrom
marcusburghardt:fix/opencode-commands-dir

Conversation

@marcusburghardt
Copy link
Copy Markdown

Description

Align the OpenCode integration's command directory with OpenCode's
documented standard: .opencode/commands/ (plural) instead of
.opencode/command/ (singular).

OpenCode's documentation (https://opencode.ai/docs/commands/) uses
commands/ as the canonical directory name. The OpenCode runtime
supports both via a {command,commands} glob, so the singular form
works but is outdated. OpenSpec already fixed this in
Fission-AI/OpenSpec#748.

This is a two-value change in opencode/__init__.py:

  • commands_subdir: "command""commands"
  • registrar_config.dir: ".opencode/command"".opencode/commands"

With corresponding test updates in test_integration_opencode.py
and test_integration_subcommand.py.

Backward compatibility

No user action is required. OpenCode loads commands from both
.opencode/command/ and .opencode/commands/ via its
{command,commands} glob, so existing projects continue
working without changes. After updating, new specify init
runs will deploy Speckit commands to .opencode/commands/
(plural). Previously deployed Speckit commands in
.opencode/command/ remain functional but can be removed:

rm .opencode/command/speckit.*.md

Testing

  • Tested locally with uv run specify --help
  • Ran existing tests with uv sync && uv run pytest
  • Tested with a sample project (if applicable)

Ran specify init /tmp/speckit-test --integration opencode --script sh
and verified commands are created in .opencode/commands/ (plural)
with no .opencode/command/ (singular) directory created.

Also ran uv run python -m pytest tests/test_agent_config_consistency.py
(24/24 pass).

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance (describe below)

This fix was identified through codebase analysis using OpenCode
(claude-opus-4-6). The two-line source change and test updates
were authored with AI assistance. All tests were run and verified
locally.

OpenCode documentation (https://opencode.ai/docs/commands/) uses
.opencode/commands/ (plural) as the canonical command directory.
The OpenCode runtime supports both .opencode/command/ and
.opencode/commands/ via a {command,commands} glob, but the
singular form was the original convention and is now outdated.

Update the OpenCode integration to write to .opencode/commands/
instead of .opencode/command/, aligning with the documented
standard and the OpenSpec fix (Fission-AI/OpenSpec#748).

Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
Assisted-by: OpenCode (claude-opus-4-6)
@marcusburghardt marcusburghardt requested a review from mnriem as a code owner May 5, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant