Skip to content

[dotnet-port-fixes] Refine skill frontmatter parsing #1145

Description

@github-actions

Tip

Your pull request is ready to create! 🎉 ✅

Everything is OK—the changes have been pushed to branch dotnet-port-fixes-skill-frontmatter-parsing-9e8fe29710c24a53. Please review the changes, including any protected files, before creating the pull request.

Create the pull request

The original pull request description is below.


Summary

Align Go file-skill frontmatter parsing with upstream .NET PR microsoft/agent-framework#8430.
The parser now rejects duplicate or incorrectly cased recognized root fields, accepts quoted root property names, preserves indented next-line scalar values, keeps empty optional scalar fields unset, and keeps the first duplicate metadata entry while warning on later case-insensitive duplicates.

Ported .NET PRs

Breaking Changes

No.

Tests and Examples

  • go test ./agent/skills/fsskills ./agent/skills
  • Added frontmatter regression coverage for quoted root keys, ambiguous/duplicate root fields, indented next-line scalar values, empty optional scalars, and duplicate metadata handling.

Notes

  • I also checked recent upstream fixes around chat-client tool scoping and approval-response binding; those were either not applicable to Go's architecture or already aligned in this repository, so this was the narrowest useful fix/test port.
  • The upstream git remote could not be refreshed from this environment because outbound fetches are blocked, so the upstream inspection was completed through the read-only GitHub bridge against .NET/Python: Refine skill frontmatter parsing agent-framework#8430 and its merged commit.

Note

GitHub Actions is not permitted to create or approve pull requests in this repository.

The changes have been pushed to branch dotnet-port-fixes-skill-frontmatter-parsing-9e8fe29710c24a53 and are ready to review.

To fix the permissions issue, go to Settings → Actions → General and enable Allow GitHub Actions to create and approve pull requests. See also: gh-aw FAQ

Show patch preview (39 of 393 lines)
From 1a9312aed4adc8fd057d1df460e625cf69b0f2e8 Mon Sep 17 00:00:00 2001
X-GH-AW-Base-Commit: b3fe48e835ad043360a3b1ba48c8c45388c12faf
From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com>
Date: Tue, 22 Sep 2026 02:46:01 +0000
Subject: [PATCH] [dotnet-port-fixes] Refine skill frontmatter parsing

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
 agent/skills/fsskills/source.go      | 125 +++++++++++++++----
 agent/skills/fsskills/source_test.go | 176 +++++++++++++++++++++++++++
 2 files changed, 277 insertions(+), 24 deletions(-)

diff --git a/agent/skills/fsskills/source.go b/agent/skills/fsskills/source.go
index 5bf6ed6..01884d6 100644
--- a/agent/skills/fsskills/source.go
+++ b/agent/skills/fsskills/source.go
@@ -35,10 +35,18 @@ var (
 )
 
 var (
+	knownFrontmatterFields = map[string]string{
+		"name":          "name",
+		"description":   "description",
+		"license":       "license",
+		"compatibility": "compatibility",
+		"metadata":      "metadata",
+		"allowed-tools": "allowed-tools",
+	}
 	frontmatterRegex          = regexp.MustCompile(`(?ms)\A^---\s*$(.+?)^---\s*$`)
-	yamlKeyValueRegex         = regexp.MustCompile(`(?m)^([\w-]+)\s*:\s*(?:["'](.+?)["']|(.+?))\s*$`)
-	yamlMetadataBlockRegex    = regexp.MustCompile(`(?m)^metadata\s*:\s*$\n((?:[ \t]+\S.*\n?|[ \t]*\r?\n)+)`)
-	yamlIndentedKeyValueRegex = regexp.MustCompile(`(?m)^\s+([\w-]+)\s*:\s*(?:["'](.+?)["']|(.+?))\s*$`)
+	yamlKeyValueRegex         = regexp.MustCompile(`(?m)^([\w-]+|["'][\w-]+["'])[ \t]*:[ \t]*(?:["'](.*?)["']|([^\r\n]*?))[ \t]*\r?$`)
+	yamlMetadataBlockRegex    = regexp.MustCompile(`(?m)^(?:metadata|"metadata"|'metadata')\s*:\s*$\r?\n((?:[ \t]+\S.*\n?|[ \t]*\r?\n)+)`)
+	yamlIndentedKeyValueRegex = regexp.MustCompile(`(?m)^[ \t]+([\w-]+)[ \t]*:[ \t]*(?:["'](.+?)["']|(.+?))[ \t]*\r?$`)
 )
 
 // FilterContext provides contextual information about a discovered file to the
@@ -315,16 +323,30 @@ func (s *Source) tryParseFrontmatter(content, skillFilePath
... (truncated)

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"

See Network Configuration for more information.

Generated by .NET to Go Fixes and Test Porting Agent · copilot · gpt54 · 169.4 AIC · ⌖ 9.58 AIC · ⊞ 15.6K · ◷

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions