Skip to content

[dotnet-code] Consolidate skill resource lookup internals#397

Merged
gdams merged 3 commits into
mainfrom
dotnet-code-skill-lookup-helpers-f67d15df366704c3
Jun 30, 2026
Merged

[dotnet-code] Consolidate skill resource lookup internals#397
gdams merged 3 commits into
mainfrom
dotnet-code-skill-lookup-helpers-f67d15df366704c3

Conversation

@michelle-clayton-work

Copy link
Copy Markdown
Contributor

This pull request refactors the handling of providedSkill in agent/skills/provider.go to improve code reuse and encapsulation. The main change is the introduction of helper methods and a constructor for providedSkill, which centralizes and simplifies resource and script lookups throughout the codebase.

Refactoring and Encapsulation Improvements:

  • Added a newProvidedSkill constructor to encapsulate the creation of resource and script maps for a Skill.
  • Introduced lookupResource and lookupScript methods on providedSkill to provide a consistent and encapsulated way to retrieve resources and scripts by name.

Code Simplification:

  • Updated the indexSkills function to use the new newProvidedSkill constructor, reducing code duplication.
  • Refactored readSkillResource and runSkillScript to use the new lookupResource and lookupScript methods, improving readability and maintainability. [1] [2]

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 29, 2026 22:09
@michelle-clayton-work
michelle-clayton-work requested a review from a team as a code owner June 29, 2026 22:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 newProvidedSkill to build the per-skill resources/scripts lookup maps in one place.
  • Added providedSkill.lookupResource / providedSkill.lookupScript helpers and updated call sites to use them.
  • Simplified indexSkills by delegating construction to the new constructor.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread agent/skills/provider.go Outdated
Comment thread agent/skills/provider.go Outdated
@github-actions

This comment has been minimized.

@michelle-clayton-work

Copy link
Copy Markdown
Contributor Author

@copilot address PR feedback

…ipt methods

Co-authored-by: michelle-clayton-work <262183035+michelle-clayton-work@users.noreply.github.com>

Copilot AI commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

@copilot address PR feedback

Done — renamed the receiver from skill to ps in both lookupResource and lookupScript methods on providedSkill (commit fe8a6d4's follow-up).

@github-actions

Copy link
Copy Markdown
Contributor

API Consistency Review — No Issues Found

This PR only modifies unexported (internal) identifiers in agent/skills/provider.go:

  • newProvidedSkill — unexported constructor
  • lookupResource / lookupScript — methods on the unexported providedSkill type

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.

Generated by Go API Consistency Review Agent for #397 · 29.8 AIC · ⌖ 12.5 AIC · ⊞ 28.7K ·

@gdams gdams linked an issue Jun 30, 2026 that may be closed by this pull request
@gdams
gdams added this pull request to the merge queue Jun 30, 2026
Merged via the queue into main with commit d44a0e5 Jun 30, 2026
18 checks passed
@gdams
gdams deleted the dotnet-code-skill-lookup-helpers-f67d15df366704c3 branch June 30, 2026 07:35
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.

[dotnet-code] Consolidate skill resource lookup internals

4 participants