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:
- Download the release
- Manually create a named directory for each skill (e.g.,
.opencode/skills/software-security/)
- Ensure the directory name exactly matches the
name field in the SKILL.md frontmatter
- Place each SKILL.md into its corresponding directory
- 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:
- Creates the
.opencode/skills/<skill-name>/ directory structure for each skill
- Generates a
SKILL.md per skill with compliant YAML frontmatter (validated name, description within 1-1024 chars, etc.)
- Copies or resolves any referenced resources (e.g.,
rules/ files) so relative paths work from the new skill location
- 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
Summary
Add OpenCode as a supported output target in the
convert_to_ide_formats.pytranslator 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:
.opencode/skills/software-security/)namefield in the SKILL.md frontmatterrules/files) still resolve correctly from the new locationThis 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.mdfiles in specific directory structures. Each skill must live in its own named directory: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
namefield in the SKILL.md YAML frontmatter. Ifname: software-security, the file must live at.opencode/skills/software-security/SKILL.md.Required YAML frontmatter:
Name validation rules:
---^[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.pythat:.opencode/skills/<skill-name>/directory structure for each skillSKILL.mdper skill with compliant YAML frontmatter (validatedname,descriptionwithin 1-1024 chars, etc.)rules/files) so relative paths work from the new skill location.opencode/output in release ZIPs alongside the existing IDE-specific formatsWillingness 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
skills/software-security/SKILL.md