feat(opencode): add Opencode plugin support#14
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Verify rules directory was created with all rule files | ||
| const rulesDir = path.join(testDir, ".claude", "rules"); | ||
| const ruleFiles = await fs.readdir(rulesDir); | ||
| expect(ruleFiles.length).toBe(7); |
There was a problem hiding this comment.
Fix rule count assertion to match template list
The harness copies every entry in RULE_TEMPLATES, which currently contains 8 files (including 07-strict-enforcement.md), so the rules directory will have 8 entries. This toBe(7) assertion will fail (and the OpenCode test below makes the same assumption), breaking CI as soon as the harness writes all templates. Consider asserting against RULE_TEMPLATES.length or updating the expected count to 8.
Useful? React with 👍 / 👎.
- Fix invalid 'tools' configuration in agent markdown files for OpenCode compatibility - Implement filesystem scanning in 'status' command to auto-discover new task files - Update installer to correctly copy agent definitions - Add 'spec' command support to OpenCode plugin - Update SKILL files to use correct subagent naming conventions
mylukin
left a comment
There was a problem hiding this comment.
Review: Changes Required Before Merge
Thanks for adding OpenCode plugin support! However, there are a few issues that need to be addressed before this PR can be merged.
1. ⚠️ Test Assertion Bug (P2)
As Codex correctly identified, the test at tests/init-helpers.test.ts:389 has an incorrect assertion:
expect(ruleFiles.length).toBe(7); // ❌ WrongRULE_TEMPLATES contains 8 entries (indices 0-7, including 07-strict-enforcement.md), so this test will fail.
Fix:
// Option 1: Use the constant (recommended - future-proof)
expect(ruleFiles.length).toBe(RULE_TEMPLATES.length);
// Option 2: Update the hardcoded value
expect(ruleFiles.length).toBe(8);2. 🚨 Critical: SKILL.md subagent_type Format Change Breaks Claude Code
The PR changes subagent_type format from colon to hyphen in shared SKILL.md files:
| Original (Claude Code format) | Changed to |
|---|---|
agent-foreman:implementer |
agent-foreman-implementer |
agent-foreman:pm |
agent-foreman-pm |
agent-foreman:ux |
agent-foreman-ux |
agent-foreman:tech |
agent-foreman-tech |
agent-foreman:qa |
agent-foreman-qa |
agent-foreman:breakdown-writer |
agent-foreman-breakdown-writer |
This will break Claude Code plugin functionality. Claude Code uses the colon format (plugin:agent) to identify subagents. The SKILL.md files are shared between both platforms.
Affected files:
plugins/agent-foreman/skills/feature-run/SKILL.mdplugins/agent-foreman/skills/foreman-spec/SKILL.md
3. 🚨 Critical: Slash Command Format Change
The PR also changes slash command formats:
| Original | Changed to |
|---|---|
/agent-foreman:run |
/agent-foreman-run |
This is also incorrect for Claude Code compatibility.
Recommended Solution
If OpenCode requires a different format, please:
- Keep the original colon format in SKILL.md files - These are used by Claude Code
- Handle format conversion in OpenCode plugin code - Transform the format at runtime in
opencode-plugin.js - Or create separate OpenCode-specific skill files - e.g.,
skills/feature-run/SKILL_OPENCODE.md
The shared SKILL.md files should remain compatible with Claude Code's expected format.
Please address these issues and I'll be happy to re-review. Let me know if you have any questions!
Adds agent-foreman install --opencode to easily install the plugin into OpenCode projects. Utilizes opencode plugin and tool setup to mimic claude code plugin functionality