Skip to content

Add YAML frontmatter to generated SKILL.md files#8

Merged
ClankerGuru merged 3 commits into
mainfrom
add-skill-frontmatter
Apr 16, 2026
Merged

Add YAML frontmatter to generated SKILL.md files#8
ClankerGuru merged 3 commits into
mainfrom
add-skill-frontmatter

Conversation

@ClankerGuru
Copy link
Copy Markdown
Owner

@ClankerGuru ClankerGuru commented Apr 16, 2026

Summary

  • Generated SKILL.md files now include YAML frontmatter (name + description) per the agentskills.io spec
  • Adds SKILL_TRIGGERS map with "when to use" context for skill discovery by Copilot and other agents
  • Fixes Copilot failing to load all 93 skills with "missing or malformed YAML frontmatter"

Test plan

  • Run opsx-sync and verify generated SKILL.md files have --- frontmatter
  • Verify Copilot loads skills without errors
  • Verify Claude Code skills still load correctly

Summary by CodeRabbit

  • New Features
    • Skills now include context-aware "when to use" trigger descriptions in metadata.
    • Enhanced skill documentation with trigger-based guidance for improved task discovery.

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.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 16, 2026

Warning

Rate limit exceeded

@ClankerGuru has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 9 minutes and 15 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 51e66cc5-70c3-4347-b619-c99f64c9da1c

📥 Commits

Reviewing files that changed from the base of the PR and between 22cd06b and f1b3836.

📒 Files selected for processing (2)
  • src/main/kotlin/zone/clanker/opsx/skill/SkillGenerator.kt
  • src/test/kotlin/zone/clanker/opsx/skill/SkillGeneratorTest.kt
📝 Walkthrough

Walkthrough

The buildCommandFile function in SkillGenerator.kt was refactored to normalize skill descriptions earlier and wrap content with YAML frontmatter. A new internal SKILL_TRIGGERS map defines trigger phrases for various task names, which conditionally augment the YAML description field when generating skill files.

Changes

Cohort / File(s) Summary
Skill Description and Frontmatter Generation
src/main/kotlin/zone/clanker/opsx/skill/SkillGenerator.kt
Added new internal SKILL_TRIGGERS map to companion object with "use when…" trigger text for task names. Refactored buildCommandFile to derive non-empty desc once, conditionally format YAML frontmatter description (augmented with trigger phrase if task found in map), and reorganize description normalization to occur before frontmatter generation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A trigger here, a trigger there,
Descriptions fold with skillful care,
YAML frontmatter wraps each skill so bright,
When tasks align, the triggers ignite! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding YAML frontmatter to generated SKILL.md files, which aligns with the core objective and file modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-skill-frontmatter

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_TRIGGERS now 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

📥 Commits

Reviewing files that changed from the base of the PR and between 1f907cf and 22cd06b.

📒 Files selected for processing (1)
  • src/main/kotlin/zone/clanker/opsx/skill/SkillGenerator.kt

Comment thread src/main/kotlin/zone/clanker/opsx/skill/SkillGenerator.kt Outdated
@ClankerGuru
Copy link
Copy Markdown
Owner Author

Thanks for the review! Addressing both findings.

   (\__/)
   (•ㅅ•)    ~ on it!
   / > 🥕

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.
@ClankerGuru ClankerGuru merged commit dcbd7d0 into main Apr 16, 2026
2 checks passed
@ClankerGuru ClankerGuru deleted the add-skill-frontmatter branch April 16, 2026 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant