MCPcopy Create free account
hub / github.com/github/gh-aw / ValidateInlineSubAgentsFrontmatter

Function ValidateInlineSubAgentsFrontmatter

pkg/parser/sub_agent_extractor.go:89–98  ·  view source on GitHub ↗

ValidateInlineSubAgentsFrontmatter performs best-effort frontmatter validation on every inline sub-agent section found in markdown. markdown should be the full content of a workflow file (including any top-level frontmatter block). The function strips the top-level frontmatter before scanning for #

(markdown string)

Source from the content-addressed store, hash-verified

87// fail compilation based on these messages — they are advisory only (best effort).
88// If no sub-agents are found, or if no issues are detected, nil is returned.
89func ValidateInlineSubAgentsFrontmatter(markdown string) []string {
90 // Strip the top-level frontmatter to obtain only the markdown body.
91 var body string
92 if parsed, err := ExtractFrontmatterFromContent(markdown); err == nil {
93 body = parsed.Markdown
94 } else {
95 body = markdown
96 }
97 return ValidateInlineSubAgentsInBody(body)
98}
99
100// ValidateInlineSubAgentsInBody performs best-effort frontmatter validation on
101// inline sub-agent sections found in an already-stripped markdown body.

Calls 2