t2732: Add missing 'name' field to skill frontmatter#2733
t2732: Add missing 'name' field to skill frontmatter#2733alex-solovyev merged 2 commits intomainfrom
Conversation
All 11 imported skills registered in skill-sources.json were missing the required 'name' field in their YAML frontmatter, causing opencode to error on startup when loading skills from ~/.config/opencode/skills/. Added name: <directory-name> to each skill source file: - remotion, video-prompt-design, caldav-calendar, cloudron-server-ops, cloudron-app-publishing, cloudflare-platform, proxmox-full, cloudron-app-packaging, heygen, animejs, seo-audit Also added a skill-frontmatter lint check to linters-local.sh that validates all registered skills have a 'name' field matching their skill-sources.json entry, preventing regression. Closes #2732
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses critical startup errors in opencode by ensuring that all imported skill files contain a mandatory 'name' field in their YAML frontmatter. This change not only fixes existing issues but also introduces a robust linting mechanism to prevent similar problems from recurring, thereby improving the stability and maintainability of the skill loading process. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
WalkthroughAdds a shell-based skill frontmatter validator and updates 11 skill markdown files to include Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer / CI
participant Linter as linters-local.sh
participant Registry as skill-sources.json
participant FS as Skill SKILL.md files
Dev->>Linter: run linter (skill-frontmatter gate)
Linter->>Registry: read .skills list (jq)
Registry-->>Linter: list of skill entries
loop for each skill
Linter->>FS: load skill's SKILL.md frontmatter
FS-->>Linter: frontmatter YAML (name)
Linter->>Linter: compare registered name vs frontmatter name
alt mismatch or missing
Linter->>Dev: print error (missing file/name or mismatch)
else match
Linter->>Dev: print success for skill
end
end
Linter->>Dev: exit non-zero if any errors
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Mon Mar 2 22:06:57 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.agents/scripts/linters-local.sh:
- Around line 647-652: The current assignment to skill_count using
"skill_count=$(jq '.skills | length' "$skill_sources" 2>/dev/null || echo "0")"
masks jq parse errors; change it to run jq without the "|| echo '0'", capture
jq's exit status, and on failure print an error referencing "$skill_sources" and
exit/return non-zero so the script fails fast; update the same pattern at the
other occurrence (the second jq call around skill validation) and ensure the
downstream if [[ "$skill_count" -eq 0 ]] branch still works when jq succeeded.
- Around line 666-674: The fm_name extraction should only search the initial
frontmatter block and strip inline YAML comments: change the awk script used for
fm_name (reading "$local_path") to first detect an opening frontmatter only at
the file start (e.g., begin scanning only after the first /^---$/ and stop after
the next /^---$/ so you don't toggle on every ---), then when matching /^name:/
remove the key prefix, strip any inline comment portion (e.g., sub(/#.*/, "") or
similar) and then strip surrounding quotes (the existing gsub for quotes can
remain), print the cleaned value and exit to avoid reading from the document
body.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (12)
.agents/scripts/linters-local.sh.agents/seo/seo-audit-skill.md.agents/services/hosting/cloudflare-platform.md.agents/services/hosting/proxmox-full-skill.md.agents/tools/animation/animejs.md.agents/tools/deployment/cloudron-app-packaging-skill.md.agents/tools/deployment/cloudron-app-publishing-skill.md.agents/tools/deployment/cloudron-server-ops-skill.md.agents/tools/productivity/caldav-calendar-skill.md.agents/tools/video/heygen-skill.md.agents/tools/video/remotion.md.agents/tools/video/video-prompt-design.md
There was a problem hiding this comment.
Code Review
This pull request fixes missing name fields in skill frontmatter, which caused startup errors, by updating 11 skill files and introducing a new linter check in linters-local.sh to prevent future regressions. However, the new check_skill_frontmatter lint gate in .agents/scripts/linters-local.sh introduces a potential command injection vulnerability, as file paths are passed directly to awk without proper sanitization, which could lead to arbitrary code execution. I've also provided suggestions to improve the robustness of the linter script's jq commands to avoid suppressing errors, which will help in debugging malformed JSON configuration files.
| fm_name=$(awk ' | ||
| /^---$/ { in_fm = !in_fm; next } | ||
| in_fm && /^name:/ { | ||
| sub(/^name: */, "") | ||
| gsub(/^["'"'"']|["'"'"']$/, "") | ||
| exit | ||
| } | ||
| ' "$local_path") |
There was a problem hiding this comment.
The check_skill_frontmatter function reads file paths from skill-sources.json and passes them directly to awk. If a file path starts with a hyphen (e.g., -f/path/to/script), awk will interpret it as an option. An attacker can exploit this to execute arbitrary awk code, which can in turn execute shell commands via the system() function. This is particularly dangerous in CI/CD environments where the linter might be run on untrusted PR content.
| fm_name=$(awk ' | |
| /^---$/ { in_fm = !in_fm; next } | |
| in_fm && /^name:/ { | |
| sub(/^name: */, "") | |
| gsub(/^["'"'"']|["'"'"']$/, "") | |
| exit | |
| } | |
| ' "$local_path") | |
| fm_name=$(awk ' | |
| /^---$/ { in_fm = !in_fm; next } | |
| in_fm && /^name:/ { | |
| sub(/^name: */, "") | |
| gsub(/^[\"'"'"']|[\"'"'"']$/, "") | |
| exit | |
| } | |
| ' -- "$local_path") |
.agents/scripts/linters-local.sh
Outdated
| fi | ||
|
|
||
| local skill_count | ||
| skill_count=$(jq '.skills | length' "$skill_sources" 2>/dev/null || echo "0") |
There was a problem hiding this comment.
Suppressing stderr with 2>/dev/null can hide important syntax errors if skill-sources.json is malformed. You can make the jq query more robust by using the alternative operator // to provide a default empty array if .skills is null or doesn't exist. This avoids the error that || echo "0" is intended to catch, and allows you to remove the error suppression so that actual file format errors are visible.
This aligns with the project's general rule to avoid blanket error suppression.
| skill_count=$(jq '.skills | length' "$skill_sources" 2>/dev/null || echo "0") | |
| skill_count=$(jq '(.skills // []) | length' "$skill_sources") |
References
- Avoid using '2>/dev/null' for blanket suppression of command errors in shell scripts to ensure that authentication, syntax, or system issues remain visible for debugging.
.agents/scripts/linters-local.sh
Outdated
| fi | ||
|
|
||
| ((checked++)) || true | ||
| done < <(jq -r '.skills[] | "\(.name)|\(.local_path)"' "$skill_sources" 2>/dev/null) |
There was a problem hiding this comment.
Similar to the count check, suppressing stderr here with 2>/dev/null can hide JSON syntax errors. By using (.skills // [])[], the query will gracefully handle cases where skills is missing or null by iterating over an empty array, producing no output. This makes the error suppression unnecessary and ensures that developers are alerted to malformed JSON files.
This follows the project's general rule to avoid unnecessary error suppression.
| done < <(jq -r '.skills[] | "\(.name)|\(.local_path)"' "$skill_sources" 2>/dev/null) | |
| done < <(jq -r '(.skills // [])[] | "\(.name)|\(.local_path)"' "$skill_sources") |
References
- Avoid using '2>/dev/null' for blanket suppression of command errors in shell scripts to ensure that authentication, syntax, or system issues remain visible for debugging.
|
Pulse dispatched a worker to address the CodeRabbit CHANGES_REQUESTED items: (1) fix jq error masking in skill_count assignment (remove '|| echo 0' fallback), (2) fix awk frontmatter extraction to only scan the initial --- block and strip inline YAML comments. Worker PID 2953496. |
- Fail fast on jq parse errors instead of masking with || echo 0 - Restrict awk name extraction to initial frontmatter block only - Strip inline YAML comments from frontmatter name values - Pre-validate skill entries before loop iteration Closes #2732
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Mon Mar 2 22:40:21 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
Summary
namefield to YAML frontmatter in all 11 imported skill source files, fixing opencode startup errors when loading skills from~/.config/opencode/skills/check_skill_frontmatterlint gate tolinters-local.shthat validates all registered skills have a correctnamefield, preventing regressionDetails
Skills deployed to
~/.config/opencode/skills/<name>/SKILL.mdare symlinks to source.mdfiles in the repo (viacreate_skill_symlinks()insetup-modules/plugins.sh). The opencode skill loader requires anamefield in the YAML frontmatter matching the directory name. All 11 skills were missing this field.Files fixed
.agents/tools/video/remotion.md.agents/tools/video/video-prompt-design.md.agents/tools/productivity/caldav-calendar-skill.md.agents/tools/deployment/cloudron-server-ops-skill.md.agents/tools/deployment/cloudron-app-publishing-skill.md.agents/services/hosting/cloudflare-platform.md.agents/services/hosting/proxmox-full-skill.md.agents/tools/deployment/cloudron-app-packaging-skill.md.agents/tools/video/heygen-skill.md.agents/tools/animation/animejs.md.agents/seo/seo-audit-skill.mdRegression prevention
Added
check_skill_frontmattertolinters-local.sh(gated asskill-frontmatter). It readsskill-sources.json, extracts thenamefield from each skill's frontmatter, and validates it matches the registered name. Runs as part of the standard lint suite.Closes #2732
Summary by CodeRabbit