chore: Split skill source discovery from layout handling#1612
Conversation
Move SKILL.md metadata parsing and tool-name matching out of SkillInstallLayout so the layout class keeps less source parsing responsibility without changing its entry points.
Move skill source root enumeration and SKILL.md source discovery out of SkillInstallLayout while keeping the existing SkillInstallLayout entry points as delegating wrappers.
📝 WalkthroughWalkthroughThis PR refactors ChangesSkill source refactor
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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.
Actionable comments posted: 3
🤖 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.
Inline comments:
In
`@Packages/src/Editor/Infrastructure/SkillSetup/SkillSourceFrontmatterReader.cs`:
- Around line 23-29: `SkillSourceFrontmatterReader` is parsing quoted
frontmatter inconsistently: `ReadToolName` and the `internal` handling should
normalize quoted scalar values the same way `name` and `description` do. Update
the parsing logic so `toolName` and `internal` strip surrounding quotes before
comparison/boolean interpretation, and reuse the existing frontmatter value
normalization path or equivalent helper in `SkillSourceFrontmatterReader` to
keep behavior consistent across all fields.
In `@Packages/src/Editor/Infrastructure/SkillSetup/SkillSourceRootEnumerator.cs`:
- Around line 260-262: The dependency name set in SkillSourceRootEnumerator
includes local file/path dependencies, which can later be matched again against
PackageCache and add duplicate stale skills. Update the dependency collection
around EnumerateManifestDependencies so local dependencies are filtered out
before building dependencyNames, and keep PackageCache matching limited to
non-local manifest dependencies only.
- Around line 168-202: `EnumerateSkillSourceRoots` is losing the intended
precedence because it yields from a `HashSet<string>`, whose enumeration order
is not the explicit CLI-only → Assets → Packages → manifest → cache order
required by `GetSkillSources`. Update the `EnumerateSkillSourceRoots` flow to
preserve insertion order while still deduplicating roots, and keep
`AddSkillSourceRoot` responsible only for normalization and duplicate checks so
the first matching `skillName` remains deterministic.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 6de3c577-b9d7-4867-9533-d3a28d67b2ff
⛔ Files ignored due to path filters (2)
Packages/src/Editor/Infrastructure/SkillSetup/SkillSourceFrontmatterReader.cs.metais excluded by none and included by nonePackages/src/Editor/Infrastructure/SkillSetup/SkillSourceRootEnumerator.cs.metais excluded by none and included by none
📒 Files selected for processing (3)
Packages/src/Editor/Infrastructure/SkillSetup/SkillInstallLayout.csPackages/src/Editor/Infrastructure/SkillSetup/SkillSourceFrontmatterReader.csPackages/src/Editor/Infrastructure/SkillSetup/SkillSourceRootEnumerator.cs
There was a problem hiding this comment.
5 issues found across 5 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Summary
User Impact
Changes
Verification