Skip to content

[dotnet-port-fixes] Align skill asset blocks with .NET - #394

Merged
gdams merged 3 commits into
mainfrom
dotnet-port-skill-available-blocks-50cec47c9536893b
Jun 30, 2026
Merged

[dotnet-port-fixes] Align skill asset blocks with .NET#394
gdams merged 3 commits into
mainfrom
dotnet-port-skill-available-blocks-50cec47c9536893b

Conversation

@michelle-clayton-work

Copy link
Copy Markdown
Contributor

Port the .NET skill content behavior that emits explicit available resources and scripts blocks for file-based skills.

Port the .NET skill content behavior that emits explicit available resources and scripts blocks for file-based skills.

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 aligns the Go file-based skill content emission with the .NET behavior by always appending authoritative asset inventory blocks to loaded SKILL.md content. It ensures consumers (including LLM prompts) consistently see explicit <available_resources> and <available_scripts> blocks, including explicit empty self-closing blocks when no assets are present.

Changes:

  • Append <available_resources> and <available_scripts> blocks to file-based skill content, emitting explicit empty blocks when lists are empty.
  • Represent script schemas under <available_scripts> with nested <parameters_schema> elements (replacing the prior <script_schemas> shape).
  • Update/extend tests to validate the new block shapes and the explicit empty-block behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
agent/skills/fsskills/source.go Appends new available-resources/scripts blocks to file skill content and implements the new XML block builders.
agent/skills/fsskills/source_script_test.go Updates script-content expectations to the new <available_scripts> / <parameters_schema> structure and validates empty resources block presence.
agent/skills/fsskills/source_test.go Adds coverage that file-based skill content includes explicit empty/non-empty <available_resources> blocks.
agent/skills/skills.go Updates Script.ParametersSchema doc comment to reflect the new <available_scripts> emission location.
agent/skills/skills_test.go Updates load_skill tool content expectation to include explicit empty available resources/scripts blocks.

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

@github-actions

This comment has been minimized.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Generated by Go API Consistency Review Agent for #394 · 409.4 AIC · ⌖ 13.2 AIC · ⊞ 27.1K

Comment thread agent/skills/fsskills/source.go Outdated
Comment thread agent/skills/fsskills/source.go Outdated
@michelle-clayton-work

Copy link
Copy Markdown
Contributor Author

@copilot address the PR feedback

…rity

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 the PR feedback

Done — both parity gaps are now fixed in commit c07a2d3:

  • buildAvailableResourcesBlock now emits description="..." on <resource> elements when resource.Description is non-empty, matching the .NET BuildAvailableResourcesBlock behavior.
  • buildAvailableScriptsBlock now emits description="..." on <script> elements (both the self-closing and expanded forms) when script.Description is non-empty, matching the .NET BuildAvailableScriptsBlock behavior.
  • Both attributes are XML-escaped via xmlEscapeAttr.
  • Added white-box unit tests in source_block_builder_test.go covering the new conditional attribute logic and XML escaping for both resources and scripts.

@github-actions

Copy link
Copy Markdown
Contributor

Cross-repo Parity Review ✅

This PR improves cross-language parity — no consistency issues found.

The previous Go implementation used a divergent <script_schemas> / <schema script="..."> format. This PR replaces it with <available_resources> and <available_scripts> blocks that precisely match the upstream .NET and Python implementations:

Behavior .NET (AgentInlineSkillContentBuilder) Python (_skills.py) Go after this PR
Resource block name <available_resources> <available_resources> <available_resources>
Script block name <available_scripts> <available_scripts> <available_scripts>
Empty list self-closing <available_resources /> self-closing <available_resources /> self-closing <available_resources />
Script with schema <script name="..."><parameters_schema>...</parameters_schema></script> same same ✅
Separator \n\n between original content and each block \n\n \n\n
Attribute XML escaping &, <, >, ", ' &, <, >, " &, <, >, ", '
Content escaping (schema) quotes preserved quotes preserved quotes preserved ✅

The Go changes to agent/skills/skills.go (comment update on ParametersSchema) and agent/skills/fsskills/source.go are semantically aligned with .NET's AgentFileSkill.GetContentAsync and Python's FileSkill.content property.

Generated by Go API Consistency Review Agent for #394 · 270 AIC · ⌖ 20.9 AIC · ⊞ 28.7K ·

@gdams
gdams added this pull request to the merge queue Jun 30, 2026
@gdams gdams linked an issue Jun 30, 2026 that may be closed by this pull request
Merged via the queue into main with commit 4db1d0e Jun 30, 2026
17 checks passed
@gdams
gdams deleted the dotnet-port-skill-available-blocks-50cec47c9536893b branch June 30, 2026 07:32
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-port-fixes] Align skill asset blocks with .NET

4 participants