feat: add OpenCode skills configuration and generation pipeline (fixes #74)#98
Open
hnshah wants to merge 1 commit intohuggingface:mainfrom
Open
feat: add OpenCode skills configuration and generation pipeline (fixes #74)#98hnshah wants to merge 1 commit intohuggingface:mainfrom
hnshah wants to merge 1 commit intohuggingface:mainfrom
Conversation
…huggingface#74) **Adds:** 1. scripts/generate_opencode_config.py - Generator for opencode.json 2. opencode.json - Generated OpenCode configuration (13 skills) 3. Updated scripts/publish.sh - Integrated OpenCode generation 4. Updated README.md - OpenCode usage documentation **Configuration includes:** - Skill discovery settings (skills/ directory, agent-skills format) - All 13 skill entries with names, descriptions, and paths - AGENTS context file reference (agents/AGENTS.md) - MCP server configuration aligned with gemini-extension.json **Generation Pipeline:** - Reuses .claude-plugin/plugin.json as primary metadata source - Discovers skills from skills/*/SKILL.md frontmatter - Extracts MCP server URL from gemini-extension.json - Validates with --check flag (integrated into CI workflow) - Follows same pattern as generate_cursor_plugin.py **Design Goals (from issue huggingface#74):** ✅ First-class OpenCode integration ✅ Reproducible and consistent with other agents ✅ Auto-generated to avoid manual drift ✅ Validation via --check flow ✅ Documentation in README **Testing:** - Generated opencode.json with all 13 skills - Verified JSON structure - Ran ./scripts/publish.sh successfully - Tested --check validation **Benefits:** - OpenCode can discover and load all skills consistently - Reduces onboarding friction for OpenCode users - Keeps configuration in sync with Claude/Cursor/Gemini - Follows Agent Skills standard Fixes huggingface#74
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds first-class OpenCode integration for this repository so OpenCode can discover and load all skills consistently with other agents.
Fixes #74
Changes
1. New Generator Script
scripts/generate_opencode_config.pyskills/*/SKILL.md.claude-plugin/plugin.jsonfor metadata (version, description)gemini-extension.jsonopencode.jsonwith complete configuration--checkflag for validationFollows same pattern as
generate_cursor_plugin.py:uv run scripts/generate_opencode_config.py2. Generated Configuration
opencode.jsonincludes:skills/directory,agent-skillsformat)agents/AGENTS.md)Structure:
{ "name": "huggingface-skills", "version": "1.0.1", "skills": { "discovery": { "locations": ["skills/"], "format": "agent-skills" }, "entries": [ /* all 13 skills */ ] }, "context": { "agentsFile": "agents/AGENTS.md" }, "mcpServers": { /* HF MCP server */ } }3. Updated Generation Pipeline
scripts/publish.shopencode.jsontoGENERATED_FILESarraygenerate_opencode_config.pyintorun_generate()--checkvalidation for OpenCode artifactsopencode.json4. Documentation
README.md./scripts/publish.shDesign Goals (from issue #74)
✅ Reproducible: Auto-generated from single source of truth
✅ Consistent: Aligned with Claude/Cursor/Gemini integrations
✅ Validated:
--checkflag prevents drift✅ Documented: Clear README section for users/contributors
✅ Maintainable: Follows existing generator patterns
Testing
Generation:
Validation:
./scripts/publish.sh --check # All generated artifacts are up to date.Output verification:
gemini-extension.jsonBenefits
For OpenCode users:
For contributors:
opencode.jsonmaintenanceFor maintainers:
Implementation Notes
Generator follows established patterns:
parse_frontmatter()pattern fromgenerate_cursor_plugin.pyIntegration is minimal:
publish.shgenerationChecklist
scripts/generate_opencode_config.pyopencode.jsonwith all skillsscripts/publish.sh(generate + check + help)Ready for review! 🚀