Add YAML frontmatter to generated SKILL.md files#8
Conversation
SKILL.md files lacked the YAML frontmatter required by the agentskills.io spec, causing Copilot to fail loading all 93 skills with "missing or malformed YAML frontmatter" errors. Adds name + description fields (with "when to use" triggers for skill discovery) to buildCommandFile() output, and a SKILL_TRIGGERS map for per-task activation context.
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 9 minutes and 15 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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 |
The frontmatter block adds necessary lines that push the method past the 60-line threshold. Extracting it hits TooManyFunctions on the class, so suppress is the cleaner option.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/main/kotlin/zone/clanker/opsx/skill/SkillGenerator.kt (1)
677-717: Add regression tests for trigger-enriched frontmatter output.
SKILL_TRIGGERSnow affects serialized YAML, but current tests (src/test/kotlin/zone/clanker/opsx/skill/SkillGeneratorTest.kt Line 42-69 and Line 104-113) only assert markdown body content. Please add assertions for frontmatter shape (---,name,description) for both mapped and unmapped tasks.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/main/kotlin/zone/clanker/opsx/skill/SkillGenerator.kt` around lines 677 - 717, Tests in SkillGeneratorTest must be extended to assert the YAML frontmatter produced by SkillGenerator includes the frontmatter delimiter and required keys; update the two test cases that currently only check markdown body (in SkillGeneratorTest) to also verify the serialized output contains the leading '---' marker and the frontmatter fields 'name' and 'description' for both a task whose trigger is present in SKILL_TRIGGERS and one whose trigger is not mapped. Locate the tests that call the generator, capture the full generated string, and add assertions that the frontmatter block exists (starts with '---') and contains "name:" and "description:" entries for both mapped and unmapped task inputs.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/main/kotlin/zone/clanker/opsx/skill/SkillGenerator.kt`:
- Around line 117-126: The frontmatter generation emits unescaped plain scalars
(description and whenToUse) which can break YAML; implement a YAML-escaping
helper (e.g., yamlSingleQuoted(value: String) that returns a single-quoted,
single-quote-escaped string) and use it when emitting the description and
whenToUse values in SkillGenerator (replace direct append/appendLine of desc and
"$desc $whenToUse" with calls to yamlSingleQuoted(task.description or desc) and
yamlSingleQuoted(whenToUse) so name, description and any combined description
text are safely quoted).
---
Nitpick comments:
In `@src/main/kotlin/zone/clanker/opsx/skill/SkillGenerator.kt`:
- Around line 677-717: Tests in SkillGeneratorTest must be extended to assert
the YAML frontmatter produced by SkillGenerator includes the frontmatter
delimiter and required keys; update the two test cases that currently only check
markdown body (in SkillGeneratorTest) to also verify the serialized output
contains the leading '---' marker and the frontmatter fields 'name' and
'description' for both a task whose trigger is present in SKILL_TRIGGERS and one
whose trigger is not mapped. Locate the tests that call the generator, capture
the full generated string, and add assertions that the frontmatter block exists
(starts with '---') and contains "name:" and "description:" entries for both
mapped and unmapped task inputs.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9e37785b-1dd9-4996-ba3f-9af662673fbf
📒 Files selected for processing (1)
src/main/kotlin/zone/clanker/opsx/skill/SkillGenerator.kt
|
Thanks for the review! Addressing both findings. |
Switches description to block scalar (|) so values containing colons, hashes, or newlines won't break the YAML frontmatter. Adds test coverage for frontmatter shape on both mapped (with SKILL_TRIGGERS) and unmapped tasks.
Summary
name+description) per the agentskills.io specSKILL_TRIGGERSmap with "when to use" context for skill discovery by Copilot and other agentsTest plan
opsx-syncand verify generated SKILL.md files have---frontmatterSummary by CodeRabbit