Skip to content

Feature Request: Add OpenCode as a Translator Output Target #29

Description

@jorcleme

Summary

Add OpenCode as a supported output target in the convert_to_ide_formats.py translator pipeline. This would allow OpenCode users to benefit from Project CodeGuard's security skills and rules without needing to manually restructure the output into OpenCode's required directory/file format.

Problem

OpenCode is an open-source AI coding agent with a growing developer community, including teams within Cisco. It supports a native skill discovery system, but its format requirements make it incompatible with Project CodeGuard's current output structure out of the box.

Today, an OpenCode user who wants to use CodeGuard skills has to:

  1. Download the release
  2. Manually create a named directory for each skill (e.g., .opencode/skills/software-security/)
  3. Ensure the directory name exactly matches the name field in the SKILL.md frontmatter
  4. Place each SKILL.md into its corresponding directory
  5. Verify that any relative path references (e.g., to rules/ files) still resolve correctly from the new location

This per-skill directory scaffolding is tedious and error-prone, especially as the number of skills grows. The existing translators for Cursor, Windsurf, Copilot, etc. solve this exact problem for their respective platforms — OpenCode should get the same treatment.

OpenCode Skill Format Requirements

OpenCode discovers skills by scanning for SKILL.md files in specific directory structures. Each skill must live in its own named directory:

.opencode/skills/<skill-name>/SKILL.md

OpenCode also searches these compatible paths:

  • .claude/skills/<skill-name>/SKILL.md
  • .agents/skills/<skill-name>/SKILL.md
  • ~/.config/opencode/skills/<skill-name>/SKILL.md (global)

Critical constraint: The directory name must match the name field in the SKILL.md YAML frontmatter. If name: software-security, the file must live at .opencode/skills/software-security/SKILL.md.

Required YAML frontmatter:

---
name: software-security       # required, 1-64 chars, lowercase alphanumeric with single hyphens
description: >-               # required, 1-1024 chars
  Security guidance based on Project CodeGuard to help AI coding agents
  generate secure code and prevent common vulnerabilities.
license: CC-BY-4.0            # optional
compatibility: opencode        # optional
metadata:                      # optional, string-to-string map
  framework: "Project CodeGuard"
  codeguard-version: "1.3.0"
---

Name validation rules:

  • 1–64 characters
  • Lowercase alphanumeric with single hyphen separators
  • Cannot start or end with -
  • No consecutive --
  • Regex: ^[a-z0-9]+(-[a-z0-9]+)*$

Full specification: https://opencode.ai/docs/skills/

Proposed Approach

Add an OpenCode output target to convert_to_ide_formats.py that:

  1. Creates the .opencode/skills/<skill-name>/ directory structure for each skill
  2. Generates a SKILL.md per skill with compliant YAML frontmatter (validated name, description within 1-1024 chars, etc.)
  3. Copies or resolves any referenced resources (e.g., rules/ files) so relative paths work from the new skill location
  4. Includes the .opencode/ output in release ZIPs alongside the existing IDE-specific formats

Willingness to Contribute

I'm happy to submit a PR implementing this if the maintainers are on board with the approach. I'd follow the existing translator patterns in the codebase to keep things consistent.

References

Metadata

Metadata

Labels

enhancementNew feature or request

Fields

No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions