Spec-compliant SKILL.md frontmatter#168
Conversation
📝 WalkthroughWalkthroughThe PR enforces a spec-compliant ChangesSKILL.md Frontmatter Schema Overhaul
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Suggested reviewers
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 docstrings
🧪 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/intent/src/staleness.ts (1)
530-548: 💤 Low valueMigration note: existing sync-state.json files may need regeneration.
The lookup key changed from frontmatter
nameto path-derivedrelName. Existing projects withsync-state.jsonkeyed by old multi-segment names (e.g.,routing/file-based) will not match the new leaf-segment keys (e.g.,file-based), potentially causing false staleness signals until the sync-state is regenerated.This appears intentional for spec compliance, but consider documenting this migration step in the changeset or docs.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/intent/src/staleness.ts` around lines 530 - 548, The lookup key for stored source SHAs has changed from the old frontmatter name field (which supported multi-segment paths like routing/file-based) to the new relName field (which uses only the leaf segment like file-based). Existing sync-state.json files keyed with the old multi-segment names will not match the new relName keys, potentially causing false staleness signals. Document this breaking change in the changeset and add migration guidance in the documentation explaining that existing projects with sync-state.json files may need to regenerate them to work with the new relName-based lookup key used in this staleness checking logic.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/intent/src/staleness.ts`:
- Around line 530-548: The lookup key for stored source SHAs has changed from
the old frontmatter name field (which supported multi-segment paths like
routing/file-based) to the new relName field (which uses only the leaf segment
like file-based). Existing sync-state.json files keyed with the old
multi-segment names will not match the new relName keys, potentially causing
false staleness signals. Document this breaking change in the changeset and add
migration guidance in the documentation explaining that existing projects with
sync-state.json files may need to regenerate them to work with the new
relName-based lookup key used in this staleness checking logic.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: b2d7ba2d-e318-4641-9f4f-00ab6048e1f6
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (12)
.changeset/frank-experts-build.mddocs/cli/intent-validate.mddocs/getting-started/quick-start-maintainers.mdpackage.jsonpackages/intent/meta/generate-skill/SKILL.mdpackages/intent/meta/tree-generator/SKILL.mdpackages/intent/src/commands/validate.tspackages/intent/src/scanner.tspackages/intent/src/staleness.tspackages/intent/tests/cli.test.tspackages/intent/tests/scanner.test.tsscripts/validate-skills.ts
💤 Files with no reviewable changes (1)
- scripts/validate-skills.ts
|
View your CI Pipeline Execution ↗ for commit f8639c0 ☁️ Nx Cloud last updated this comment at |
Closes #160
Makes generated
SKILL.mdfrontmatter compliant with the Agent Skills specification.Changes
namemust be a spec-legal leaf segment matching its parent directory: lowercase letters, numbers, and hyphens only, 64 characters max, no slashes.type,library,library_version, andframeworkmove under themetadatamap instead of being top-level keys.intent validatenow errors on: a slash/non-leafname, anamewith non-spec characters, anameover 64 characters, non-spec top-level scalar keys, and a non-stringmetadatamap.name.generate-skillandtree-generatortemplates emit the new shape, with placeholder values quoted so the example metadata parses as strings.scripts/validate-skills.tsvalidator (superseded byintent validate) and the now-orphaned rootyamldependency.sourcesandrequiresremain top-level for now (separate follow-up).Summary by CodeRabbit
Release Notes
Documentation
Breaking Changes
type,library,library_version,framework) moved under ametadatamapTests
Chores