Repository navigation
Python: .NET: [Bug]: SKILL.md frontmatter drops the continuation lines of a multi-line description #9392
Description
Observed Behavior
AgentFileSkillsSource reads the SKILL.md frontmatter with regular expressions. A value ends at the end of its line. When a description continues on indented lines (a multi-line plain scalar, valid YAML), only the first line is kept and the rest is dropped without a warning. The skill list that the provider writes into the instructions then gives the model an incomplete description, for example:
<description>Summarize a meeting transcript into decisions and action</description>
The part that tells the model when to use the skill ("Use when ...") is usually in the lost lines, so the model loads skills less reliably.
Expected Behavior
The description holds the full value, as a YAML parser reads it: "Summarize a meeting transcript into decisions and action items. Use when the user shares a transcript or asks for meeting notes." The Agent Skills specification (https://agentskills.io/specification) requires YAML frontmatter. If the parser supports only one-line values, a warning for a continued value would make the problem visible.
Steps to Reproduce
- Create
skills/meeting-notes/SKILL.mdwith the frontmatter below. - Create an
AgentSkillsProviderfor the folderskillsand add it to an agent. - Run the agent and look at the instructions sent to the model (or at the
AgentSkillFrontmatter.Descriptionof the loaded skill). - The description holds only its first line.
Minimal Reproduction
---
name: meeting-notes
description: Summarize a meeting transcript into decisions and action
items. Use when the user shares a transcript or asks for meeting notes.
---
Body.var skills = new AgentSkillsProvider("skills", options: new AgentSkillsProviderOptions { DisableLoadSkillApproval = true }, loggerFactory: null);
// Add `skills` to ChatClientAgentOptions.AIContextProviders and run one turn.
// The skill list in the system message shows: "Summarize a meeting transcript into decisions and action"The key-value pattern of 1.20.0, ^([\w-]+)\s*:\s*(?:["'](.+?)["']|(.+?))\s*$, and the refined pattern on main after #8430 (s_yamlKeyValueRegex in dotnet/src/Microsoft.Agents.AI/Skills/File/AgentFileSkillsSource.cs) both stop at the end of the first line for this input.
Error Messages and Stack Traces
None. No warning is logged.
Package Versions
Microsoft.Agents.AI: 1.20.0 (the pattern on main behaves the same)
.NET Version
.NET 10.0
Operating System
Linux
Regression
No
Additional Context
A folded block scalar, a common way to write a long description, also fails: with the pattern on main, description: > followed by indented lines gives the value ">". The Python implementation was not checked.
Acknowledgements
- I searched existing issues and did not find a duplicate.
- I personally verified this behavior and the reproduction details are authentic.
- I will wait for explicit maintainer agreement before starting implementation of a non-trivial change.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity
[-].NET: [Bug]: SKILL.md frontmatter drops the continuation lines of a multi-line description[/-][+]Python: .NET: [Bug]: SKILL.md frontmatter drops the continuation lines of a multi-line description[/+]github-actions commentedon Oct 14, 2026
🤖 Automated triage reproduction notes (agent-authored — trust but verify)
Agent analysis
Repro:
dotnet/src/Microsoft.Agents.AI/Skills/File/AgentFileSkillsSource.cs::TryParseFrontmattertruncates a plain YAML description when its value starts inline and continues on indented lines;ParseYamlScalarValuereturns the first-line capture for non-block scalars. Minimal repro: write the issue'sSKILL.md, load it withAgentFileSkillsSource.GetSkillsAsync, and assertFrontmatter.Descriptionequals the YAML-folded full value.dotnet/tests/Microsoft.Agents.AI.UnitTests/AgentSkills/FileAgentSkillLoaderTests.cs1.20.01.24.0Ayoubhm07 commentedon Oct 21, 2026
I checked the Python side, since the issue carries both labels and the triage note only covers
AgentFileSkillsSource.cs. On main at 30bc5c1,FileSkillsSourcereturns the full description for the issue's SKILL.md with LF and with CRLF line endings, and for a>folded block, because_extract_frontmatterparses the block withyaml.compose. As far as I can tell only the .NET regex is affected.jaliyaudagedara commentedon Oct 22, 2026
I'd like to take this one. I have a fix ready (diff) and wanted to check the direction before opening a PR.
This is .NET only. Python already handles it (PyYAML since #8430, as mentioned above).
The fix
In
AgentFileSkillsSource.ParseYamlScalarValue, plain values now pick up their indented continuation lines, the same way YAML does:Summarize a meeting transcript into decisions and actionSummarize a meeting transcript into decisions and action items. Use when the user shares a transcript.Quoted values and
|/>blocks work as before. No new dependency and no public API change.Lists stay as they are
A list or nested mapping isn't joined into one string:
This still gives
- Read, same as today.One extra check
TryParseFrontmatternow callsValidateCompatibility. Today acompatibilityvalue over 500 characters makes theAgentSkillFrontmatterconstructor throw. Nothing catches it, so one badSKILL.mdstops every skill from loading. The fix makes long values easier to hit, so I added the check.Worth knowing
description. A continuedallowed-toolsnow includes all the listed tools.namesplit over two lines now fails validation instead of loading truncated.Tests are in
FileAgentSkillLoaderTests. The AgentSkills tests pass on net10.0 and net472.Question
In #8430, Eduard van Valkenburg (@eavanvalkenburg) suggested a YAML package, and SergeyMenshykh said .NET could follow up once one is agreed. Would you take this smaller fix in the meantime, or wait for that?