Skip to content

.NET: Add description attribute to resource and script elements in skill body#6759

Merged
SergeyMenshykh merged 2 commits into
microsoft:mainfrom
SergeyMenshykh:sergeymenshykh-skill-descriptions-in-prompts
Jun 26, 2026
Merged

.NET: Add description attribute to resource and script elements in skill body#6759
SergeyMenshykh merged 2 commits into
microsoft:mainfrom
SergeyMenshykh:sergeymenshykh-skill-descriptions-in-prompts

Conversation

@SergeyMenshykh

@SergeyMenshykh SergeyMenshykh commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Re-adds the optional description attribute to <resource> and <script> elements within the <available_resources> and <available_scripts> XML blocks injected into skill bodies. Descriptions were removed incidentally in #6343 during a broader XML restructuring.

Changes

  • AgentInlineSkillContentBuilder.cs — Emit description="..." attribute on <resource> and <script> elements when the description is non-null and non-empty. Values are XML-escaped.
  • AgentInlineSkillContentBuilderTests.cs — Added tests for description rendering, escaping, and empty-string omission.

Closes: #6760

Copilot AI review requested due to automatic review settings June 26, 2026 11:10
@SergeyMenshykh SergeyMenshykh self-assigned this Jun 26, 2026
@SergeyMenshykh SergeyMenshykh moved this to In Progress in Agent Framework Jun 26, 2026
@SergeyMenshykh SergeyMenshykh moved this from In Progress to In Review in Agent Framework Jun 26, 2026
@moonbox3 moonbox3 added .NET Usage: [Issues, PRs], Target: .Net workflows Usage: [Issues, PRs], Target: Workflows labels Jun 26, 2026

@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.

Automated Code Review

Reviewers: 4 | Confidence: 94% | Result: All clear

Reviewed: Correctness, Security Reliability, Failure Modes, Design Approach


Automated review by SergeyMenshykh's agents

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 restores the optional description="..." attribute on <resource> and <script> entries emitted into skill bodies (under <available_resources> / <available_scripts>), after it was removed during prior XML restructuring. This helps retain human-authored metadata while keeping the output safe via XML escaping.

Changes:

  • Emit description="..." on <resource> elements when AgentSkillResource.Description is non-null/non-empty (XML-escaped).
  • Emit description="..." on <script> elements when AgentSkillScript.Description is non-null/non-empty (XML-escaped), for both schema and non-schema script cases.
  • Update unit tests to validate description rendering/omission and resource description escaping.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
dotnet/src/Microsoft.Agents.AI/Skills/Programmatic/AgentInlineSkillContentBuilder.cs Adds optional description attributes to emitted resource/script XML entries, with escaping.
dotnet/tests/Microsoft.Agents.AI.UnitTests/AgentSkills/AgentInlineSkillContentBuilderTests.cs Updates/adds assertions for description emission and omission; adds resource description escaping coverage.
dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowHostingExtensions.cs Fixes a duplicated word in an XML doc comment.

@SergeyMenshykh SergeyMenshykh force-pushed the sergeymenshykh-skill-descriptions-in-prompts branch from d396aec to 6de4fa9 Compare June 26, 2026 11:17
@SergeyMenshykh SergeyMenshykh enabled auto-merge June 26, 2026 11:20
@SergeyMenshykh SergeyMenshykh force-pushed the sergeymenshykh-skill-descriptions-in-prompts branch from 6de4fa9 to b121268 Compare June 26, 2026 11:41
…ill body

Include the optional description attribute on <resource> and <script>
elements within <available_resources> and <available_scripts> blocks,
aligning .NET with the Python implementation. The description is emitted
only when non-null/non-empty and is XML-escaped.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@SergeyMenshykh SergeyMenshykh added this pull request to the merge queue Jun 26, 2026
@SergeyMenshykh SergeyMenshykh force-pushed the sergeymenshykh-skill-descriptions-in-prompts branch from b121268 to af796a8 Compare June 26, 2026 15:40
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 26, 2026
@SergeyMenshykh SergeyMenshykh enabled auto-merge June 26, 2026 17:29
@SergeyMenshykh SergeyMenshykh added this pull request to the merge queue Jun 26, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Jun 26, 2026
@SergeyMenshykh SergeyMenshykh added this pull request to the merge queue Jun 26, 2026
Merged via the queue into microsoft:main with commit 846c963 Jun 26, 2026
27 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in Agent Framework Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NET Usage: [Issues, PRs], Target: .Net workflows Usage: [Issues, PRs], Target: Workflows

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

.NET: Skill resource/script descriptions not rendered in available_resources and available_scripts blocks

6 participants