Skip to content

Conversation

@Momentum96
Copy link
Contributor

@Momentum96 Momentum96 commented Jan 12, 2026

Summary

Fixes a bug where skills loaded from ~/.claude/skills (and other directories processed by opencode-skill-loader) would return empty text when invoked as slash commands.

Problem

The opencode-skill-loader was initializing CommandDefinition.template as an empty string ("") and relying on lazyContent.load() to populate it. However, the OpenCode command system likely accesses the template property directly without triggering the lazy loader, resulting in empty output.

Solution

Modified src/features/opencode-skill-loader/loader.ts to implement eager loading, similar to how claude-code-plugin-loader works:

  1. Destructure body from parseFrontmatter immediately.
  2. Construct the template string with the <skill-instruction> wrapper.
  3. Assign the content directly to definition.template.
  4. Update lazyContent to return the pre-loaded content (preserving interface compatibility but removing the double file read).

Verification

  • bun run typecheck passed
  • bun run build passed
  • Verified locally by loading the plugin in OpenCode and invoking a skill from ~/.claude/skills.

Summary by cubic

Fixes empty output from skill slash commands by eagerly loading skill templates in opencode-skill-loader. Aligns behavior with claude-code-plugin-loader and removes unnecessary file reads.

  • Bug Fixes
    • Parse frontmatter body once and build the template.
    • Set definition.template immediately; lazyContent returns the preloaded string.
    • Prevents empty templates for skills from ~/.claude/skills and project directories.

Written for commit 79bd75b. Summary will update on new commits.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 12, 2026

All contributors have signed the CLA. Thank you! ✅
Posted by the CLA Assistant Lite bot.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@Momentum96
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Jan 12, 2026
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Ask questions if you need clarification on any suggestion

- Extract body during initial parseFrontmatter call
- Rename lazyContent → eagerLoader with rationale comment
- Eliminates redundant file read and race condition
@kdcokenny
Copy link
Collaborator

thx for the contribution!

@kdcokenny kdcokenny merged commit d9aabb3 into code-yeongyu:dev Jan 13, 2026
3 checks passed
kdcokenny pushed a commit that referenced this pull request Jan 13, 2026
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.

2 participants