feat(AI-012): port Claude skills to OpenCode commands#43
Merged
Conversation
Adds scripts/skills-to-opencode.sh that mechanically transforms ai/skills/<name>/SKILL.md into ai/opencode/commands/<name>.md. Format transform (single AWK pass): - Drop the `name:` line in YAML frontmatter (OpenCode uses the *filename* as the command identifier, so audit.md becomes /audit in the TUI). - Keep `description:` and any other frontmatter fields. - Copy the markdown body verbatim. Skip-list (Claude-only primitives that would not work in OpenCode): - creating-skills meta-skill for Claude skill anatomy - dispatching-parallel-agents uses Task subagent_type - crystallize, insights depend on claude-mem (Anthropic-only MCP) - executing-plans depends on TaskCreate primitive Result: 12 portable commands, 5 skipped. Each generated command is a 1:1 derivative of its SKILL.md source. CLI: - ./scripts/skills-to-opencode.sh generate or sync - ./scripts/skills-to-opencode.sh --check CI gate: exit 1 if drift - ./scripts/skills-to-opencode.sh --help usage Idempotence: re-running with identical inputs is a no-op. Orphan command files (no matching skill, not on the skip-list) are removed on regen and flagged on --check. Deploy: setup-linux.sh now copies ai/opencode/commands/*.md to ~/.config/opencode/commands/ alongside the existing opencode.jsonc deploy. Orphan removal at the deploy layer mirrors the same logic at the source layer, so removing a skill from ai/skills/ propagates to the user's machine on the next setup run. CI: a new step in the `lint` job runs `./scripts/skills-to-opencode.sh --check`, so a SKILL.md edit without a matching command regen fails CI loudly rather than silently drifting. Windows side deferred: setup-windows.ps1 has no opencode bootstrap yet (AI-014 pending). When that lands, it will add the equivalent deploy block and optionally a skills-to-opencode.ps1 regen script for parity. Tests: - tests/skills-to-opencode.bats: 23 assertions (script existence, syntax, generated file count, skip-list enforcement, frontmatter transform correctness, body preservation, drift detection on mutated/orphan files, idempotence, --help, unknown-arg rejection). - tests/verify-setup.bats: new assertion in the integration container verifying the deploy block creates ~/.config/opencode/commands/ with the expected 12 portable files. First concrete chunk of the AI-015-harness-parity-across-agents umbrella.
This was referenced May 18, 2026
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
First concrete chunk of the AI-015-harness-parity-across-agents umbrella. Ports the 17 Claude Code skills under
ai/skills/<name>/SKILL.mdinto 12 OpenCode commands underai/opencode/commands/<name>.md. 5 Claude-only skills are deliberately skipped.What
scripts/skills-to-opencode.sh— deterministic AWK-based transform. Dropsname:from frontmatter (OpenCode uses the filename as command identifier), keepsdescription:, copies body verbatim.ai/opencode/commands/*.md— 12 generated files committed to repo, in sync with theirai/skills/sources.setup-linux.shdeploy block — copies the commands directory to~/.config/opencode/commands/alongside the existingopencode.jsoncdeploy; idempotent; removes orphans.--checkCI gate inlintjob — fails the build if aSKILL.mdis edited without regenerating its matching command.tests/skills-to-opencode.bats+ 1 intests/verify-setup.bats(integration container).Skip-list (Claude-only primitives, would not work in OpenCode)
creating-skillsdispatching-parallel-agentscrystallizeinsightsexecuting-plansThe 12 portable skills cover the bulk of the daily workflow: audit, debug-hardware, docker, prd-to-issues, project-maturation, systematic-debugging, test, test-driven-development, using-git-worktrees, vault-doctor (Hive MCP works in OpenCode too), verification-before-completion, writing-plans.
Out of scope (deferred)
setup-windows.ps1has no opencode bootstrap yet (AI-014 pending). When AI-014 lands, it will add the equivalent deploy block + optionally ascripts/skills-to-opencode.ps1regen script..opencode/commands/. This PR deploys globally to~/.config/opencode/commands/. Per-project override is supported by OpenCode but not addressed here.Test plan
bats tests/skills-to-opencode.bats— 23/23 greenbats tests/*.bats— 517/517 green (no regression)shellcheck scripts/skills-to-opencode.shcleanbash -n+zsh -nboth clean./scripts/skills-to-opencode.sh --checkexits 0 (no drift)--checkfail (test feat(scripts): add init-repo-standards generator (SDD-010) #19)--checkfail (test setup-windows.ps1: SessionStart hook points to wrong deploy path #20)Cross-links
10_projects/dotfiles/11-tasks.md-> AI-01230-architecture/adr-009-multi-agent-runtime(vault)