.NET: Add 'advertise' frontmatter option to control automatic skill advertisement#6912
Open
ron-clover wants to merge 2 commits into
Open
.NET: Add 'advertise' frontmatter option to control automatic skill advertisement#6912ron-clover wants to merge 2 commits into
ron-clover wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an opt-out mechanism for automatic skill advertisement in the .NET Agent Skills system prompt, letting skills remain loadable/usable while being omitted from the <available_skills> listing to reduce prompt size and enable explicit-invocation patterns.
Changes:
- Introduces
AgentSkillFrontmatter.Advertise(defaulttrue) and parsesadvertise:fromSKILL.mdfrontmatter (only explicit booleanfalsedisables advertising). - Updates
AgentSkillsProvider.BuildSkillsInstructionsto exclude non-advertised skills from the generated skills listing while keeping all skills available via tools (e.g.,load_skill). - Adds unit tests for parsing behavior and provider behavior, plus sample/docs updates demonstrating an unadvertised
temperature-converterskill.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| dotnet/tests/Microsoft.Agents.AI.UnitTests/AgentSkills/FileAgentSkillLoaderTests.cs | Adds parsing tests for advertise and asserts default Advertise = true. |
| dotnet/tests/Microsoft.Agents.AI.UnitTests/AgentSkills/AgentSkillsProviderTests.cs | Verifies non-advertised skills are excluded from instructions but still loadable via load_skill. |
| dotnet/src/Microsoft.Agents.AI/Skills/File/AgentFileSkillsSource.cs | Parses advertise frontmatter and maps it to AgentSkillFrontmatter.Advertise. |
| dotnet/src/Microsoft.Agents.AI/Skills/AgentSkillsProvider.cs | Filters out Advertise = false skills when building the <available_skills> instruction listing. |
| dotnet/src/Microsoft.Agents.AI/Skills/AgentSkillFrontmatter.cs | Adds the Advertise property with documentation and default value. |
| dotnet/samples/02-agents/AgentSkills/README.md | Documents how advertise: false differs from filtering (keeps skill loadable). |
| dotnet/samples/02-agents/AgentSkills/Agent_Step01_FileBasedSkills/skills/temperature-converter/SKILL.md | Adds a sample unadvertised skill (advertise: false). |
| dotnet/samples/02-agents/AgentSkills/Agent_Step01_FileBasedSkills/README.md | Updates sample documentation to describe unadvertised skill behavior and usage. |
| dotnet/samples/02-agents/AgentSkills/Agent_Step01_FileBasedSkills/Program.cs | Updates sample code/instructions to explicitly reference and demonstrate loading the unadvertised skill. |
Author
|
@microsoft-github-policy-service agree company="Clover Security" |
…dvertisement Adds a boolean 'advertise' frontmatter property (default: true) to agent skills. Skills marked 'advertise: false' are omitted from the generated <available_skills> listing in the system prompt but remain fully functional and loadable by name via the load_skill tool. - AgentSkillFrontmatter: new Advertise property (default true) - AgentFileSkillsSource: parse the 'advertise' frontmatter key - AgentSkillsProvider: skip non-advertised skills in the skills listing - Samples: demonstrate an unadvertised temperature-converter skill in Agent_Step01_FileBasedSkills, referenced explicitly from the agent's instructions; document the option in the AgentSkills READMEs Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
8a17e1e to
ec3fc2c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation & Context
AgentSkillsProviderunconditionally lists every skill's name and description in the<available_skills>block of the system prompt. There is no way for a skill author to decide that a skill should not be auto-introduced to the model: the only existing mechanism, skill filtering (FilteringAgentSkillsSource), removes the skill entirely so it can no longer be loaded at all.This change lets a skill opt out of automatic advertisement while remaining fully functional, which is useful for keeping the system prompt small with large skill sets, and for skills that should only be used when referenced explicitly (e.g. from the agent's instructions or from another skill).
Description & Review Guide
A new boolean
advertisefrontmatter property, defaulting totruefor full backward compatibility:AgentSkillFrontmatter: newAdvertiseproperty (get/set, defaulttrue), so code-defined skills (AgentInlineSkill,AgentClassSkill) can set it via theirFrontmatteras well.AgentFileSkillsSource: parses theadvertisefrontmatter key; anything other than an explicit booleanfalsekeeps the default oftrue.AgentSkillsProvider.BuildSkillsInstructions: skips skills withAdvertise = falsewhen generating the<available_skills>listing. Theload_skill/read_skill_resource/run_skill_scripttools are unchanged, so a non-advertised skill remains loadable by name.false, explicittrue, invalid value, default) and for the provider (non-advertised skill absent from instructions yet still loadable viaload_skill).Agent_Step01_FileBasedSkillsgains an unadvertisedtemperature-converterskill that the agent's own instructions reference explicitly; the AgentSkills READMEs document the option and how it differs from skill filtering.advertise(or any non-falsevalue) behaves exactly as before. No public API changes beyond the new optional property.SkillFrontmatterdoes not have this property yet; it could adopt the sameadvertisefield for cross-language parity.advertiseis the right name for the property, and whether treating unparseable values astrue(rather than rejecting the skill) is the desired behavior.Related Issue
Fixes #6913
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.🤖 Generated with Claude Code