Skip to content

feat: add skill rendering with <skill>name</skill> syntax#24

Merged
JosXa merged 1 commit intomainfrom
opencode-agent/issue-22
Feb 1, 2026
Merged

feat: add skill rendering with <skill>name</skill> syntax#24
JosXa merged 1 commit intomainfrom
opencode-agent/issue-22

Conversation

@JosXa
Copy link
Copy Markdown
Owner

@JosXa JosXa commented Jan 31, 2026

Summary

Implements skill rendering in snippets as requested in #22.

Features

  • New experimental flag: experimental.skillRendering (disabled by default)
  • Two syntax options:
    • Block format: <skill>jira</skill>
    • Self-closing: <skill name="jira" />
  • Skill loading from standard OpenCode paths:
    • Global: ~/.config/opencode/skill[s]/<name>/SKILL.md
    • Project: .opencode/skill[s]/<name>/SKILL.md
    • Claude compatibility: .claude/skills/<name>/SKILL.md
  • Renders skill body verbatim (excludes YAML frontmatter)
  • Processing order: skills → snippets → shell commands

Usage

  1. Enable the feature in your config:

    {
      "experimental": {
        "skillRendering": true
      }
    }
  2. Reference skills in your snippets or messages:

    Create a bug ticket. <skill>jira</skill>

Files Changed

  • src/config.ts - Added experimental.skillRendering flag
  • src/constants.ts - Added skill tag regex patterns
  • src/skill-loader.ts - New file for loading skills from disk
  • src/skill-renderer.ts - New file for expanding skill tags
  • src/skill-renderer.test.ts - Comprehensive test suite
  • index.ts - Integration of skill loading and rendering
  • schema/config.schema.json - Updated config schema

Closes #22

@JosXa JosXa mentioned this pull request Jan 31, 2026
@JosXa
Copy link
Copy Markdown
Owner Author

JosXa commented Feb 1, 2026

Yo opencode, please rebase. Another branch added experimental settings

Adds support for rendering OpenCode skills inline within snippets.

- Introduces experimental.skillRendering config flag (disabled by default)
- Supports two syntaxes: <skill>name</skill> and <skill name="name" />
- Loads skills from standard OpenCode paths:
  - ~/.config/opencode/skill[s]/<name>/SKILL.md (global)
  - .opencode/skill[s]/<name>/SKILL.md (project)
  - .claude/skills/<name>/SKILL.md (Claude Code compatibility)
- Skills are rendered verbatim (body only, excludes frontmatter)
- Processing order: skills → snippets → shell commands
- Includes comprehensive tests for skill rendering

Closes #22
@JosXa JosXa force-pushed the opencode-agent/issue-22 branch from a8b1d21 to 9946200 Compare February 1, 2026 15:26
@JosXa
Copy link
Copy Markdown
Owner Author

JosXa commented Feb 1, 2026

Done! Rebased onto main and resolved the conflict in index.ts where the session.idle handler from the inject tag feature was merged.

The merge conflict was straightforward - I combined both changes:

  • The session.idle hook from main (for cleaning up injections)
  • The skill rendering features from this PR

All tests pass ✓

@JosXa JosXa merged commit b4e665b into main Feb 1, 2026
3 checks passed
@JosXa JosXa deleted the opencode-agent/issue-22 branch February 1, 2026 15:38
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.

Skill rendering

1 participant