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)
| 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. |
| 89 | func 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. |