[dotnet-code] Consolidate skill resource lookup internals#397
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR refactors agent/skills/provider.go to centralize how a providedSkill indexes and looks up resources/scripts, improving reuse and keeping lookup behavior encapsulated within the provider internals (no intended public API/behavior changes).
Changes:
- Added
newProvidedSkillto build the per-skillresources/scriptslookup maps in one place. - Added
providedSkill.lookupResource/providedSkill.lookupScripthelpers and updated call sites to use them. - Simplified
indexSkillsby delegating construction to the new constructor.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This comment has been minimized.
This comment has been minimized.
|
@copilot address PR feedback |
…ipt methods Co-authored-by: michelle-clayton-work <262183035+michelle-clayton-work@users.noreply.github.com>
Done — renamed the receiver from |
API Consistency Review — No Issues FoundThis PR only modifies unexported (internal) identifiers in
All changes are purely internal refactoring with no impact on exported Go APIs or observable user-visible behavior. There are no new public contracts, no changed defaults, and no behavioral divergence to compare against the upstream .NET or Python implementations. Result: Out of scope for cross-repo parity review. No consistency issues identified.
|
This pull request refactors the handling of
providedSkillinagent/skills/provider.goto improve code reuse and encapsulation. The main change is the introduction of helper methods and a constructor forprovidedSkill, which centralizes and simplifies resource and script lookups throughout the codebase.Refactoring and Encapsulation Improvements:
newProvidedSkillconstructor to encapsulate the creation of resource and script maps for aSkill.lookupResourceandlookupScriptmethods onprovidedSkillto provide a consistent and encapsulated way to retrieve resources and scripts by name.Code Simplification:
indexSkillsfunction to use the newnewProvidedSkillconstructor, reducing code duplication.readSkillResourceandrunSkillScriptto use the newlookupResourceandlookupScriptmethods, improving readability and maintainability. [1] [2]