feat(opencode): add native skills mode (--skills) for opencode#3539
Open
Securiteru wants to merge 1 commit into
Open
feat(opencode): add native skills mode (--skills) for opencode#3539Securiteru wants to merge 1 commit into
Securiteru wants to merge 1 commit into
Conversation
opencode's native extension mechanism is skills (.opencode/skills/<name>/SKILL.md with name+description frontmatter), as used by ~/.config/opencode/skills/. The opencode integration previously installed only legacy markdown commands (.opencode/commands/), which modern opencode does not auto-load. Add a --skills option (mirroring Copilot's pattern) that installs Spec Kit commands as native opencode skills under .opencode/skills/speckit-<name>/SKILL.md. Commands remain the default for backward compatibility; the two modes are mutually exclusive. - OpencodeIntegration(MarkdownIntegration) gains options()/setup() branching - _OpencodeSkillsHelper(SkillsIntegration) is an internal, unregistered delegate - effective_invoke_separator/build_command_invocation adapt to skills mode - build_exec_args (opencode run dispatch) preserved unchanged - Tests cover: skill file layout, frontmatter, hyphen separator, init flow Verified: specify init --integration opencode --integration-options=--skills produces 10 .opencode/skills/speckit-*/SKILL.md; default still produces .opencode/commands/; codex unchanged.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds opt-in OpenCode native skills scaffolding while retaining legacy command-mode compatibility.
Changes:
- Adds
--skillssetup and invocation handling. - Adds tests for layout, frontmatter, separators, and initialization.
Show a summary per file
| File | Description |
|---|---|
src/specify_cli/integrations/opencode/__init__.py |
Implements OpenCode skills mode. |
tests/integrations/test_integration_opencode.py |
Tests skills-mode behavior. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 4
- Review effort level: Medium
Comment on lines
+100
to
+104
| if self._skills_mode: | ||
| stem = command_name | ||
| if stem.startswith("speckit."): | ||
| stem = stem[len("speckit."):] | ||
| invocation = "/speckit-" + stem.replace(".", "-") |
Comment on lines
+281
to
+283
| assert result.exit_code == 0, f"init failed: {result.output}" | ||
| assert (target / ".opencode" / "skills" / "speckit-specify" / "SKILL.md").exists() | ||
| assert not (target / ".opencode" / "commands").exists() |
Comment on lines
+5
to
+9
| - **Skills** (native, recommended): ``.opencode/skills/<name>/SKILL.md`` at the | ||
| project level and ``~/.config/opencode/skills/`` globally. Skills carry | ||
| ``name`` + ``description`` frontmatter and are invoked as ``/speckit-<name>``. | ||
| - **Commands** (legacy): ``.opencode/commands/speckit.<name>.md`` slash-command | ||
| files, with ``.opencode/command/`` as a deprecated predecessor. |
Comment on lines
+202
to
+205
| class TestOpencodeSkillsMode: | ||
| """``--skills`` installs native opencode skills under .opencode/skills/.""" | ||
|
|
||
| KEY = "opencode" |
Collaborator
|
Please address Copilot feedback |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
opencode's native extension mechanism is skills (
.opencode/skills/<name>/SKILL.mdwithname+descriptionfrontmatter — the layout~/.config/opencode/skills/uses). Theopencodeintegration currently installs only legacy markdown commands (.opencode/commands/), which modern opencode does not auto-load.This adds a
--skillsoption to the opencode integration (mirroring the existing Copilot--skillspattern) that installs Spec Kit commands as native opencode skills under.opencode/skills/speckit-<name>/SKILL.md. Commands remain the default for backward compatibility; the two modes are mutually exclusive.Why
Users running opencode today get command files that opencode doesn't load as skills.
--skillsproduces the native skill layout opencode discovers automatically, makingspecify init --integration opencode --integration-options="--skills"actually usable end-to-end with opencode.What changed
OpencodeIntegration(MarkdownIntegration)gainsoptions()(--skillsflag) and asetup()branch._OpencodeSkillsHelper(SkillsIntegration)— internal, unregistered delegate that installs skills to.opencode/skills/(config folder.opencode/, subdirskills, registrar extension/SKILL.md).effective_invoke_separator/build_command_invocationadapt to hyphenated (/speckit-<name>) invocations in skills mode.post_process_skill_contentdelegates to the helper for shared hook-guidance injection.build_exec_args(theopencode run --commanddispatch) is preserved unchanged.Verification
specify init --integration opencode --integration-options="--skills"→ 10.opencode/skills/speckit-*/SKILL.md(nocommands/dir).specify init --integration opencode(default) → legacy.opencode/commands/speckit.*.md(unchanged).specify init --integration codex→ unchanged.TestOpencodeSkillsModecovering skill layout, frontmatter, hyphen separator, init flow. 72/72 opencode+codex tests pass; 2461/2462 broader suite (1 pre-existing unrelated failure in a workflow URL-download test).Backward compatibility
Default behaviour is unchanged (commands).
--skillsis opt-in. Existing opencode tests (commands mode, legacy-dir migration) all pass unmodified.Checklist
--skillspatternbuild_exec_argsdispatch preserved